Commit b57461c5 authored by Christian Kandeler's avatar Christian Kandeler Committed by hjk
Browse files

Maemo: Disable proxy use for device access.

Workaround for proxy problems on Windows (Qt bug?).

Reviewed-by: kh1
(cherry picked from commit f3ac8e43)
parent 995b6db0
......@@ -42,6 +42,7 @@
#include <QtCore/QFile>
#include <QtCore/QMutex>
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QTcpSocket>
namespace Core {
......@@ -68,8 +69,8 @@ namespace {
} // anonymous namespace
SshConnectionParameters::SshConnectionParameters() :
timeout(0), authType(AuthByKey), port(0)
SshConnectionParameters::SshConnectionParameters(ProxyType proxyType) :
timeout(0), authType(AuthByKey), port(0), proxyType(proxyType)
{
}
......@@ -176,6 +177,7 @@ SshConnectionPrivate::SshConnectionPrivate(SshConnection *conn)
: m_socket(new QTcpSocket(this)), m_state(SocketUnconnected),
m_sendFacility(m_socket),
m_channelManager(new SshChannelManager(m_sendFacility, this)),
m_connParams(SshConnectionParameters::DefaultProxy),
m_error(SshNoError), m_ignoreNextPacket(false), m_conn(conn)
{
setupPacketHandlers();
......@@ -551,6 +553,8 @@ void SshConnectionPrivate::connectToHost(const SshConnectionParameters &serverIn
this->m_connParams = serverInfo;
m_state = SocketConnecting;
m_timeoutTimer.start(m_connParams.timeout * 1000);
m_socket->setProxy(m_connParams.proxyType == SshConnectionParameters::DefaultProxy
? QNetworkProxy::DefaultProxy : QNetworkProxy::NoProxy);
m_socket->connectToHost(serverInfo.host, serverInfo.port);
}
......
......@@ -49,7 +49,8 @@ class SshConnectionPrivate;
struct CORE_EXPORT SshConnectionParameters
{
SshConnectionParameters();
enum ProxyType { DefaultProxy, NoProxy };
SshConnectionParameters(ProxyType proxyType);
QString host;
QString uname;
......@@ -58,6 +59,7 @@ struct CORE_EXPORT SshConnectionParameters
int timeout;
enum AuthType { AuthByPwd, AuthByKey } authType;
quint16 port;
ProxyType proxyType;
};
CORE_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
......
......@@ -114,6 +114,7 @@ DebuggerStartParameters::DebuggerStartParameters() :
qmlServerAddress("127.0.0.1"),
qmlServerPort(0),
useServerStartScript(false),
connParams(SshConnectionParameters::NoProxy),
toolChainType(ToolChain::UNKNOWN),
startMode(NoStartMode),
executableUid(0)
......
......@@ -175,7 +175,8 @@ private:
};
MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::DeviceType devType)
: name(name),
: server(Core::SshConnectionParameters::NoProxy),
name(name),
type(devType),
portsSpec(defaultPortsSpec(type)),
internalId(MaemoDeviceConfigurations::instance().m_nextId++)
......@@ -190,7 +191,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::Dev
MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
quint64 &nextId)
: name(settings.value(NameKey).toString()),
: server(Core::SshConnectionParameters::NoProxy),
name(settings.value(NameKey).toString()),
type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())),
portsSpec(settings.value(PortsSpecKey, defaultPortsSpec(type)).toString()),
internalId(settings.value(InternalIdKey, nextId).toULongLong())
......@@ -209,7 +211,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
}
MaemoDeviceConfig::MaemoDeviceConfig()
: name(QCoreApplication::translate("MaemoDeviceConfig", "(Invalid device)")),
: server(Core::SshConnectionParameters::NoProxy),
name(QCoreApplication::translate("MaemoDeviceConfig", "(Invalid device)")),
internalId(InvalidId)
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment