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

List:       kde-commits
Subject:    kdepim/kmail
From:       Andreas Gungl <a.gungl () gmx ! de>
Date:       2003-12-31 15:41:08
Message-ID: 20031231154108.6C32593EA () office ! kde ! org
[Download RAW message or body]

CVS commit by gungl: 

Trivial commit: release the save ticket when save() failed


  M +14 -4     kmaddrbook.cpp   1.82


--- kdepim/kmail/kmaddrbook.cpp  #1.81:1.82
@@ -173,7 +173,12 @@ void KMAddrBookExternal::addEmail( const
 
     KABC::Ticket *t = ab->requestSaveTicket();
-    if ( t )
+    bool saved = false;
+    if ( t ) {
       ab->insertAddressee(a);
-    if ( !t || !ab->save( t ) ) {
+      saved = ab->save( t );
+      if ( !saved )
+        ab->releaseSaveTicket( t );
+    }
+    if ( !saved ) {
       KMessageBox::error( parent, i18n("Can't save to addressbook.") );
     } else {
@@ -238,7 +243,12 @@ bool KMAddrBookExternal::addVCard( const
   if ( addressees.isEmpty() ) {
     KABC::Ticket *t = ab->requestSaveTicket();
-    if ( t )
+    bool saved = false;
+    if ( t ) {
       ab->insertAddressee( addressee );
-    if ( !t || !ab->save( t ) ) {
+      saved = ab->save( t );
+      if ( !saved )
+        ab->releaseSaveTicket( t );
+    }
+    if ( !saved ) {
       KMessageBox::error( parent, i18n("Can't save to addressbook.") );
       inserted = false;


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

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