Akonadi

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

KDE's Doxygen guidelines are available online.