Changeset View
Changeset View
Standalone View
Standalone View
agents/newmailnotifier/newmailnotifieragent.cpp
Show All 23 Lines | |||||
24 | #include <AkonadiCore/NewMailNotifierAttribute> | 24 | #include <AkonadiCore/NewMailNotifierAttribute> | ||
25 | #include "specialnotifierjob.h" | 25 | #include "specialnotifierjob.h" | ||
26 | #include "newmailnotifieradaptor.h" | 26 | #include "newmailnotifieradaptor.h" | ||
27 | #include "newmailnotifieragentsettings.h" | 27 | #include "newmailnotifieragentsettings.h" | ||
28 | 28 | | |||
29 | #include <AkonadiCore/ServerManager> | 29 | #include <AkonadiCore/ServerManager> | ||
30 | #include <KIdentityManagement/IdentityManager> | 30 | #include <KIdentityManagement/IdentityManager> | ||
31 | 31 | | |||
32 | #include <KDBusConnectionPool> | 32 | #include <QDBusConnection> | ||
33 | 33 | | |||
34 | #include <changerecorder.h> | 34 | #include <changerecorder.h> | ||
35 | #include <entitydisplayattribute.h> | 35 | #include <entitydisplayattribute.h> | ||
36 | #include <entityhiddenattribute.h> | 36 | #include <entityhiddenattribute.h> | ||
37 | #include <itemfetchscope.h> | 37 | #include <itemfetchscope.h> | ||
38 | #include <session.h> | 38 | #include <session.h> | ||
39 | #include <AttributeFactory> | 39 | #include <AttributeFactory> | ||
40 | #include <CollectionFetchScope> | 40 | #include <CollectionFetchScope> | ||
Show All 21 Lines | 55 | { | |||
62 | new NewMailNotifierAdaptor(this); | 62 | new NewMailNotifierAdaptor(this); | ||
63 | 63 | | |||
64 | NewMailNotifierAgentSettings::instance(KSharedConfig::openConfig()); | 64 | NewMailNotifierAgentSettings::instance(KSharedConfig::openConfig()); | ||
65 | mIdentityManager = KIdentityManagement::IdentityManager::self(); | 65 | mIdentityManager = KIdentityManagement::IdentityManager::self(); | ||
66 | connect(mIdentityManager, QOverload<>::of(&KIdentityManagement::IdentityManager::changed), this, &NewMailNotifierAgent::slotIdentitiesChanged); | 66 | connect(mIdentityManager, QOverload<>::of(&KIdentityManagement::IdentityManager::changed), this, &NewMailNotifierAgent::slotIdentitiesChanged); | ||
67 | slotIdentitiesChanged(); | 67 | slotIdentitiesChanged(); | ||
68 | mDefaultIconName = QStringLiteral("kmail"); | 68 | mDefaultIconName = QStringLiteral("kmail"); | ||
69 | 69 | | |||
70 | KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/NewMailNotifierAgent"), | 70 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/NewMailNotifierAgent"), | ||
71 | this, QDBusConnection::ExportAdaptors); | 71 | this, QDBusConnection::ExportAdaptors); | ||
72 | 72 | | |||
73 | QString service = QStringLiteral("org.freedesktop.Akonadi.NewMailNotifierAgent"); | 73 | QString service = QStringLiteral("org.freedesktop.Akonadi.NewMailNotifierAgent"); | ||
74 | if (Akonadi::ServerManager::hasInstanceIdentifier()) { | 74 | if (Akonadi::ServerManager::hasInstanceIdentifier()) { | ||
75 | service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier(); | 75 | service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier(); | ||
76 | } | 76 | } | ||
77 | KDBusConnectionPool::threadConnection().registerService(service); | 77 | QDBusConnection::sessionBus().registerService(service); | ||
78 | 78 | | |||
79 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceStatusChanged, this, &NewMailNotifierAgent::slotInstanceStatusChanged); | 79 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceStatusChanged, this, &NewMailNotifierAgent::slotInstanceStatusChanged); | ||
80 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceRemoved, this, &NewMailNotifierAgent::slotInstanceRemoved); | 80 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceRemoved, this, &NewMailNotifierAgent::slotInstanceRemoved); | ||
81 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceAdded, this, &NewMailNotifierAgent::slotInstanceAdded); | 81 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceAdded, this, &NewMailNotifierAgent::slotInstanceAdded); | ||
82 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceNameChanged, this, &NewMailNotifierAgent::slotInstanceNameChanged); | 82 | connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceNameChanged, this, &NewMailNotifierAgent::slotInstanceNameChanged); | ||
83 | 83 | | |||
84 | changeRecorder()->setMimeTypeMonitored(KMime::Message::mimeType()); | 84 | changeRecorder()->setMimeTypeMonitored(KMime::Message::mimeType()); | ||
85 | changeRecorder()->itemFetchScope().setCacheOnly(true); | 85 | changeRecorder()->itemFetchScope().setCacheOnly(true); | ||
▲ Show 20 Lines • Show All 396 Lines • Show Last 20 Lines |