emailservices/nmclientapi/src/nmapieventnotifier.cpp
changeset 53 bf7eb7911fc5
parent 30 759dc5235cdb
child 48 10eaf342f539
child 54 997a02608b3a
--- a/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Fri Jun 11 13:27:14 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Wed Jun 23 18:00:21 2010 +0300
@@ -74,7 +74,7 @@
     if (mNmApiEventNotifierPrivate->mIsRunning) {
         result = true;
     }
-    else
+    else {
         if (!mNmApiEventNotifierPrivate->initializeEngine()) {
             mNmApiEventNotifierPrivate->mIsRunning = false;
             result = false;
@@ -85,11 +85,15 @@
 
             connect(mNmApiEventNotifierPrivate->mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), mNmApiEventNotifierPrivate,
                 SLOT(emailStoreEvent(NmApiMessage)), Qt::QueuedConnection);
-
+            
+            // initiate event listening
+            mNmApiEventNotifierPrivate->mEngine->startCollectingEvents();
+            
             mNmApiEventNotifierPrivate->mEmitSignals->start();
             mNmApiEventNotifierPrivate->mIsRunning = true;
             result = true;
         }
+    }
     return result;
 }
 
@@ -129,6 +133,7 @@
     
     qRegisterMetaType<EmailClientApi::NmApiMailboxEvent> ("EmailClientApi::NmApiMailboxEvent");
     qRegisterMetaType<EmailClientApi::NmApiMessageEvent> ("EmailClientApi::NmApiMessageEvent");
+    
     NmApiMessage events;
     while (!mNmApiEventNotifierPrivate->mBufferOfEvents.isEmpty()) {
         events = mNmApiEventNotifierPrivate->mBufferOfEvents.takeFirst();