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

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim/libkdepim
From:       Allen Winter <winter () kde ! org>
Date:       2010-10-19 16:01:06
Message-ID: 20101019160106.E5BA2AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1187490 by winterz:

in openAddressBook(), check if the startServiceByDesktopName("kaddressbook") fails
and tell the user why if it does. Users report that sometimes opening the addressbook
fails, but we havent' been able to reproduce. So this is an attempt to get
an error message back on failures to see what might be happening.
for kolab/issue4475

MERGE: trunk


 M  +12 -2     kaddrbook.cpp  


--- branches/kdepim/enterprise/kdepim/libkdepim/kaddrbook.cpp #1187489:1187490
@@ -162,9 +162,19 @@
   ab->setErrorHandler( 0 );
 }
 
-void KAddrBookExternal::openAddressBook(QWidget *) {
-  kapp->startServiceByDesktopName( "kaddressbook" );
+void KAddrBookExternal::openAddressBook( QWidget *parent )
+{
+  QString errStr;
+  if ( kapp->startServiceByDesktopName( "kaddressbook", QString(), &errStr ) > 0 ) {
+    QString txt;
+    if ( !errStr.isEmpty() ) {
+      txt = i18n( "<qt>Unable to open kaddressbook.<p>Error: \"%1\"</qt>" ).arg( errStr );
+    } else {
+      txt = i18n( "<qt>Unable to open kaddressbook.<p>Error:  unknown.</qt>" );
 }
+    KMessageBox::sorry( parent, txt );
+  }
+}
 
 void KAddrBookExternal::addNewAddressee( QWidget* )
 {
[prev in list] [next in list] [prev in thread] [next in thread] 

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