emailservices/nmailagent/src/main.cpp
changeset 20 ecc8def7944a
parent 18 578830873419
child 23 2dc6caa42ec3
--- a/emailservices/nmailagent/src/main.cpp	Fri Apr 16 14:51:52 2010 +0300
+++ b/emailservices/nmailagent/src/main.cpp	Mon May 03 12:23:15 2010 +0300
@@ -16,9 +16,16 @@
 */
 
 
-#include <QCoreApplication>
+#include "nmmailagentheaders.h"
 #include "nmmailagent.h"
 
+#ifdef __WINSCW__
+const int NmStartupDelay = 14000; // 14s
+#else
+const int NmStartupDelay = 4000; // 4s
+#endif
+
+
 /*!
 	int main
 */
@@ -26,9 +33,9 @@
 {
     QCoreApplication app(argc, argv);
     NmMailAgent agent;
-    if( !agent.init() ) {
-        // failed to start the framework
-        return 1;
-    }
+
+    // Agent will be initialised with a delay to avoid startup problems
+    QTimer::singleShot(NmStartupDelay, &agent, SLOT(delayedStart()));
+
     return app.exec();
 }