summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2020-09-23 18:34:15 +0200
committerGitHub <noreply@github.com>2020-09-23 18:34:15 +0200
commit865ae1d802cc58cc812f4802c0b3f8c1ca7a38f3 (patch)
tree7618511f1baa4f8f3be68ebbe5e8a8a883176730 /src/modlistsortproxy.cpp
parent77576f626d76be8098ef807dad5633a60a8c03a5 (diff)
parentd9cc013813a2a360a9518ecfd3b2e0bb0596d86a (diff)
Merge pull request #1236 from Holt59/expose-modinterface-meta
Add getters for most meta-information in mod.
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index ab6dd852..ca0f3bb1 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -198,14 +198,14 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
lt = comp < 0;
} break;
case ModList::COL_CATEGORY: {
- if (leftMod->getPrimaryCategory() != rightMod->getPrimaryCategory()) {
- if (leftMod->getPrimaryCategory() < 0) lt = false;
- else if (rightMod->getPrimaryCategory() < 0) lt = true;
+ if (leftMod->primaryCategory() != rightMod->primaryCategory()) {
+ if (leftMod->primaryCategory() < 0) lt = false;
+ else if (rightMod->primaryCategory() < 0) lt = true;
else {
try {
CategoryFactory &categories = CategoryFactory::instance();
- QString leftCatName = categories.getCategoryName(categories.getCategoryIndex(leftMod->getPrimaryCategory()));
- QString rightCatName = categories.getCategoryName(categories.getCategoryIndex(rightMod->getPrimaryCategory()));
+ QString leftCatName = categories.getCategoryName(categories.getCategoryIndex(leftMod->primaryCategory()));
+ QString rightCatName = categories.getCategoryName(categories.getCategoryIndex(rightMod->primaryCategory()));
lt = leftCatName < rightCatName;
} catch (const std::exception &e) {
log::error("failed to compare categories: {}", e.what());
@@ -214,12 +214,12 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
}
} break;
case ModList::COL_MODID: {
- if (leftMod->getNexusID() != rightMod->getNexusID())
- lt = leftMod->getNexusID() < rightMod->getNexusID();
+ if (leftMod->nexusId() != rightMod->nexusId())
+ lt = leftMod->nexusId() < rightMod->nexusId();
} break;
case ModList::COL_VERSION: {
- if (leftMod->getVersion() != rightMod->getVersion())
- lt = leftMod->getVersion() < rightMod->getVersion();
+ if (leftMod->version() != rightMod->version())
+ lt = leftMod->version() < rightMod->version();
} break;
case ModList::COL_INSTALLTIME: {
QDateTime leftTime = left.data().toDateTime();
@@ -228,8 +228,8 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
return leftTime < rightTime;
} break;
case ModList::COL_GAME: {
- if (leftMod->getGameName() != rightMod->getGameName()) {
- lt = leftMod->getGameName() < rightMod->getGameName();
+ if (leftMod->gameName() != rightMod->gameName()) {
+ lt = leftMod->gameName() < rightMod->gameName();
}
else {
int comp = QString::compare(leftMod->name(), rightMod->name(), Qt::CaseInsensitive);
@@ -392,7 +392,7 @@ bool ModListSortProxy::categoryMatchesMod(
case CategoryFactory::Endorsed:
{
- b = (info->endorsedState() == ModInfo::ENDORSED_TRUE);
+ b = (info->endorsedState() == EndorsedState::ENDORSED_TRUE);
break;
}
@@ -425,13 +425,13 @@ bool ModListSortProxy::categoryMatchesMod(
return false;
}
- b = (info->getNexusID() > 0);
+ b = (info->nexusId() > 0);
break;
}
case CategoryFactory::Tracked:
{
- b = (info->trackedState() == ModInfo::TRACKED_TRUE);
+ b = (info->trackedState() == TrackedState::TRACKED_TRUE);
break;
}
@@ -531,7 +531,7 @@ bool ModListSortProxy::filterMatchesMod(ModInfo::Ptr info, bool enabled) const
bool ok;
int filterID = currentKeyword.toInt(&ok);
if (ok) {
- int modID = info->getNexusID();
+ int modID = info->nexusId();
while (modID > 0) {
if (modID == filterID) {
foundKeyword = true;