From cacf7e05428fa7ff8d3c6d1d5413460f21395d1c Mon Sep 17 00:00:00 2001 From: Lost Dragonist Date: Fri, 8 Jun 2018 22:38:43 -0500 Subject: Allow sorting by "source game" column --- src/modlistsortproxy.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 435967c9..88084ae1 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -208,6 +208,16 @@ bool ModListSortProxy::lessThan(const QModelIndex &left, if (leftTime != rightTime) return leftTime < rightTime; } break; + case ModList::COL_GAME: { + if (leftMod->getGameName() != rightMod->getGameName()) { + lt = leftMod->getGameName() < rightMod->getGameName(); + } + else { + int comp = QString::compare(leftMod->name(), rightMod->name(), Qt::CaseInsensitive); + if (comp != 0) + lt = comp < 0; + } + } break; case ModList::COL_PRIORITY: { // nop, already compared by priority } break; -- cgit v1.3.1 From 0c4b1e9a928236542703a50cbe2c4b2d216feb0e Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 9 Jun 2018 10:44:23 -0700 Subject: Prevent instances from ending in a space Windows directories are not allowed to end in a space. Allowing this creates a broken directory that is difficult for the user to remove. --- src/instancemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index 43ae152b..2b718cb2 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -146,7 +146,7 @@ QString InstanceManager::queryInstanceName(const QStringList &instanceList) cons if (dialog.exec() == QDialog::Rejected) { throw MOBase::MyException(QObject::tr("Canceled")); } - instanceId = dialog.textValue().replace(QRegExp("[^0-9a-zA-Z ]"), ""); + instanceId = dialog.textValue().replace(QRegExp("[^0-9a-zA-Z ]"), "").remove(QRegExp("( )*$")); bool alreadyExists=false; for (const QString &instance : instanceList) { -- cgit v1.3.1