fix preselection of default profile
authorKonrad Rosenbaum <konrad@silmor.de>
Sun, 7 Aug 2016 19:55:09 +0000 (21:55 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Sun, 7 Aug 2016 19:55:09 +0000 (21:55 +0200)
sessman/login.cpp

index be42348..6c22591 100644 (file)
@@ -94,12 +94,17 @@ MLogin::MLogin(MSessionManager*sm)
 void MLogin::initProfiles()
 {
        QSettings set;
+       int defpronum=-1;
+       const QString defpro=set.value("defaultprofile").toString();
        set.beginGroup("profiles");
        QStringList prf=set.childGroups();
        profiles->clear();
        for(int i=0;i<prf.size();i++){
+               if(prf[i]==defpro)defpronum=i;
                profiles->addItem(set.value(prf[i]+"/name").toString(),prf[i]);
        }
+       if(defpronum>=0)
+               profiles->setCurrentIndex(defpronum);
 }
 
 void MLogin::loadProfile()