2
Copyright (c) 2011 Volker Krause <vkrause@kde.org>
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.
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.
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
20
#ifndef STORAGEJANITOR_H
21
#define STORAGEJANITOR_H
24
#include <qdbusmacros.h>
25
#include <QtDBus/QDBusConnection>
31
class StorageJanitorThread : public QThread
35
explicit StorageJanitorThread( QObject * parent = 0 );
41
* Various database checking/maintenance features.
43
class StorageJanitor : public QObject
46
Q_CLASSINFO( "D-Bus Interface", "org.freedesktop.Akonadi.Janitor" )
48
explicit StorageJanitor(QObject* parent = 0);
52
/** Triggers a consistency check of the internal storage. */
53
Q_SCRIPTABLE Q_NOREPLY void check();
54
/** Triggers a vacuuming of the database, that is compacting of unused space. */
55
Q_SCRIPTABLE Q_NOREPLY void vacuum();
58
/** Sends informational messages to a possible UI for this. */
59
Q_SCRIPTABLE void information( const QString &msg );
62
void inform( const char *msg );
63
void inform( const QString &msg );
66
* Look for collections belonging to non-existent resources.
68
void findOrphanedCollections();
71
* Verifies there is a path from @p col to the root of the collection tree
72
* and that that everything along that path belongs to the same resource.
74
void checkPathToRoot( const Akonadi::Collection &col );
77
* Look for items belonging to non-existing collections.
79
void findOrphanedItems();
82
* Look for parts belonging to non-existing items.
84
void findOrphanedParts();
87
* Look for parts referring to the same external file.
89
void findOverlappingParts();
92
* Verify fs and db part state.
94
void verifyExternalParts();
97
* Look for dirty objects.
99
void findDirtyObjects();
102
QDBusConnection m_connection;
105
#endif // STORAGEJANITOR_H