Changeset View
Changeset View
Standalone View
Standalone View
agents/mailfilteragent/mailfilteragent.cpp
Show All 33 Lines | |||||
34 | #include <AkonadiCore/itemfetchscope.h> | 34 | #include <AkonadiCore/itemfetchscope.h> | ||
35 | #include <Akonadi/KMime/MessageParts> | 35 | #include <Akonadi/KMime/MessageParts> | ||
36 | #include <Akonadi/KMime/MessageStatus> | 36 | #include <Akonadi/KMime/MessageStatus> | ||
37 | #include <AkonadiCore/session.h> | 37 | #include <AkonadiCore/session.h> | ||
38 | #include <MailCommon/MailKernel> | 38 | #include <MailCommon/MailKernel> | ||
39 | #include <KLocalizedString> | 39 | #include <KLocalizedString> | ||
40 | #include <QIcon> | 40 | #include <QIcon> | ||
41 | #include "mailfilteragent_debug.h" | 41 | #include "mailfilteragent_debug.h" | ||
42 | #include <KIconLoader> | | |||
43 | #include <KMime/Message> | 42 | #include <KMime/Message> | ||
44 | #include <KNotification> | 43 | #include <KNotification> | ||
45 | #include <KWindowSystem> | 44 | #include <KWindowSystem> | ||
46 | #include <AgentManager> | 45 | #include <AgentManager> | ||
47 | #include <ItemFetchJob> | 46 | #include <ItemFetchJob> | ||
48 | #include <AttributeFactory> | 47 | #include <AttributeFactory> | ||
49 | #include <KConfigGroup> | 48 | #include <KConfigGroup> | ||
50 | 49 | | |||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 69 | { | |||
107 | const QString service = Akonadi::ServerManager::self()->agentServiceName(Akonadi::ServerManager::Agent, QStringLiteral("akonadi_mailfilter_agent")); | 106 | const QString service = Akonadi::ServerManager::self()->agentServiceName(Akonadi::ServerManager::Agent, QStringLiteral("akonadi_mailfilter_agent")); | ||
108 | 107 | | |||
109 | KDBusConnectionPool::threadConnection().registerService(service); | 108 | KDBusConnectionPool::threadConnection().registerService(service); | ||
110 | //Enabled or not filterlogdialog | 109 | //Enabled or not filterlogdialog | ||
111 | KSharedConfig::Ptr config = KSharedConfig::openConfig(); | 110 | KSharedConfig::Ptr config = KSharedConfig::openConfig(); | ||
112 | if (config->hasGroup("FilterLog")) { | 111 | if (config->hasGroup("FilterLog")) { | ||
113 | KConfigGroup group(config, "FilterLog"); | 112 | KConfigGroup group(config, "FilterLog"); | ||
114 | if (group.readEntry("Enabled", false)) { | 113 | if (group.readEntry("Enabled", false)) { | ||
115 | const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("view-filter")).pixmap(KIconLoader::SizeSmall, KIconLoader::SizeSmall); | | |||
116 | KNotification *notify = new KNotification(QStringLiteral("mailfilterlogenabled")); | 114 | KNotification *notify = new KNotification(QStringLiteral("mailfilterlogenabled")); | ||
117 | notify->setComponentName(QApplication::applicationDisplayName()); | 115 | notify->setComponentName(QApplication::applicationDisplayName()); | ||
118 | notify->setPixmap(pixmap); | 116 | notify->setIconName(QStringLiteral("view-filter")); | ||
119 | notify->setText(i18nc("Notification when the filter log was enabled", "Mail Filter Log Enabled")); | 117 | notify->setText(i18nc("Notification when the filter log was enabled", "Mail Filter Log Enabled")); | ||
120 | notify->sendEvent(); | 118 | notify->sendEvent(); | ||
121 | } | 119 | } | ||
122 | } | 120 | } | ||
123 | 121 | | |||
124 | changeRecorder()->itemFetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent); | 122 | changeRecorder()->itemFetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent); | ||
125 | changeRecorder()->itemFetchScope().setCacheOnly(true); | 123 | changeRecorder()->itemFetchScope().setCacheOnly(true); | ||
126 | changeRecorder()->fetchCollection(true); | 124 | changeRecorder()->fetchCollection(true); | ||
▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines |