From 0822b88738e00625efd27ccca9119885272924d2 Mon Sep 17 00:00:00 2001
From: "Javier S. Pedro" <maemo@javispedro.com>
Date: Mon, 26 Sep 2011 02:36:09 +0200
Subject: fixing bugs found during use ;)

---
 ckitcallnotification/ckitcallprovider.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'ckitcallnotification')

diff --git a/ckitcallnotification/ckitcallprovider.cpp b/ckitcallnotification/ckitcallprovider.cpp
index 90dab97..acfcca3 100644
--- a/ckitcallnotification/ckitcallprovider.cpp
+++ b/ckitcallnotification/ckitcallprovider.cpp
@@ -22,8 +22,8 @@ void CKitCallProvider::activeCallChanged()
 {
 	QVariantMap info = _activeCall->value().toMap();
 	qDebug() << "active call changed" << info;
-	if (!info.contains("state")) {
-		qWarning() << "broken active call context property";
+	if (!info.contains("state") || !info.value("status", false).toBool()) {
+		return; // Ignore until we get a map with all the required properties.
 	}
 	int state = info["state"].toInt();
 	if (state == 0) {
@@ -34,13 +34,15 @@ void CKitCallProvider::activeCallChanged()
 		}
 		// "Incoming call"
 		if (_notification) {
+			// An existing incoming call has been updated
 			_notification->changeDisplayName(displayName);
 		} else {
+			// This is a new incoming call
 			_notification = new CKitCallNotification(displayName, this);
 			emit incomingNotification(_notification);
 		}
 	} else {
-		// Call is either answered, dropped, missed, ..
+		// Call has either been answered, rejected, missed, ..
 		if (_notification) {
 			_notification->clear();
 			_notification->deleteLater();
-- 
cgit v1.2.3