Akonadi

dbustracer.cpp
1 /***************************************************************************
2  * Copyright (C) 2006 by Tobias Koenig <[email protected]> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License as *
6  * published by the Free Software Foundation; either version 2 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU Library General Public *
15  * License along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 
20 #include "dbustracer.h"
21 #include "tracernotificationadaptor.h"
22 
23 using namespace Akonadi::Server;
24 
25 DBusTracer::DBusTracer()
26  : QObject(nullptr)
27 {
28  new TracerNotificationAdaptor(this);
29 
30  QDBusConnection::sessionBus().registerObject(QStringLiteral("/tracing/notifications"), this, QDBusConnection::ExportAdaptors);
31 }
32 
33 DBusTracer::~DBusTracer() = default;
34 
35 void DBusTracer::beginConnection(const QString &identifier, const QString &msg)
36 {
37  Q_EMIT connectionStarted(identifier, msg);
38 }
39 
40 void DBusTracer::endConnection(const QString &identifier, const QString &msg)
41 {
42  Q_EMIT connectionEnded(identifier, msg);
43 }
44 
45 void DBusTracer::connectionInput(const QString &identifier, const QByteArray &msg)
46 {
47  Q_EMIT connectionDataInput(identifier, QString::fromUtf8(msg));
48 }
49 
50 void DBusTracer::connectionOutput(const QString &identifier, const QByteArray &msg)
51 {
52  Q_EMIT connectionDataOutput(identifier, QString::fromUtf8(msg));
53 }
54 
55 void DBusTracer::signal(const QString &signalName, const QString &msg)
56 {
57  Q_EMIT signalEmitted(signalName, msg);
58 }
59 
60 void DBusTracer::warning(const QString &componentName, const QString &msg)
61 {
62  Q_EMIT warningEmitted(componentName, msg);
63 }
64 
65 void DBusTracer::error(const QString &componentName, const QString &msg)
66 {
67  Q_EMIT errorEmitted(componentName, msg);
68 }
void warning(const QString &componentName, const QString &msg) override
This method is called whenever a component wants to output a warning.
Definition: dbustracer.cpp:60
bool registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options)
QDBusConnection sessionBus()
QString fromUtf8(const char *str, int size)
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:50
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:40
void error(const QString &componentName, const QString &msg) override
This method is called whenever a component wants to output an error.
Definition: dbustracer.cpp:65
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:45
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:55
Q_EMITQ_EMIT
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:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 23 2020 22:45:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.