[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim/certmanager/lib/backends/qgpgme
From:       Marc Mutz <mutz () kde ! org>
Date:       2009-05-13 13:01:17
Message-ID: 1242219677.027922.27656.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 967435 by mutz:

Fix handling of list-of-none (aka 'verbose'-style) options. Backport from e4 rev's \
967419,967432.

 M  +14 -2     qgpgmecryptoconfig.cpp  


--- branches/kdepim/enterprise/kdepim/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp \
#967434:967435 @@ -447,6 +447,13 @@
   bool isString = isStringType();
 
   if ( isList() ) {
+    if ( argType() == ArgType_None ) {
+        bool ok = true;
+        const QVariant 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;
+    }
     QValueList<QVariant> lst;
     QStringList items = QStringList::split( ',', str );
     for( QStringList::const_iterator valit = items.begin(); valit != items.end(); \
++valit ) { @@ -657,7 +664,10 @@
   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 @@
 {
   Q_ASSERT( mArgType == ArgType_None );
   Q_ASSERT( isList() );
-  setUIntValue( i );
+  mValue = i;
+  mSet = i > 0;
+  mDirty = true;
 }
 
 void QGpgMECryptoConfigEntry::setStringValueList( const QStringList& lst )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic