summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-04 00:11:20 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-04 00:11:20 +0100
commitd6e4fb29713d6ce55b092c0e22412f6121e7f516 (patch)
treece4c2c3a2786bdbb9752c26d6feaab3735ba9bd6 /logic
parent44669290747b1d254d10c130e4e728051c8c4c5d (diff)
downloadMultiMC-d6e4fb29713d6ce55b092c0e22412f6121e7f516.tar
MultiMC-d6e4fb29713d6ce55b092c0e22412f6121e7f516.tar.gz
MultiMC-d6e4fb29713d6ce55b092c0e22412f6121e7f516.tar.lz
MultiMC-d6e4fb29713d6ce55b092c0e22412f6121e7f516.tar.xz
MultiMC-d6e4fb29713d6ce55b092c0e22412f6121e7f516.zip
Implement instance sorting options.
Diffstat (limited to 'logic')
-rw-r--r--logic/lists/InstanceList.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp
index 08985a19..b42d7b7a 100644
--- a/logic/lists/InstanceList.cpp
+++ b/logic/lists/InstanceList.cpp
@@ -422,7 +422,13 @@ bool InstanceProxyModel::subSortLessThan(const QModelIndex &left,
{
BaseInstance *pdataLeft = static_cast<BaseInstance *>(left.internalPointer());
BaseInstance *pdataRight = static_cast<BaseInstance *>(right.internalPointer());
- // kDebug() << *pdataLeft << *pdataRight;
- return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0;
- // return pdataLeft->name() < pdataRight->name();
+ QString sortMode = MMC->settings()->get("InstSortMode").toString();
+ if(sortMode == "LastLaunch")
+ {
+ return pdataLeft->lastLaunch() > pdataRight->lastLaunch();
+ }
+ else
+ {
+ return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0;
+ }
}