Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Runtime
Commits
87605e14
Commit
87605e14
authored
Jun 28, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for multi instance
parent
bf2faaeb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
agents/maildispatcher/maildispatcheragent.cpp
agents/maildispatcher/maildispatcheragent.cpp
+7
-1
agents/maildispatcher/sendjob.cpp
agents/maildispatcher/sendjob.cpp
+7
-1
agents/newmailnotifier/newmailnotifieragent.cpp
agents/newmailnotifier/newmailnotifieragent.cpp
+7
-1
No files found.
agents/maildispatcher/maildispatcheragent.cpp
View file @
87605e14
...
...
@@ -32,6 +32,7 @@
#include <itemfetchscope.h>
#include <mailtransportakonadi/sentactionattribute.h>
#include <mailtransportakonadi/sentbehaviourattribute.h>
#include <AkonadiCore/ServerManager>
#include <knotifyconfigwidget.h>
#include "maildispatcher_debug.h"
...
...
@@ -192,7 +193,12 @@ MailDispatcherAgent::MailDispatcherAgent(const QString &id)
KDBusConnectionPool
::
threadConnection
().
registerObject
(
QStringLiteral
(
"/MailDispatcherAgent"
),
this
,
QDBusConnection
::
ExportAdaptors
);
KDBusConnectionPool
::
threadConnection
().
registerService
(
QStringLiteral
(
"org.freedesktop.Akonadi.MailDispatcherAgent"
));
QString
service
=
QStringLiteral
(
"org.freedesktop.Akonadi.MailDispatcherAgent"
);
if
(
Akonadi
::
ServerManager
::
hasInstanceIdentifier
())
{
service
+=
QLatin1Char
(
'.'
)
+
Akonadi
::
ServerManager
::
instanceIdentifier
();
}
KDBusConnectionPool
::
threadConnection
().
registerService
(
service
);
d
->
queue
=
new
OutboxQueue
(
this
);
connect
(
d
->
queue
,
SIGNAL
(
newItems
()),
...
...
agents/maildispatcher/sendjob.cpp
View file @
87605e14
...
...
@@ -42,6 +42,7 @@
#include <mailtransportakonadi/transportattribute.h>
#include <mailtransport/transportjob.h>
#include <mailtransport/transportmanager.h>
#include <AkonadiCore/ServerManager>
#include <QTimer>
#include <QtDBus/QDBusInterface>
...
...
@@ -321,8 +322,13 @@ bool SendJob::Private::filterItem(int filterset)
Q_ASSERT
(
mailfilterInterface
==
nullptr
);
// TODO: create on stack
QString
service
=
QStringLiteral
(
"org.freedesktop.Akonadi.MailFilterAgent"
);
if
(
Akonadi
::
ServerManager
::
hasInstanceIdentifier
())
{
service
+=
QLatin1Char
(
'.'
)
+
Akonadi
::
ServerManager
::
instanceIdentifier
();
}
mailfilterInterface
=
new
QDBusInterface
(
QStringLiteral
(
"org.freedesktop.Akonadi.MailFilterAgent"
)
,
service
,
QStringLiteral
(
"/MailFilterAgent"
),
QStringLiteral
(
"org.freedesktop.Akonadi.MailFilterAgent"
),
KDBusConnectionPool
::
threadConnection
(),
q
);
...
...
agents/newmailnotifier/newmailnotifieragent.cpp
View file @
87605e14
...
...
@@ -27,6 +27,7 @@
#include "newmailnotifieragentsettings.h"
#include "newmailnotifiersettingsdialog.h"
#include <AkonadiCore/ServerManager>
#include <KIdentityManagement/IdentityManager>
#include <kdbusconnectionpool.h>
...
...
@@ -77,7 +78,12 @@ NewMailNotifierAgent::NewMailNotifierAgent(const QString &id)
KDBusConnectionPool
::
threadConnection
().
registerObject
(
QStringLiteral
(
"/NewMailNotifierAgent"
),
this
,
QDBusConnection
::
ExportAdaptors
);
KDBusConnectionPool
::
threadConnection
().
registerService
(
QStringLiteral
(
"org.freedesktop.Akonadi.NewMailNotifierAgent"
));
QString
service
=
QStringLiteral
(
"org.freedesktop.Akonadi.NewMailNotifierAgent"
);
if
(
Akonadi
::
ServerManager
::
hasInstanceIdentifier
())
{
service
+=
QLatin1Char
(
'.'
)
+
Akonadi
::
ServerManager
::
instanceIdentifier
();
}
KDBusConnectionPool
::
threadConnection
().
registerService
(
service
);
connect
(
Akonadi
::
AgentManager
::
self
(),
&
Akonadi
::
AgentManager
::
instanceStatusChanged
,
this
,
&
NewMailNotifierAgent
::
slotInstanceStatusChanged
);
connect
(
Akonadi
::
AgentManager
::
self
(),
&
Akonadi
::
AgentManager
::
instanceRemoved
,
this
,
&
NewMailNotifierAgent
::
slotInstanceRemoved
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment