Changeset ec44687


Ignore:
Timestamp:
11/12/13 14:34:43 (17 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
1c049ce
Parents:
04e6c5d
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/pcdm-backend.cpp

    rb28c8d9 rec44687  
    263263  //Load the default paths/locale 
    264264  QString xDir = Config::xSessionsDir(); 
     265  QStringList paths = QString(getenv("PATH")).split(":"); 
     266  if(paths.isEmpty()){ paths <<"/usr/local/bin" << "/usr/local/sbin" << "/usr/bin" << "/usr/sbin" << "/bin" << "/sbin"; } 
    265267  if(!xDir.endsWith("/")){ xDir.append("/"); } 
    266268  QString xIconDir = Config::xSessionsImageDir(); 
     
    279281      //if(!tmp[0].startsWith("/")){ tmp[0] = "/usr/local/bin/"+tmp[0]; } 
    280282      if(!tmp[3].startsWith("/")&&!tmp[3].startsWith(":")&&!tmp[3].isEmpty()){ tmp[3] = xIconDir+tmp[3]; } 
    281       if(!tmp[4].startsWith("/")){ tmp[4] = "/usr/local/bin/"+tmp[4]; } 
     283      if(!tmp[4].startsWith("/") && !QFile::exists(tmp[4])){  
     284        for(int p=0; i<paths.length(); i++){ 
     285          if(QFile::exists(paths[p]+"/"+tmp[4])){ 
     286            tmp[4] = paths[p]+"/"+tmp[4]; 
     287          } 
     288        } 
     289      } 
    282290      //Check for valid DE using the "tryexec" line 
    283291        //this allows for special startup commands on the "exec" line 
Note: See TracChangeset for help on using the changeset viewer.