summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-21 21:20:01 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-21 21:20:01 +0100
commitd81fb09f33f8cd668db20b6120c481580c6c938e (patch)
tree7dc8158abf3559ce312c7cfb9271d92b83333e39 /src
parent34c87a0efa18ad77cbf773bc99bd9f08082b27e9 (diff)
Replace isFixedPriority by hasAutomaticPriority.
Diffstat (limited to 'src')
-rw-r--r--src/modinfo.h5
-rw-r--r--src/modlist.cpp4
-rw-r--r--src/profile.cpp8
3 files changed, 9 insertions, 8 deletions
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<size_t>(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<unsigned int>(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;
}