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

List:       kde-commits
Subject:    KDE/kdepim/akonadi/libakonadi
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2008-02-08 21:14:50
Message-ID: 1202505290.158943.13803.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 772470 by krake:

Make ItemSync available as public API:
- change id -> item mapping from usage of remoteId() to id() so clients can
  use ItemSync to create new items in Akonadi without having to fake a remoteId
- install the header
- remove the API dox declaring it as internal, also remove the comment about \
transactions  since it is back to being a transaction.

@Volker: "local" and "remote" should probably be renamed


 M  +1 -0      CMakeLists.txt  
 M  +7 -7      itemsync.cpp  
 M  +3 -4      itemsync.h  


--- trunk/KDE/kdepim/akonadi/libakonadi/CMakeLists.txt #772469:772470
@@ -153,6 +153,7 @@
 	itempayloadinternals_p.h
 	itemserializerplugin.h
 	itemstorejob.h
+        itemsync.h
 	itemmodel.h
 	itemview.h
 	job.h
--- trunk/KDE/kdepim/akonadi/libakonadi/itemsync.cpp #772469:772470
@@ -42,8 +42,8 @@
 
     Collection syncCollection;
 
-    // local: mapped remote id -> item, id -> item
-    QHash<QString, Akonadi::Item> localItems;
+    // local: mapped id -> item
+    QHash<int, Akonadi::Item> localItems;
     QSet<Akonadi::Item> unprocessedLocalItems;
 
     // remote items
@@ -102,19 +102,19 @@
 
   const Item::List list = static_cast<ItemFetchJob*>( job )->items();
   foreach ( const Item item, list ) {
-    d->localItems.insert( item.reference().remoteId(), item );
+    d->localItems.insert( item.reference().id(), item );
     d->unprocessedLocalItems.insert( item );
   }
 
   // added / updated
   foreach ( const Item remoteItem, d->remoteItems ) {
+#ifndef NDEBUG
     if ( remoteItem.reference().remoteId().isEmpty() ) {
-      kWarning( 5250 ) << "Item " << remoteItem.reference().id() << " does not have \
                a remote identifier - skipping";
-      d->progress++;
-      continue;
+      kWarning( 5250 ) << "Item " << remoteItem.reference().id() << " does not have \
a remote identifier";  }
+#endif
 
-    const Item localItem = d->localItems.value( remoteItem.reference().remoteId() );
+    const Item localItem = d->localItems.value( remoteItem.reference().id() );
     d->unprocessedLocalItems.remove( localItem );
     // missing locally
     if ( !localItem.isValid() ) {
--- trunk/KDE/kdepim/akonadi/libakonadi/itemsync.h #772469:772470
@@ -20,6 +20,8 @@
 #ifndef AKONADI_ITEMSYNC_H
 #define AKONADI_ITEMSYNC_H
 
+#include "libakonadi_export.h"
+
 #include <libakonadi/item.h>
 #include <libakonadi/transactionjobs.h>
 
@@ -28,12 +30,9 @@
 class Collection;
 
 /**
-  @internal
-
   Syncs remote and local items.
-  @todo Put this into a big transaction again (improves performance considerable)
 */
-class ItemSync : public TransactionSequence
+class AKONADI_EXPORT ItemSync : public TransactionSequence
 {
   Q_OBJECT
 


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

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