Commit dd6966b2 authored by ck's avatar ck
Browse files

Maemo: Do the bind() for remote mounts on the device.

This makes us more independent of the developer PC's firewall setting.

Reviewed-by: kh1
parent 34c1c10c
...@@ -72,7 +72,6 @@ static const QLatin1String MountPortsKey(PREFIX ".MountPorts"); ...@@ -72,7 +72,6 @@ static const QLatin1String MountPortsKey(PREFIX ".MountPorts");
static const QLatin1String BaseEnvironmentBaseKey(PREFIX ".BaseEnvironmentBase"); static const QLatin1String BaseEnvironmentBaseKey(PREFIX ".BaseEnvironmentBase");
static const QLatin1String UserEnvironmentChangesKey(PREFIX ".UserEnvironmentChanges"); static const QLatin1String UserEnvironmentChangesKey(PREFIX ".UserEnvironmentChanges");
static const QLatin1String UseRemoteGdbKey(PREFIX ".UseRemoteGdb"); static const QLatin1String UseRemoteGdbKey(PREFIX ".UseRemoteGdb");
static const QLatin1String GdbMountPortKey(PREFIX ".GdbMountPort");
} // namespace Internal } // namespace Internal
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager
......
...@@ -292,7 +292,7 @@ QString MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc, ...@@ -292,7 +292,7 @@ QString MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc,
// something in the config dialog, but we will make sure we use // something in the config dialog, but we will make sure we use
// the right port from the information file. // the right port from the information file.
return devConf.type == MaemoDeviceConfig::Physical return devConf.type == MaemoDeviceConfig::Physical
? QString::number(devConf.gdbServerPort) ? QString::number(devConf.debuggingPort)
: rc->runtimeGdbServerPort(); : rc->runtimeGdbServerPort();
} }
......
...@@ -56,7 +56,7 @@ namespace { ...@@ -56,7 +56,7 @@ namespace {
const QLatin1String TypeKey("Type"); const QLatin1String TypeKey("Type");
const QLatin1String HostKey("Host"); const QLatin1String HostKey("Host");
const QLatin1String SshPortKey("SshPort"); const QLatin1String SshPortKey("SshPort");
const QLatin1String GdbServerPortKey("GdbServerPort"); const QLatin1String DebuggingPortKey("GdbServerPort");
const QLatin1String UserNameKey("Uname"); const QLatin1String UserNameKey("Uname");
const QLatin1String AuthKey("Authentication"); const QLatin1String AuthKey("Authentication");
const QLatin1String KeyFileKey("KeyFile"); const QLatin1String KeyFileKey("KeyFile");
...@@ -94,7 +94,7 @@ private: ...@@ -94,7 +94,7 @@ private:
MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::DeviceType devType) MaemoDeviceConfig::MaemoDeviceConfig(const QString &name, MaemoDeviceConfig::DeviceType devType)
: name(name), : name(name),
type(devType), type(devType),
gdbServerPort(defaultGdbServerPort(type)), debuggingPort(defaultDebuggingPort(type)),
internalId(MaemoDeviceConfigurations::instance().m_nextId++) internalId(MaemoDeviceConfigurations::instance().m_nextId++)
{ {
server.host = defaultHost(type); server.host = defaultHost(type);
...@@ -109,7 +109,7 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings, ...@@ -109,7 +109,7 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings,
quint64 &nextId) quint64 &nextId)
: name(settings.value(NameKey).toString()), : name(settings.value(NameKey).toString()),
type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())), type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())),
gdbServerPort(settings.value(GdbServerPortKey, defaultGdbServerPort(type)).toInt()), debuggingPort(settings.value(DebuggingPortKey, defaultDebuggingPort(type)).toInt()),
internalId(settings.value(InternalIdKey, nextId).toULongLong()) internalId(settings.value(InternalIdKey, nextId).toULongLong())
{ {
if (internalId == nextId) if (internalId == nextId)
...@@ -136,7 +136,7 @@ int MaemoDeviceConfig::defaultSshPort(DeviceType type) const ...@@ -136,7 +136,7 @@ int MaemoDeviceConfig::defaultSshPort(DeviceType type) const
return type == Physical ? DefaultSshPortHW : DefaultSshPortSim; return type == Physical ? DefaultSshPortHW : DefaultSshPortSim;
} }
int MaemoDeviceConfig::defaultGdbServerPort(DeviceType type) const int MaemoDeviceConfig::defaultDebuggingPort(DeviceType type) const
{ {
return type == Physical ? DefaultGdbServerPortHW : DefaultGdbServerPortSim; return type == Physical ? DefaultGdbServerPortHW : DefaultGdbServerPortSim;
} }
...@@ -157,7 +157,7 @@ void MaemoDeviceConfig::save(QSettings &settings) const ...@@ -157,7 +157,7 @@ void MaemoDeviceConfig::save(QSettings &settings) const
settings.setValue(TypeKey, type); settings.setValue(TypeKey, type);
settings.setValue(HostKey, server.host); settings.setValue(HostKey, server.host);
settings.setValue(SshPortKey, server.port); settings.setValue(SshPortKey, server.port);
settings.setValue(GdbServerPortKey, gdbServerPort); settings.setValue(DebuggingPortKey, debuggingPort);
settings.setValue(UserNameKey, server.uname); settings.setValue(UserNameKey, server.uname);
settings.setValue(AuthKey, server.authType); settings.setValue(AuthKey, server.authType);
settings.setValue(PasswordKey, server.pwd); settings.setValue(PasswordKey, server.pwd);
......
...@@ -63,12 +63,12 @@ public: ...@@ -63,12 +63,12 @@ public:
Core::SshConnectionParameters server; Core::SshConnectionParameters server;
QString name; QString name;
DeviceType type; DeviceType type;
int gdbServerPort; int debuggingPort;
quint64 internalId; quint64 internalId;
private: private:
int defaultSshPort(DeviceType type) const; int defaultSshPort(DeviceType type) const;
int defaultGdbServerPort(DeviceType type) const; int defaultDebuggingPort(DeviceType type) const;
QString defaultHost(DeviceType type) const; QString defaultHost(DeviceType type) const;
}; };
......
...@@ -39,7 +39,7 @@ const QLatin1String InvalidMountPoint("/"); ...@@ -39,7 +39,7 @@ const QLatin1String InvalidMountPoint("/");
} // anonymous namespace } // anonymous namespace
MaemoRemoteMountsModel::MountSpecification::MountSpecification(const QString &l, MaemoRemoteMountsModel::MountSpecification::MountSpecification(const QString &l,
const QString &r, int p) : localDir(l), remoteMountPoint(r), port(p) {} const QString &r, int p) : localDir(l), remoteMountPoint(r), remotePort(p) {}
bool MaemoRemoteMountsModel::MountSpecification::isValid() const bool MaemoRemoteMountsModel::MountSpecification::isValid() const
{ {
...@@ -54,10 +54,10 @@ MaemoRemoteMountsModel::MaemoRemoteMountsModel(QObject *parent) : ...@@ -54,10 +54,10 @@ MaemoRemoteMountsModel::MaemoRemoteMountsModel(QObject *parent) :
void MaemoRemoteMountsModel::addMountSpecification(const QString &localDir) void MaemoRemoteMountsModel::addMountSpecification(const QString &localDir)
{ {
int port = 10000; int port = 10100;
int i = 0; int i = 0;
while (i < rowCount()) { while (i < rowCount()) {
if (mountSpecificationAt(i).port == port) { if (mountSpecificationAt(i).remotePort == port) {
++port; ++port;
i = 0; i = 0;
} else { } else {
...@@ -114,7 +114,7 @@ QVariantMap MaemoRemoteMountsModel::toMap() const ...@@ -114,7 +114,7 @@ QVariantMap MaemoRemoteMountsModel::toMap() const
foreach (const MountSpecification &mountSpec, m_mountSpecs) { foreach (const MountSpecification &mountSpec, m_mountSpecs) {
localDirsList << mountSpec.localDir; localDirsList << mountSpec.localDir;
remoteMountPointsList << mountSpec.remoteMountPoint; remoteMountPointsList << mountSpec.remoteMountPoint;
mountPortsList << mountSpec.port; mountPortsList << mountSpec.remotePort;
} }
map.insert(ExportedLocalDirsKey, localDirsList); map.insert(ExportedLocalDirsKey, localDirsList);
map.insert(RemoteMountPointsKey, remoteMountPointsList); map.insert(RemoteMountPointsKey, remoteMountPointsList);
...@@ -157,7 +157,7 @@ QVariant MaemoRemoteMountsModel::headerData(int section, ...@@ -157,7 +157,7 @@ QVariant MaemoRemoteMountsModel::headerData(int section,
switch (section) { switch (section) {
case LocalDirRow: return tr("Local directory"); case LocalDirRow: return tr("Local directory");
case RemoteMountPointRow: return tr("Remote mount point"); case RemoteMountPointRow: return tr("Remote mount point");
case PortRow: return tr("Local port"); case PortRow: return tr("Remote port");
default: return QVariant(); default: return QVariant();
} }
} }
...@@ -179,7 +179,7 @@ QVariant MaemoRemoteMountsModel::data(const QModelIndex &index, int role) const ...@@ -179,7 +179,7 @@ QVariant MaemoRemoteMountsModel::data(const QModelIndex &index, int role) const
break; break;
case PortRow: case PortRow:
if (role == Qt::DisplayRole || role == Qt::EditRole) if (role == Qt::DisplayRole || role == Qt::EditRole)
return mountSpec.port; return mountSpec.remotePort;
break; break;
} }
return QVariant(); return QVariant();
...@@ -208,10 +208,10 @@ bool MaemoRemoteMountsModel::setData(const QModelIndex &index, ...@@ -208,10 +208,10 @@ bool MaemoRemoteMountsModel::setData(const QModelIndex &index,
case PortRow: { case PortRow: {
const int newPort = value.toInt(); const int newPort = value.toInt();
for (int i = 0; i < m_mountSpecs.count(); ++i) { for (int i = 0; i < m_mountSpecs.count(); ++i) {
if (i != index.row() && m_mountSpecs.at(i).port == newPort) if (i != index.row() && m_mountSpecs.at(i).remotePort == newPort)
return false; return false;
} }
m_mountSpecs[index.row()].port = newPort; m_mountSpecs[index.row()].remotePort = newPort;
set = true; set = true;
break; break;
} }
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
QString localDir; QString localDir;
QString remoteMountPoint; QString remoteMountPoint;
int port; int remotePort;
}; };
explicit MaemoRemoteMountsModel(QObject *parent = 0); explicit MaemoRemoteMountsModel(QObject *parent = 0);
......
...@@ -56,8 +56,7 @@ namespace Qt4ProjectManager { ...@@ -56,8 +56,7 @@ namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
namespace { namespace {
const bool DefaultUseRemoteGdbValue = false; // TODO: Make true once utfs-server works on Windows. const bool DefaultUseRemoteGdbValue = false; // TODO: Make true once it works reliably on Windows
const int DefaultGdbMountPort = 10100;
} // anonymous namespace } // anonymous namespace
using namespace ProjectExplorer; using namespace ProjectExplorer;
...@@ -67,7 +66,6 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent, ...@@ -67,7 +66,6 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
: RunConfiguration(parent, QLatin1String(MAEMO_RC_ID)) : RunConfiguration(parent, QLatin1String(MAEMO_RC_ID))
, m_proFilePath(proFilePath) , m_proFilePath(proFilePath)
, m_useRemoteGdb(DefaultUseRemoteGdbValue) , m_useRemoteGdb(DefaultUseRemoteGdbValue)
, m_gdbMountPort(DefaultGdbMountPort)
, m_baseEnvironmentBase(SystemEnvironmentBase) , m_baseEnvironmentBase(SystemEnvironmentBase)
{ {
init(); init();
...@@ -80,7 +78,6 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent, ...@@ -80,7 +78,6 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
, m_gdbPath(source->m_gdbPath) , m_gdbPath(source->m_gdbPath)
, m_arguments(source->m_arguments) , m_arguments(source->m_arguments)
, m_useRemoteGdb(source->useRemoteGdb()) , m_useRemoteGdb(source->useRemoteGdb())
, m_gdbMountPort(source->gdbMountPort())
, m_baseEnvironmentBase(source->m_baseEnvironmentBase) , m_baseEnvironmentBase(source->m_baseEnvironmentBase)
, m_systemEnvironment(source->m_systemEnvironment) , m_systemEnvironment(source->m_systemEnvironment)
, m_userEnvironmentChanges(source->m_userEnvironmentChanges) , m_userEnvironmentChanges(source->m_userEnvironmentChanges)
...@@ -150,7 +147,6 @@ QVariantMap MaemoRunConfiguration::toMap() const ...@@ -150,7 +147,6 @@ QVariantMap MaemoRunConfiguration::toMap() const
const QDir dir = QDir(target()->project()->projectDirectory()); const QDir dir = QDir(target()->project()->projectDirectory());
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath)); map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
map.insert(UseRemoteGdbKey, useRemoteGdb()); map.insert(UseRemoteGdbKey, useRemoteGdb());
map.insert(GdbMountPortKey, gdbMountPort());
map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase); map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase);
map.insert(UserEnvironmentChangesKey, map.insert(UserEnvironmentChangesKey,
ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges)); ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
...@@ -168,7 +164,6 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map) ...@@ -168,7 +164,6 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
const QDir dir = QDir(target()->project()->projectDirectory()); const QDir dir = QDir(target()->project()->projectDirectory());
m_proFilePath = dir.filePath(map.value(ProFileKey).toString()); m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool(); m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool();
m_gdbMountPort = map.value(GdbMountPortKey, DefaultGdbMountPort).toInt();
m_userEnvironmentChanges = m_userEnvironmentChanges =
ProjectExplorer::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey) ProjectExplorer::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey)
.toStringList()); .toStringList());
......
...@@ -96,8 +96,6 @@ public: ...@@ -96,8 +96,6 @@ public:
QString runtimeGdbServerPort() const; QString runtimeGdbServerPort() const;
bool useRemoteGdb() const { return m_useRemoteGdb; } bool useRemoteGdb() const { return m_useRemoteGdb; }
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; } void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
int gdbMountPort() const { return m_gdbMountPort; }
void setGdbMountPort(int port) { m_gdbMountPort = port; }
const QString gdbCmd() const; const QString gdbCmd() const;
const QString dumperLib() const; const QString dumperLib() const;
...@@ -144,7 +142,6 @@ private: ...@@ -144,7 +142,6 @@ private:
MaemoRemoteMountsModel *m_remoteMounts; MaemoRemoteMountsModel *m_remoteMounts;
QStringList m_arguments; QStringList m_arguments;
bool m_useRemoteGdb; bool m_useRemoteGdb;
int m_gdbMountPort;
BaseEnvironmentBase m_baseEnvironmentBase; BaseEnvironmentBase m_baseEnvironmentBase;
ProjectExplorer::Environment m_systemEnvironment; ProjectExplorer::Environment m_systemEnvironment;
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
#include <QtGui/QRadioButton> #include <QtGui/QRadioButton>
#include <QtGui/QSpinBox>
#include <QtGui/QTableView> #include <QtGui/QTableView>
#include <QtGui/QToolButton> #include <QtGui/QToolButton>
...@@ -132,9 +131,7 @@ void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout) ...@@ -132,9 +131,7 @@ void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
m_debugDetailsContainer = new Utils::DetailsWidget(this); m_debugDetailsContainer = new Utils::DetailsWidget(this);
QWidget *debugWidget = new QWidget; QWidget *debugWidget = new QWidget;
m_debugDetailsContainer->setWidget(debugWidget); m_debugDetailsContainer->setWidget(debugWidget);
#ifndef Q_OS_WIN
mainLayout->addWidget(m_debugDetailsContainer); mainLayout->addWidget(m_debugDetailsContainer);
#endif
QFormLayout *debugLayout = new QFormLayout(debugWidget); QFormLayout *debugLayout = new QFormLayout(debugWidget);
QHBoxLayout *debugRadioButtonsLayout = new QHBoxLayout; QHBoxLayout *debugRadioButtonsLayout = new QHBoxLayout;
debugLayout->addRow(debugRadioButtonsLayout); debugLayout->addRow(debugRadioButtonsLayout);
...@@ -147,17 +144,6 @@ void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout) ...@@ -147,17 +144,6 @@ void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
gdbServerButton->setChecked(!gdbButton->isChecked()); gdbServerButton->setChecked(!gdbButton->isChecked());
connect(gdbButton, SIGNAL(toggled(bool)), this, connect(gdbButton, SIGNAL(toggled(bool)), this,
SLOT(handleDebuggingTypeChanged(bool))); SLOT(handleDebuggingTypeChanged(bool)));
QHBoxLayout *spinBoxLayout = new QHBoxLayout;
m_gdbMountPortSpinBox = new QSpinBox;
m_gdbMountPortSpinBox->setMinimum(1024);
m_gdbMountPortSpinBox->setMaximum((1 << 16) - 1);
spinBoxLayout->addWidget(m_gdbMountPortSpinBox);
spinBoxLayout->addStretch(1);
debugLayout->addRow(tr("Local port for mounting the project directory:"),
spinBoxLayout);
m_gdbMountPortSpinBox->setValue(m_runConfiguration->gdbMountPort());
connect(m_gdbMountPortSpinBox, SIGNAL(valueChanged(int)), this,
SLOT(handleGdbMountPortChanged(int)));
handleDebuggingTypeChanged(gdbButton->isChecked()); handleDebuggingTypeChanged(gdbButton->isChecked());
} }
...@@ -167,9 +153,7 @@ void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout) ...@@ -167,9 +153,7 @@ void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout)
m_mountDetailsContainer = new Utils::DetailsWidget(this); m_mountDetailsContainer = new Utils::DetailsWidget(this);
QWidget *mountViewWidget = new QWidget; QWidget *mountViewWidget = new QWidget;
m_mountDetailsContainer->setWidget(mountViewWidget); m_mountDetailsContainer->setWidget(mountViewWidget);
#ifndef Q_OS_WIN
mainLayout->addWidget(m_mountDetailsContainer); mainLayout->addWidget(m_mountDetailsContainer);
#endif
QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget); QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget);
QHBoxLayout *tableLayout = new QHBoxLayout; QHBoxLayout *tableLayout = new QHBoxLayout;
mountViewLayout->addLayout(tableLayout); mountViewLayout->addLayout(tableLayout);
...@@ -339,12 +323,6 @@ void MaemoRunConfigurationWidget::handleDebuggingTypeChanged(bool useGdb) ...@@ -339,12 +323,6 @@ void MaemoRunConfigurationWidget::handleDebuggingTypeChanged(bool useGdb)
const QString detailsText = useGdb ? tr("Use gdb") : tr("Use gdbserver"); const QString detailsText = useGdb ? tr("Use gdb") : tr("Use gdbserver");
m_debugDetailsContainer->setSummaryText(tr("<b>Debugging details:</b> ") m_debugDetailsContainer->setSummaryText(tr("<b>Debugging details:</b> ")
+ detailsText); + detailsText);
m_gdbMountPortSpinBox->setEnabled(useGdb);
}
void MaemoRunConfigurationWidget::handleGdbMountPortChanged(int port)
{
m_runConfiguration->setGdbMountPort(port);
} }
void MaemoRunConfigurationWidget::fetchEnvironment() void MaemoRunConfigurationWidget::fetchEnvironment()
......
...@@ -43,7 +43,6 @@ class QLabel; ...@@ -43,7 +43,6 @@ class QLabel;
class QLineEdit; class QLineEdit;
class QModelIndex; class QModelIndex;
class QPushButton; class QPushButton;
class QSpinBox;
class QTableView; class QTableView;
class QToolButton; class QToolButton;
class QVBoxLayout; class QVBoxLayout;
...@@ -81,7 +80,6 @@ private slots: ...@@ -81,7 +80,6 @@ private slots:
void changeLocalMountDir(const QModelIndex &index); void changeLocalMountDir(const QModelIndex &index);
void enableOrDisableRemoveMountSpecButton(); void enableOrDisableRemoveMountSpecButton();
void handleDebuggingTypeChanged(bool useGdb); void handleDebuggingTypeChanged(bool useGdb);
void handleGdbMountPortChanged(int port);
void fetchEnvironment(); void fetchEnvironment();
void fetchEnvironmentFinished(); void fetchEnvironmentFinished();
void userChangesEdited(); void userChangesEdited();
...@@ -101,7 +99,6 @@ private: ...@@ -101,7 +99,6 @@ private:
QLineEdit *m_argsLineEdit; QLineEdit *m_argsLineEdit;
QLabel *m_executableLabel; QLabel *m_executableLabel;
QComboBox *m_devConfBox; QComboBox *m_devConfBox;
QSpinBox *m_gdbMountPortSpinBox;
QTableView *m_mountView; QTableView *m_mountView;
QToolButton *m_removeMountButton; QToolButton *m_removeMountButton;
Utils::DetailsWidget *m_mountDetailsContainer; Utils::DetailsWidget *m_mountDetailsContainer;
......
...@@ -114,7 +114,7 @@ QString MaemoSettingsWidget::searchKeywords() const ...@@ -114,7 +114,7 @@ QString MaemoSettingsWidget::searchKeywords() const
{ {
QString rc; QString rc;
QTextStream(&rc) << m_ui->configurationLabel->text() QTextStream(&rc) << m_ui->configurationLabel->text()
<< ' ' << m_ui->gdbServerLabel->text() << ' ' << m_ui->debuggingPortLabel->text()
<< ' ' << m_ui->sshPortLabel->text() << ' ' << m_ui->sshPortLabel->text()
<< ' ' << m_ui->keyButton->text() << ' ' << m_ui->keyButton->text()
<< ' ' << m_ui->passwordButton->text() << ' ' << m_ui->passwordButton->text()
...@@ -213,7 +213,7 @@ void MaemoSettingsWidget::fillInValues() ...@@ -213,7 +213,7 @@ void MaemoSettingsWidget::fillInValues()
m_ui->nameLineEdit->setText(currentConfig().name); m_ui->nameLineEdit->setText(currentConfig().name);
m_ui->hostLineEdit->setText(currentConfig().server.host); m_ui->hostLineEdit->setText(currentConfig().server.host);
m_ui->sshPortSpinBox->setValue(currentConfig().server.port); m_ui->sshPortSpinBox->setValue(currentConfig().server.port);
m_ui->gdbServerPortSpinBox->setValue(currentConfig().gdbServerPort); m_ui->gdbServerPortSpinBox->setValue(currentConfig().debuggingPort);
m_ui->timeoutSpinBox->setValue(currentConfig().server.timeout); m_ui->timeoutSpinBox->setValue(currentConfig().server.timeout);
m_ui->userLineEdit->setText(currentConfig().server.uname); m_ui->userLineEdit->setText(currentConfig().server.uname);
m_ui->pwdLineEdit->setText(currentConfig().server.pwd); m_ui->pwdLineEdit->setText(currentConfig().server.pwd);
...@@ -295,7 +295,7 @@ void MaemoSettingsWidget::sshPortEditingFinished() ...@@ -295,7 +295,7 @@ void MaemoSettingsWidget::sshPortEditingFinished()
void MaemoSettingsWidget::gdbServerPortEditingFinished() void MaemoSettingsWidget::gdbServerPortEditingFinished()
{ {
currentConfig().gdbServerPort = m_ui->gdbServerPortSpinBox->value(); currentConfig().debuggingPort = m_ui->gdbServerPortSpinBox->value();
} }
void MaemoSettingsWidget::timeoutEditingFinished() void MaemoSettingsWidget::timeoutEditingFinished()
......
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="gdbServerLabel"> <widget class="QLabel" name="debuggingPortLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred"> <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Gdb server:</string> <string>Debugging:</string>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -87,7 +87,7 @@ void MaemoSshRunner::start() ...@@ -87,7 +87,7 @@ void MaemoSshRunner::start()
m_mountSpecs << MaemoRemoteMountsModel::MountSpecification( m_mountSpecs << MaemoRemoteMountsModel::MountSpecification(
m_runConfig->localDirToMountForRemoteGdb(), m_runConfig->localDirToMountForRemoteGdb(),
MaemoGlobal::remoteProjectSourcesMountPoint(), MaemoGlobal::remoteProjectSourcesMountPoint(),
m_runConfig->gdbMountPort()); m_devConfig.debuggingPort);
} }
m_stop = false; m_stop = false;
...@@ -252,10 +252,10 @@ void MaemoSshRunner::handleUploadFinished(Core::SftpJobId jobId, ...@@ -252,10 +252,10 @@ void MaemoSshRunner::handleUploadFinished(Core::SftpJobId jobId,
return; return;
} }
mount(); startUtfsClients();
} }
void MaemoSshRunner::mount() void MaemoSshRunner::startUtfsClients()
{ {
const QString chmodFuse const QString chmodFuse
= MaemoGlobal::remoteSudo() + QLatin1String(" chmod a+r+w /dev/fuse"); = MaemoGlobal::remoteSudo() + QLatin1String(" chmod a+r+w /dev/fuse");
...@@ -266,43 +266,34 @@ void MaemoSshRunner::mount() ...@@ -266,43 +266,34 @@ void MaemoSshRunner::mount()
for (int i = 0; i < m_mountSpecs.count(); ++i) { for (int i = 0; i < m_mountSpecs.count(); ++i) {
const MaemoRemoteMountsModel::MountSpecification &mountSpec const MaemoRemoteMountsModel::MountSpecification &mountSpec
= m_mountSpecs.at(i); = m_mountSpecs.at(i);
QProcess * const utfsServerProc = new QProcess(this); const QString port = QString::number(mountSpec.remotePort);
connect(utfsServerProc, SIGNAL(readyReadStandardError()), this,
SLOT(handleUtfsServerErrorOutput()));
const QString port = QString::number(mountSpec.port);
const QString localSecretOpt = QLatin1String("-l");
const QString remoteSecretOpt = QLatin1String("-r");
const QStringList utfsServerArgs = QStringList() << localSecretOpt
<< port << remoteSecretOpt << port << QLatin1String("-b") << port
<< mountSpec.localDir;
utfsServerProc->start(utfsServer(), utfsServerArgs);
if (!utfsServerProc->waitForStarted()) {
delete utfsServerProc;
emit error(tr("Could not start UTFS server: %1")
.arg(utfsServerProc->errorString()));
return;
}
m_utfsServers << utfsServerProc;
const QString mkdir = QString::fromLocal8Bit("%1 mkdir -p %2") const QString mkdir = QString::fromLocal8Bit("%1 mkdir -p %2")
.arg(MaemoGlobal::remoteSudo(), mountSpec.remoteMountPoint); .arg(MaemoGlobal::remoteSudo(), mountSpec.remoteMountPoint);
const QString chmod = QString::fromLocal8Bit("%1 chmod a+r+w+x %2")