Use logging categories in a few dataengines

Test Plan: Compiles

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D13357
wilder-5.14
David Edmundson 8 years ago
parent a999301714
commit a8573d1be5
  1. 6
      dataengines/statusnotifieritem/CMakeLists.txt
  2. 12
      dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
  3. 8
      dataengines/statusnotifieritem/systemtraytypes.cpp
  4. 5
      dataengines/time/CMakeLists.txt
  5. 7
      dataengines/time/timeengine.cpp

@ -31,6 +31,12 @@ target_link_libraries(plasma_engine_statusnotifieritem
dbusmenuqt dbusmenuqt
) )
ecm_qt_declare_logging_category(statusnotifieritem_engine_SRCS HEADER debug.h
IDENTIFIER DATAENGINE_SNI
CATEGORY_NAME kde.dataengine.sni
DEFAULT_SEVERITY Info)
kcoreaddons_desktop_to_json(plasma_engine_statusnotifieritem plasma-dataengine-statusnotifieritem.desktop) kcoreaddons_desktop_to_json(plasma_engine_statusnotifieritem plasma-dataengine-statusnotifieritem.desktop)
install(TARGETS plasma_engine_statusnotifieritem DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/dataengine) install(TARGETS plasma_engine_statusnotifieritem DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/dataengine)

@ -25,7 +25,7 @@
#include "dbusproperties.h" #include "dbusproperties.h"
#include <QDebug> #include "debug.h"
#include <iostream> #include <iostream>
static const QString s_watcherServiceName(QStringLiteral("org.kde.StatusNotifierWatcher")); static const QString s_watcherServiceName(QStringLiteral("org.kde.StatusNotifierWatcher"));
@ -73,7 +73,7 @@ void StatusNotifierItemEngine::init()
void StatusNotifierItemEngine::serviceChange(const QString& name, const QString& oldOwner, const QString& newOwner) void StatusNotifierItemEngine::serviceChange(const QString& name, const QString& oldOwner, const QString& newOwner)
{ {
qDebug()<< "Service" << name << "status change, old owner:" << oldOwner << "new:" << newOwner; qCDebug(DATAENGINE_SNI)<< "Service" << name << "status change, old owner:" << oldOwner << "new:" << newOwner;
if (newOwner.isEmpty()) { if (newOwner.isEmpty()) {
//unregistered //unregistered
@ -86,7 +86,7 @@ void StatusNotifierItemEngine::serviceChange(const QString& name, const QString&
void StatusNotifierItemEngine::registerWatcher(const QString& service) void StatusNotifierItemEngine::registerWatcher(const QString& service)
{ {
//qDebug()<<"service appeared"<<service; //qCDebug(DATAENGINE_SNI)<<"service appeared"<<service;
if (service == s_watcherServiceName) { if (service == s_watcherServiceName) {
delete m_statusNotifierWatcher; delete m_statusNotifierWatcher;
@ -115,7 +115,7 @@ void StatusNotifierItemEngine::registerWatcher(const QString& service)
} else { } else {
delete m_statusNotifierWatcher; delete m_statusNotifierWatcher;
m_statusNotifierWatcher = nullptr; m_statusNotifierWatcher = nullptr;
qDebug()<<"System tray daemon not reachable"; qCDebug(DATAENGINE_SNI)<<"System tray daemon not reachable";
} }
} }
} }
@ -123,7 +123,7 @@ void StatusNotifierItemEngine::registerWatcher(const QString& service)
void StatusNotifierItemEngine::unregisterWatcher(const QString& service) void StatusNotifierItemEngine::unregisterWatcher(const QString& service)
{ {
if (service == s_watcherServiceName) { if (service == s_watcherServiceName) {
qDebug()<< s_watcherServiceName << "disappeared"; qCDebug(DATAENGINE_SNI)<< s_watcherServiceName << "disappeared";
disconnect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemRegistered, this, &StatusNotifierItemEngine::serviceRegistered); disconnect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemRegistered, this, &StatusNotifierItemEngine::serviceRegistered);
disconnect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemUnregistered, this, &StatusNotifierItemEngine::serviceUnregistered); disconnect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemUnregistered, this, &StatusNotifierItemEngine::serviceUnregistered);
@ -137,7 +137,7 @@ void StatusNotifierItemEngine::unregisterWatcher(const QString& service)
void StatusNotifierItemEngine::serviceRegistered(const QString &service) void StatusNotifierItemEngine::serviceRegistered(const QString &service)
{ {
qDebug() << "Registering"<<service; qCDebug(DATAENGINE_SNI) << "Registering"<<service;
newItem(service); newItem(service);
} }

@ -42,13 +42,13 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, KDbusImageStruct
if (argument.currentType() == QDBusArgument::StructureType) { if (argument.currentType() == QDBusArgument::StructureType) {
argument.beginStructure(); argument.beginStructure();
//qDebug() << "begun structure"; //qCDebug(DATAENGINE_SNI)() << "begun structure";
argument >> width; argument >> width;
//qDebug() << width; //qCDebug(DATAENGINE_SNI)() << width;
argument >> height; argument >> height;
//qDebug() << height; //qCDebug(DATAENGINE_SNI)() << height;
argument >> data; argument >> data;
//qDebug() << data.size(); //qCDebug(DATAENGINE_SNI)() << data.size();
argument.endStructure(); argument.endStructure();
} }

@ -6,6 +6,11 @@ set(time_engine_SRCS
solarsystem.cpp solarsystem.cpp
) )
ecm_qt_declare_logging_category(time_engine_SRCS HEADER debug.h
IDENTIFIER DATAENGINE_TIME
CATEGORY_NAME kde.dataengine.time
DEFAULT_SEVERITY Info)
add_library(plasma_engine_time MODULE ${time_engine_SRCS}) add_library(plasma_engine_time MODULE ${time_engine_SRCS})
target_link_libraries(plasma_engine_time target_link_libraries(plasma_engine_time

@ -33,6 +33,7 @@
#endif #endif
#include "timesource.h" #include "timesource.h"
#include "debug.h"
//timezone is defined in msvc //timezone is defined in msvc
#ifdef timezone #ifdef timezone
@ -70,7 +71,7 @@ void TimeEngine::init()
int err = timerfd_settime(timeChangedFd, 3, &timespec, nullptr); //monitor for the time changing int err = timerfd_settime(timeChangedFd, 3, &timespec, nullptr); //monitor for the time changing
//(flags == TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET). However these are not exposed in glibc so value is hardcoded //(flags == TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET). However these are not exposed in glibc so value is hardcoded
if (err) { if (err) {
qWarning() << "Could not create timer with TFD_TIMER_CANCEL_ON_SET. Clock skews will not be detected. Error:" << qPrintable(strerror(err)); qCWarning(DATAENGINE_TIME) << "Could not create timer with TFD_TIMER_CANCEL_ON_SET. Clock skews will not be detected. Error:" << qPrintable(strerror(err));
} }
connect(this, &QObject::destroyed, [timeChangedFd]() { connect(this, &QObject::destroyed, [timeChangedFd]() {
@ -96,14 +97,14 @@ void TimeEngine::init()
void TimeEngine::clockSkewed() void TimeEngine::clockSkewed()
{ {
qDebug() << "Time engine Clock skew signaled"; qCDebug(DATAENGINE_TIME) << "Time engine Clock skew signaled";
updateAllSources(); updateAllSources();
forceImmediateUpdateOfAllVisualizations(); forceImmediateUpdateOfAllVisualizations();
} }
void TimeEngine::tzConfigChanged() void TimeEngine::tzConfigChanged()
{ {
qDebug() << "Local timezone changed signaled"; qCDebug(DATAENGINE_TIME) << "Local timezone changed signaled";
TimeSource *s = qobject_cast<TimeSource *>(containerForSource(QStringLiteral("Local"))); TimeSource *s = qobject_cast<TimeSource *>(containerForSource(QStringLiteral("Local")));
if (s) { if (s) {

Loading…
Cancel
Save