use correct method to get the file path

This commit is contained in:
2022-08-23 16:44:30 +02:00
parent 29e237113d
commit 8393a7bc10

View File

@@ -62,18 +62,8 @@ class FindInFilesWidget(Tab):
#
def _open_file(self, index: QModelIndex):
path = []
i = index
while i.isValid():
path.append(i.data())
i = i.parent()
path.reverse()
file = Path()
for s in path:
file = file / s
if file.is_file():
file = self._model.filePath(index)
if Path(file).is_file():
PluginRegistry.execute_single("open_file", f"{file}")
def _select_base_dir(self):