From 0822b88738e00625efd27ccca9119885272924d2 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Mon, 26 Sep 2011 02:36:09 +0200 Subject: fixing bugs found during use ;) --- libsowatch/watchserver.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libsowatch/watchserver.cpp') diff --git a/libsowatch/watchserver.cpp b/libsowatch/watchserver.cpp index 07e4609..c81d937 100644 --- a/libsowatch/watchserver.cpp +++ b/libsowatch/watchserver.cpp @@ -68,6 +68,7 @@ void WatchServer::runWatchlet(const QString& id) void WatchServer::closeWatchlet() { if (_currentWatchlet) { + qDebug() << "deactivating watchlet" << _currentWatchlet->id(); _currentWatchlet->deactivate(); _currentWatchlet = 0; if (_watch->isConnected() && _pendingNotifications.empty()) { @@ -183,13 +184,13 @@ void WatchServer::notificationReceived(Notification *notification) connect(notification, SIGNAL(changed()), SLOT(notificationChanged())); connect(notification, SIGNAL(cleared()), SLOT(notificationCleared())); - qDebug() << "notification received" << notification->title() << notification->count(); + qDebug() << "notification received" << notification->title() << "(" << notification->count() << ")"; _watch->updateNotificationCount(type, getNotificationCount(type)); QDateTime oldThreshold = QDateTime::currentDateTime().addSecs(-_oldNotificationThreshold); if (notification->dateTime() < oldThreshold) { - return; // Do not care about that old notifications... + return; // Do not care about notifications that old... } if (_pendingNotifications.isEmpty()) { @@ -211,7 +212,7 @@ void WatchServer::notificationChanged() Notification* n = static_cast(obj); const Notification::Type type = n->type(); - qDebug() << "notification changed" << n->title() << n->count(); + qDebug() << "notification changed" << n->title() << "(" << n->count() << ")"; _watch->updateNotificationCount(type, getNotificationCount(type)); if (!_pendingNotifications.isEmpty() && _pendingNotifications.head() == n) { @@ -228,11 +229,12 @@ void WatchServer::notificationCleared() const Notification::Type type = n->type(); _notifications[type].removeOne(n); - qDebug() << "notification deleted" << n->title() << n->count(); + qDebug() << "notification deleted" << n->title() << "(" << n->count() << ")"; _watch->updateNotificationCount(type, getNotificationCount(type)); - if (!_pendingNotifications.isEmpty() && _pendingNotifications.head() == n) {qDebug() << "removing top notification"; + if (!_pendingNotifications.isEmpty() && _pendingNotifications.head() == n) { + qDebug() << "removing top notification"; _pendingNotifications.removeAll(n); nextNotification(); } else { -- cgit v1.2.3