X-Git-Url: http://git.maemo.org/git/?p=jenirok;a=blobdiff_plain;f=src%2Fdaemon%2Fcalllistener.h;h=639504891d7a1929c584cc3805e80aee804a4818;hp=4fe29b46e684d76cb114cc49c8420936665365f9;hb=9127dc5e47aee7fa6659f45ae60a9394612f27b1;hpb=7457945ab2973c6c93fbb9e92af7d81f15bced9d diff --git a/src/daemon/calllistener.h b/src/daemon/calllistener.h index 4fe29b4..6395048 100644 --- a/src/daemon/calllistener.h +++ b/src/daemon/calllistener.h @@ -26,7 +26,6 @@ #include #include "informationbox.h" #include "eniro.h" -#include "connectionmanager.h" class CallListener: public QObject { @@ -35,11 +34,18 @@ class CallListener: public QObject public: CallListener(); ~CallListener(); - void begin(); + bool begin(); void end(); static const int REQUEST_TIMEOUT = 10000; static const int BANNER_DELAY = 350; - static const int NUMBER_OF_RETRIES = 3; + static const int SEARCH_RETRIES = 2; + static const int CONNECT_RETRIES = 3; + static const int CONNECTION_LOOKUP_RETRIES = 15; + static const int WAIT_BETWEEN_RETRIES = 1000; + static const int ERROR_BANNER_TIMEOUT = 4000; + +protected: + virtual void timerEvent(QTimerEvent* event); private slots: void requestFinished(QVector const& results, Eniro::SearchDetails const& details, bool error); @@ -55,10 +61,12 @@ private: void showDelayedResult(QString const& text, int delay); void searchInit(); void searchClose(); + bool handleConnection(); + void showError(QString const& msg); + void sleep(int ms); QString createResult(QString const& name, QString const& street, QString const& city); QString timedMessage_; Eniro* eniro_; - ConnectionManager* connectionManager_; bool closeConnection_; bool initialized_; InformationBox* box_; @@ -67,6 +75,7 @@ private: int retries_; QString currentSearch_; Eniro::Site site_; + int timer_; }; #endif // CALLLISTENER_H