summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-07-06 15:14:19 +0200
committerJustus Winter <[email protected]>2017-07-11 10:58:45 +0200
commit8453d27177b0e79ed1b63e1ab95644f150dcf6d0 (patch)
tree7e08b5d922fea3c4368b0cc0d8cfd6e6504e1b1d
parent5aebe68f92fb5634f8f42ac72ac8902e15dfa8d1 (diff)
Do not display too advanced options in CO_DE_VS mode
Partially reverts 40fbc965b6afda5a8495b60779cb31e985e1befa, but only restricts the options displayed when GnuPG is configured to comply with de-vs. Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--src/ui/cryptoconfigmodule.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/cryptoconfigmodule.cpp b/src/ui/cryptoconfigmodule.cpp
index 8636883..176d03d 100644
--- a/src/ui/cryptoconfigmodule.cpp
+++ b/src/ui/cryptoconfigmodule.cpp
@@ -40,6 +40,7 @@
#include <klineedit.h>
#include <KLocalizedString>
#include "kleo_ui_debug.h"
+#include <utils/formatting.h>
#include <qicon.h>
#include <QDialogButtonBox>
@@ -330,11 +331,17 @@ Kleo::CryptoConfigGroupGUI::CryptoConfigGroupGUI(
QGridLayout *glay, QWidget *widget)
: QObject(module), mGroup(group)
{
+ const bool de_vs = Kleo::Formatting::complianceMode() == QStringLiteral("de-vs");
const int startRow = glay->rowCount();
const QStringList entries = mGroup->entryList();
for (QStringList::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) {
QGpgME::CryptoConfigEntry *entry = group->entry(*it);
Q_ASSERT(entry);
+ /* Skip "dangerous" options if we are running in CO_DE_VS. */
+ if (de_vs && entry->level() > QGpgME::CryptoConfigEntry::Level_Advanced) {
+ qCDebug(KLEO_UI_LOG) << "entry" << *it << "too advanced, skipping";
+ continue;
+ }
CryptoConfigEntryGUI *entryGUI =
CryptoConfigEntryGUIFactory::createEntryGUI(module, entry, *it, glay, widget);
if (entryGUI) {