mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 05:25:50 +03:00
Merge pull request #1886 from nextcloud/enh/proxy
Move the proxyfiles to libsync where they make more sense
This commit is contained in:
commit
1afb70e114
5 changed files with 24 additions and 29 deletions
|
@ -54,7 +54,6 @@ set(client_SRCS
|
|||
accountmanager.cpp
|
||||
accountsettings.cpp
|
||||
application.cpp
|
||||
clientproxy.cpp
|
||||
connectionvalidator.cpp
|
||||
folder.cpp
|
||||
folderman.cpp
|
||||
|
|
|
@ -24,6 +24,7 @@ set(libsync_SRCS
|
|||
wordlist.cpp
|
||||
bandwidthmanager.cpp
|
||||
capabilities.cpp
|
||||
clientproxy.cpp
|
||||
cookiejar.cpp
|
||||
discoveryphase.cpp
|
||||
filesystem.cpp
|
||||
|
|
|
@ -56,9 +56,29 @@ bool ClientProxy::isUsingSystemDefault()
|
|||
return true;
|
||||
}
|
||||
|
||||
const char *proxyTypeToCStr(QNetworkProxy::ProxyType type)
|
||||
{
|
||||
switch (type) {
|
||||
case QNetworkProxy::NoProxy:
|
||||
return "NoProxy";
|
||||
case QNetworkProxy::DefaultProxy:
|
||||
return "DefaultProxy";
|
||||
case QNetworkProxy::Socks5Proxy:
|
||||
return "Socks5Proxy";
|
||||
case QNetworkProxy::HttpProxy:
|
||||
return "HttpProxy";
|
||||
case QNetworkProxy::HttpCachingProxy:
|
||||
return "HttpCachingProxy";
|
||||
case QNetworkProxy::FtpCachingProxy:
|
||||
return "FtpCachingProxy";
|
||||
default:
|
||||
return "NoProxy";
|
||||
}
|
||||
}
|
||||
|
||||
QString printQNetworkProxy(const QNetworkProxy &proxy)
|
||||
{
|
||||
return QString("%1://%2:%3").arg(proxy.type()).arg(proxy.hostName()).arg(proxy.port());
|
||||
return QString("%1://%2:%3").arg(proxyTypeToCStr(proxy.type())).arg(proxy.hostName()).arg(proxy.port());
|
||||
}
|
||||
|
||||
void ClientProxy::setupQtProxyFromConfig()
|
||||
|
@ -108,26 +128,6 @@ void ClientProxy::setupQtProxyFromConfig()
|
|||
}
|
||||
}
|
||||
|
||||
const char *ClientProxy::proxyTypeToCStr(QNetworkProxy::ProxyType type)
|
||||
{
|
||||
switch (type) {
|
||||
case QNetworkProxy::NoProxy:
|
||||
return "NoProxy";
|
||||
case QNetworkProxy::DefaultProxy:
|
||||
return "DefaultProxy";
|
||||
case QNetworkProxy::Socks5Proxy:
|
||||
return "Socks5Proxy";
|
||||
case QNetworkProxy::HttpProxy:
|
||||
return "HttpProxy";
|
||||
case QNetworkProxy::HttpCachingProxy:
|
||||
return "HttpCachingProxy";
|
||||
case QNetworkProxy::FtpCachingProxy:
|
||||
return "FtpCachingProxy";
|
||||
default:
|
||||
return "NoProxy";
|
||||
}
|
||||
}
|
||||
|
||||
void ClientProxy::lookupSystemProxyAsync(const QUrl &url, QObject *dst, const char *slot)
|
||||
{
|
||||
auto *runnable = new SystemProxyRunnable(url);
|
|
@ -32,7 +32,7 @@ class ConfigFile;
|
|||
* @brief The ClientProxy class
|
||||
* @ingroup libsync
|
||||
*/
|
||||
class ClientProxy : public QObject
|
||||
class OWNCLOUDSYNC_EXPORT ClientProxy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -43,12 +43,9 @@ public:
|
|||
|
||||
public slots:
|
||||
void setupQtProxyFromConfig();
|
||||
|
||||
private:
|
||||
const char *proxyTypeToCStr(QNetworkProxy::ProxyType type);
|
||||
};
|
||||
|
||||
class SystemProxyRunnable : public QObject, public QRunnable
|
||||
class OWNCLOUDSYNC_EXPORT SystemProxyRunnable : public QObject, public QRunnable
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
|
@ -69,7 +69,6 @@ list(APPEND FolderMan_SRC ../src/gui/guiutility.cpp )
|
|||
list(APPEND FolderMan_SRC ../src/gui/navigationpanehelper.cpp )
|
||||
list(APPEND FolderMan_SRC ../src/gui/userinfo.cpp )
|
||||
list(APPEND FolderMan_SRC ../src/gui/connectionvalidator.cpp )
|
||||
list(APPEND FolderMan_SRC ../src/gui/clientproxy.cpp )
|
||||
list(APPEND FolderMan_SRC ../src/gui/ocsjob.cpp )
|
||||
list(APPEND FolderMan_SRC ../src/gui/ocsnavigationappsjob.cpp )
|
||||
list(APPEND FolderMan_SRC ../src/gui/accountstate.cpp )
|
||||
|
@ -79,7 +78,6 @@ list(APPEND FolderMan_SRC stubfolderman.cpp )
|
|||
nextcloud_add_test(FolderMan "${FolderMan_SRC}")
|
||||
|
||||
SET(RemoteWipe_SRC ../src/gui/remotewipe.cpp)
|
||||
list(APPEND RemoteWipe_SRC ../src/gui/clientproxy.cpp )
|
||||
list(APPEND RemoteWipe_SRC ../src/gui/guiutility.cpp )
|
||||
list(APPEND RemoteWipe_SRC ../src/gui/userinfo.cpp )
|
||||
list(APPEND RemoteWipe_SRC ../src/gui/connectionvalidator.cpp )
|
||||
|
|
Loading…
Reference in a new issue