summaryrefslogtreecommitdiffstats
path: root/examples/client/main.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-26 12:30:25 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-26 12:30:25 +0100
commit010afd20f7c278a52536f5c37d0ade13b3017e69 (patch)
treef3087bf6766b49a44916e87e0e9450d471313d57 /examples/client/main.cpp
parent9bab96fcca9dd752c6068ed620cd32adf0f9dae7 (diff)
downloadsink-010afd20f7c278a52536f5c37d0ade13b3017e69.tar.gz
sink-010afd20f7c278a52536f5c37d0ade13b3017e69.zip
Print the disk usage as part of the stat command
Diffstat (limited to 'examples/client/main.cpp')
-rw-r--r--examples/client/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/client/main.cpp b/examples/client/main.cpp
index 946557f..ad65e44 100644
--- a/examples/client/main.cpp
+++ b/examples/client/main.cpp
@@ -21,6 +21,7 @@
21#include <QCommandLineParser> 21#include <QCommandLineParser>
22#include <QCommandLineOption> 22#include <QCommandLineOption>
23#include <QElapsedTimer> 23#include <QElapsedTimer>
24#include <QDir>
24 25
25#include "common/clientapi.h" 26#include "common/clientapi.h"
26#include "common/resource.h" 27#include "common/resource.h"
@@ -407,6 +408,12 @@ int main(int argc, char *argv[])
407 total += size; 408 total += size;
408 } 409 }
409 std::cout << "Total [kb]: " << total / 1024 << std::endl; 410 std::cout << "Total [kb]: " << total / 1024 << std::endl;
411 int diskUsage = 0;
412 QDir dir(Akonadi2::storageLocation());
413 for (const auto &folder : dir.entryList(QStringList() << resource + "*")) {
414 diskUsage += Akonadi2::Storage(Akonadi2::storageLocation(), folder, Akonadi2::Storage::ReadOnly).diskUsage();
415 }
416 std::cout << "Disk usage [kb]: " << diskUsage / 1024 << std::endl;
410 } 417 }
411 } else { 418 } else {
412 qWarning() << "Unknown command " << command; 419 qWarning() << "Unknown command " << command;