Optimization in KDE-PIM
Stay away from nested event-loops.
This was potentially using a lot of memory, as the foreach loop would
result in n jobs which aren't freed until the end of the function (and n
can grow to the amount of items in the akonadi db). Further, collections
were potentially repeatedly fetched.
This patch should therefore not only remove the nested event-loops, but
also improve performance and memory usage.