summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-13 13:00:54 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-13 13:00:54 +0100
commitc93cf33c8324052b321fc0428c394016abcee115 (patch)
tree52280bbb9f687c3aebff2becf038eca49d6f846f /src
parent163b33f22817fda6ead29de8f9d9624434766be9 (diff)
Remove OrganizerCore::modsSortedByProfilePriority.
Diffstat (limited to 'src')
-rw-r--r--src/modlist.cpp14
-rw-r--r--src/modlistviewactions.cpp4
-rw-r--r--src/organizercore.cpp16
-rw-r--r--src/organizercore.h9
4 files changed, 15 insertions, 28 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index f820e4d1..d4ffbeff 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -900,7 +900,19 @@ QStringList ModList::allModsByProfilePriority(MOBase::IProfile* profile) const
{
Profile* mo2Profile = profile == nullptr ?
m_Organizer->currentProfile() : static_cast<Profile*>(profile);
- return m_Organizer->modsSortedByProfilePriority(mo2Profile);
+
+ QStringList res;
+ for (int i = mo2Profile->getPriorityMinimum();
+ i < mo2Profile->getPriorityMinimum() + (int)mo2Profile->numRegularMods();
+ ++i) {
+ int modIndex = mo2Profile->modIndexByPriority(i);
+ auto modInfo = ModInfo::getByIndex(modIndex);
+ if (!modInfo->hasFlag(ModInfo::FLAG_OVERWRITE) &&
+ !modInfo->hasFlag(ModInfo::FLAG_BACKUP)) {
+ res.push_back(ModInfo::getByIndex(modIndex)->internalName());
+ }
+ }
+ return res;
}
MOBase::IModInterface* ModList::getMod(const QString& name) const
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp
index cc50f009..63d74192 100644
--- a/src/modlistviewactions.cpp
+++ b/src/modlistviewactions.cpp
@@ -547,7 +547,7 @@ void ModListViewActions::sendModsToSeparator(const QModelIndexList& index) const
int newPriority = std::numeric_limits<int>::max();
bool foundSection = false;
- for (auto mod : m_core.modsSortedByProfilePriority(m_core.currentProfile())) {
+ for (auto mod : m_core.modList()->allModsByProfilePriority()) {
unsigned int modIndex = ModInfo::getIndex(mod);
ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex);
if (!foundSection && result.compare(mod) == 0) {
@@ -1128,7 +1128,7 @@ void ModListViewActions::moveOverwriteContentToExistingMod() const
QString modAbsolutePath;
- for (const auto& mod : m_core.modsSortedByProfilePriority(m_core.currentProfile())) {
+ for (const auto& mod : m_core.modList()->allModsByProfilePriority()) {
if (result.compare(mod) == 0) {
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(mod));
modAbsolutePath = modInfo->absolutePath();
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 3d730c23..bbf6029b 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -1016,22 +1016,6 @@ ModList *OrganizerCore::modList()
return &m_ModList;
}
-QStringList OrganizerCore::modsSortedByProfilePriority(Profile *profile) const
-{
- QStringList res;
- for (int i = profile->getPriorityMinimum();
- i < profile->getPriorityMinimum() + (int)profile->numRegularMods();
- ++i) {
- int modIndex = profile->modIndexByPriority(i);
- auto modInfo = ModInfo::getByIndex(modIndex);
- if (!modInfo->hasFlag(ModInfo::FLAG_OVERWRITE) &&
- !modInfo->hasFlag(ModInfo::FLAG_BACKUP)) {
- res.push_back(ModInfo::getByIndex(modIndex)->internalName());
- }
- }
- return res;
-}
-
bool OrganizerCore::previewFileWithAlternatives(
QWidget* parent, QString fileName, int selectedOrigin)
{
diff --git a/src/organizercore.h b/src/organizercore.h
index e8b42609..7ec4dda8 100644
--- a/src/organizercore.h
+++ b/src/organizercore.h
@@ -300,15 +300,6 @@ public:
static void setGlobalCoreDumpType(env::CoreDumpTypes type);
static std::wstring getGlobalCoreDumpPath();
- /**
- * @brief Returns the name of all the mods in the priority order of the given profile.
- *
- * @param profile Profile to use for the mod order.
- *
- * @return the name of all the mods in the priority order of the given profile.
- */
- QStringList modsSortedByProfilePriority(Profile* profile) const;
-
public:
MOBase::IModRepositoryBridge *createNexusBridge() const;
QString profileName() const;