Akonadi

dbustracer.cpp
1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2006 Tobias Koenig <[email protected]> *
3  * *
4  * SPDX-License-Identifier: LGPL-2.0-or-later *
5  ***************************************************************************/
6 
7 #include "dbustracer.h"
8 #include "tracernotificationadaptor.h"
9 
10 using namespace Akonadi::Server;
11 
12 DBusTracer::DBusTracer()
13  : QObject(nullptr)
14 {
15  new TracerNotificationAdaptor(this);
16 
17  QDBusConnection::sessionBus().registerObject(QStringLiteral("/tracing/notifications"), this, QDBusConnection::ExportAdaptors);
18 }
19 
20 DBusTracer::~DBusTracer() = default;
21 
22 void DBusTracer::beginConnection(const QString &identifier, const QString &msg)
23 {
24  Q_EMIT connectionStarted(identifier, msg);
25 }
26 
27 void DBusTracer::endConnection(const QString &identifier, const QString &msg)
28 {
29  Q_EMIT connectionEnded(identifier, msg);
30 }
31 
32 void DBusTracer::connectionInput(const QString &identifier, const QByteArray &msg)
33 {
34  Q_EMIT connectionDataInput(identifier, QString::fromUtf8(msg));
35 }
36 
37 void DBusTracer::connectionOutput(const QString &identifier, const QByteArray &msg)
38 {
39  Q_EMIT connectionDataOutput(identifier, QString::fromUtf8(msg));
40 }
41 
42 void DBusTracer::signal(const QString &signalName, const QString &msg)
43 {
44  Q_EMIT signalEmitted(signalName, msg);
45 }
46 
47 void DBusTracer::warning(const QString &componentName, const QString &msg)
48 {
49  Q_EMIT warningEmitted(componentName, msg);
50 }
51 
52 void DBusTracer::error(const QString &componentName, const QString &msg)
53 {
54  Q_EMIT errorEmitted(componentName, msg);
55 }
void endConnection(const QString &identifier, const QString &msg) override
This method is called whenever a data (imap) connection to akonadi server is closed.
Definition: dbustracer.cpp:27
void error(const QString &componentName, const QString &msg) override
This method is called whenever a component wants to output an error.
Definition: dbustracer.cpp:52
QString fromUtf8(const char *str, int size)
Q_EMITQ_EMIT
bool registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options)
void connectionInput(const QString &identifier, const QByteArray &msg) override
This method is called whenever the akonadi server retrieves some data from the outside.
Definition: dbustracer.cpp:32
void warning(const QString &componentName, const QString &msg) override
This method is called whenever a component wants to output a warning.
Definition: dbustracer.cpp:47
QDBusConnection sessionBus()
void signal(const QString &signalName, const QString &msg) override
This method is called whenever a dbus signal is emitted on the bus.
Definition: dbustracer.cpp:42
void connectionOutput(const QString &identifier, const QByteArray &msg) override
This method is called whenever the akonadi server sends some data out to a client.
Definition: dbustracer.cpp:37
void beginConnection(const QString &identifier, const QString &msg) override
This method is called whenever a new data (imap) connection to the akonadi server is established.
Definition: dbustracer.cpp:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.