From 62a9d13948e6e299d41eb6876c0f1fbaf0160d79 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 21 Jan 2021 19:31:05 +0100 Subject: Remove unused priority-related functions from Profile. --- src/profile.cpp | 18 +----------------- src/profile.h | 11 ----------- 2 files changed, 1 insertion(+), 28 deletions(-) (limited to 'src') diff --git a/src/profile.cpp b/src/profile.cpp index c45ecd30..caea776c 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -600,17 +600,6 @@ std::vector > Profile::getActiveMods() return result; } - -unsigned int Profile::modIndexByPriority(int priority) const -{ - try { - return m_ModIndexByPriority.at(priority); - } catch (std::out_of_range) { - throw MyException(tr("invalid priority %1").arg(priority)); - } -} - - void Profile::setModEnabled(unsigned int index, bool enabled) { if (index >= m_ModStatus.size()) { @@ -698,7 +687,7 @@ bool Profile::setModPriority(unsigned int index, int &newPriority) return false; } - for (auto& [priority, index] : m_ModIndexByPriority) { + for (const auto& [priority, index] : m_ModIndexByPriority) { if (newPriority < oldPriority && priority >= newPriority && priority < oldPriority) { m_ModStatus.at(index).m_Priority += 1; } @@ -1085,11 +1074,6 @@ void Profile::storeSettingsByArray(const QString &prefix, const QListendArray(); } -int Profile::getPriorityMinimum() const -{ - return m_ModIndexByPriority.begin()->first; -} - bool Profile::forcedLibrariesEnabled(const QString &executable) const { return setting("forced_libraries", executable + "/enabled", false).toBool(); diff --git a/src/profile.h b/src/profile.h index 903a8553..d354dd48 100644 --- a/src/profile.h +++ b/src/profile.h @@ -261,15 +261,6 @@ public: **/ size_t numMods() const { return m_ModStatus.size(); } - /** - * @brief retrieve the mod index based on the priority - * - * @param priority priority to look up - * @return the index of the mod - * @throw std::exception an exception is thrown if there is no mod with the specified priority - **/ - unsigned int modIndexByPriority(int priority) const; - /** * @brief enable or disable a mod * @@ -333,8 +324,6 @@ public: QList settingsByArray(const QString &prefix) const; void storeSettingsByArray(const QString &prefix, const QList &values); - int getPriorityMinimum() const; - bool forcedLibrariesEnabled(const QString &executable) const; void setForcedLibrariesEnabled(const QString &executable, bool enabled); QList determineForcedLibraries(const QString &executable) const; -- cgit v1.3.1