From 9640dc58e498966b482dcded6990cf4b47c556ac Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Thu, 12 Jan 2017 12:57:00 +0100 Subject: qt: Add support for stringValueList in CryptoConf * lang/qt/src/Makefile.am (qgpgme_sources): Add cryptoconfig.cpp * lang/qt/src/cryptoconfig.cpp: New. * lang/qt/src/cryptoconfig.h (CryptoConfigEntry::stringValueList): New. * lang/qt/src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigEntry::stringValueList): New. * lang/qt/src/qgpgmenewcryptoconfig.h: Update accordingly. -- This is a pardigm change in cryptoconfig.h to avoid ABI breaks with each new config value we support it now has an implementation that is directly related to qgpgmenewcryptoconfig, which is now the only one. --- lang/qt/src/qgpgmenewcryptoconfig.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lang/qt/src/qgpgmenewcryptoconfig.cpp') diff --git a/lang/qt/src/qgpgmenewcryptoconfig.cpp b/lang/qt/src/qgpgmenewcryptoconfig.cpp index 49b27caa..4738a03b 100644 --- a/lang/qt/src/qgpgmenewcryptoconfig.cpp +++ b/lang/qt/src/qgpgmenewcryptoconfig.cpp @@ -546,6 +546,18 @@ std::vector QGpgMENewCryptoConfigEntry::uintValueList() const return m_option.currentValue().uintValues(); } +QStringList QGpgMENewCryptoConfigEntry::stringValueList() const +{ + Q_ASSERT(isList()); + const Argument arg = m_option.currentValue(); + const std::vector values = arg.stringValues(); + QStringList ret; + for(const char *value: values) { + ret << QString::fromUtf8(value); + } + return ret; +} + QList QGpgMENewCryptoConfigEntry::urlValueList() const { const Type type = m_option.type(); -- cgit v1.2.3