SCRATCH move icons over to Env, instance proxy model to gui

This commit is contained in:
Petr Mrázek
2015-02-01 11:44:47 +01:00
parent 154d19bb74
commit aa70ed2244
22 changed files with 92 additions and 74 deletions

View File

@@ -0,0 +1,23 @@
#include "InstanceProxyModel.h"
#include "MultiMC.h"
#include <logic/BaseInstance.h>
InstanceProxyModel::InstanceProxyModel(QObject *parent) : GroupedProxyModel(parent)
{
}
bool InstanceProxyModel::subSortLessThan(const QModelIndex &left,
const QModelIndex &right) const
{
BaseInstance *pdataLeft = static_cast<BaseInstance *>(left.internalPointer());
BaseInstance *pdataRight = static_cast<BaseInstance *>(right.internalPointer());
QString sortMode = MMC->settings()->get("InstSortMode").toString();
if (sortMode == "LastLaunch")
{
return pdataLeft->lastLaunch() > pdataRight->lastLaunch();
}
else
{
return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0;
}
}