From 8393a7bc100a258adee9bb2cf463e7eac7fd04c2 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 23 Aug 2022 16:44:30 +0200 Subject: [PATCH] use correct method to get the file path --- src/plugins/findInFiles/findinfileswidget.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/plugins/findInFiles/findinfileswidget.py b/src/plugins/findInFiles/findinfileswidget.py index 8805d13..12c59d7 100644 --- a/src/plugins/findInFiles/findinfileswidget.py +++ b/src/plugins/findInFiles/findinfileswidget.py @@ -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):