summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
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;
+ }
}