summaryrefslogtreecommitdiffstats
path: root/sinksh/sinksh_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/sinksh_utils.cpp')
-rw-r--r--sinksh/sinksh_utils.cpp32
1 files changed, 8 insertions, 24 deletions
diff --git a/sinksh/sinksh_utils.cpp b/sinksh/sinksh_utils.cpp
index 9a0d1d8..3bbffef 100644
--- a/sinksh/sinksh_utils.cpp
+++ b/sinksh/sinksh_utils.cpp
@@ -36,31 +36,15 @@ StoreBase &getStore(const QString &type)
36{ 36{
37 using namespace Sink::ApplicationDomain; 37 using namespace Sink::ApplicationDomain;
38 38
39 if (type == getTypeName<Folder>()) { 39#define REGISTER_TYPE(TYPE) \
40 static Store<Folder> store; 40 if (type == getTypeName<TYPE>()) { static Store<TYPE> store; return store; } else
41 return store; 41SINK_REGISTER_TYPES()
42 } else if (type == getTypeName<Mail>()) { 42#undef REGISTER_TYPE
43 static Store<Mail> store; 43 {
44 return store; 44 SinkWarning_("", "") << "Trying to get a store that doesn't exist: " << type;
45 } else if (type == getTypeName<Event>()) { 45 Q_ASSERT(false);
46 static Store<Event> store; 46 }
47 return store;
48 } else if (type == getTypeName<SinkResource>()) {
49 static Store<SinkResource> store;
50 return store;
51 } else if (type == getTypeName<SinkAccount>()) {
52 static Store<SinkAccount> store;
53 return store;
54 } else if (type == getTypeName<Identity>()) {
55 static Store<Identity> store;
56 return store;
57 } else if (type == getTypeName<Contact>()) {
58 static Store<Contact> store;
59 return store;
60 }
61 47
62 SinkWarning_("", "") << "Trying to get a store that doesn't exist: " << type;
63 Q_ASSERT(false);
64 static DummyStore store; 48 static DummyStore store;
65 return store; 49 return store;
66} 50}