Subject: [kdepim-runtime] agents/nepomukfeeder: fix ItemFetchScope so collections get indexed
Git commit 544162347435cb0c63e2c66fe3b6f611c751cf9d by Christian Mollekopf.
Committed on 22/02/2012 at 16:09.
Pushed by cmollekopf into branch 'master'.

fix ItemFetchScope so collections get indexed

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/544162347435cb0c63e2c66fe3b6f611c751cf9d

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 e204c78..b3c8d30 100644
--- a/agents/nepomukfeeder/nepomukfeederagent.cpp
+++ b/agents/nepomukfeeder/nepomukfeederagent.cpp
@@ -120,7 +120,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)));

(C)2011 mailinglist-archive.com