diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-11-04 00:11:20 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-11-04 00:11:20 +0100 |
commit | d6e4fb29713d6ce55b092c0e22412f6121e7f516 (patch) | |
tree | ce4c2c3a2786bdbb9752c26d6feaab3735ba9bd6 /logic | |
parent | 44669290747b1d254d10c130e4e728051c8c4c5d (diff) | |
download | MultiMC-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.cpp | 12 |
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; + } } |