[Kde-pim] KDE/kdepimlibs/akonadi

Stephen Kelly steveire at gmail.com
Wed Sep 30 16:36:26 BST 2009


SVN commit 1029709 by skelly:

Make the EntityTreeModel take a ChangeRecorder instead of a Monitor.

This is necessary to resolve a race condition as described in the
mailing list a few weeks ago.

This is backwards incompatible, but it's @since 4.4, so that's ok.

I have s/Monitor/ChangeRecorder/ patches for kdepim, playground/pim
and Mailody. If anything else is broken by this, just make the same change.

CCMAIL: kde-pim at kde.org

 M  +3 -3      contact/addressbookcombobox.cpp  
 M  +3 -3      contact/contactcompletionmodel.cpp  
 M  +1 -1      contact/contactcompletionmodel_p.h  
 M  +2 -2      entitytreemodel.cpp  
 M  +5 -3      entitytreemodel.h  
 M  +1 -1      entitytreemodel_p.cpp  
 M  +2 -1      entitytreemodel_p.h  
 M  +1 -1      tests/fakemonitor.cpp  
 M  +2 -2      tests/fakemonitor.h  


--- trunk/KDE/kdepimlibs/akonadi/contact/addressbookcombobox.cpp #1029708:1029709
@@ -24,10 +24,10 @@
 #include "asyncselectionhandler_p.h"
 #include "collectionfiltermodel_p.h"
 
+#include <akonadi/changerecorder.h>
 #include <akonadi/collectionfetchscope.h>
 #include <akonadi/entitytreemodel.h>
 #include <akonadi/entityfilterproxymodel.h>
-#include <akonadi/monitor.h>
 #include <akonadi/session.h>
 #include <kabc/addressee.h>
 #include <kabc/contactgroup.h>
@@ -56,7 +56,7 @@
                                                     << KABC::ContactGroup::mimeType(); break;
       }
 
-      mMonitor = new Akonadi::Monitor;
+      mMonitor = new Akonadi::ChangeRecorder;
       mMonitor->fetchCollection( true );
       mMonitor->setCollectionMonitored( Akonadi::Collection::root() );
 
@@ -99,7 +99,7 @@
     AddressBookComboBox *mParent;
 
     QComboBox *mComboBox;
-    Monitor *mMonitor;
+    ChangeRecorder *mMonitor;
     EntityTreeModel *mModel;
     AsyncSelectionHandler *mSelectionHandler;
 };
--- trunk/KDE/kdepimlibs/akonadi/contact/contactcompletionmodel.cpp #1029708:1029709
@@ -24,8 +24,8 @@
 #include <kdescendantsproxymodel.h>
 
 #include <akonadi/entityfilterproxymodel.h>
+#include <akonadi/changerecorder.h>
 #include <akonadi/itemfetchscope.h>
-#include <akonadi/monitor.h>
 #include <akonadi/session.h>
 
 #include <kabc/addressee.h>
@@ -39,7 +39,7 @@
   if ( mSelf )
     return mSelf;
 
-  Monitor *monitor = new Monitor;
+  ChangeRecorder *monitor = new ChangeRecorder;
   monitor->fetchCollection( true );
   monitor->itemFetchScope().fetchFullPayload();
   monitor->setCollectionMonitored( Akonadi::Collection::root() );
@@ -60,7 +60,7 @@
   return mSelf;
 }
 
-ContactCompletionModel::ContactCompletionModel( Session *session, Monitor *monitor, QObject *parent )
+ContactCompletionModel::ContactCompletionModel( Session *session, ChangeRecorder *monitor, QObject *parent )
   : EntityTreeModel( session, monitor, parent )
 {
 }
--- trunk/KDE/kdepimlibs/akonadi/contact/contactcompletionmodel_p.h #1029708:1029709
@@ -38,7 +38,7 @@
       EmailColumn         ///< The preferred email of the contact.
     };
 
-    ContactCompletionModel( Session *session, Monitor *monitor, QObject *parent = 0 );
+    ContactCompletionModel( Session *session, ChangeRecorder *monitor, QObject *parent = 0 );
     virtual ~ContactCompletionModel();
 
     virtual QVariant getData( const Item &item, int column, int role = Qt::DisplayRole ) const;
--- trunk/KDE/kdepimlibs/akonadi/entitytreemodel.cpp #1029708:1029709
@@ -29,11 +29,11 @@
 #include <KDE/KUrl>
 
 #include <akonadi/attributefactory.h>
+#include <akonadi/changerecorder.h>
 #include <akonadi/collectionmodifyjob.h>
 #include <akonadi/entitydisplayattribute.h>
 #include <akonadi/transactionsequence.h>
 #include <akonadi/itemmodifyjob.h>
-#include <akonadi/monitor.h>
 #include <akonadi/session.h>
 #include "collectionfetchscope.h"
 
@@ -45,7 +45,7 @@
 using namespace Akonadi;
 
 EntityTreeModel::EntityTreeModel( Session *session,
-                                  Monitor *monitor,
+                                  ChangeRecorder *monitor,
                                   QObject *parent
                                 )
     : QAbstractItemModel( parent ),
--- trunk/KDE/kdepimlibs/akonadi/entitytreemodel.h #1029708:1029709
@@ -49,6 +49,8 @@
 
 namespace Akonadi
 {
+
+class ChangeRecorder;
 class CollectionStatistics;
 class Item;
 class ItemFetchScope;
@@ -65,7 +67,7 @@
  *
  * @code
  *
- *   Monitor *monitor = new Monitor(this);
+ *   ChangeRecorder *monitor = new ChangeRecorder(this);
  *   monitor->setCollectionMonitored(Collection::root());
  *   monitor->setMimeTypeMonitored(KABC::addresseeMimeType());
  *
@@ -125,10 +127,10 @@
      * Creates a new entity tree model.
      *
      * @param session The Session to use to communicate with Akonadi.
-     * @param monitor The Monitor whose entities should be represented in the model.
+     * @param monitor The ChangeRecorder whose entities should be represented in the model.
      * @param parent The parent object.
      */
-    EntityTreeModel( Session *session, Monitor *monitor, QObject *parent = 0 );
+    EntityTreeModel( Session *session, ChangeRecorder *monitor, QObject *parent = 0 );
 
     /**
      * Destroys the entity tree model.
--- trunk/KDE/kdepimlibs/akonadi/entitytreemodel_p.cpp #1029708:1029709
@@ -25,6 +25,7 @@
 
 #include <akonadi/agentmanager.h>
 #include <akonadi/agenttype.h>
+#include <akonadi/changerecorder.h>
 #include <akonadi/collectionfetchjob.h>
 #include <akonadi/collectionfetchscope.h>
 #include <akonadi/collectionstatistics.h>
@@ -32,7 +33,6 @@
 #include <akonadi/entitydisplayattribute.h>
 #include <akonadi/itemfetchjob.h>
 #include <akonadi/itemmodifyjob.h>
-#include <akonadi/monitor.h>
 #include <akonadi/session.h>
 
 #include <kdebug.h>
--- trunk/KDE/kdepimlibs/akonadi/entitytreemodel_p.h #1029708:1029709
@@ -32,6 +32,7 @@
 namespace Akonadi
 {
 class ItemFetchJob;
+class ChangeRecorder;
 }
 
 struct Node
@@ -109,7 +110,7 @@
   QHash<Collection::Id, QList<Node*> > m_childEntities;
   QSet<Collection::Id> m_populatedCols;
 
-  Monitor *m_monitor;
+  ChangeRecorder *m_monitor;
   Collection m_rootCollection;
   Node *m_rootNode;
   QString m_rootCollectionDisplayName;
--- trunk/KDE/kdepimlibs/akonadi/tests/fakemonitor.cpp #1029708:1029709
@@ -26,7 +26,7 @@
 using namespace Akonadi;
 
 FakeMonitor::FakeMonitor(EventQueue *eventQueue, FakeAkonadiServer *fakeServer, QObject* parent)
-  : Monitor(parent), m_eventQueue(eventQueue), m_fakeServer(fakeServer)
+  : ChangeRecorder(parent), m_eventQueue(eventQueue), m_fakeServer(fakeServer)
 {
   connect(eventQueue, SIGNAL(dequeued()), SLOT(processNextEvent()));
 }
--- trunk/KDE/kdepimlibs/akonadi/tests/fakemonitor.h #1029708:1029709
@@ -20,12 +20,12 @@
 #ifndef FAKEMONITOR_H
 #define FAKEMONITOR_H
 
-#include "monitor.h"
+#include "changerecorder.h"
 
 class EventQueue;
 class FakeAkonadiServer;
 
-class FakeMonitor : public Akonadi::Monitor
+class FakeMonitor : public Akonadi::ChangeRecorder
 {
   Q_OBJECT
 public:
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list