Changeset 7894d23


Ignore:
Timestamp:
05/07/15 06:26:08 (2 weeks ago)
Author:
Ken Moore <ken@…>
Branches:
enter/10, releng/10.1.2
Children:
9d5aaec
Parents:
873fc63
git-author:
Ken Moore <ken@…> (05/07/15 06:22:16)
git-committer:
Ken Moore <ken@…> (05/07/15 06:26:08)
Message:

Fix a PCDM bug with loading the last DE info when there are no users available at the moment.

File:
1 edited

Legend:

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

    r30611f7 r7894d23  
    285285  //retranslateUi(); 
    286286  LoadAvailableUsers(); //Note: this is the first time it is run 
     287  if(DEBUG_MODE){ qDebug() << " - Translate GUI"; } 
    287288  retranslateUi(); 
    288289  if(DEBUG_MODE){ qDebug() << "Done with initialization"; } 
     
    544545  if(DEBUG_MODE){ qDebug() << "UserList (names):" << userlist << sysAvail; } 
    545546  //Add the usernames to the login widget (if different) 
    546   if(userlist != sysAvail){ 
     547  if(userlist != sysAvail || sysAvail.isEmpty() ){ 
    547548    loginW->setUsernames(userlist); //add in the detected users 
    548549    sysAvail = userlist; //save for later 
     
    601602  //The main login widget 
    602603  if(hostname.isEmpty()){ 
     604    if(DEBUG_MODE){ qDebug() << "Finding Hostname..."; } 
    603605    //Find the system hostname 
    604606    hostname = pcbsd::Utils::runShellCommand("hostname").join(" ").simplified(); 
     607    if(DEBUG_MODE){ qDebug() << " - Host:" << hostname; } 
    605608    loginW->displayHostName(hostname);     
    606609  } 
     610  if(DEBUG_MODE){ qDebug() << "Translate Login Widget"; } 
    607611  loginW->retranslateUi(); 
    608612   
     
    611615    //Get the new desktop list (translated) 
    612616    QStringList deList = Backend::getAvailableDesktops(); //priority ordered 
    613     QString lastDE = Backend::getLastDE(loginW->currentUsername()); 
     617    QString lastDE; 
     618    if(!loginW->currentUsername().isEmpty()){ lastDE = Backend::getLastDE(loginW->currentUsername()); } 
     619    if(DEBUG_MODE){ qDebug() << "DE's:" << deList << lastDE; } 
    614620    if(lastDE.isEmpty()){ lastDE = deList[0]; } 
    615621    //Organize the desktop list alphabetically by filename 
     
    632638        deSwitcher->addItem( DEL[i].section(":::",0,0), DEL[i].section(":::",1,1), DEL[i].section(":::",2,2) ); 
    633639      } 
     640      if(DEBUG_MODE){ qDebug() << "Last used DE:" << lastDE; } 
    634641      //Set the switcher to the last used desktop environment 
    635642      if( !lastDE.isEmpty() ){ deSwitcher->setCurrentItem(lastDE); } 
     
    643650        deInfo << DEL[i].section(":::",2,2); 
    644651      } 
     652      if(DEBUG_MODE){ qDebug() << "Loading DE's into the login widget"; } 
    645653      loginW->setDesktops(deNames, deIcons, deInfo); 
    646654      //Set the switcher to the last used desktop environment 
     655      if(DEBUG_MODE){ qDebug() << "Last used DE:" << lastDE; } 
    647656      loginW->setCurrentDE(lastDE); 
    648657    } 
Note: See TracChangeset for help on using the changeset viewer.