Message info
 
To:kde-commits@kde.org From:Till Adam Subject:[kdepim-runtime] agents/nepomukfeeder: Prioritize non-mail colletions in the feeder. Date:Sun, 18 Mar 2012 16:38:03 +0100 (CET)
 

Git commit 4db1c180a37713293ee126deed1f97473ab64618 by Till Adam.
Committed on 18/03/2012 at 15:39.
Pushed by tilladam into branch 'master'.

Prioritize non-mail colletions in the feeder.

M +12 -1 agents/nepomukfeeder/feederqueue.cpp

http://commits.kde.org/kdepim-runtime/4db1c180a37713293ee126deed1f97473ab64618

diff --git a/agents/nepomukfeeder/feederqueue.cpp b/agents/nepomukfeeder/feederqueue.cpp
index 910264e..f2490c6 100644
--- a/agents/nepomukfeeder/feederqueue.cpp
+++ b/agents/nepomukfeeder/feederqueue.cpp
@@ -103,7 +103,18 @@ void FeederQueue::setIndexingSpeed(FeederQueue::IndexingSpeed speed)
void FeederQueue::addCollection( const Akonadi::Collection &collection )
{
//kDebug() << collection.id();
- mCollectionQueue.append( collection );
+
+ // If the collection contains mail, append it, otherwise prepend.
+ // This ensures the smaller, fewer collections with things like
+ // contacts or events in them are processed first. They tend to
+ // be more important than the full text index of mail.
+ // Bit of a hack, yes, would probably be better to have priorties
+ // in the plugins and then keep a priority queue properly.
+ if ( collection.contentMimeTypes().contains( QLatin1String( "message/rfc822" ) ) )
+ mCollectionQueue.append( collection );
+ else
+ mCollectionQueue.prepend( collection );
+
if ( mPendingJobs == 0 ) {
processNextCollection();
}