From 1fa20b3838f03fc5fa4023ef9096ef423b15b527 Mon Sep 17 00:00:00 2001
From: ck <qt-info@nokia.com>
Date: Mon, 8 Feb 2010 17:02:27 +0100
Subject: [PATCH] Maemo: Removed ifdefs for old ssh approach.

---
 .../qt-maemo/maemoruncontrol.cpp              | 258 +-----------------
 .../qt-maemo/maemoruncontrol.h                |  35 +--
 .../qt-maemo/maemosettingswidget.cpp          |  36 +--
 .../qt-maemo/maemosettingswidget.h            |   8 +-
 .../qt-maemo/maemosshconnection.cpp           |   4 -
 .../qt-maemo/maemosshconnection.h             |   4 -
 .../qt-maemo/maemosshthread.cpp               |   4 -
 .../qt-maemo/maemosshthread.h                 |   4 -
 .../qt4projectmanager/qt-maemo/qt-maemo.pri   |   1 -
 9 files changed, 10 insertions(+), 344 deletions(-)

diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
index 2351d6611d5..26a3660ed85 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
@@ -36,11 +36,6 @@
 
 #include "maemorunconfiguration.h"
 
-#ifndef USE_SSH_LIB
-#include "qt4buildconfiguration.h"
-#include "qt4project.h"
-#endif // USE_SSH_LIB
-
 #include <coreplugin/icore.h>
 #include <coreplugin/progressmanager/progressmanager.h>
 #include <debugger/debuggermanager.h>
@@ -56,9 +51,6 @@
 namespace Qt4ProjectManager {
 namespace Internal {
 
-#ifndef USE_SSH_LIB
-using ProjectExplorer::Environment;
-#endif // USE_SSH_LIB
 using ProjectExplorer::RunConfiguration;
 using ProjectExplorer::ToolChain;
 
@@ -67,26 +59,12 @@ AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc)
     , runConfig(qobject_cast<MaemoRunConfiguration *>(rc))
     , devConfig(runConfig ? runConfig->deviceConfig() : MaemoDeviceConfig())
 {
-#ifndef USE_SSH_LIB
-    setProcessEnvironment(deployProcess);
-    connect(&deployProcess, SIGNAL(readyReadStandardError()), this,
-        SLOT(readStandardError()));
-    connect(&deployProcess, SIGNAL(readyReadStandardOutput()), this,
-        SLOT(readStandardOutput()));
-    connect(&deployProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this,
-        SLOT(deployProcessFinished()));
-#endif // USE_SSH_LIB
-    qDebug("%s: runconfig = %p, exdecutable = %s", Q_FUNC_INFO, runConfig, qPrintable(runConfig->executable()));
 }
 
 void AbstractMaemoRunControl::startDeployment(bool forDebugging)
 {
     QTC_ASSERT(runConfig, return);
 
-#ifndef USE_SSH_LIB
-    Core::ICore::instance()->progressManager()->addTask(m_progress.future(),
-        tr("Deploying"), QLatin1String("Maemo.Deploy"));
-#endif // USE_SSH_LIB
     if (devConfig.isValid()) {
         deployables.clear();        
         if (runConfig->currentlyNeedsDeployment()) {
@@ -100,24 +78,14 @@ void AbstractMaemoRunControl::startDeployment(bool forDebugging)
                 &MaemoRunConfiguration::debuggingHelpersDeployed));
         }
 
-#ifndef USE_SSH_LIB
-        m_progress.setProgressRange(0, deployables.count());
-        m_progress.setProgressValue(0);
-        m_progress.reportStarted();
-#endif // USE_SSH_LIB
         deploy();
     } else {
-#ifdef USE_SSH_LIB
         handleDeploymentFinished(false);
-#else
-        deploymentFinished(false);
-#endif // USE_SSH_LIB
     }
 }
 
 void AbstractMaemoRunControl::deploy()
 {
-#ifdef USE_SSH_LIB
     if (!deployables.isEmpty()) {
         QList<SshDeploySpec> deploySpecs;
         QStringList files;
@@ -146,60 +114,27 @@ void AbstractMaemoRunControl::deploy()
     } else {
         handleDeploymentFinished(true);
     }
-#else
-    if (!deployables.isEmpty()) {
-        const Deployable &deployable = deployables.first();
-        emit addToOutputWindow(this, tr("File to deploy: %1.").arg(deployable.fileName));
-
-        QStringList cmdArgs;
-        cmdArgs << "-P" << sshPort() << options() << deployable.fileName
-            << (devConfig.uname % QLatin1Char('@') % devConfig.host
-                % QLatin1Char(':') % remoteDir());
-        deployProcess.setWorkingDirectory(deployable.dir);
-
-        deployProcess.start(runConfig->scpCmd(), cmdArgs);
-        if (!deployProcess.waitForStarted()) {
-            emit error(this, tr("Could not start scp. Deployment failed."));
-            deployProcess.kill();
-        } else {
-            emit started();
-        }
-    } else {
-        deploymentFinished(true);
-    }
-#endif // USE_SSH_LIB
 }
 
-#ifdef USE_SSH_LIB
 void AbstractMaemoRunControl::handleFileCopied()
 {
     Deployable deployable = deployables.takeFirst();
     (runConfig->*deployable.updateTimestamp)();
     m_progress.setProgressValue(m_progress.progressValue() + 1);
 }
-#endif // USE_SSH_LIB
 
 void AbstractMaemoRunControl::stopDeployment()
 {
-#ifdef USE_SSH_LIB
     sshDeployer->stop();
-#else
-    deployProcess.kill();
-#endif // USE_SSH_LIB
 }
 
 bool AbstractMaemoRunControl::isDeploying() const
 {
-#ifdef USE_SSH_LIB
     return !sshDeployer.isNull() && sshDeployer->isRunning();
-#else
-    return deployProcess.state() != QProcess::NotRunning;
-#endif // USE_SSH_LIB
 }
 
 void AbstractMaemoRunControl::deployProcessFinished()
 {
-#if USE_SSH_LIB
     const bool success = !sshDeployer->hasError();
     if (success) {
         emit addToOutputWindow(this, tr("Deployment finished."));
@@ -209,33 +144,8 @@ void AbstractMaemoRunControl::deployProcessFinished()
     }
     m_progress.reportFinished();
     handleDeploymentFinished(success);
-#else
-    bool success;
-    if (deployProcess.exitCode() == 0) {
-        emit addToOutputWindow(this, tr("Target deployed."));
-        success = true;
-        Deployable deployable = deployables.takeFirst();
-        (runConfig->*deployable.updateTimestamp)();
-        m_progress.setProgressValue(m_progress.progressValue() + 1);
-    } else {
-        emit error(this, tr("Deployment failed."));
-        success = false;
-    }
-    if (deployables.isEmpty() || !success)
-        deploymentFinished(success);
-    else
-        deploy();
-#endif // USE_SSH_LIB
 }
 
-#ifndef USE_SSH_LIB
-void AbstractMaemoRunControl::deploymentFinished(bool success)
-{
-    m_progress.reportFinished();
-    handleDeploymentFinished(success);
-}
-#endif // USE_SSH_LIB
-
 const QString AbstractMaemoRunControl::executableOnHost() const
 {
     qDebug("runconfig->executable: %s", qPrintable(runConfig->executable()));
@@ -289,62 +199,15 @@ const QString AbstractMaemoRunControl::targetCmdLinePrefix() const
         arg(executableOnTarget());
 }
 
-#ifndef USE_SSH_LIB
-bool AbstractMaemoRunControl::setProcessEnvironment(QProcess &process)
-{
-    QTC_ASSERT(runConfig, return false);
-    Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration*>
-        (runConfig->project()->activeBuildConfiguration());
-    QTC_ASSERT(qt4bc, return false);
-    Environment env = Environment::systemEnvironment();
-    qt4bc->toolChain()->addToEnvironment(env);
-    process.setEnvironment(env.toStringList());
-
-    return true;
-}
-
-void AbstractMaemoRunControl::readStandardError()
-{
-    QProcess *process = static_cast<QProcess *>(sender());
-    const QByteArray &data = process->readAllStandardError();
-    emit addToOutputWindow(this, QString::fromLocal8Bit(data.constData(),
-        data.length()));
-}
-
-void AbstractMaemoRunControl::readStandardOutput()
-{
-    QProcess *process = static_cast<QProcess *>(sender());
-    const QByteArray &data = process->readAllStandardOutput();
-    emit addToOutputWindow(this, QString::fromLocal8Bit(data.constData(),
-        data.length()));
-}
-#endif // USE_SSH_LIB
-
-// #pragma mark -- MaemoRunControl
-
 
 MaemoRunControl::MaemoRunControl(RunConfiguration *runConfiguration)
     : AbstractMaemoRunControl(runConfiguration)
 {
-#ifndef USE_SSH_LIB
-    setProcessEnvironment(sshProcess);
-    setProcessEnvironment(stopProcess);
-
-    connect(&sshProcess, SIGNAL(readyReadStandardError()), this,
-        SLOT(readStandardError()));
-    connect(&sshProcess, SIGNAL(readyReadStandardOutput()), this,
-        SLOT(readStandardOutput()));
-    connect(&sshProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this,
-        SLOT(executionFinished()));
-#endif // USE_SSH_LIB
 }
 
 MaemoRunControl::~MaemoRunControl()
 {
     stop();
-#ifndef USE_SSH_LIB
-    stopProcess.waitForFinished(5000);
-#endif
 }
 
 void MaemoRunControl::start()
@@ -363,7 +226,6 @@ void MaemoRunControl::handleDeploymentFinished(bool success)
 
 void MaemoRunControl::startExecution()
 {
-#ifdef USE_SSH_LIB
     const QString remoteCall = QString::fromLocal8Bit("%1 %2 %3")
         .arg(targetCmdLinePrefix()).arg(executableOnTarget())
         .arg(runConfig->arguments().join(" "));
@@ -375,41 +237,18 @@ void MaemoRunControl::startExecution()
     emit addToOutputWindow(this, tr("Starting remote application."));
     emit started();
     sshRunner->start();
-#else
-    const QString remoteCall = QString::fromLocal8Bit("%1 %2 %3")
-        .arg(targetCmdLinePrefix()).arg(executableOnTarget())
-        .arg(runConfig->arguments().join(" "));
-
-    QStringList cmdArgs;
-    cmdArgs << "-n" << "-p" << sshPort() << "-l" << devConfig.uname
-        << options() << devConfig.host << remoteCall;
-    sshProcess.start(runConfig->sshCmd(), cmdArgs);
-
-    sshProcess.start(runConfig->sshCmd(), cmdArgs);
-    emit addToOutputWindow(this, tr("Starting remote application."));
-    if (sshProcess.waitForStarted()) {
-        emit started();
-    } else {
-        emit error(this, tr("Could not start ssh!"));
-        sshProcess.kill();
-    }
-#endif // USE_SSH_LIB
 }
 
 void MaemoRunControl::executionFinished()
 {
-    if (stoppedByUser)
+    if (stoppedByUser) {
         emit addToOutputWindow(this, tr("Remote process stopped by user."));
-#ifdef USE_SSH_LIB
-    else if (sshRunner->hasError())
+    } else if (sshRunner->hasError()) {
         emit addToOutputWindow(this, tr("Remote process exited with error: ")
                                % sshRunner->error());
-#else
-    else if (sshProcess.exitCode() != 0)
-        emit addToOutputWindow(this, tr("Remote process exited with error."));
-#endif // USE_SSH_LIB
-    else
+    } else {
         emit addToOutputWindow(this, tr("Remote process finished successfully."));
+    }
     emit finished();
 }
 
@@ -422,55 +261,31 @@ void MaemoRunControl::stop()
     if (isDeploying()) {
         stopDeployment();
     } else {
-#ifdef USE_SSH_LIB
         sshRunner->stop();
         const QString remoteCall = QString::fromLocal8Bit("pkill -x %1; "
             "sleep 1; pkill -x -9 %1").arg(executableFileName());
         sshStopper.reset(new MaemoSshRunner(devConfig, remoteCall));
         sshStopper->start();
-#else
-        stopProcess.kill();
-        QStringList cmdArgs;
-        const QString remoteCall = QString::fromLocal8Bit("pkill -x %1; "
-            "sleep 1; pkill -x -9 %1").arg(executableFileName());
-        cmdArgs << "-n" << "-p" << sshPort() << "-l" << devConfig.uname
-            << options() << devConfig.host << remoteCall;
-        stopProcess.start(runConfig->sshCmd(), cmdArgs);
-#endif // USE_SSH_LIB
     }
 }
 
 bool MaemoRunControl::isRunning() const
 {
     return isDeploying()
-#ifdef USE_SSH_LIB
         || (!sshRunner.isNull() && sshRunner->isRunning());
-#else
-        || sshProcess.state() != QProcess::NotRunning;
-#endif // USE_SSH_LIB
 }
 
-#ifdef USE_SSH_LIB
 void MaemoRunControl::handleRemoteOutput(const QString &output)
 {
     emit addToOutputWindowInline(this, output);
 }
 
-#endif // USE_SSH_LIB
-
-// #pragma mark -- MaemoDebugRunControl
-
 
 MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration)
     : AbstractMaemoRunControl(runConfiguration)
     , debuggerManager(0)
     , startParams(new Debugger::DebuggerStartParameters)
 {
-#ifndef USE_SSH_LIB
-    setProcessEnvironment(gdbServer);
-    setProcessEnvironment(stopProcess);
-#endif // USE_SSH_LIB
-
     debuggerManager = ExtensionSystem::PluginManager::instance()
         ->getObject<Debugger::DebuggerManager>();
 
@@ -522,20 +337,10 @@ void MaemoDebugRunControl::startGdbServer()
         arg(targetCmdLinePrefix()).arg(gdbServerPort())
         .arg(executableOnTarget()).arg(runConfig->arguments().join(" ")));
     inferiorPid = -1;
-#ifdef USE_SSH_LIB
     sshRunner.reset(new MaemoSshRunner(devConfig, remoteCall));
     connect(sshRunner.data(), SIGNAL(remoteOutput(QString)),
             this, SLOT(gdbServerStarted(QString)));
     sshRunner->start();
-#else
-    QStringList sshArgs;
-    sshArgs << "-t" << "-n" << "-l" << devConfig.uname << "-p"
-        << sshPort() << options() << devConfig.host << remoteCall;
-    disconnect(&gdbServer, SIGNAL(readyReadStandardError()), 0, 0);
-    connect(&gdbServer, SIGNAL(readyReadStandardError()), this,
-        SLOT(gdbServerStarted()));
-    gdbServer.start(runConfig->sshCmd(), sshArgs);
-#endif // USE_SSH_LIB
 }
 
 void MaemoDebugRunControl::gdbServerStartFailed(const QString &reason)
@@ -545,7 +350,6 @@ void MaemoDebugRunControl::gdbServerStartFailed(const QString &reason)
     emit finished();
 }
 
-#ifdef USE_SSH_LIB
 void MaemoDebugRunControl::gdbServerStarted(const QString &output)
 {
     qDebug("gdbserver's stderr output: %s", output.toLatin1().data());
@@ -575,43 +379,6 @@ void MaemoDebugRunControl::gdbServerStarted(const QString &output)
     disconnect(sshRunner.data(), SIGNAL(remoteOutput(QString)), 0, 0);
     startDebugging();
 }
-#else
-void MaemoDebugRunControl::gdbServerStarted()
-{
-    const QByteArray output = gdbServer.readAllStandardError();
-    qDebug("gdbserver's stderr output: %s", output.data());
-
-    const QByteArray searchString("pid = ");
-    const int searchStringLength = searchString.length();
-
-    int pidStartPos = output.indexOf(searchString);
-    const int pidEndPos = output.indexOf("\n", pidStartPos + searchStringLength);
-    if (pidStartPos == -1 || pidEndPos == -1) {
-        gdbServerStartFailed(output.data());
-        return;
-    }
-
-    pidStartPos += searchStringLength;
-    QByteArray pidString = output.mid(pidStartPos, pidEndPos - pidStartPos);
-    qDebug("pidString = %s", pidString.data());
-
-    bool ok;
-    const int pid = pidString.toInt(&ok);
-    if (!ok) {
-        gdbServerStartFailed(tr("Debugging failed, could not parse gdb "
-            "server pid!"));
-        return;
-    }
-
-    inferiorPid = pid;
-    qDebug("inferiorPid = %d", inferiorPid);
-
-    disconnect(&gdbServer, SIGNAL(readyReadStandardError()), 0, 0);
-    connect(&gdbServer, SIGNAL(readyReadStandardError()), this,
-        SLOT(readStandardError()));
-    startDebugging();
-}
-#endif // USE_SSH_LIB
 
 void MaemoDebugRunControl::startDebugging()
 {
@@ -633,17 +400,12 @@ void MaemoDebugRunControl::stop()
 bool MaemoDebugRunControl::isRunning() const
 {
     return isDeploying()
-#ifdef USE_SSH_LIB
         || (!sshRunner.isNull() && sshRunner->isRunning())
-#else
-        || gdbServer.state() != QProcess::NotRunning
-#endif // USE_SSH_LIB
         || debuggerManager->state() != Debugger::DebuggerNotReady;
 }
 
 void MaemoDebugRunControl::debuggingFinished()
 {
-#ifdef USE_SSH_LIB
     if (!sshRunner.isNull() && sshRunner->isRunning()) {
         sshRunner->stop();
         const QString remoteCall = QString::fromLocal8Bit("kill %1; sleep 1; "
@@ -651,18 +413,6 @@ void MaemoDebugRunControl::debuggingFinished()
         sshStopper.reset(new MaemoSshRunner(devConfig, remoteCall));
         sshStopper->start();
     }
-#else
-    if (gdbServer.state() != QProcess::NotRunning) {
-        stopProcess.kill();
-        const QString remoteCall = QString::fromLocal8Bit("kill %1; sleep 1; "
-            "kill -9 %1; pkill -x -9 gdbserver").arg(inferiorPid);
-        QStringList sshArgs;
-        sshArgs << "-n" << "-l" << devConfig.uname << "-p" << sshPort()
-            << options() << devConfig.host << remoteCall;
-        stopProcess.start(runConfig->sshCmd(), sshArgs);
-    }
-    qDebug("ssh return code is %d", gdbServer.exitCode());
-#endif // USE_SSH_LIB
     emit addToOutputWindow(this, tr("Debugging finished."));
     emit finished();
 }
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h
index 5cef957ea39..18c923b92a0 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h
@@ -41,9 +41,6 @@
 #include <projectexplorer/runconfiguration.h>
 
 #include <QtCore/QFutureInterface>
-#ifndef USE_SSH_LIB
-#include <QtCore/QProcess>
-#endif
 #include <QtCore/QScopedPointer>
 #include <QtCore/QString>
 
@@ -77,19 +74,9 @@ protected:
     const QString targetCmdLinePrefix() const;
     const QString remoteDir() const;
     const QStringList options() const;
-#ifndef USE_SSH_LIB
-    void deploymentFinished(bool success);
-    virtual bool setProcessEnvironment(QProcess &process);
-#endif // USE_SSH_LIB
 private slots:
-#ifndef USE_SSH_LIB
-    void readStandardError();
-    void readStandardOutput();
-#endif // USE_SSH_LIB
     void deployProcessFinished();
-#ifdef USE_SSH_LIB
     void handleFileCopied();
-#endif
 
 protected:
     MaemoRunConfiguration *runConfig; // TODO this pointer can be invalid
@@ -99,11 +86,8 @@ private:
     virtual void handleDeploymentFinished(bool success)=0;
 
     QFutureInterface<void> m_progress;
-#ifdef USE_SSH_LIB
     QScopedPointer<MaemoSshDeployer> sshDeployer;
-#else
-    QProcess deployProcess;
-#endif // USE_SSH_LIB
+
     struct Deployable
     {
         typedef void (MaemoRunConfiguration::*updateFunc)();
@@ -128,21 +112,14 @@ public:
 
 private slots:
     void executionFinished();
-#ifdef USE_SSH_LIB
     void handleRemoteOutput(const QString &output);
-#endif
 
 private:
     virtual void handleDeploymentFinished(bool success);
     void startExecution();
 
-#ifdef USE_SSH_LIB
     QScopedPointer<MaemoSshRunner> sshRunner;
     QScopedPointer<MaemoSshRunner> sshStopper;
-#else
-    QProcess sshProcess;
-    QProcess stopProcess;
-#endif // USE_SSH_LIB
     bool stoppedByUser;
 };
 
@@ -161,12 +138,7 @@ signals:
     void stopRequested();
 
 private slots:
-#ifdef USE_SSH_LIB
     void gdbServerStarted(const QString &output);
-#else
-    void gdbServerStarted();
-#endif // USE_SSH_LIB
-
     void debuggerOutput(const QString &output);
 
 private:
@@ -177,13 +149,8 @@ private:
     void gdbServerStartFailed(const QString &reason);
     void startDebugging();
 
-#ifdef USE_SSH_LIB
     QScopedPointer<MaemoSshRunner> sshRunner;
     QScopedPointer<MaemoSshRunner> sshStopper;
-#else
-    QProcess gdbServer;
-    QProcess stopProcess;
-#endif // USE_SSH_LIB
     Debugger::DebuggerManager *debuggerManager;
     QSharedPointer<Debugger::DebuggerStartParameters> startParams;
     int inferiorPid;
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp
index 816944f2994..027c28437dc 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp
@@ -114,11 +114,9 @@ MaemoSettingsWidget::MaemoSettingsWidget(QWidget *parent)
       m_nameValidator(new NameValidator(m_devConfs)),
       m_sshPortValidator(new PortAndTimeoutValidator),
       m_gdbServerPortValidator(new PortAndTimeoutValidator),
-      m_timeoutValidator(new PortAndTimeoutValidator)
-#ifdef USE_SSH_LIB
-      , m_deviceTester(0)
-      , m_keyDeployer(0)
-#endif
+      m_timeoutValidator(new PortAndTimeoutValidator),
+      m_deviceTester(0),
+      m_keyDeployer(0)
 
 {
     initGui();
@@ -139,16 +137,6 @@ void MaemoSettingsWidget::initGui()
     foreach(const MaemoDeviceConfig &devConf, m_devConfs)
         m_ui->configListWidget->addItem(devConf.name);
     m_defaultTestOutput = m_ui->testResultEdit->toPlainText();
-
-#ifndef USE_SSH_LIB // Password authentication does not currently work due to ssh/scp issues.
-    m_ui->testConfigButton->hide();
-    m_ui->deployKeyButton->hide();
-    m_ui->testResultEdit->hide();
-    m_ui->authTypeLabel->hide();
-    m_ui->authTypeButtonsWidget->hide();
-    m_ui->passwordLabel->hide();
-    m_ui->pwdLineEdit->hide();
-#endif
     if (m_devConfs.count() == 1)
         m_ui->configListWidget->setCurrentRow(0, QItemSelectionModel::Select);
 }
@@ -326,8 +314,6 @@ void MaemoSettingsWidget::keyFileEditingFinished()
 
 void MaemoSettingsWidget::testConfig()
 {
-#ifdef USE_SSH_LIB
-    qDebug("Oh yes, this config will be tested!");
     if (m_deviceTester)
         return;
 
@@ -347,7 +333,6 @@ void MaemoSettingsWidget::testConfig()
     connect(m_ui->testConfigButton, SIGNAL(clicked()),
             this, SLOT(stopConfigTest()));
     m_deviceTester->start();
-#endif
 }
 
 void MaemoSettingsWidget::processSshOutput(const QString &data)
@@ -358,7 +343,6 @@ void MaemoSettingsWidget::processSshOutput(const QString &data)
 
 void MaemoSettingsWidget::handleTestThreadFinished()
 {
-#ifdef USE_SSH_LIB
     if (!m_deviceTester)
         return;
 
@@ -373,15 +357,11 @@ void MaemoSettingsWidget::handleTestThreadFinished()
     }
     m_ui->testResultEdit->setPlainText(output);
     stopConfigTest();
-#endif
 }
 
 void MaemoSettingsWidget::stopConfigTest()
 {
-#ifdef USE_SSH_LIB
-    qDebug("================> %s", Q_FUNC_INFO);
     if (m_deviceTester) {
-        qDebug("Actually doing something");
         m_ui->testConfigButton->disconnect();
         const bool buttonWasEnabled = m_ui->testConfigButton->isEnabled();
         m_deviceTester->disconnect();
@@ -394,7 +374,6 @@ void MaemoSettingsWidget::stopConfigTest()
                 this, SLOT(testConfig()));
         m_ui->testConfigButton->setEnabled(buttonWasEnabled);
     }
-#endif
 }
 
 QString MaemoSettingsWidget::parseTestOutput()
@@ -428,8 +407,6 @@ QString MaemoSettingsWidget::parseTestOutput()
 
 void MaemoSettingsWidget::deployKey()
 {
-#ifdef USE_SSH_LIB
-    qDebug("Deploying key");
     if (m_keyDeployer)
         return;
 
@@ -452,13 +429,10 @@ void MaemoSettingsWidget::deployKey()
     connect(m_ui->deployKeyButton, SIGNAL(clicked()),
             this, SLOT(stopDeploying()));
     m_keyDeployer->start();
-#endif
 }
 
 void MaemoSettingsWidget::handleDeployThreadFinished()
 {
-#ifdef USE_SSH_LIB
-    qDebug("================> %s", Q_FUNC_INFO);
     if (!m_keyDeployer)
         return;
 
@@ -471,13 +445,10 @@ void MaemoSettingsWidget::handleDeployThreadFinished()
     }
     m_ui->testResultEdit->setPlainText(output);
     stopDeploying();
-#endif
 }
 
 void MaemoSettingsWidget::stopDeploying()
 {
-#ifdef USE_SSH_LIB
-    qDebug("================> %s", Q_FUNC_INFO);
     if (m_keyDeployer) {
         m_ui->deployKeyButton->disconnect();
         const bool buttonWasEnabled = m_ui->deployKeyButton->isEnabled();
@@ -490,7 +461,6 @@ void MaemoSettingsWidget::stopDeploying()
                 this, SLOT(deployKey()));
         m_ui->deployKeyButton->setEnabled(buttonWasEnabled);
     }
-#endif
 }
 
 void MaemoSettingsWidget::selectionChanged()
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h
index 14356dba19d..af69024f6b0 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h
@@ -50,12 +50,10 @@ QT_END_NAMESPACE
 namespace Qt4ProjectManager {
 namespace Internal {
 
-class PortAndTimeoutValidator;
-class NameValidator;
-#ifdef USE_SSH_LIB
 class MaemoSshRunner;
 class MaemoSshDeployer;
-#endif
+class NameValidator;
+class PortAndTimeoutValidator;
 
 class MaemoSettingsWidget : public QWidget
 {
@@ -105,10 +103,8 @@ private:
     PortAndTimeoutValidator * const m_sshPortValidator;
     PortAndTimeoutValidator * const m_gdbServerPortValidator;
     PortAndTimeoutValidator * const m_timeoutValidator;
-#ifdef USE_SSH_LIB
     MaemoSshRunner *m_deviceTester;
     MaemoSshDeployer *m_keyDeployer;
-#endif
     QString m_deviceTestOutput;
     QString m_defaultTestOutput;
 };
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
index 2d0763a64cf..c19878bda41 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
@@ -41,8 +41,6 @@
 
 #include "maemosshconnection.h"
 
-#ifdef USE_SSH_LIB
-
 #include "maemodeviceconfigurations.h"
 
 #include <ne7ssh.h>
@@ -209,5 +207,3 @@ MaemoSftpConnection::Ptr MaemoSftpConnection::create(const MaemoDeviceConfig &de
 
 } // namespace Internal
 } // namespace Qt4ProjectManager
-
-#endif
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h b/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h
index 777c6df22b6..2d09e89eac4 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h
@@ -42,8 +42,6 @@
 #ifndef MAEMOSSHCONNECTION_H
 #define MAEMOSSHCONNECTION_H
 
-#ifdef USE_SSH_LIB
-
 #include <QtCore/QObject>
 #include <QtCore/QScopedPointer>
 #include <QtCore/QSharedPointer>
@@ -149,6 +147,4 @@ private:
 } // namespace Internal
 } // namespace Qt4ProjectManager
 
-#endif
-
 #endif // MAEMOSSHCONNECTION_H
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
index 014c526eecf..c3ce401ef42 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
@@ -41,8 +41,6 @@
 
 #include "maemosshthread.h"
 
-#ifdef USE_SSH_LIB
-
 namespace Qt4ProjectManager {
 namespace Internal {
 
@@ -122,5 +120,3 @@ void MaemoSshDeployer::runInternal()
 
 } // namespace Internal
 } // namespace Qt4ProjectManager
-
-#endif
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h b/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
index 3d2462edff7..76431aef7fa 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
@@ -49,8 +49,6 @@
 #include <QtCore/QMutex>
 #include <QtCore/QThread>
 
-#ifdef USE_SSH_LIB
-
 namespace Qt4ProjectManager {
 namespace Internal {
 
@@ -118,6 +116,4 @@ private:
 } // namespace Internal
 } // namespace Qt4ProjectManager
 
-#endif
-
 #endif // MAEMOSSHTHREAD_H
diff --git a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri
index 7ce644c24b5..a6e6970eca0 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri
+++ b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri
@@ -2,7 +2,6 @@ SUPPORT_QT_MAEMO = $$(QTCREATOR_WITH_MAEMO)
 !isEmpty(SUPPORT_QT_MAEMO) {
     message("Adding experimental support for Qt/Maemo applications.")
     DEFINES += QTCREATOR_WITH_MAEMO
-    DEFINES += USE_SSH_LIB
     INCLUDEPATH += $$PWD/../../../libs/3rdparty/net7ssh/src
     INCLUDEPATH += $$PWD/../../../libs/3rdparty/botan/build
     LIBS += -l$$qtLibraryTarget(Net7ssh) -l$$qtLibraryTarget(Botan)
-- 
GitLab