Commit 2fe6ffd2 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Make filtering by tags (and display of tags) work in key selection

GnuPG-bug-id: 5174
parent 2c35da3d
......@@ -14,6 +14,8 @@
#include <view/searchbar.h>
#include <view/tabwidget.h>
#include "utils/tags.h"
#include <Libkleo/KeyListModel>
#include <Libkleo/KeyCache>
......@@ -38,6 +40,11 @@
#include <algorithm>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS
#endif
using namespace Kleo;
using namespace Kleo::Dialogs;
using namespace Kleo::Commands;
......@@ -162,6 +169,11 @@ CertificateSelectionDialog::Private::Private(CertificateSelectionDialog *qq)
{
ui.tabWidget.setFlatModel(AbstractKeyListModel::createFlatKeyListModel(q));
ui.tabWidget.setHierarchicalModel(AbstractKeyListModel::createHierarchicalKeyListModel(q));
#ifdef GPGME_HAS_REMARKS
const auto tagKeys = Tags::tagKeys();
ui.tabWidget.flatModel()->setRemarkKeys(tagKeys);
ui.tabWidget.hierarchicalModel()->setRemarkKeys(tagKeys);
#endif
ui.tabWidget.connectSearchBar(&ui.searchBar);
connect(&ui.tabWidget, SIGNAL(currentViewChanged(QAbstractItemView*)),
......
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