summaryrefslogtreecommitdiff
path: root/client/Config.h
diff options
context:
space:
mode:
authorAlex <b0ris@b0ris-satellite.localdomain>2011-11-05 02:13:28 +0200
committerAlex <b0ris@b0ris-satellite.localdomain>2011-11-05 02:13:28 +0200
commit6f9a82364b5480ac7b0056b3563776bacf605f62 (patch)
tree26cbe3ca78bd2f0c933dcf20ad04c2a618c204b9 /client/Config.h
parentb7e0b79e7ce53bf467b1bcb8d60e86fac509f776 (diff)
Server config requests. ALERT: segfault at runtime! Not fixed yet
Diffstat (limited to 'client/Config.h')
-rw-r--r--client/Config.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/client/Config.h b/client/Config.h
index c95d9c6..11bed90 100644
--- a/client/Config.h
+++ b/client/Config.h
@@ -4,13 +4,15 @@
#define CONFIG_H
#include <client.h>
+#include <QObject>
#include "Proxy.h"
+#include <SslClient.h>
using std::vector;
using std::string;
-class ProxyEntryGeneric;
-class ProxyEntryStatic;
+class SslClient;
+class QTimer;
/**
* @brief Singleton class that represents client configuration<br/>
@@ -19,8 +21,9 @@ class ProxyEntryStatic;
* Then retries is made to connect to server and acqire actual config,
* firewall list, etc.
*/
-class Config
+class Config: public QObject
{
+ Q_OBJECT
public:
/**
* @brief Class to represent 'firewall' record in the config file
@@ -207,11 +210,21 @@ private:
* @brief Pointer to the singleton Config instance
*/
static Config *self;
-
+
/**
* @brief time interval between consequtive config updates
*/
unsigned updateInterval;
+
+ /**
+ * @brief SslCLient instance that connects to server and retrieves config
+ */
+ SslClient *client;
+
+ /**
+ * @brief timer that is responsible on config updates
+ */
+ QTimer *configUpdateTimer;
bool configValid;
vector<ProxyEntryGeneric> genericProxy;
vector<ProxyEntryStatic> staticProxy;
@@ -219,6 +232,9 @@ private:
vector<ServerEntry> servers;
int ReadGenericProxy();
int ReadStaticProxy();
+private slots:
+ void updateConfig();
+ void gotServerReply(SslClient::RequestType &type, QByteArray &confdata);
};