Skip to content
Browse files

Clean up the mount tray FM opening function - it looks like the probl…

…ems with xdg-open are related to missing environment variables with the "sudo" start of the app
  • Loading branch information...
1 parent 4ba4baf commit b3ee7b3e31151179f0c6404da3af56f220f3869c @beanpole135 beanpole135 committed Sep 12, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 src-qt4/pc-mounttray/mountTray.cpp
View
7 src-qt4/pc-mounttray/mountTray.cpp
@@ -302,9 +302,10 @@ void MountTray::openMediaDir(QString dir){
}
//Open the default file manager to the given directory as that user
qDebug() << "Opening the media directory with user permissions";
- QString cmd = "su -m "+USERNAME+" -c \'xdg-open \""+dir+"\"\' &";
- if(DEBUG_MODE){ qDebug() << " -cmd:" << cmd; }
- system( cmd.toUtf8() );
+ QString cmd = "su -m "+USERNAME+" -c \"xdg-open \'"+dir+"\' \"";
+ if(DEBUG_MODE){ qDebug() << " -cmd:" << cmd ; }
+ cmd.prepend("("); cmd.append(") &");
+ system( cmd.toUtf8() );
}
void MountTray::slotRescan(){

0 comments on commit b3ee7b3

Please sign in to comment.
Something went wrong with that request. Please try again.