summaryrefslogtreecommitdiff
path: root/libsowatch/watchserver.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-26 02:36:09 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-26 02:36:09 +0200
commit0822b88738e00625efd27ccca9119885272924d2 (patch)
treef379817602cc23dd829c0aa4751b6b5edc348923 /libsowatch/watchserver.cpp
parentcf5d24b94d96b722c6d76c2225293a56a50d3c2b (diff)
downloadsowatch-0822b88738e00625efd27ccca9119885272924d2.tar.gz
sowatch-0822b88738e00625efd27ccca9119885272924d2.zip
fixing bugs found during use ;)
Diffstat (limited to 'libsowatch/watchserver.cpp')
-rw-r--r--libsowatch/watchserver.cpp12
1 files changed, 7 insertions, 5 deletions
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<Notification*>(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 {