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

List:       kde-commits
Subject:    KDE/kdepim/akonadi/resources/kabc
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2008-08-31 22:39:35
Message-ID: 1220222375.585018.27104.nullmailer () svn ! kde ! org
[Download RAW message or body]

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<KABC::Resource> *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() );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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