Changeset View
Changeset View
Standalone View
Standalone View
resources/maildir/maildirresource.cpp
Show All 28 Lines | |||||
29 | #include <Akonadi/KMime/MessageParts> | 29 | #include <Akonadi/KMime/MessageParts> | ||
30 | #include <changerecorder.h> | 30 | #include <changerecorder.h> | ||
31 | #include <itemfetchscope.h> | 31 | #include <itemfetchscope.h> | ||
32 | #include <itemfetchjob.h> | 32 | #include <itemfetchjob.h> | ||
33 | #include <itemmodifyjob.h> | 33 | #include <itemmodifyjob.h> | ||
34 | #include <collectionfetchscope.h> | 34 | #include <collectionfetchscope.h> | ||
35 | #include <cachepolicy.h> | 35 | #include <cachepolicy.h> | ||
36 | #include <collectionfetchjob.h> | 36 | #include <collectionfetchjob.h> | ||
37 | #include <KDBusConnectionPool> | | |||
38 | #include <Akonadi/KMime/MessageFlags> | 37 | #include <Akonadi/KMime/MessageFlags> | ||
39 | #include <kmime/kmime_message.h> | 38 | #include <kmime/kmime_message.h> | ||
40 | #include <AkonadiCore/SpecialCollectionAttribute> | 39 | #include <AkonadiCore/SpecialCollectionAttribute> | ||
41 | 40 | | |||
42 | #include "maildirresource_debug.h" | 41 | #include "maildirresource_debug.h" | ||
43 | #include <KDirWatch> | 42 | #include <KDirWatch> | ||
44 | #include <KLocalizedString> | 43 | #include <KLocalizedString> | ||
45 | 44 | | |||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 103 | { | |||
110 | if (configFile.isEmpty()) { | 109 | if (configFile.isEmpty()) { | ||
111 | // check if the resource was used before | 110 | // check if the resource was used before | ||
112 | CollectionFetchJob *job = new CollectionFetchJob(Collection::root(), Akonadi::CollectionFetchJob::FirstLevel, this); | 111 | CollectionFetchJob *job = new CollectionFetchJob(Collection::root(), Akonadi::CollectionFetchJob::FirstLevel, this); | ||
113 | job->fetchScope().setResource(id); | 112 | job->fetchScope().setResource(id); | ||
114 | connect(job, &CollectionFetchJob::result, this, &MaildirResource::attemptConfigRestoring); | 113 | connect(job, &CollectionFetchJob::result, this, &MaildirResource::attemptConfigRestoring); | ||
115 | job->start(); | 114 | job->start(); | ||
116 | } | 115 | } | ||
117 | new MaildirSettingsAdaptor(mSettings); | 116 | new MaildirSettingsAdaptor(mSettings); | ||
118 | KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"), | 117 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"), | ||
119 | mSettings, QDBusConnection::ExportAdaptors); | 118 | mSettings, QDBusConnection::ExportAdaptors); | ||
120 | connect(this, &MaildirResource::reloadConfiguration, this, &MaildirResource::configurationChanged); | 119 | connect(this, &MaildirResource::reloadConfiguration, this, &MaildirResource::configurationChanged); | ||
121 | 120 | | |||
122 | // We need to enable this here, otherwise we neither get the remote ID of the | 121 | // We need to enable this here, otherwise we neither get the remote ID of the | ||
123 | // parent collection when a collection changes, nor the full item when an item | 122 | // parent collection when a collection changes, nor the full item when an item | ||
124 | // is added. | 123 | // is added. | ||
125 | changeRecorder()->fetchCollection(true); | 124 | changeRecorder()->fetchCollection(true); | ||
126 | changeRecorder()->itemFetchScope().fetchFullPayload(true); | 125 | changeRecorder()->itemFetchScope().fetchFullPayload(true); | ||
▲ Show 20 Lines • Show All 761 Lines • Show Last 20 Lines |