Added some debug info to devices and notifications models

This commit is contained in:
Albert Vaca 2014-07-01 01:25:30 +02:00
parent cabb0f2f7b
commit 12411da360
2 changed files with 14 additions and 7 deletions

View file

@ -26,9 +26,10 @@
#include <KConfigGroup>
#include <KIcon>
#include "kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#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<QStringList> 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) {

View file

@ -26,8 +26,10 @@
#include <KConfigGroup>
#include <KIcon>
#include "modeltest.h"
#include "kdebugnamespace.h"
#include <core/kdebugnamespace.h>
//#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<QStringList> 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) {