diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-11-10 08:51:24 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-11-10 08:51:24 +0100 |
commit | 5711b1be95a826daf0e11b64bec04c4b0d2ea5ef (patch) | |
tree | 8141716398aab297f6e319ec1006d89a391ff87e /gui/groupview/GroupedProxyModel.cpp | |
parent | 90eea4f05c4fac56d91d7c2d2a36db3873a1af20 (diff) | |
download | PrismLauncher-5711b1be95a826daf0e11b64bec04c4b0d2ea5ef.tar.gz PrismLauncher-5711b1be95a826daf0e11b64bec04c4b0d2ea5ef.tar.bz2 PrismLauncher-5711b1be95a826daf0e11b64bec04c4b0d2ea5ef.zip |
'Fix' instance group sorting
Diffstat (limited to 'gui/groupview/GroupedProxyModel.cpp')
-rw-r--r-- | gui/groupview/GroupedProxyModel.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gui/groupview/GroupedProxyModel.cpp b/gui/groupview/GroupedProxyModel.cpp index d9d6ac78..30845caa 100644 --- a/gui/groupview/GroupedProxyModel.cpp +++ b/gui/groupview/GroupedProxyModel.cpp @@ -1,6 +1,7 @@ #include "GroupedProxyModel.h" #include "GroupView.h" +#include "logger/QsLog.h" GroupedProxyModel::GroupedProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { @@ -16,7 +17,22 @@ bool GroupedProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig } else { - return leftCategory < rightCategory; + // FIXME: real group sorting happens in GroupView::updateGeometries(), see LocaleString + auto result = leftCategory.localeAwareCompare(rightCategory); + if(result < 0) + { + QLOG_DEBUG() << leftCategory << "<" << rightCategory; + } + if(result == 0) + { + QLOG_DEBUG() << leftCategory << "=" << rightCategory; + return subSortLessThan(left, right); + } + if(result > 0) + { + QLOG_DEBUG() << leftCategory << ">" << rightCategory; + } + return result < 0; } } |