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_)
if(closeConnection_)
{
+ QTimer::singleShot(500, this, SLOT(closeConnection()));
+ }
+}
+
+void CallListener::closeConnection()
+{
+ if(closeConnection_)
+ {
closeConnection_ = false;
ConnectionManager cm;
cm.disconnect(true);
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)
if(retries < CONNECT_RETRIES)
{
- sendRetrySignal(best.id, initialized_);
+ sendRetrySignal(best.id, false);
+ sleep(WAIT_BETWEEN_RETRIES);
}
}
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");
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:
void callTerminate();
void showTimedMessage();
void handleAnswer();
+ void closeConnection();
private:
Q_DISABLE_COPY(CallListener);