Commit 79288caf authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Sort the filters in the drop down menu alphabetically

GnuPG-bug-id: 5388
parent da6b8b9f
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <QComboBox> #include <QComboBox>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QPushButton> #include <QPushButton>
#include <QSortFilterProxyModel>
#include <Libkleo/GnuPG> #include <Libkleo/GnuPG>
#include <qgpgme/keylistjob.h> #include <qgpgme/keylistjob.h>
...@@ -93,6 +93,7 @@ private: ...@@ -93,6 +93,7 @@ private:
} }
private: private:
QSortFilterProxyModel *proxyModel;
QLineEdit *lineEdit; QLineEdit *lineEdit;
QComboBox *combo; QComboBox *combo;
QPushButton *certifyButton; QPushButton *certifyButton;
...@@ -120,7 +121,10 @@ SearchBar::Private::Private(SearchBar *qq) ...@@ -120,7 +121,10 @@ SearchBar::Private::Private(SearchBar *qq)
layout->addWidget(certifyButton); layout->addWidget(certifyButton);
showOrHideCertifyButton(); showOrHideCertifyButton();
combo->setModel(KeyFilterManager::instance()->model()); proxyModel = new QSortFilterProxyModel{q};
proxyModel->setSourceModel(KeyFilterManager::instance()->model());
proxyModel->sort(0, Qt::AscendingOrder);
combo->setModel(proxyModel);
KDAB_SET_OBJECT_NAME(layout); KDAB_SET_OBJECT_NAME(layout);
KDAB_SET_OBJECT_NAME(lineEdit); KDAB_SET_OBJECT_NAME(lineEdit);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment