Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Jenirok
Summary Tracker SCM Files
authoreshe <jessehakanen@gmail.com>
Tue, 17 Aug 2010 13:21:18 +0000 (14:21 +0100)
committereshe <jessehakanen@gmail.com>
Tue, 17 Aug 2010 13:21:18 +0000 (14:21 +0100)
src/common/connectionmanager.cpp
src/daemon/calllistener.cpp
src/daemon/calllistener.h

index 510a504..fb0f395 100644 (file)
@@ -192,13 +192,6 @@ bool ConnectionManager::disconnect(bool force)
 {
     if(force)
     {
-        // Do not allow forced disconnection if connection was not started
-        // by this class.
-        if(!connected_)
-        {
-            return false;
-        }
-
         QDBusMessage msg = QDBusMessage::createSignal("/com/nokia/icd_ui",
                                                       "com.nokia.icd_ui",
                                                       "disconnect");
index 79a6485..0938fb8 100644 (file)
@@ -157,12 +157,12 @@ void CallListener::requestFinished(QVector <Source::Result> const& results,
                                    Source::SearchDetails const& details,
                                    bool error)
 {
-    if(closeConnection_)
+    /*if(closeConnection_)
     {
         closeConnection_ = false;
         ConnectionManager cm;
         cm.disconnect(true);
-    }
+    }*/
 
     // If box is not visible, the call must have been terminated already
     if(!initialized_ || !box_->isVisible() || !currentCall_)
@@ -401,6 +401,14 @@ void CallListener::searchClose()
 
     if(closeConnection_)
     {
+        QTimer::singleShot(500, this, SLOT(closeConnection()));
+    }
+}
+
+void CallListener::closeConnection()
+{
+    if(closeConnection_)
+    {
         closeConnection_ = false;
         ConnectionManager cm;
         cm.disconnect(true);
@@ -511,10 +519,11 @@ bool CallListener::handleConnection()
             return false;
         }
 
-        qDebug() << "Connecting to " << best.name;
+        qDebug() << "Connecting to " << best.name << " (" << best.id << ")";
 
         if(cm.connect(best.id))
         {
+            sleep(500);
             break;
         }
         else if(cm.error() == ConnectionManager::INVALID_IAP)
@@ -529,7 +538,8 @@ bool CallListener::handleConnection()
 
         if(retries < CONNECT_RETRIES)
         {
-            sendRetrySignal(best.id, initialized_);
+            sendRetrySignal(best.id, false);
+            sleep(WAIT_BETWEEN_RETRIES);
         }
 
     }
@@ -597,7 +607,7 @@ bool CallListener::is3g()
 
 void CallListener::sendRetrySignal(QString const& iap, bool retry)
 {
-    QDBusMessage msg = QDBusMessage::createSignal("/com/nokia/icd_ui",
+   QDBusMessage msg = QDBusMessage::createSignal("/com/nokia/icd_ui",
                                                   "com.nokia.icd_ui",
                                                   "retry");
 
index 23b97eb..0fba1c7 100644 (file)
@@ -39,11 +39,11 @@ public:
     static const int REQUEST_TIMEOUT = 10000;
     static const int BANNER_DELAY = 350;
     static const int SEARCH_RETRIES = 2;
-    static const int CONNECT_RETRIES = 2;
-    static const int CONNECTION_LOOKUP_RETRIES = 8;
+    static const int CONNECT_RETRIES = 1;
+    static const int CONNECTION_LOOKUP_RETRIES = 7;
     static const int GPRS_SCANS = 2;
-    static const int WLAN_SCANS = 5;
-    static const int WAIT_BETWEEN_RETRIES = 500;
+    static const int WLAN_SCANS = 4;
+    static const int WAIT_BETWEEN_RETRIES = 400;
     static const int ERROR_BANNER_TIMEOUT = 4500;
 
 protected:
@@ -55,6 +55,7 @@ private slots:
     void callTerminate();
     void showTimedMessage();
     void handleAnswer();
+    void closeConnection();
 
 private:
     Q_DISABLE_COPY(CallListener);

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment