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

List:       kde-commits
Subject:    [kdepim-runtime/KDE/4.8] agents/nepomukfeeder: fix ItemFetchScope so collections get indexed
From:       Christian Mollekopf <chrigi_1 () fastmail ! fm>
Date:       2012-02-29 23:34:30
Message-ID: 20120229233430.DCF7AA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 8b4f0931454d9ebba19dc7a2e025a34e3412b039 by Christian Mollekopf.
Committed on 22/02/2012 at 16:09.
Pushed by cmollekopf into branch 'KDE/4.8'.

fix ItemFetchScope so collections get indexed
(cherry picked from commit 544162347435cb0c63e2c66fe3b6f611c751cf9d)

M  +2    -7    agents/nepomukfeeder/feederqueue.cpp
M  +0    -4    agents/nepomukfeeder/feederqueue.h
M  +0    -1    agents/nepomukfeeder/nepomukfeederagent.cpp

http://commits.kde.org/kdepim-runtime/8b4f0931454d9ebba19dc7a2e025a34e3412b039

diff --git a/agents/nepomukfeeder/feederqueue.cpp \
b/agents/nepomukfeeder/feederqueue.cpp index 346ba81..baf3352 100644
--- a/agents/nepomukfeeder/feederqueue.cpp
+++ b/agents/nepomukfeeder/feederqueue.cpp
@@ -27,6 +27,7 @@
 #include <nie.h>
 
 #include <Akonadi/ItemFetchJob>
+#include <Akonadi/ItemFetchScope>
 
 #include <KLocalizedString>
 #include <KUrl>
@@ -274,13 +275,6 @@ const Akonadi::Collection& FeederQueue::currentCollection()
   return mCurrentCollection;
 }
 
-void FeederQueue::setItemFetchScope(ItemFetchScope scope)
-{
-  mItemFetchScope = scope;
-}
-
-
-
 ItemQueue::ItemQueue(int batchSize, int fetchSize, QObject* parent)
 : QObject(parent),
   mPendingRemoveDataJobs( 0 ),
@@ -338,6 +332,7 @@ bool ItemQueue::processItem()
     //kDebug() << QString("Fetching %1 items").arg(mItemFetchList.size());
     Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItemFetchList, 0 );
     job->fetchScope().fetchFullPayload();
+    job->fetchScope().setAncestorRetrieval( ItemFetchScope::Parent );
     job->fetchScope().setCacheOnly( true );
     job->setProperty("numberOfItems", mItemFetchList.size());
     connect( job, SIGNAL(result(KJob*)), SLOT(fetchJobResult(KJob*)) );
diff --git a/agents/nepomukfeeder/feederqueue.h b/agents/nepomukfeeder/feederqueue.h
index 5cfc3ec..3f5da76 100644
--- a/agents/nepomukfeeder/feederqueue.h
+++ b/agents/nepomukfeeder/feederqueue.h
@@ -22,7 +22,6 @@
 #include <QObject>
 #include <Akonadi/Item>
 #include <Akonadi/Collection>
-#include <Akonadi/ItemFetchScope>
 #include <QTimer>
 #include <QQueue>
 #include <QUrl>
@@ -114,8 +113,6 @@ public:
   explicit FeederQueue( QObject* parent = 0 );
   virtual ~FeederQueue();
   
-  void setItemFetchScope( Akonadi::ItemFetchScope scope);
-
   ///add the collection to the queue, all items of it will be fetched and indexed
   void addCollection(const Akonadi::Collection &);
   ///adds the item to the highPrioQueue
@@ -174,7 +171,6 @@ private:
     
   Akonadi::Collection::List mCollectionQueue;
   Akonadi::Collection mCurrentCollection;
-  Akonadi::ItemFetchScope mItemFetchScope;
   bool mReIndex;
   bool mOnline;
   QTimer mProcessItemQueueTimer;
diff --git a/agents/nepomukfeeder/nepomukfeederagent.cpp \
b/agents/nepomukfeeder/nepomukfeederagent.cpp index 0808ee3..4739ccb 100644
--- a/agents/nepomukfeeder/nepomukfeederagent.cpp
+++ b/agents/nepomukfeeder/nepomukfeederagent.cpp
@@ -112,7 +112,6 @@ NepomukFeederAgent::NepomukFeederAgent(const QString& id) :
   checkOnline();
   QTimer::singleShot( 0, this, SLOT(selfTest()) );
 
-  mQueue.setItemFetchScope(changeRecorder()->itemFetchScope());
   mQueue.setIndexingSpeed( mIdleDetectionDisabled ? FeederQueue::FullSpeed : \
FeederQueue::ReducedSpeed );  
   connect(&mQueue, SIGNAL(progress(int)), SIGNAL(percent(int)));


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

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