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

List:       kde-commits
Subject:    proko2: kdepim/kresources/kolab
From:       David Faure <faure () kde ! org>
Date:       2004-07-21 13:47:22
Message-ID: 20040721134722.1754C99EC () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

When cancelling the "choose a subresource" dialog, cancel the saving.
But of course that means the object isn't saved, and the user is asked again
the next time he modifies the object (e.g. note). Better than confusing kmail completely though.


  M +2 -0      kabc/resourcekolab.cpp   1.1.2.15
  M +8 -3      kcal/resourcekolab.cpp   1.1.2.16
  M +5 -1      knotes/resourcekolab.cpp   1.1.2.20


--- kdepim/kresources/kolab/kabc/resourcekolab.cpp  #1.1.2.14:1.1.2.15
@@ -274,4 +274,6 @@ bool KABC::ResourceKolab::kmailUpdateAdd
   } else {
     subResource = findWritableResource( mSubResources );
+    if ( subResource.isEmpty() )
+      return false;
     sernum = 0;
   }

--- kdepim/kresources/kolab/kcal/resourcekolab.cpp  #1.1.2.15:1.1.2.16
@@ -214,4 +214,6 @@ void ResourceKolab::incidenceUpdated( KC
       return;
     subResource = findWritableResource( *map );
+    if ( subResource.isEmpty() )
+      return;
     sernum = 0;
   }
@@ -280,5 +282,6 @@ bool ResourceKolab::addEvent( KCal::Even
   QString subResource =
     newEvent ? findWritableResource( mEventSubResources ) : _subresource;
-  Q_ASSERT( !subResource.isEmpty() );
+  if ( subResource.isEmpty() )
+    return false;
 
   if ( !mSilent ) {
@@ -365,5 +368,6 @@ bool ResourceKolab::addTodo( KCal::Todo*
   QString subResource =
     newTodo ? findWritableResource( mTodoSubResources ) : _subresource;
-  Q_ASSERT( !subResource.isEmpty() );
+  if ( subResource.isEmpty() )
+    return false;
 
   if ( !mSilent ) {
@@ -437,5 +441,6 @@ bool ResourceKolab::addJournal( KCal::Jo
   QString subResource =
     newJournal ? findWritableResource( mJournalSubResources ) : _subresource;
-  Q_ASSERT( !subResource.isEmpty() );
+  if ( subResource.isEmpty() )
+    return false;
 
   if ( !mSilent ) {

--- kdepim/kresources/kolab/knotes/resourcekolab.cpp  #1.1.2.19:1.1.2.20
@@ -174,4 +174,6 @@ bool ResourceKolab::addNote( KCal::Journ
   QString resource =
     newNote ? findWritableResource( mSubResources ) : subresource;
+  if ( resource.isEmpty() ) // canceled
+    return false;
 
   if ( !mSilent ) {
@@ -217,6 +219,8 @@ void ResourceKolab::incidenceUpdated( KC
     subResource = mUidMap[ i->uid() ].resource();
     sernum = mUidMap[ i->uid() ].serialNumber();
-  } else {
+  } else { // can this happen?
     subResource = findWritableResource( mSubResources );
+    if ( subResource.isEmpty() ) // canceled
+      return;
     sernum = 0;
   }


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

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