diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index c1659f733..1e7ce7e74 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -3,6 +3,7 @@
Fixed:
+- Messages are now sorted using active locale.
- Fixed bug #49 and duplicate feed/category detection.
- Experimentally fixed bug #50.
- NSIS installer is now portable. It makes only ONE access to registry and you can use it to install RSS Guard to any location such as USB flash drives.
diff --git a/src/core/messagesproxymodel.cpp b/src/core/messagesproxymodel.cpp
index 688111280..a7558eb6d 100644
--- a/src/core/messagesproxymodel.cpp
+++ b/src/core/messagesproxymodel.cpp
@@ -39,10 +39,13 @@ MessagesProxyModel::~MessagesProxyModel() {
}
bool MessagesProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const {
- // TODO: Maybe use QString::localeAwareCompare() here for
- // title at least, but this will be probably little slower
- // than default implementation.
- return QSortFilterProxyModel::lessThan(left, right);
+ if (left.column() == MSG_DB_TITLE_INDEX && right.column() == MSG_DB_TITLE_INDEX) {
+ return QString::localeAwareCompare(m_sourceModel->data(left).toString(),
+ m_sourceModel->data(right).toString()) < 0;
+ }
+ else {
+ return QSortFilterProxyModel::lessThan(left, right);
+ }
}
QModelIndexList MessagesProxyModel::mapListFromSource(const QModelIndexList &indexes, bool deep) {