Commit 12411da3 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Added some debug info to devices and notifications models

parent cabb0f2f
......@@ -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) {
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment