From 12411da360eb21a12c6e7461b32caa063b862eac Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Tue, 1 Jul 2014 01:25:30 +0200 Subject: [PATCH] Added some debug info to devices and notifications models --- interfaces/devicesmodel.cpp | 12 ++++++++---- interfaces/notificationsmodel.cpp | 9 ++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp index ce9af3d22..bef9db4f3 100644 --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -26,9 +26,10 @@ #include #include -#include "kdebugnamespace.h" +#include + +#include "dbusinterfaces.h" // #include "modeltest.h" -#include "interfaces/dbusinterfaces.h" DevicesModel::DevicesModel(QObject *parent) : QAbstractListModel(parent) @@ -105,16 +106,19 @@ void DevicesModel::refreshDeviceList() } if (!m_dbusInterface->isValid()) { + kDebug(debugArea()) << "dbus interface not valid"; return; } - bool onlyPaired = (m_displayFilter & StatusPaired); bool onlyReachable = (m_displayFilter & StatusReachable); QDBusPendingReply pendingDeviceIds = m_dbusInterface->devices(onlyReachable, onlyPaired); pendingDeviceIds.waitForFinished(); - if (pendingDeviceIds.isError()) return; + if (pendingDeviceIds.isError()) { + kDebug(debugArea()) << pendingDeviceIds.error(); + return; + } const QStringList& deviceIds = pendingDeviceIds.value(); Q_FOREACH(const QString& id, deviceIds) { diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp index ea84fd615..7ff163821 100644 --- a/interfaces/notificationsmodel.cpp +++ b/interfaces/notificationsmodel.cpp @@ -26,8 +26,10 @@ #include #include -#include "modeltest.h" -#include "kdebugnamespace.h" +#include + +//#include "modeltest.h" + NotificationsModel::NotificationsModel(QObject* parent) : QAbstractListModel(parent) @@ -110,12 +112,14 @@ void NotificationsModel::refreshNotificationList() } if (!m_dbusInterface->isValid()) { + kDebug(debugArea()) << "dbus interface not valid"; return; } QDBusPendingReply pendingNotificationIds = m_dbusInterface->activeNotifications(); pendingNotificationIds.waitForFinished(); if (pendingNotificationIds.isError()) { + kDebug(debugArea()) << pendingNotificationIds.error(); return; } const QStringList& notificationIds = pendingNotificationIds.value(); @@ -205,7 +209,6 @@ bool NotificationsModel::isAnyDimissable() const return false; } - void NotificationsModel::dismissAll() { Q_FOREACH (NotificationDbusInterface* notification, m_notificationList) {