Some fixes to connection manager.
[jenirok] / src / common / connectionmanager.h
index b92cca2..b5a2c3c 100644 (file)
@@ -46,7 +46,6 @@ public:
 
     ConnectionManager(QObject* parent = 0);
     ~ConnectionManager();
-    void setBlocking(bool value);
     bool connect();
     bool connect(Connection const& connection);
     bool connect(QString const& id);
@@ -55,13 +54,8 @@ public:
     bool isConnected();
     bool scanConnections(QList<Connection>& connections, ConnectionType type = NO_TYPE);
     Error error() const;
-    static unsigned int const TIMEOUT = 20000;
-
-signals:
-    void connectReply(bool connected);
-    void isConnectedReply(bool connected);
-    void newConnection(ConnectionManager::Connection const& connection);
-    void scanReady();
+    static unsigned int const TIMEOUT = 15000;
+    static unsigned int const WAIT_AFTER_CONNECT = 400;
 
 protected:
     virtual void timerEvent(QTimerEvent* event);
@@ -72,8 +66,8 @@ private slots:
     void scanResult(const QDBusMessage& rep);
 
 private:
+    void sleep(unsigned int ms);
     bool waitSignal(bool* ready);
-    bool blocking_;
     bool stateReady_;
     bool connectionReady_;
     bool scanReady_;
@@ -82,6 +76,7 @@ private:
     int numberOfConnections_;
     int scannedConnections_;
     int timer_;
+    ConnectionType searchType_;
     Error error_;
     QList<Connection>* connections_;
     QDBusInterface* icd2interface_;