[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdepim/certmanager/lib/backends/qgpgme
From: David Faure <faure () kde ! org>
Date: 2004-03-31 23:13:47
Message-ID: 20040331231347.4791690CD () office ! kde ! org
[Download RAW message or body]
CVS commit by faure:
Fixed error box when using KMail's configure dialog and gpgconf can't be found
(no more error box until actually clicking the "configure" button in the Security module's last tab)
M +10 -5 qgpgmecryptoconfig.cpp 1.22
M +2 -2 qgpgmecryptoconfig.h 1.10
--- kdepim/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp #1.21:1.22
@@ -56,9 +56,8 @@ static bool s_duringClear = false;
// Change size of mFlags bitfield if adding new values here
-QGpgMECryptoConfig::QGpgMECryptoConfig( bool showErrors )
+QGpgMECryptoConfig::QGpgMECryptoConfig()
: mComponents( 7 ), mParsed( false )
{
mComponents.setAutoDelete( true );
- runGpgConf( showErrors );
}
@@ -83,9 +82,15 @@ void QGpgMECryptoConfig::runGpgConf( boo
rc = -1;
else
- rc = ( proc.normalExit() ) ? proc.exitStatus() : -1 ;
+ rc = ( proc.normalExit() ) ? proc.exitStatus() : -2 ;
// handle errors, if any (and if requested)
if ( showErrors && rc != 0 ) {
- QString wmsg = i18n("<qt>Failed to execute gpgconf:<br>%1</qt>").arg( strerror(rc) );
+ QString wmsg = i18n("<qt>Failed to execute gpgconf:<br>%1</qt>");
+ if ( rc == -1 )
+ wmsg = wmsg.arg( i18n( "program not found" ) );
+ else if ( rc == -2 )
+ wmsg = wmsg.arg( i18n( "program cannot be executed" ) );
+ else
+ wmsg = wmsg.arg( strerror(rc) );
kdWarning(5150) << wmsg << endl; // to see it from test_cryptoconfig.cpp
KMessageBox::error(0, wmsg);
@@ -113,5 +118,5 @@ QStringList QGpgMECryptoConfig::componen
{
if ( !mParsed )
- const_cast<QGpgMECryptoConfig*>( this )->runGpgConf( false );
+ const_cast<QGpgMECryptoConfig*>( this )->runGpgConf( true );
QDictIterator<QGpgMECryptoConfigComponent> it( mComponents );
QStringList names;
--- kdepim/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.h #1.9:1.10
@@ -53,7 +53,6 @@ public:
/**
* Constructor
- * @param showErrors if true, a messagebox will be shown if e.g. gpgconf wasn't found
*/
- QGpgMECryptoConfig( bool showErrors = true );
+ QGpgMECryptoConfig();
virtual ~QGpgMECryptoConfig();
@@ -68,4 +67,5 @@ private slots:
void slotCollectStdOut( KProcIO* proc );
private:
+ /// @param showErrors if true, a messagebox will be shown if e.g. gpgconf wasn't found
void runGpgConf( bool showErrors );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic