From ba3e4330f27c1f83dd4d05e8e7b678687b2d1cb6 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Tue, 3 May 2011 00:36:20 +0200 Subject: [PATCH] Changed the way the masters get retrieved in masterSelectionChanged --- apps/launcher/datafilespage.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 785c3d21ba..428d163fa3 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -298,16 +298,16 @@ void DataFilesPage::setupConfig() void DataFilesPage::masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { - // TODO: Use mMasterWidget->selectedItems if (mMastersWidget->selectionModel()->hasSelection()) { - const QModelIndexList selectedIndexes = mMastersWidget->selectionModel()->selectedIndexes(); QStringList masters; QString masterstr; // Create a QStringList containing all the masters - foreach (const QModelIndex &index, selectedIndexes) { - masters.append(index.data().toString()); + const QList selectedMasters = mMastersWidget->selectedItems(); + + foreach (const QTableWidgetItem *item, selectedMasters) { + masters.append(item->data(Qt::DisplayRole).toString()); } masters.sort(); @@ -465,10 +465,6 @@ void DataFilesPage::profileChanged(const QString &previous, const QString &curre { qDebug() << "Profile changed " << current << previous; - //if (previous.isEmpty()) { - // return; - //} - // Just to be sure if (!previous.isEmpty()) { writeConfig(previous); mLauncherConfig->sync();