summaryrefslogtreecommitdiffstats
path: root/akonadish
diff options
context:
space:
mode:
Diffstat (limited to 'akonadish')
-rw-r--r--akonadish/akonadish_utils.cpp12
-rw-r--r--akonadish/akonadish_utils.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/akonadish/akonadish_utils.cpp b/akonadish/akonadish_utils.cpp
index bfb72ca..ffbdcb3 100644
--- a/akonadish/akonadish_utils.cpp
+++ b/akonadish/akonadish_utils.cpp
@@ -70,5 +70,17 @@ QSharedPointer<QAbstractItemModel> loadModel(const QString &type, Akonadi2::Quer
70 return model; 70 return model;
71} 71}
72 72
73QMap<QString, QString> keyValueMapFromArgs(const QStringList &args)
74{
75 //TODO: this is not the most clever of algorithms. preserved during the port of commands
76 // from akonadi2_client ... we can probably do better, however ;)
77 QMap<QString, QString> map;
78 for (int i = 0; i + 2 <= args.size(); i += 2) {
79 map.insert(args.at(i), args.at(i + 1));
80 }
81
82 return map;
83}
84
73} 85}
74 86
diff --git a/akonadish/akonadish_utils.h b/akonadish/akonadish_utils.h
index c15162f..17b8ec7 100644
--- a/akonadish/akonadish_utils.h
+++ b/akonadish/akonadish_utils.h
@@ -34,6 +34,7 @@ class StoreBase;
34bool isValidStoreType(const QString &type); 34bool isValidStoreType(const QString &type);
35StoreBase &getStore(const QString &type); 35StoreBase &getStore(const QString &type);
36QSharedPointer<QAbstractItemModel> loadModel(const QString &type, Akonadi2::Query query); 36QSharedPointer<QAbstractItemModel> loadModel(const QString &type, Akonadi2::Query query);
37QMap<QString, QString> keyValueMapFromArgs(const QStringList &args);
37 38
38/** 39/**
39 * A small abstraction layer to use the akonadi store with the type available as string. 40 * A small abstraction layer to use the akonadi store with the type available as string.