diff options
Diffstat (limited to 'launcher/InstanceProxyModel.cpp')
-rw-r--r-- | launcher/InstanceProxyModel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/launcher/InstanceProxyModel.cpp b/launcher/InstanceProxyModel.cpp index 0311c239..9ee38a65 100644 --- a/launcher/InstanceProxyModel.cpp +++ b/launcher/InstanceProxyModel.cpp @@ -5,6 +5,10 @@ InstanceProxyModel::InstanceProxyModel(QObject *parent) : GroupedProxyModel(parent) { + m_naturalSort.setNumericMode(true); + m_naturalSort.setCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive); + // FIXME: use loaded translation as source of locale instead, hook this up to translation changes + m_naturalSort.setLocale(QLocale::system()); } QVariant InstanceProxyModel::data(const QModelIndex & index, int role) const @@ -29,6 +33,6 @@ bool InstanceProxyModel::subSortLessThan(const QModelIndex &left, } else { - return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0; + return m_naturalSort.compare(pdataLeft->name(), pdataRight->name()) < 0; } } |