From 9e852a36bf61e5d81c9335706c0be1514e9954d0 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Tue, 3 May 2011 00:47:12 +0200 Subject: [PATCH] Changed all QList<> to const --- apps/launcher/datafilespage.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 30fc7e8ad1..1fa93962ac 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -179,7 +179,7 @@ void DataFilesPage::setupDataFiles(const QString &path) for (int i=0; i itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); + const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); if (itemList.isEmpty()) // Master is not yet in the widget { @@ -212,7 +212,7 @@ void DataFilesPage::setupDataFiles(const QString &path) const QString currentMaster = QString::fromStdString(mlist[i].name); availableMasters.append(currentMaster); - QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); + const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); if (itemList.isEmpty()) // Master is not yet in the widget { @@ -228,7 +228,7 @@ void DataFilesPage::setupDataFiles(const QString &path) QStandardItem *parent = new QStandardItem(availableMasters.join(",")); QStandardItem *child = new QStandardItem(currentFile); - QList masterList = mDataFilesModel->findItems(availableMasters.join(",")); + const QList masterList = mDataFilesModel->findItems(availableMasters.join(",")); if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel parent->appendRow(child); @@ -279,7 +279,6 @@ void DataFilesPage::setupConfig() profiles.append("Default"); } - //mProfilesModel->setStringList(profiles); mProfilesComboBox->addItems(profiles); QString currentProfile = mLauncherConfig->value("CurrentProfile").toString(); @@ -375,7 +374,7 @@ void DataFilesPage::addPlugins(const QModelIndex &index) // Now we see if the pluginsmodel already contains this plugin const QString childIndexData = QVariant(mDataFilesModel->data(childIndex)).toString(); - QList itemList = mPluginsModel->findItems(childIndexData); + const QList itemList = mPluginsModel->findItems(childIndexData); if (itemList.isEmpty()) { @@ -401,7 +400,7 @@ void DataFilesPage::removePlugins(const QModelIndex &index) for (int r=0; rrowCount(index); ++r) { QModelIndex childIndex = index.child(r, 0); - QList itemList = mPluginsModel->findItems(QVariant(childIndex.data()).toString()); + const QList itemList = mPluginsModel->findItems(QVariant(childIndex.data()).toString()); if (!itemList.isEmpty()) { foreach (const QStandardItem *currentItem, itemList) { @@ -500,7 +499,7 @@ void DataFilesPage::readConfig() const QString keyValue = mLauncherConfig->value(key).toString(); if (key.startsWith("Plugin")) { - QList pluginList = mPluginsModel->findItems(keyValue); + const QList pluginList = mPluginsModel->findItems(keyValue); if (!pluginList.isEmpty()) { @@ -512,7 +511,7 @@ void DataFilesPage::readConfig() if (key.startsWith("Master")) { qDebug() << "Read master: " << keyValue; - QList masterList = mMastersWidget->findItems(keyValue, Qt::MatchFixedString); + const QList masterList = mMastersWidget->findItems(keyValue, Qt::MatchFixedString); if (!masterList.isEmpty()) { foreach (QTableWidgetItem *currentMaster, masterList) { @@ -550,7 +549,7 @@ void DataFilesPage::writeConfig(QString profile) mLauncherConfig->remove(""); // Clear the subgroup // First write the masters to the config - QList selectedMasters = mMastersWidget->selectedItems(); + const QList selectedMasters = mMastersWidget->selectedItems(); // We don't use foreach because we need i for (int i = 0; i < selectedMasters.size(); ++i) {