Changeset View
Changeset View
Standalone View
Standalone View
src/akonadi/akonadidatasourcerepository.cpp
Show All 26 Lines | |||||
27 | #include <QApplication> | 27 | #include <QApplication> | ||
28 | 28 | | |||
29 | #include <AkonadiWidgets/ControlGui> | 29 | #include <AkonadiWidgets/ControlGui> | ||
30 | 30 | | |||
31 | #include "akonadiconfigdialog.h" | 31 | #include "akonadiconfigdialog.h" | ||
32 | 32 | | |||
33 | using namespace Akonadi; | 33 | using namespace Akonadi; | ||
34 | 34 | | |||
35 | DataSourceRepository::DataSourceRepository(const StorageInterface::Ptr &storage, | 35 | DataSourceRepository::DataSourceRepository(StorageInterface::FetchContentTypes contentTypes, | ||
36 | const StorageInterface::Ptr &storage, | ||||
36 | const SerializerInterface::Ptr &serializer) | 37 | const SerializerInterface::Ptr &serializer) | ||
37 | : m_storage(storage), | 38 | : m_contentTypes(contentTypes), | ||
39 | m_storage(storage), | ||||
38 | m_serializer(serializer) | 40 | m_serializer(serializer) | ||
39 | { | 41 | { | ||
40 | } | 42 | } | ||
41 | 43 | | |||
42 | KJob *DataSourceRepository::update(Domain::DataSource::Ptr source) | 44 | KJob *DataSourceRepository::update(Domain::DataSource::Ptr source) | ||
43 | { | 45 | { | ||
44 | auto collection = m_serializer->createCollectionFromDataSource(source); | 46 | auto collection = m_serializer->createCollectionFromDataSource(source); | ||
45 | Q_ASSERT(collection.isValid()); | 47 | Q_ASSERT(collection.isValid()); | ||
46 | return m_storage->updateCollection(collection); | 48 | return m_storage->updateCollection(collection); | ||
47 | } | 49 | } | ||
48 | 50 | | |||
49 | void DataSourceRepository::showConfigDialog() | 51 | void DataSourceRepository::showConfigDialog() | ||
50 | { | 52 | { | ||
51 | ConfigDialog dialog(qApp->activeWindow()); | 53 | ConfigDialog dialog(m_contentTypes, qApp->activeWindow()); | ||
52 | dialog.exec(); | 54 | dialog.exec(); | ||
53 | } | 55 | } | ||
54 | 56 | | |||
55 | void DataSourceRepository::windowNeedsDataBackend(QWidget *window) | 57 | void DataSourceRepository::windowNeedsDataBackend(QWidget *window) | ||
56 | { | 58 | { | ||
57 | Akonadi::ControlGui::widgetNeedsAkonadi(window); | 59 | Akonadi::ControlGui::widgetNeedsAkonadi(window); | ||
58 | } | 60 | } |