From 5711b1be95a826daf0e11b64bec04c4b0d2ea5ef Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Mon, 10 Nov 2014 08:51:24 +0100 Subject: 'Fix' instance group sorting --- gui/groupview/GroupedProxyModel.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gui/groupview/GroupedProxyModel.cpp') 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; } } -- cgit