From 8a61a9bc5493faf7771520eb1050a1ea770d71f8 Mon Sep 17 00:00:00 2001 From: Defman21 Date: Thu, 4 May 2017 20:29:15 +0300 Subject: [PATCH] Misc: use xdg-open for the show in finder command fixed #250 Signed-off-by: Defman21 --- src/components/koSysUtils.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/components/koSysUtils.py b/src/components/koSysUtils.py index 0b071e5977..b01135aecf 100644 --- a/src/components/koSysUtils.py +++ b/src/components/koSysUtils.py @@ -258,21 +258,15 @@ def ShowFileInFileManager(self, filename): manager = self._getManager() if os.path.isfile(filename): filename = os.path.dirname(filename) - if manager == "gnome": + xdg_open = self.Which('xdg-open') + if xdg_open: + os.system('xdg-open "%s" &' % filename) + elif manager == "gnome": os.system('nautilus "%s" &' % filename) elif manager == "kde": - os.system('konqueror --profile filemanagement "%s" &' % filename) + os.system('dolphin "%s" &' % filename) else: - # see if nautilus or konqueror exists, and use them - nautilus = self.Which("nautilus") - if nautilus: - os.system('nautilus "%s" &' % filename) - return - konqueror = self.Which("konqueror") - if konqueror: - os.system('konqueror --profile filemanagement "%s" &' % filename) - return - raise "NOT IMPLEMENTED" + raise "File manager not found / xdg-open not installed" def OpenFile(self, filename): """OpenFile