summaryrefslogtreecommitdiffstats
path: root/common/genericresource.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-10 14:43:29 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-10 14:43:29 +0100
commit5327f6d0324a76669a90f31e593613f0fc2d956d (patch)
tree1e3a89636f0031fa11e6cb1304040fa0ed8bcd60 /common/genericresource.cpp
parentf7295af29a56cab9c6c8a3e581e80ee11cb5102b (diff)
downloadsink-5327f6d0324a76669a90f31e593613f0fc2d956d.tar.gz
sink-5327f6d0324a76669a90f31e593613f0fc2d956d.zip
Added resource disk usage
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r--common/genericresource.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp
index 7b8d9bb..3655a63 100644
--- a/common/genericresource.cpp
+++ b/common/genericresource.cpp
@@ -292,12 +292,22 @@ KAsync::Job<void> GenericResource::replay(const QByteArray &type, const QByteArr
292 292
293void GenericResource::removeFromDisk(const QByteArray &instanceIdentifier) 293void GenericResource::removeFromDisk(const QByteArray &instanceIdentifier)
294{ 294{
295 Warning() << "Removing from generic resource";
295 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier, Akonadi2::Storage::ReadWrite).removeFromDisk(); 296 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier, Akonadi2::Storage::ReadWrite).removeFromDisk();
296 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".userqueue", Akonadi2::Storage::ReadWrite).removeFromDisk(); 297 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".userqueue", Akonadi2::Storage::ReadWrite).removeFromDisk();
297 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronizerqueue", Akonadi2::Storage::ReadWrite).removeFromDisk(); 298 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronizerqueue", Akonadi2::Storage::ReadWrite).removeFromDisk();
298 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".changereplay", Akonadi2::Storage::ReadWrite).removeFromDisk(); 299 Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".changereplay", Akonadi2::Storage::ReadWrite).removeFromDisk();
299} 300}
300 301
302qint64 GenericResource::diskUsage(const QByteArray &instanceIdentifier)
303{
304 auto size = Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier, Akonadi2::Storage::ReadOnly).diskUsage();
305 size += Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".userqueue", Akonadi2::Storage::ReadOnly).diskUsage();
306 size += Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".synchronizerqueue", Akonadi2::Storage::ReadOnly).diskUsage();
307 size += Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier + ".changereplay", Akonadi2::Storage::ReadOnly).diskUsage();
308 return size;
309}
310
301void GenericResource::onProcessorError(int errorCode, const QString &errorMessage) 311void GenericResource::onProcessorError(int errorCode, const QString &errorMessage)
302{ 312{
303 Warning() << "Received error from Processor: " << errorCode << errorMessage; 313 Warning() << "Received error from Processor: " << errorCode << errorMessage;