Added option to skip the leading zero of an incoming call.
[jenirok] / src / daemon / calllistener.h
index cbc4698..b58f3cb 100644 (file)
@@ -36,14 +36,14 @@ public:
     ~CallListener();
     bool begin();
     void end();
-    static const int REQUEST_TIMEOUT = 10000;
+    static const int REQUEST_TIMEOUT = 8000;
     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:
@@ -54,10 +54,20 @@ private slots:
     void incomingCall(QDBusObjectPath path, QString numbe);
     void callTerminate();
     void showTimedMessage();
+    void handleAnswer();
+    void closeConnection();
 
 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);
@@ -79,8 +89,9 @@ private:
     QLabel* label_;
     static QDBusConnection systemBus_;
     int retries_;
-    QString currentSearch_;
     int timer_;
+    CallDetails* currentCall_;
+    bool ignoreFirstZero_;
 };
 
 #endif // CALLLISTENER_H