diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2018-02-21 17:03:55 +0300 |
---|---|---|
committer | Olivier Goffart <olivier@woboq.com> | 2018-02-26 18:11:46 +0300 |
commit | 22c7002d5981f6f0efcc62d89187b91bd05a6f44 (patch) | |
tree | bf7978dfa8f0183281d55244e2fddc464acb2ba7 /src/gui/clientproxy.h | |
parent | 996814297615d5d2a67a398828c1c96141c7d845 (diff) |
Move ClientProxy and ConnecitonValidator to gui
They are using the ConfigFile and are used to control
when to sync rather than for the sync itself
Diffstat (limited to 'src/gui/clientproxy.h')
-rw-r--r-- | src/gui/clientproxy.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/gui/clientproxy.h b/src/gui/clientproxy.h new file mode 100644 index 000000000..6552d5e0f --- /dev/null +++ b/src/gui/clientproxy.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) by Klaas Freitag <freitag@owncloud.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#ifndef CLIENTPROXY_H +#define CLIENTPROXY_H + +#include <QObject> +#include <QNetworkProxy> +#include <QRunnable> +#include <QUrl> + +#include <csync.h> +#include "common/utility.h" +#include "owncloudlib.h" + +namespace OCC { + +class ConfigFile; + +/** + * @brief The ClientProxy class + * @ingroup libsync + */ +class ClientProxy : public QObject +{ + Q_OBJECT +public: + explicit ClientProxy(QObject *parent = 0); + + static bool isUsingSystemDefault(); + static void lookupSystemProxyAsync(const QUrl &url, QObject *dst, const char *slot); + +public slots: + void setupQtProxyFromConfig(); + +private: + const char *proxyTypeToCStr(QNetworkProxy::ProxyType type); +}; + +class SystemProxyRunnable : public QObject, public QRunnable +{ + Q_OBJECT +public: + SystemProxyRunnable(const QUrl &url); + void run(); +signals: + void systemProxyLookedUp(const QNetworkProxy &url); + +private: + QUrl _url; +}; + +QString printQNetworkProxy(const QNetworkProxy &proxy); +} + +#endif // CLIENTPROXY_H |