diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-21 19:42:41 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-21 19:42:41 +0100 |
| commit | 1747dcf5632a7887906b9b6d412e95e3af9c8249 (patch) | |
| tree | 6e662c5b2eb64d72b8c3e9f95f99333768f127f4 /src | |
| parent | f8943ee477e1cb5821e6208ee2d177c26c4b4ad3 (diff) | |
INT_MAX -> std::numeric_limits, plus minor clean.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistbypriorityproxy.cpp | 2 | ||||
| -rw-r--r-- | src/organizercore.cpp | 2 | ||||
| -rw-r--r-- | src/profile.cpp | 2 | ||||
| -rw-r--r-- | src/profile.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/modlistbypriorityproxy.cpp b/src/modlistbypriorityproxy.cpp index 7dae7a54..d1d045fc 100644 --- a/src/modlistbypriorityproxy.cpp +++ b/src/modlistbypriorityproxy.cpp @@ -234,7 +234,7 @@ bool ModListByPriorityProxy::canDropMimeData(const QMimeData* data, Qt::DropActi bool hasSeparator = false; unsigned int firstRowIndex = -1; - int firstRowPriority = INT_MAX; + int firstRowPriority = std::numeric_limits<int>::max(); for (auto sourceRow : dropInfo.rows()) { hasSeparator = hasSeparator || ModInfo::getByIndex(sourceRow)->isSeparator(); if (m_sortOrder == Qt::AscendingOrder && m_profile->getModPriority(sourceRow) < firstRowPriority diff --git a/src/organizercore.cpp b/src/organizercore.cpp index d6c22d3c..cf641886 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1943,7 +1943,7 @@ std::vector<Mapping> OrganizerCore::fileMapping(const QString &profileName, bool overwriteActive = false; - for (auto mod : profile.getActiveMods()) { + for (const auto& mod : profile.getActiveMods()) { if (std::get<0>(mod).compare("overwrite", Qt::CaseInsensitive) == 0) { continue; } diff --git a/src/profile.cpp b/src/profile.cpp index caea776c..acda465b 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -591,7 +591,7 @@ std::vector<std::tuple<QString, QString, int> > Profile::getActiveMods() if ((iter->second != UINT_MAX) && m_ModStatus[iter->second].m_Enabled) { ModInfo::Ptr modInfo = ModInfo::getByIndex(iter->second); if (modInfo->hasFlag(ModInfo::FLAG_OVERWRITE)) - result.push_back(std::make_tuple(modInfo->internalName(), modInfo->absolutePath(), INT_MAX)); + result.push_back(std::make_tuple(modInfo->internalName(), modInfo->absolutePath(), std::numeric_limits<int>::max())); else result.push_back(std::make_tuple(modInfo->internalName(), modInfo->absolutePath(), m_ModStatus[iter->second].m_Priority)); } diff --git a/src/profile.h b/src/profile.h index d354dd48..d1e3f104 100644 --- a/src/profile.h +++ b/src/profile.h @@ -243,7 +243,7 @@ public: * * @return list of active mods sorted by priority (ascending). "first" is the mod name, "second" is its path **/ - std::vector<std::tuple<QString, QString, int> > getActiveMods(); + std::vector<std::tuple<QString, QString, int>> getActiveMods(); /** * @brief retrieve a mod of the indexes ordered by priority |
