Akonadi

intervalcheck.h
1 /*
2  SPDX-FileCopyrightText: 2008 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "collectionscheduler.h"
10 
11 #include <QDateTime>
12 #include <QHash>
13 
14 namespace Akonadi
15 {
16 namespace Server
17 {
18 class ItemRetrievalManager;
19 
20 /**
21  Interval checking thread.
22 */
23 class IntervalCheck : public CollectionScheduler
24 {
25  Q_OBJECT
26 
27 public:
28  explicit IntervalCheck(ItemRetrievalManager &itemRetrievalManager);
29  ~IntervalCheck() override;
30 
31  /**
32  * Requests the given collection to be synced.
33  * Executed from any thread, forwards to triggerCollectionXSync() in the
34  * retrieval thread.
35  * A minimum time interval between two sync requests is ensured.
36  */
37  void requestCollectionSync(const Collection &collection);
38 
39 protected:
40  int collectionScheduleInterval(const Collection &collection) override;
41  bool hasChanged(const Collection &collection, const Collection &changed) override;
42  bool shouldScheduleCollection(const Collection &collection) override;
43 
44  void collectionExpired(const Collection &collection) override;
45 
46 private:
47  QHash<int, QDateTime> mLastChecks;
48  QHash<QString, QDateTime> mLastCollectionTreeSyncs;
49  ItemRetrievalManager &mItemRetrievalManager;
50 };
51 
52 } // namespace Server
53 } // namespace Akonadi
54 
Q_OBJECTQ_OBJECT
void requestCollectionSync(const Collection &collection)
Requests the given collection to be synced.
Represents a collection of PIM items.
Definition: collection.h:61
Manages and processes item retrieval requests.
Interval checking thread.
Definition: intervalcheck.h:23
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jul 2 2022 06:41:48 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.