From 2d34c336ee253ab63bb892dde25ce0742068ef5c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 15 Mar 2016 19:13:21 +0100 Subject: Fixed accounts support --- common/CMakeLists.txt | 1 + common/facadefactory.cpp | 1 + common/modelresult.cpp | 1 + common/resourceconfig.cpp | 11 +++-------- common/resourcefacade.cpp | 3 --- 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 notification.h bufferadaptor.h test.h + log.h ${CMAKE_CURRENT_BINARY_DIR}/sink_export.h DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME} COMPONENT Devel ) 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() void FacadeFactory::registerStaticFacades() { registerFacade(QByteArray()); + registerFacade(QByteArray()); } std::shared_ptr 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; template class ModelResult; template class ModelResult; +template class ModelResult; 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 @@ #include #include #include +#include static QSharedPointer getConfig(const QByteArray &identifier) { return QSharedPointer::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/" + identifier + ".ini", QSettings::IniFormat); } -static QSharedPointer getSettings() -{ - return getConfig("resources"); -} - - QByteArray ResourceConfig::newIdentifier(const QByteArray &type) { auto settings = getConfig("resources"); @@ -78,7 +73,7 @@ QMap ResourceConfig::getResources() void ResourceConfig::clear() { - auto settings = getSettings(); + auto settings = getConfig("resources"); settings->clear(); settings->sync(); } @@ -148,7 +143,7 @@ QMap AccountConfig::getAccounts() void AccountConfig::clear() { - auto settings = getSettings(); + auto settings = getConfig("accounts"); settings->clear(); settings->sync(); } 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, typename Sink::ResultEmitter getResources(const QList &resourceFilter, const QByteArray &type = QByteArray()) { - // Return the global resource (signified by an empty name) for types that don't eblong to a specific resource - if (type == "sinkresource") { + // Return the global resource (signified by an empty name) for types that don't belong to a specific resource + if (type == "sinkresource" || type == "sinkaccount") { return QList() << ""; } QList resources; @@ -252,5 +252,6 @@ REGISTER_TYPE(ApplicationDomain::Event); REGISTER_TYPE(ApplicationDomain::Mail); REGISTER_TYPE(ApplicationDomain::Folder); REGISTER_TYPE(ApplicationDomain::SinkResource); +REGISTER_TYPE(ApplicationDomain::SinkAccount); } // namespace Sink -- cgit v1.2.3