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 @@ ...@@ -42,6 +42,7 @@
#include <QtCore/QFile> #include <QtCore/QFile>
#include <QtCore/QMutex> #include <QtCore/QMutex>
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QTcpSocket> #include <QtNetwork/QTcpSocket>
namespace Core { namespace Core {
...@@ -68,8 +69,8 @@ namespace { ...@@ -68,8 +69,8 @@ namespace {
} // anonymous namespace } // anonymous namespace
SshConnectionParameters::SshConnectionParameters() : SshConnectionParameters::SshConnectionParameters(ProxyType proxyType) :
timeout(0), authType(AuthByKey), port(0) timeout(0), authType(AuthByKey), port(0), proxyType(proxyType)
{ {
} }
...@@ -176,6 +177,7 @@ SshConnectionPrivate::SshConnectionPrivate(SshConnection *conn) ...@@ -176,6 +177,7 @@ SshConnectionPrivate::SshConnectionPrivate(SshConnection *conn)
: m_socket(new QTcpSocket(this)), m_state(SocketUnconnected), : m_socket(new QTcpSocket(this)), m_state(SocketUnconnected),
m_sendFacility(m_socket), m_sendFacility(m_socket),
m_channelManager(new SshChannelManager(m_sendFacility, this)), m_channelManager(new SshChannelManager(m_sendFacility, this)),
m_connParams(SshConnectionParameters::DefaultProxy),
m_error(SshNoError), m_ignoreNextPacket(false), m_conn(conn) m_error(SshNoError), m_ignoreNextPacket(false), m_conn(conn)
{ {
setupPacketHandlers(); setupPacketHandlers();
...@@ -551,6 +553,8 @@ void SshConnectionPrivate::connectToHost(const SshConnectionParameters &serverIn ...@@ -551,6 +553,8 @@ void SshConnectionPrivate::connectToHost(const SshConnectionParameters &serverIn
this->m_connParams = serverInfo; this->m_connParams = serverInfo;
m_state = SocketConnecting; m_state = SocketConnecting;
m_timeoutTimer.start(m_connParams.timeout * 1000); 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); m_socket->connectToHost(serverInfo.host, serverInfo.port);
} }
......
...@@ -49,7 +49,8 @@ class SshConnectionPrivate; ...@@ -49,7 +49,8 @@ class SshConnectionPrivate;
struct CORE_EXPORT SshConnectionParameters struct CORE_EXPORT SshConnectionParameters
{ {
SshConnectionParameters(); enum ProxyType { DefaultProxy, NoProxy };
SshConnectionParameters(ProxyType proxyType);
QString host; QString host;
QString uname; QString uname;
...@@ -58,6 +59,7 @@ struct CORE_EXPORT SshConnectionParameters ...@@ -58,6 +59,7 @@ struct CORE_EXPORT SshConnectionParameters
int timeout; int timeout;
enum AuthType { AuthByPwd, AuthByKey } authType; enum AuthType { AuthByPwd, AuthByKey } authType;
quint16 port; quint16 port;
ProxyType proxyType;
}; };
CORE_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2); CORE_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
......
...@@ -114,6 +114,7 @@ DebuggerStartParameters::DebuggerStartParameters() : ...@@ -114,6 +114,7 @@ DebuggerStartParameters::DebuggerStartParameters() :
qmlServerAddress("127.0.0.1"), qmlServerAddress("127.0.0.1"),
qmlServerPort(0), qmlServerPort(0),
useServerStartScript(false), useServerStartScript(false),
connParams(SshConnectionParameters::NoProxy),
toolChainType(ToolChain::UNKNOWN), toolChainType(ToolChain::UNKNOWN),
startMode(NoStartMode), startMode(NoStartMode),
executableUid(0) executableUid(0)
......
...@@ -175,7 +175,8 @@ private: ...@@ -175,7 +175,8 @@ private:
}; };
MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::DeviceType devType) MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::DeviceType devType)
: name(name), : server(Core::SshConnectionParameters::NoProxy),
name(name),
type(devType), type(devType),
portsSpec(defaultPortsSpec(type)), portsSpec(defaultPortsSpec(type)),
internalId(MaemoDeviceConfigurations::instance().m_nextId++) internalId(MaemoDeviceConfigurations::instance().m_nextId++)
...@@ -190,7 +191,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::Dev ...@@ -190,7 +191,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::Dev
MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings, MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
quint64 &nextId) 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())), type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())),
portsSpec(settings.value(PortsSpecKey, defaultPortsSpec(type)).toString()), portsSpec(settings.value(PortsSpecKey, defaultPortsSpec(type)).toString()),
internalId(settings.value(InternalIdKey, nextId).toULongLong()) internalId(settings.value(InternalIdKey, nextId).toULongLong())
...@@ -209,7 +211,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings, ...@@ -209,7 +211,8 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
} }
MaemoDeviceConfig::MaemoDeviceConfig() MaemoDeviceConfig::MaemoDeviceConfig()
: name(QCoreApplication::translate("MaemoDeviceConfig", "(Invalid device)")), : server(Core::SshConnectionParameters::NoProxy),
name(QCoreApplication::translate("MaemoDeviceConfig", "(Invalid device)")),
internalId(InvalidId) 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