Akonadi

storagejanitor.h
1 /*
2  Copyright (c) 2011 Volker Krause <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef STORAGEJANITOR_H
21 #define STORAGEJANITOR_H
22 
23 #include "akthread.h"
24 
25 #include <QDBusConnection>
26 
27 namespace Akonadi
28 {
29 namespace Server
30 {
31 
32 class Collection;
33 class AkonadiServer;
34 
38 class StorageJanitor : public AkThread
39 {
40  Q_OBJECT
41  Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Akonadi.Janitor")
42 
43 public:
44  explicit StorageJanitor(AkonadiServer &mAkonadi);
45  ~StorageJanitor() override;
46 
47 public Q_SLOTS:
49  Q_SCRIPTABLE Q_NOREPLY void check();
51  Q_SCRIPTABLE Q_NOREPLY void vacuum();
52 
53 Q_SIGNALS:
55  Q_SCRIPTABLE void information(const QString &msg);
56  Q_SCRIPTABLE void done();
57 
58 protected:
59  void init() override;
60  void quit() override;
61 
62 private:
63  void inform(const char *msg);
64  void inform(const QString &msg);
66  qint64 lostAndFoundCollection();
67 
71  void findOrphanedResources();
72 
76  void findOrphanedCollections();
77 
82  void checkPathToRoot(const Collection &col);
83 
87  void findOrphanedItems();
88 
92  void findOrphanedParts();
93 
97  void findOrphanedPimItemFlags();
98 
102  void findOverlappingParts();
103 
107  void verifyExternalParts();
108 
112  void findDirtyObjects();
113 
119  void findRIDDuplicates();
120 
127  void checkSizeTreshold();
128 
133  void migrateToLevelledCacheHierarchy();
134 
139  void findOrphanSearchIndexEntries();
140 
146  void ensureSearchCollection();
147 
148 private:
149  qint64 m_lostFoundCollectionId;
150  AkonadiServer &m_akonadi;
151 };
152 
153 } // namespace Server
154 } // namespace Akonadi
155 
156 #endif // STORAGEJANITOR_H
Q_CLASSINFO(Name, Value)
Q_SCRIPTABLE Q_NOREPLY void vacuum()
Triggers a vacuuming of the database, that is compacting of unused space.
Represents a collection of PIM items.
Definition: collection.h:76
Various database checking/maintenance features.
Q_SCRIPTABLE void information(const QString &msg)
Sends informational messages to a possible UI for this.
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
Q_SCRIPTABLE Q_NOREPLY void check()
Triggers a consistency check of the internal storage.
Helper integration between Akonadi and Qt.
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:08:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.