summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-12-11 14:00:51 +0100
committerLaurent Montel <[email protected]>2018-12-11 14:00:51 +0100
commit48ba6bbafda54a51f4b81ec457d8431888092435 (patch)
treeaf929f46b80e4ead1cc0fbb4ba1fabd37719402a
parent21342dd7d863ef9a31672491db2915c08c772452 (diff)
Fix sort element
-rw-r--r--agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp b/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp
index d0368aa..40dd5cd 100644
--- a/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp
+++ b/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp
@@ -121,6 +121,7 @@ NewMailNotifierSelectCollectionWidget::NewMailNotifierSelectCollectionWidget(QWi
Akonadi::CollectionFilterProxyModel *mimeTypeProxy = new Akonadi::CollectionFilterProxyModel(this);
mimeTypeProxy->setExcludeVirtualCollections(true);
+ mimeTypeProxy->setDynamicSortFilter(true);
mimeTypeProxy->addMimeTypeFilters(QStringList() << KMime::Message::mimeType());
mimeTypeProxy->setSourceModel(mModel);
@@ -136,6 +137,9 @@ NewMailNotifierSelectCollectionWidget::NewMailNotifierSelectCollectionWidget(QWi
mCollectionFilter->setSourceModel(mNewMailNotifierProxyModel);
mCollectionFilter->setDynamicSortFilter(true);
mCollectionFilter->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ mCollectionFilter->setSortRole(Qt::DisplayRole);
+ mCollectionFilter->setSortCaseSensitivity(Qt::CaseSensitive);
+ mCollectionFilter->setSortLocaleAware(true);
KLineEdit *searchLine = new KLineEdit(this);
searchLine->setPlaceholderText(i18n("Search..."));
@@ -171,6 +175,7 @@ NewMailNotifierSelectCollectionWidget::~NewMailNotifierSelectCollectionWidget()
void NewMailNotifierSelectCollectionWidget::slotCollectionTreeFetched()
{
+ mCollectionFilter->sort(0, Qt::AscendingOrder);
mFolderView->expandAll();
}