diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/CMakeLists.txt | 1 | ||||
-rw-r--r-- | common/facadefactory.cpp | 1 | ||||
-rw-r--r-- | common/modelresult.cpp | 1 | ||||
-rw-r--r-- | common/resourceconfig.cpp | 11 | ||||
-rw-r--r-- | common/resourcefacade.cpp | 3 | ||||
-rw-r--r-- | common/store.cpp | 5 |
6 files changed, 9 insertions, 13 deletions
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 4cb9e91..a47d259 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt | |||
@@ -115,6 +115,7 @@ install(FILES | |||
115 | notification.h | 115 | notification.h |
116 | bufferadaptor.h | 116 | bufferadaptor.h |
117 | test.h | 117 | test.h |
118 | log.h | ||
118 | ${CMAKE_CURRENT_BINARY_DIR}/sink_export.h | 119 | ${CMAKE_CURRENT_BINARY_DIR}/sink_export.h |
119 | DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME} COMPONENT Devel | 120 | DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME} COMPONENT Devel |
120 | ) | 121 | ) |
diff --git a/common/facadefactory.cpp b/common/facadefactory.cpp index ab52681..bae8f7b 100644 --- a/common/facadefactory.cpp +++ b/common/facadefactory.cpp | |||
@@ -55,6 +55,7 @@ void FacadeFactory::resetFactory() | |||
55 | void FacadeFactory::registerStaticFacades() | 55 | void FacadeFactory::registerStaticFacades() |
56 | { | 56 | { |
57 | registerFacade<Sink::ApplicationDomain::SinkResource, ResourceFacade>(QByteArray()); | 57 | registerFacade<Sink::ApplicationDomain::SinkResource, ResourceFacade>(QByteArray()); |
58 | registerFacade<Sink::ApplicationDomain::SinkAccount, AccountFacade>(QByteArray()); | ||
58 | } | 59 | } |
59 | 60 | ||
60 | std::shared_ptr<void> FacadeFactory::getFacade(const QByteArray &resource, const QByteArray &instanceIdentifier, const QByteArray &typeName) | 61 | std::shared_ptr<void> FacadeFactory::getFacade(const QByteArray &resource, const QByteArray &instanceIdentifier, const QByteArray &typeName) |
diff --git a/common/modelresult.cpp b/common/modelresult.cpp index 1c06a7d..6fe6782 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp | |||
@@ -279,3 +279,4 @@ template class ModelResult<Sink::ApplicationDomain::Folder, Sink::ApplicationDom | |||
279 | template class ModelResult<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Mail::Ptr>; | 279 | template class ModelResult<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Mail::Ptr>; |
280 | template class ModelResult<Sink::ApplicationDomain::Event, Sink::ApplicationDomain::Event::Ptr>; | 280 | template class ModelResult<Sink::ApplicationDomain::Event, Sink::ApplicationDomain::Event::Ptr>; |
281 | template class ModelResult<Sink::ApplicationDomain::SinkResource, Sink::ApplicationDomain::SinkResource::Ptr>; | 281 | template class ModelResult<Sink::ApplicationDomain::SinkResource, Sink::ApplicationDomain::SinkResource::Ptr>; |
282 | template class ModelResult<Sink::ApplicationDomain::SinkAccount, Sink::ApplicationDomain::SinkAccount::Ptr>; | ||
diff --git a/common/resourceconfig.cpp b/common/resourceconfig.cpp index 4b33990..fa94f3c 100644 --- a/common/resourceconfig.cpp +++ b/common/resourceconfig.cpp | |||
@@ -22,18 +22,13 @@ | |||
22 | #include <QSharedPointer> | 22 | #include <QSharedPointer> |
23 | #include <QStandardPaths> | 23 | #include <QStandardPaths> |
24 | #include <QFile> | 24 | #include <QFile> |
25 | #include <log.h> | ||
25 | 26 | ||
26 | static QSharedPointer<QSettings> getConfig(const QByteArray &identifier) | 27 | static QSharedPointer<QSettings> getConfig(const QByteArray &identifier) |
27 | { | 28 | { |
28 | return QSharedPointer<QSettings>::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/" + identifier + ".ini", QSettings::IniFormat); | 29 | return QSharedPointer<QSettings>::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/" + identifier + ".ini", QSettings::IniFormat); |
29 | } | 30 | } |
30 | 31 | ||
31 | static QSharedPointer<QSettings> getSettings() | ||
32 | { | ||
33 | return getConfig("resources"); | ||
34 | } | ||
35 | |||
36 | |||
37 | QByteArray ResourceConfig::newIdentifier(const QByteArray &type) | 32 | QByteArray ResourceConfig::newIdentifier(const QByteArray &type) |
38 | { | 33 | { |
39 | auto settings = getConfig("resources"); | 34 | auto settings = getConfig("resources"); |
@@ -78,7 +73,7 @@ QMap<QByteArray, QByteArray> ResourceConfig::getResources() | |||
78 | 73 | ||
79 | void ResourceConfig::clear() | 74 | void ResourceConfig::clear() |
80 | { | 75 | { |
81 | auto settings = getSettings(); | 76 | auto settings = getConfig("resources"); |
82 | settings->clear(); | 77 | settings->clear(); |
83 | settings->sync(); | 78 | settings->sync(); |
84 | } | 79 | } |
@@ -148,7 +143,7 @@ QMap<QByteArray, QByteArray> AccountConfig::getAccounts() | |||
148 | 143 | ||
149 | void AccountConfig::clear() | 144 | void AccountConfig::clear() |
150 | { | 145 | { |
151 | auto settings = getSettings(); | 146 | auto settings = getConfig("accounts"); |
152 | settings->clear(); | 147 | settings->clear(); |
153 | settings->sync(); | 148 | settings->sync(); |
154 | } | 149 | } |
diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp index d91c974..0cda82c 100644 --- a/common/resourcefacade.cpp +++ b/common/resourcefacade.cpp | |||
@@ -202,9 +202,6 @@ QPair<KAsync::Job<void>, typename Sink::ResultEmitter<Sink::ApplicationDomain::S | |||
202 | const auto configuredAccounts = AccountConfig::getAccounts(); | 202 | const auto configuredAccounts = AccountConfig::getAccounts(); |
203 | for (const auto &res : configuredAccounts.keys()) { | 203 | for (const auto &res : configuredAccounts.keys()) { |
204 | const auto type = configuredAccounts.value(res); | 204 | const auto type = configuredAccounts.value(res); |
205 | if (query.propertyFilter.contains("type") && query.propertyFilter.value("type").toByteArray() != type) { | ||
206 | continue; | ||
207 | } | ||
208 | if (!query.ids.isEmpty() && !query.ids.contains(res)) { | 205 | if (!query.ids.isEmpty() && !query.ids.contains(res)) { |
209 | continue; | 206 | continue; |
210 | } | 207 | } |
diff --git a/common/store.cpp b/common/store.cpp index 2c1dcad..bedbc47 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -47,8 +47,8 @@ QString Store::storageLocation() | |||
47 | 47 | ||
48 | static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray()) | 48 | static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray()) |
49 | { | 49 | { |
50 | // Return the global resource (signified by an empty name) for types that don't eblong to a specific resource | 50 | // Return the global resource (signified by an empty name) for types that don't belong to a specific resource |
51 | if (type == "sinkresource") { | 51 | if (type == "sinkresource" || type == "sinkaccount") { |
52 | return QList<QByteArray>() << ""; | 52 | return QList<QByteArray>() << ""; |
53 | } | 53 | } |
54 | QList<QByteArray> resources; | 54 | QList<QByteArray> resources; |
@@ -252,5 +252,6 @@ REGISTER_TYPE(ApplicationDomain::Event); | |||
252 | REGISTER_TYPE(ApplicationDomain::Mail); | 252 | REGISTER_TYPE(ApplicationDomain::Mail); |
253 | REGISTER_TYPE(ApplicationDomain::Folder); | 253 | REGISTER_TYPE(ApplicationDomain::Folder); |
254 | REGISTER_TYPE(ApplicationDomain::SinkResource); | 254 | REGISTER_TYPE(ApplicationDomain::SinkResource); |
255 | REGISTER_TYPE(ApplicationDomain::SinkAccount); | ||
255 | 256 | ||
256 | } // namespace Sink | 257 | } // namespace Sink |