Some optimization to settings and searching.
[jenirok] / src / daemon / calllistener.h
index cf47953..23b97eb 100644 (file)
@@ -39,8 +39,8 @@ public:
     static const int REQUEST_TIMEOUT = 10000;
     static const int BANNER_DELAY = 350;
     static const int SEARCH_RETRIES = 2;
-    static const int CONNECT_RETRIES = 3;
-    static const int CONNECTION_LOOKUP_RETRIES = 10;
+    static const int CONNECT_RETRIES = 2;
+    static const int CONNECTION_LOOKUP_RETRIES = 8;
     static const int GPRS_SCANS = 2;
     static const int WLAN_SCANS = 5;
     static const int WAIT_BETWEEN_RETRIES = 500;
@@ -54,10 +54,19 @@ private slots:
     void incomingCall(QDBusObjectPath path, QString numbe);
     void callTerminate();
     void showTimedMessage();
+    void handleAnswer();
 
 private:
     Q_DISABLE_COPY(CallListener);
 
+    struct CallDetails
+    {
+        QString number;
+        Source::Result result;
+        bool answered;
+        unsigned int time;
+    };
+
     void search(Source::SearchDetails const& details);
     void showResult(QString const& text);
     void showDelayedResult(QString const& text, int delay);
@@ -67,6 +76,7 @@ private:
     void showError(QString const& msg, int delay = 0);
     bool is3g();
     void sleep(int ms);
+    void sendRetrySignal(QString const& iap, bool retry);
     QString createResult(QString const& name, QString const& street, QString const& city);
     QString timedMessage_;
     Source* source_;
@@ -78,8 +88,8 @@ private:
     QLabel* label_;
     static QDBusConnection systemBus_;
     int retries_;
-    QString currentSearch_;
     int timer_;
+    CallDetails* currentCall_;
 };
 
 #endif // CALLLISTENER_H