Changeset 9a6b8ef


Ignore:
Timestamp:
01/13/14 07:15:51 (8 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
82baccc
Parents:
efd1e98
Message:

Add the "PCDM_SESSION" environment variable to the user's desktop session with the value being the (all uppercase) non-localized name of the DE that was started.

Location:
src-qt4/PCDM/src
Files:
3 edited

Legend:

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

    rd2cbe8c r9a6b8ef  
    1212#include "pcbsd-utils.h" 
    1313 
    14 QStringList displaynameList,usernameList,homedirList,usershellList,instXNameList,instXBinList,instXCommentList,instXIconList; 
     14QStringList displaynameList,usernameList,homedirList,usershellList,instXNameList,instXBinList,instXCommentList,instXIconList,instXDEList; 
    1515QString logFile; 
    1616QString saveX,saveUsername, lastUser, lastDE; 
     
    2727  if(index == -1){ Backend::log("PCDM: Invalid Desktop Name: " + xName); return ""; } 
    2828  return instXCommentList[index]; 
     29} 
     30 
     31QString Backend::getNLDesktopName(QString xName){ 
     32  //Get the non-localized desktop name from the localized version 
     33  if(instXNameList.isEmpty()){ loadXSessionsData(); } 
     34  int index = instXNameList.indexOf(xName); 
     35  if(index == -1){ Backend::log("PCDM: Invalid Desktop Name: " +xName); return ""; } 
     36  return instXDEList[index];     
    2937} 
    3038 
     
    315323  instXNameList.clear(); instXBinList.clear();  
    316324  instXCommentList.clear(); instXIconList.clear(); 
     325  instXDEList.clear(); 
    317326  //Load the default paths/locale 
    318327  QString xDir = Config::xSessionsDir(); 
     
    349358        instXNameList << tmp[1]; 
    350359        instXCommentList << tmp[2]; 
     360        instXDEList << tmp[5]; //Non-localized name of the DE 
    351361        //Check to make sure we have a valid icon 
    352362        if(!tmp[3].isEmpty() && !QFile::exists(tmp[3]) ){ tmp[3] = ""; } 
     
    406416  //Format the results into the output list 
    407417  output.clear(); 
    408   output << exec << lname << lcomm << icon << tryexec; 
     418  output << exec << lname << lcomm << icon << tryexec << name; 
    409419  return output; 
    410420 
  • src-qt4/PCDM/src/pcdm-backend.h

    r4eecf13 r9a6b8ef  
    3232    static QStringList getAvailableDesktops(); 
    3333    static QString getDesktopComment(QString); 
     34    static QString getNLDesktopName(QString); 
    3435    static QString getDesktopIcon(QString); 
    3536    static QString getDesktopBinary(QString); 
  • src-qt4/PCDM/src/pcdm-xprocess.cpp

    r6c5c258 r9a6b8ef  
    181181  environ.insert("HOME",xhome); //Set the users home directory 
    182182  environ.insert("SHELL",xshell); //Set the user's default shell 
     183  environ.insert("PCDM_SESSION", Backend::getNLDesktopName(xde).toUpper() ); //List the desktop environment that is being started 
    183184  this->setProcessEnvironment(environ); 
    184185  this->setWorkingDirectory(xhome); //set the current directory to the user's home directory 
Note: See TracChangeset for help on using the changeset viewer.