aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/cryptoconfig.cpp
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2021-06-29 10:12:33 +0000
committerIngo Klöcker <[email protected]>2021-06-29 10:12:33 +0000
commit12006a782900687a7f0158a3f931528cfc5ff451 (patch)
tree99ac41fdd172540dd95b602a333e2aaffc16c2dd /lang/qt/src/cryptoconfig.cpp
parentUpdate NEWS. (diff)
downloadgpgme-12006a782900687a7f0158a3f931528cfc5ff451.tar.gz
gpgme-12006a782900687a7f0158a3f931528cfc5ff451.zip
qt: Allow retrieving the default value of a config entry
* lang/qt/src/cryptoconfig.cpp, lang/qt/src/cryptoconfig.h (CryptoConfigEntry::defaultValue): New. * lang/qt/src/qgpgmenewcryptoconfig.cpp, lang/qt/src/qgpgmenewcryptoconfig.h (QGpgMENewCryptoConfigEntry::defaultValue): New. * lang/qt/tests/t-config.cpp (CryptoConfigTest::testDefault()): Add test of CryptoConfigEntry::defaultValue(). Port away from deprecated CryptoConfig::entry overload. -- GnuPG-bug-id: 5515
Diffstat (limited to 'lang/qt/src/cryptoconfig.cpp')
-rw-r--r--lang/qt/src/cryptoconfig.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lang/qt/src/cryptoconfig.cpp b/lang/qt/src/cryptoconfig.cpp
index d52dce73..4f13d3f0 100644
--- a/lang/qt/src/cryptoconfig.cpp
+++ b/lang/qt/src/cryptoconfig.cpp
@@ -44,6 +44,15 @@ QStringList CryptoConfigEntry::stringValueList() const
return entry->stringValueList();
}
+QVariant CryptoConfigEntry::defaultValue() const
+{
+ const QGpgMENewCryptoConfigEntry *entry = dynamic_cast <const QGpgMENewCryptoConfigEntry*>(this);
+ if (!entry) {
+ return {};
+ }
+ return entry->defaultValue();
+}
+
QGpgME::CryptoConfigEntry *CryptoConfig::entry(const QString &componentName, const QString &entryName) const
{
const CryptoConfigComponent *comp = component(componentName);