Some error banner delays fixed.
[jenirok] / src / daemon / calllistener.cpp
index 821c073..4307347 100644 (file)
@@ -40,7 +40,7 @@ QDBusConnection CallListener::systemBus_ = QDBusConnection::systemBus();
 
 CallListener::CallListener(): eniro_(0),
 closeConnection_(false), initialized_(false), box_(0), label_(0),
-retries_(-1), site_(Eniro::FI), timer_(0), autoconnect_(false)
+retries_(-1), site_(Eniro::FI), timer_(0)
 {
 }
 
@@ -374,7 +374,7 @@ bool CallListener::handleConnection()
 
     if(configType == Settings::ALWAYS_ASK)
     {
-        showError(tr("Automatic connecting is not allowed by settings."));
+        showError(tr("Automatic connecting is not allowed by settings."), BANNER_DELAY);
         return false;
     }
 
@@ -460,11 +460,19 @@ bool CallListener::handleConnection()
     return initialized_;
 }
 
-void CallListener::showError(QString const& msg)
+void CallListener::showError(QString const& msg, int timeout)
 {
     qDebug() << "Error: " << msg;
     box_->setTimeout(ERROR_BANNER_TIMEOUT);
-    showResult(msg);
+
+    if(timeout)
+    {
+        showDelayedResult(msg, timeout);
+    }
+    else
+    {
+        showResult(msg);
+    }
 }
 
 void CallListener::timerEvent(QTimerEvent* event)