From kde-commits Sun Aug 31 22:39:35 2008 From: Kevin Krammer Date: Sun, 31 Aug 2008 22:39:35 +0000 To: kde-commits Subject: KDE/kdepim/akonadi/resources/kabc Message-Id: <1220222375.585018.27104.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122022238304836 SVN commit 855502 by krake: Basic checks for resource config sanity: - do not pass empty config - do not accept getting an Akonadi resource Fake title for first assistant page otherwise the new fading transition looks really ugly M +17 -4 kabcresource.cpp M +1 -1 kresourceassistant.cpp --- trunk/KDE/kdepim/akonadi/resources/kabc/kabcresource.cpp #855501:855502 @@ -602,14 +602,27 @@ } closeConfiguration(); - KSharedConfig::Ptr config = KGlobal::config(); - Q_ASSERT( !config.isNull() ); - KGlobal::config()->reparseConfiguration(); + if ( KGlobal::config()->groupList().isEmpty() ) { + emit status( Broken, i18nc( "@info:status", "No KDE address book plugin configured yet" ) ); + return; + } + + Q_ASSERT( KGlobal::config().data() != 0); + KRES::Manager *manager = mAddressBook->getResourceManager(); - manager->readConfig( config.data() ); + manager->readConfig( KGlobal::config().data() ); + KRES::Resource *resource = manager->standardResource(); + if ( resource != 0 ) { + if ( resource->type().toLower() == QLatin1String( "akonadi" ) ) { + kError() << "Resource config points to an Akonadi bridge resource"; + emit status( Broken, i18nc( "@info:status", "No KDE address book plugin configured yet" ) ); + return; + } + } + setResourcePointers( manager->standardResource() ); if ( mBaseResource == 0 ) { emit status( Broken, i18nc( "@info:status", "No KDE address book plugin configured yet" ) ); --- trunk/KDE/kdepim/akonadi/resources/kabc/kresourceassistant.cpp #855501:855502 @@ -323,7 +323,7 @@ setCaption( i18nc( "@title:window", "KDE Compatibility Assistant" ) ); QWidget *introPage = new CompatibilityIntroductionLabel( this ); - addPage( introPage, QString() ); + addPage( introPage, QLatin1String( " " ) ); d->mFactory = KRES::Factory::self( resourceFamily.toLower() );