Skip to content

Commit

Permalink
Misc: use xdg-open for the show in finder command
Browse files Browse the repository at this point in the history
fixed #250

Signed-off-by: Defman21 <[email protected]>
  • Loading branch information
Defman21 committed May 4, 2017
1 parent 04af5f2 commit 8a61a9b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/components/koSysUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a61a9b

Please sign in to comment.