Changeset 2e00225


Ignore:
Timestamp:
12/05/13 08:11:48 (13 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
00fef47
Parents:
d280777 (diff), a0b0a6d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Files:
1 added
1 edited

Legend:

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

    rf2fe669 rdaab719  
    494494    QStringList deList = Backend::getAvailableDesktops(); 
    495495    QString lastDE = Backend::getLastDE(loginW->currentUsername()); 
     496    //Organize the desktop list alphabetically 
     497    QStringList DEL; 
     498    for(int i=0; i<deList.length(); i++){ 
     499      //Check the icon 
     500        QString deIcon = Backend::getDesktopIcon(deList[i]); 
     501        if( deIcon.isEmpty() ){ deIcon = currentTheme->itemIcon("desktop"); } //set the default icon if none given 
     502        if( !QFile::exists(deIcon) ){ deIcon = ":/images/desktop.png"; } 
     503      QString entry = deList[i] +";;;"+deIcon+";;;"+Backend::getDesktopComment(deList[i]); 
     504      DEL << entry; 
     505      if(lastDE.isEmpty()){ lastDE = deList[i]; } //grab the highest-priority DE if empty 
     506    } 
     507    DEL.sort(); //make it alphabetical 
    496508    //Now fill the switcher 
    497509    if(!simpleDESwitcher){ 
    498510      deSwitcher->removeAllItems(); 
    499       for(int i=0; i<deList.length(); i++){ 
    500         QString deIcon = Backend::getDesktopIcon(deList[i]); 
    501         if( deIcon.isEmpty() ){ deIcon = currentTheme->itemIcon("desktop"); } //set the default icon if none given 
    502         if( !QFile::exists(deIcon) ){ deIcon = ":/images/desktop.png"; } 
    503         //Now add the item back to the widget 
    504         deSwitcher->addItem( deList[i], deIcon, Backend::getDesktopComment(deList[i]) ); 
     511      for(int i=0; i<DEL.length(); i++){ 
     512        //Now add the item 
     513        deSwitcher->addItem( DEL[i].section(";;;",0,0), DEL[i].section(";;;",1,1), DEL[i].section(";;;",2,2) ); 
    505514      } 
    506515      //Set the switcher to the last used desktop environment 
     
    509518    }else{ 
    510519      //Simple switcher on the login widget 
    511       QStringList deIcons, deInfo; 
    512       for(int i=0; i<deList.length(); i++){  
    513         QString ico = Backend::getDesktopIcon(deList[i]); 
    514         if(ico.isEmpty()){ ico = currentTheme->itemIcon("desktop"); } 
    515         if(!QFile::exists(ico)){ ico = ":/images/desktop.png"; } 
    516         deIcons << ico; 
    517         deInfo << Backend::getDesktopComment(deList[i]); 
     520      QStringList deNames, deIcons, deInfo; 
     521      for(int i=0; i<DEL.length(); i++){ 
     522        deNames << DEL[i].section(";;;",0,0); 
     523        deIcons << DEL[i].section(";;;",1,1); 
     524        deInfo << DEL[i].section(";;;",2,2); 
    518525      } 
    519526      loginW->setDesktops(deList, deIcons, deInfo); 
Note: See TracChangeset for help on using the changeset viewer.