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

List:       kde-commits
Subject:    KDE/kdepim/kalarm
From:       David Jarvie <djarvie () kde ! org>
Date:       2010-11-11 23:34:22
Message-ID: 20101111233422.C5163AC89E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195772 by djarvie:

Fix the backend contents being deleted when a collection is removed


 M  +13 -0     akonadimodel.cpp  
 M  +0 -1      akonadimodel.h  


--- trunk/KDE/kdepim/kalarm/akonadimodel.cpp #1195771:1195772
@@ -1095,10 +1095,17 @@
     kDebug() << collection.id();
     Collection col = collection;
     mCollectionsDeleting << collection.id();
+    // Note: CollectionDeleteJob deletes the backend storage also.
+    AgentManager* agentManager = AgentManager::self();
+    const AgentInstance instance = agentManager->instance(collection.resource());
+    if (instance.isValid())
+        agentManager->removeInstance(instance);
+#if 0
     CollectionDeleteJob* job = new CollectionDeleteJob(col);
     connect(job, SIGNAL(result(KJob*)), SLOT(deleteCollectionJobDone(KJob*)));
     mPendingCollectionJobs[job] = CollJobData(col.id(), displayName(col));
     job->start();
+#endif
     return true;
 }
 
@@ -1110,6 +1117,7 @@
     return mCollectionsDeleting.contains(id);
 }
 
+#if 0
 /******************************************************************************
 * Called when a collection deletion job has completed.
 * Checks for any error.
@@ -1133,6 +1141,7 @@
     else
         emit collectionDeleted(jobData.id, true);
 }
+#endif
 
 /******************************************************************************
 * Called when a collection modification job has completed.
@@ -1381,7 +1390,10 @@
     if (!ix.isValid())
         return false;
     if (mCollectionsDeleting.contains(ix.data(ParentCollectionRole).value<Collection>().id()))
 +    {
+        kDebug() << "Collection being deleted";
         return true;    // the event's collection is being deleted
+    }
     Item item = ix.data(ItemRole).value<Item>();
     ItemDeleteJob* job = new ItemDeleteJob(item);
     connect(job, SIGNAL(result(KJob*)), SLOT(itemJobDone(KJob*)));
@@ -1601,6 +1613,7 @@
         bool newEnabled = collection.hasAttribute<CollectionAttribute>() ? \
collection.attribute<CollectionAttribute>()->isEnabled() : false;  if (first  ||  \
newEnabled != oldEnabled)  {
+            kDebug() << "enabled ->" << newEnabled;
             first = false;
             mCollectionEnabled[collection.id()] = newEnabled;
             emit collectionStatusChanged(collection, Enabled, newEnabled);
--- trunk/KDE/kdepim/kalarm/akonadimodel.h #1195771:1195772
@@ -212,7 +212,6 @@
         void slotEmitEventChanged();
         void addCollectionJobDone(KJob*);
         void modifyCollectionJobDone(KJob*);
-        void deleteCollectionJobDone(KJob*);
         void itemJobDone(KJob*);
 
     private:


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

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