use correct method to get the file path
This commit is contained in:
@@ -62,18 +62,8 @@ class FindInFilesWidget(Tab):
|
|||||||
#
|
#
|
||||||
|
|
||||||
def _open_file(self, index: QModelIndex):
|
def _open_file(self, index: QModelIndex):
|
||||||
|
file = self._model.filePath(index)
|
||||||
path = []
|
if Path(file).is_file():
|
||||||
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():
|
|
||||||
PluginRegistry.execute_single("open_file", f"{file}")
|
PluginRegistry.execute_single("open_file", f"{file}")
|
||||||
|
|
||||||
def _select_base_dir(self):
|
def _select_base_dir(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user