<table><tr><td style="">dfaure created this revision.<br />dfaure added a reviewer: dvratil.<br />Herald added a project: KDE PIM.<br />dfaure requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20362">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Wrote a unittest just for fun. Found lots of interesting things...</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Methods called in the wrong thread, leading to QTimer warnings</li>
<li class="remarkup-list-item">Unscheduling all collections with the same "next time" when one collection is removed</li>
<li class="remarkup-list-item">for() loops with if+return, where find_if() is much more readable</li>
<li class="remarkup-list-item">Unnecessary detaching (non-const lowerBound)</li>
<li class="remarkup-list-item">All this will break in 2038 (32 bit time in seconds), will fix in next commit</li>
</ul></div></div><br /><div><strong>TEST PLAN</strong><div><p>bin/collectionschedulertest</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R165 Akonadi </div></div></div><br /><div><strong>BRANCH</strong><div><div>2019_collectionscheduler_tests</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20362">https://phabricator.kde.org/D20362</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/server/CMakeLists.txt<br />
autotests/server/collectionschedulertest.cpp<br />
autotests/server/fakecollectionscheduler.cpp<br />
autotests/server/fakecollectionscheduler.h<br />
src/server/collectionscheduler.cpp<br />
src/server/collectionscheduler.h</div></div></div><br /><div><strong>To: </strong>dfaure, dvratil<br /><strong>Cc: </strong>kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>