From ee4a2d0a8d0e7bcfdbfbbd2474d102eb16cc1bf7 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Tue, 3 May 2011 00:43:44 +0200 Subject: [PATCH] Fixed a problem with the currentprofile not being set in the combobox --- apps/launcher/datafilespage.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 428d163fa..30fc7e8ad 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -119,7 +119,7 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent) connect(mPluginsModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(resizeRows())); //connect(mProfileComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(profileChanged(const QString&))); - connect(mProfilesComboBox, SIGNAL(textChanged(const QString&, const QString&)), this, SLOT(profileChanged(const QString&, const QString&))); + connect(mNewProfileButton, SIGNAL(pressed()), this, SLOT(newProfile())); @@ -274,10 +274,10 @@ void DataFilesPage::setupConfig() mLauncherConfig->beginGroup("Profiles"); QStringList profiles = mLauncherConfig->childGroups(); - /*if (profiles.isEmpty()) { + if (profiles.isEmpty()) { // Add a default profile profiles.append("Default"); - }*/ + } //mProfilesModel->setStringList(profiles); mProfilesComboBox->addItems(profiles); @@ -294,6 +294,10 @@ void DataFilesPage::setupConfig() mProfilesComboBox->setCurrentIndex(mProfilesComboBox->findText(currentProfile)); mLauncherConfig->endGroup(); + + // Now we connect the combobox to do something if the profile changes + // This prevents strange behaviour while reading and appending the profiles + connect(mProfilesComboBox, SIGNAL(textChanged(const QString&, const QString&)), this, SLOT(profileChanged(const QString&, const QString&))); } void DataFilesPage::masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) @@ -341,7 +345,7 @@ void DataFilesPage::masterSelectionChanged(const QItemSelection &selected, const QString master = currentIndex.data().toString(); master.prepend("*"); master.append("*"); - QList itemList = mDataFilesModel->findItems(master, Qt::MatchWildcard); + const QList itemList = mDataFilesModel->findItems(master, Qt::MatchWildcard); if (itemList.isEmpty()) qDebug() << "Empty as shit";