From d81fb09f33f8cd668db20b6120c481580c6c938e Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 21 Jan 2021 21:20:01 +0100 Subject: Replace isFixedPriority by hasAutomaticPriority. --- src/modinfo.h | 5 +++-- src/modlist.cpp | 4 ++-- src/profile.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/modinfo.h b/src/modinfo.h index ff6c4001..f93296d2 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -602,9 +602,10 @@ public: // Methods after this do not come from IModInterface: */ virtual void ignoreUpdate(bool ignore) = 0; - // check if this mod has a fixed priority (i.e. that cannot be modified by users) + // check if the priority of this mod is not user-modifiable (i.e. + // computed by MO2 automatically) // - bool isFixedPriority() const { return isBackup() || isOverwrite(); } + bool hasAutomaticPriority() const { return isBackup() || isOverwrite(); } // check if this mod should always be enabled or disabled // diff --git a/src/modlist.cpp b/src/modlist.cpp index 6637f48a..e2a443bd 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -197,7 +197,7 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const return version; } else if (column == COL_PRIORITY) { - if (modInfo->isFixedPriority()) { + if (modInfo->hasAutomaticPriority()) { return QVariant(); // hide priority for mods where it's fixed } else { @@ -642,7 +642,7 @@ Qt::ItemFlags ModList::flags(const QModelIndex &modelIndex) const } if (modelIndex.isValid()) { ModInfo::Ptr modInfo = ModInfo::getByIndex(modelIndex.row()); - if (!modInfo->isFixedPriority()) { + if (!modInfo->hasAutomaticPriority()) { result |= Qt::ItemIsDragEnabled; result |= Qt::ItemIsUserCheckable; if ((modelIndex.column() == COL_PRIORITY) || diff --git a/src/profile.cpp b/src/profile.cpp index 66c23ea1..2546661b 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -234,7 +234,7 @@ void Profile::doWriteModlist() // the priority order was inverted on load so it has to be inverted again const auto index = iter->second; ModInfo::Ptr modInfo = ModInfo::getByIndex(index); - if (!modInfo->isFixedPriority()) { + if (!modInfo->hasAutomaticPriority()) { if (modInfo->isForeign()) { file->write("*"); } else if (m_ModStatus[index].m_Enabled) { @@ -460,7 +460,7 @@ void Profile::refreshModStatus() // find the mod and check that this is a regular mod (and not a backup) ModInfo::Ptr info = ModInfo::getByIndex(modIndex); - if (modIndex < m_ModStatus.size() && !info->isFixedPriority()) { + if (modIndex < m_ModStatus.size() && !info->hasAutomaticPriority()) { m_ModStatus[modIndex].m_Enabled = enabled; if (m_ModStatus[modIndex].m_Priority == -1) { if (static_cast(index) >= m_ModStatus.size()) { @@ -527,7 +527,7 @@ void Profile::refreshModStatus() int offset = topInsert * -1; for (size_t i = 0; i < m_ModStatus.size(); ++i) { ModInfo::Ptr modInfo = ModInfo::getByIndex(static_cast(i)); - if (modInfo->isFixedPriority()) { + if (modInfo->hasAutomaticPriority()) { continue; } @@ -674,7 +674,7 @@ int Profile::getModPriority(unsigned int index) const bool Profile::setModPriority(unsigned int index, int &newPriority) { - if (ModInfo::getByIndex(index)->isFixedPriority()) { + if (ModInfo::getByIndex(index)->hasAutomaticPriority()) { // can't change priority of overwrite/backups return false; } -- cgit v1.3.1