Fix compiler warning.
[yandex-traffic] / connection.hpp
1 #ifndef __CONNECTION_H__
2 #define __CONNECTION_H__
3
4 #include <QtCore>
5 #include <QtDBus>
6
7
8 // Singleton, which listens for ICD DBUS events about connection change
9 class ConnectionChecker : public QObject
10 {
11     Q_OBJECT
12
13 public:
14     enum network_type_t {
15         Net_None,
16         Net_WLAN,
17         Net_GSM,
18     };
19
20 private:
21     bool _connected;
22     network_type_t _net_type;
23
24     QDBusConnection _bus;
25     QDBusInterface *_itf;
26
27 protected:
28     ConnectionChecker ();
29
30     void updateState (bool new_state, const QString& net_type = QString ());
31
32 protected slots:
33     void stateSignal (const QDBusMessage& msg);
34
35 public:
36     static ConnectionChecker *instance ();
37
38     bool isConnected () const
39     { return _connected; };
40
41     network_type_t network_type () const
42     { return _net_type; };
43
44     void requestState ();
45
46 signals:
47     void connected (bool active);
48     void type_changed (ConnectionChecker::network_type_t type);
49 };
50
51 #endif // __CONNECTION_H__