summaryrefslogtreecommitdiffstats
path: root/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp')
-rw-r--r--certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp b/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp
index c67800502..ae45d6833 100644
--- a/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp
+++ b/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp
@@ -447,6 +447,13 @@ TQVariant QGpgMECryptoConfigEntry::stringToValue( const TQString& str, bool unes
bool isString = isStringType();
if ( isList() ) {
+ if ( argType() == ArgType_None ) {
+ bool ok = true;
+ const TQVariant v = str.isEmpty() ? 0U : str.toUInt( &ok ) ;
+ if ( !ok )
+ kdWarning(5150) << "list-of-none should have an unsigned int as value:" << str << endl;
+ return v;
+ }
TQValueList<TQVariant> lst;
TQStringList items = TQStringList::split( ',', str );
for( TQStringList::const_iterator valit = items.begin(); valit != items.end(); ++valit ) {
@@ -657,7 +664,10 @@ void QGpgMECryptoConfigEntry::resetToDefault()
if ( mFlags & GPGCONF_FLAG_DEFAULT )
mValue = mDefaultValue;
else if ( mArgType == ArgType_None )
- mValue = false;
+ if ( isList() )
+ mValue = 0U;
+ else
+ mValue = false;
}
void QGpgMECryptoConfigEntry::setBoolValue( bool b )
@@ -715,7 +725,9 @@ void QGpgMECryptoConfigEntry::setNumberOfTimesSet( unsigned int i )
{
Q_ASSERT( mArgType == ArgType_None );
Q_ASSERT( isList() );
- setUIntValue( i );
+ mValue = i;
+ mSet = i > 0;
+ mDirty = true;
}
void QGpgMECryptoConfigEntry::setStringValueList( const TQStringList& lst )