Commit 7b1fa6ef authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Skip any config options beyond expert level

This filters out any options with expert level beyond "expert", i.e.,
in particular, those with expert level "invisible".

GnuPG-bug-id: 5677
parent 68178cdb
...@@ -415,13 +415,16 @@ Kleo::CryptoConfigGroupGUI::CryptoConfigGroupGUI( ...@@ -415,13 +415,16 @@ Kleo::CryptoConfigGroupGUI::CryptoConfigGroupGUI(
: QObject(module), mGroup(group) : QObject(module), mGroup(group)
{ {
const bool de_vs = Kleo::gnupgUsesDeVsCompliance(); const bool de_vs = Kleo::gnupgUsesDeVsCompliance();
// Skip "dangerous" expert options if we are running in CO_DE_VS.
// Otherwise, skip any options beyond expert level.
const auto maxEntryLevel = de_vs ? QGpgME::CryptoConfigEntry::Level_Advanced
: QGpgME::CryptoConfigEntry::Level_Expert;
const int startRow = glay->rowCount(); const int startRow = glay->rowCount();
const QStringList entries = mGroup->entryList(); const QStringList entries = mGroup->entryList();
for (QStringList::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) { for (QStringList::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) {
QGpgME::CryptoConfigEntry *entry = group->entry(*it); QGpgME::CryptoConfigEntry *entry = group->entry(*it);
Q_ASSERT(entry); Q_ASSERT(entry);
/* Skip "dangerous" options if we are running in CO_DE_VS. */ if (entry->level() > maxEntryLevel) {
if (de_vs && entry->level() > QGpgME::CryptoConfigEntry::Level_Advanced) {
qCDebug(KLEO_UI_LOG) << "entry" << *it << "too advanced, skipping"; qCDebug(KLEO_UI_LOG) << "entry" << *it << "too advanced, skipping";
continue; continue;
} }
......
Supports Markdown
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