From kde-commits Mon Nov 29 13:59:05 2010 From: Marc Mutz Date: Mon, 29 Nov 2010 13:59:05 +0000 To: kde-commits Subject: KDE/kdepim/libkleo/tests Message-Id: <20101129135905.BD867AC8A4 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129103923002331 SVN commit 1202051 by mutz: test_cryptoconfig: optionally test QGpgMENewCryptoConfig M +10 -1 test_cryptoconfig.cpp --- trunk/KDE/kdepim/libkleo/tests/test_cryptoconfig.cpp #1202050:1202051 @@ -30,6 +30,7 @@ */ #include "libkleo/backends/qgpgme/qgpgmecryptoconfig.h" +#include "libkleo/backends/qgpgme/qgpgmenewcryptoconfig.h" #include #include @@ -49,11 +50,19 @@ if ( GpgME::initializeLibrary( 0 ) ) return 1; + const bool newCryptoConfig = argc == 2 && qstrcmp( argv[1], "--new" ) == 0; + if ( newCryptoConfig ) + argc = 1; // hide from KDE + KAboutData aboutData( "test_cryptoconfig", 0, ki18n("CryptoConfig Test"), "0.1" ); KCmdLineArgs::init( argc, argv, &aboutData ); KApplication app( false ); - Kleo::CryptoConfig * config = new QGpgMECryptoConfig(); + Kleo::CryptoConfig * config = 0; + if ( newCryptoConfig ) + config = new QGpgMENewCryptoConfig; + else + config = new QGpgMECryptoConfig; // Dynamic querying of the options cout << "Components:" << endl;