summaryrefslogtreecommitdiff
path: root/src/modlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlist.cpp')
-rw-r--r--src/modlist.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 7da6fe3b..22899aaa 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -1417,7 +1417,7 @@ QString ModList::getColumnToolTip(int column) const
}
}
-void ModList::shiftMods(const QModelIndexList& indices, int offset)
+void ModList::shiftModsPriority(const QModelIndexList& indices, int offset)
{
// retrieve the mod index and sort them by priority to avoid issue
// when moving them
@@ -1451,6 +1451,26 @@ void ModList::shiftMods(const QModelIndexList& indices, int offset)
emit modPrioritiesChanged(allIndex);
}
+void ModList::changeModsPriority(const QModelIndexList& indices, int priority)
+{
+ if (indices.isEmpty()) {
+ return;
+ }
+
+ std::vector<int> allIndex;
+ for (auto& idx : indices) {
+ auto index = idx.data(IndexRole).toInt();
+ allIndex.push_back(index);
+ }
+
+ if (allIndex.size() == 1) {
+ changeModPriority(allIndex[0], priority);
+ }
+ else {
+ changeModPriority(allIndex, priority);
+ }
+}
+
bool ModList::toggleState(const QModelIndexList& indices)
{
emit aboutToChangeData();