Commit 27b04b3f authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Offer only OpenPGP keys in edit group dialog if CMS is disabled

GnuPG-bug-id: 5688
parent 83d9bbf1
......@@ -12,7 +12,9 @@
#include "commands/detailscommand.h"
#include "view/keytreeview.h"
#include <settings.h>
#include <Libkleo/DefaultKeyFilter>
#include <Libkleo/KeyListModel>
#include <KConfigGroup>
......@@ -40,6 +42,16 @@ using namespace GpgME;
Q_DECLARE_METATYPE(GpgME::Key)
namespace
{
auto createOpenPGPOnlyKeyFilter()
{
auto filter = std::make_shared<DefaultKeyFilter>();
filter->setIsOpenPGP(DefaultKeyFilter::Set);
return filter;
}
}
class EditGroupDialog::Private
{
friend class ::Kleo::Dialogs::EditGroupDialog;
......@@ -86,6 +98,9 @@ public:
ui.availableKeysList->view()->setRootIsDecorated(false);
ui.availableKeysList->setFlatModel(availableKeysModel);
ui.availableKeysList->setHierarchicalView(false);
if (!Settings{}.cmsEnabled()) {
ui.availableKeysList->setKeyFilter(createOpenPGPOnlyKeyFilter());
}
availableKeysLayout->addWidget(ui.availableKeysList, /*stretch=*/ 1);
centerLayout->addLayout(availableKeysLayout, /*stretch=*/ 1);
......
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