Skip to content
Browse files

Make sure that when PCDM is looking for the existance of the "tryexec…

…" *.desktop value it searches the entire PATH rather than just /usr/local/bin
  • Loading branch information...
1 parent 04e6c5d commit ec4468790bd51c23895935300fbdbfcc966db53a @beanpole135 beanpole135 committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 src-qt4/PCDM/src/pcdm-backend.cpp
View
10 src-qt4/PCDM/src/pcdm-backend.cpp
@@ -262,6 +262,8 @@ void Backend::loadXSessionsData(){
instXCommentList.clear(); instXIconList.clear();
//Load the default paths/locale
QString xDir = Config::xSessionsDir();
+ QStringList paths = QString(getenv("PATH")).split(":");
+ if(paths.isEmpty()){ paths <<"/usr/local/bin" << "/usr/local/sbin" << "/usr/bin" << "/usr/sbin" << "/bin" << "/sbin"; }
if(!xDir.endsWith("/")){ xDir.append("/"); }
QString xIconDir = Config::xSessionsImageDir();
if(!xIconDir.endsWith("/")){ xIconDir.append("/"); }
@@ -278,7 +280,13 @@ void Backend::loadXSessionsData(){
//Complete file paths if necessary
//if(!tmp[0].startsWith("/")){ tmp[0] = "/usr/local/bin/"+tmp[0]; }
if(!tmp[3].startsWith("/")&&!tmp[3].startsWith(":")&&!tmp[3].isEmpty()){ tmp[3] = xIconDir+tmp[3]; }
- if(!tmp[4].startsWith("/")){ tmp[4] = "/usr/local/bin/"+tmp[4]; }
+ if(!tmp[4].startsWith("/") && !QFile::exists(tmp[4])){
+ for(int p=0; i<paths.length(); i++){
+ if(QFile::exists(paths[p]+"/"+tmp[4])){
+ tmp[4] = paths[p]+"/"+tmp[4];
+ }
+ }
+ }
//Check for valid DE using the "tryexec" line
//this allows for special startup commands on the "exec" line
if(QFile::exists(tmp[4])){

0 comments on commit ec44687

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