mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 07:39:40 +00:00
Changed all QList<> to const
This commit is contained in:
parent
ee4a2d0a8d
commit
9e852a36bf
1 changed files with 8 additions and 9 deletions
|
@ -179,7 +179,7 @@ void DataFilesPage::setupDataFiles(const QString &path)
|
||||||
for (int i=0; i<masterFiles.count(); ++i)
|
for (int i=0; i<masterFiles.count(); ++i)
|
||||||
{
|
{
|
||||||
QString currentMaster = masterFiles.at(i);
|
QString currentMaster = masterFiles.at(i);
|
||||||
QList<QTableWidgetItem*> itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly);
|
const QList<QTableWidgetItem*> itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly);
|
||||||
|
|
||||||
if (itemList.isEmpty()) // Master is not yet in the widget
|
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);
|
const QString currentMaster = QString::fromStdString(mlist[i].name);
|
||||||
availableMasters.append(currentMaster);
|
availableMasters.append(currentMaster);
|
||||||
|
|
||||||
QList<QTableWidgetItem*> itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly);
|
const QList<QTableWidgetItem*> itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly);
|
||||||
|
|
||||||
if (itemList.isEmpty()) // Master is not yet in the widget
|
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 *parent = new QStandardItem(availableMasters.join(","));
|
||||||
QStandardItem *child = new QStandardItem(currentFile);
|
QStandardItem *child = new QStandardItem(currentFile);
|
||||||
|
|
||||||
QList<QStandardItem*> masterList = mDataFilesModel->findItems(availableMasters.join(","));
|
const QList<QStandardItem*> masterList = mDataFilesModel->findItems(availableMasters.join(","));
|
||||||
|
|
||||||
if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel
|
if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel
|
||||||
parent->appendRow(child);
|
parent->appendRow(child);
|
||||||
|
@ -279,7 +279,6 @@ void DataFilesPage::setupConfig()
|
||||||
profiles.append("Default");
|
profiles.append("Default");
|
||||||
}
|
}
|
||||||
|
|
||||||
//mProfilesModel->setStringList(profiles);
|
|
||||||
mProfilesComboBox->addItems(profiles);
|
mProfilesComboBox->addItems(profiles);
|
||||||
|
|
||||||
QString currentProfile = mLauncherConfig->value("CurrentProfile").toString();
|
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
|
// Now we see if the pluginsmodel already contains this plugin
|
||||||
const QString childIndexData = QVariant(mDataFilesModel->data(childIndex)).toString();
|
const QString childIndexData = QVariant(mDataFilesModel->data(childIndex)).toString();
|
||||||
|
|
||||||
QList<QStandardItem *> itemList = mPluginsModel->findItems(childIndexData);
|
const QList<QStandardItem *> itemList = mPluginsModel->findItems(childIndexData);
|
||||||
|
|
||||||
if (itemList.isEmpty())
|
if (itemList.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -401,7 +400,7 @@ void DataFilesPage::removePlugins(const QModelIndex &index)
|
||||||
for (int r=0; r<mDataFilesModel->rowCount(index); ++r) {
|
for (int r=0; r<mDataFilesModel->rowCount(index); ++r) {
|
||||||
QModelIndex childIndex = index.child(r, 0);
|
QModelIndex childIndex = index.child(r, 0);
|
||||||
|
|
||||||
QList<QStandardItem *> itemList = mPluginsModel->findItems(QVariant(childIndex.data()).toString());
|
const QList<QStandardItem *> itemList = mPluginsModel->findItems(QVariant(childIndex.data()).toString());
|
||||||
|
|
||||||
if (!itemList.isEmpty()) {
|
if (!itemList.isEmpty()) {
|
||||||
foreach (const QStandardItem *currentItem, itemList) {
|
foreach (const QStandardItem *currentItem, itemList) {
|
||||||
|
@ -500,7 +499,7 @@ void DataFilesPage::readConfig()
|
||||||
const QString keyValue = mLauncherConfig->value(key).toString();
|
const QString keyValue = mLauncherConfig->value(key).toString();
|
||||||
|
|
||||||
if (key.startsWith("Plugin")) {
|
if (key.startsWith("Plugin")) {
|
||||||
QList<QStandardItem *> pluginList = mPluginsModel->findItems(keyValue);
|
const QList<QStandardItem *> pluginList = mPluginsModel->findItems(keyValue);
|
||||||
|
|
||||||
if (!pluginList.isEmpty())
|
if (!pluginList.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -512,7 +511,7 @@ void DataFilesPage::readConfig()
|
||||||
|
|
||||||
if (key.startsWith("Master")) {
|
if (key.startsWith("Master")) {
|
||||||
qDebug() << "Read master: " << keyValue;
|
qDebug() << "Read master: " << keyValue;
|
||||||
QList<QTableWidgetItem*> masterList = mMastersWidget->findItems(keyValue, Qt::MatchFixedString);
|
const QList<QTableWidgetItem*> masterList = mMastersWidget->findItems(keyValue, Qt::MatchFixedString);
|
||||||
|
|
||||||
if (!masterList.isEmpty()) {
|
if (!masterList.isEmpty()) {
|
||||||
foreach (QTableWidgetItem *currentMaster, masterList) {
|
foreach (QTableWidgetItem *currentMaster, masterList) {
|
||||||
|
@ -550,7 +549,7 @@ void DataFilesPage::writeConfig(QString profile)
|
||||||
mLauncherConfig->remove(""); // Clear the subgroup
|
mLauncherConfig->remove(""); // Clear the subgroup
|
||||||
|
|
||||||
// First write the masters to the config
|
// First write the masters to the config
|
||||||
QList<QTableWidgetItem *> selectedMasters = mMastersWidget->selectedItems();
|
const QList<QTableWidgetItem *> selectedMasters = mMastersWidget->selectedItems();
|
||||||
|
|
||||||
// We don't use foreach because we need i
|
// We don't use foreach because we need i
|
||||||
for (int i = 0; i < selectedMasters.size(); ++i) {
|
for (int i = 0; i < selectedMasters.size(); ++i) {
|
||||||
|
|
Loading…
Reference in a new issue