summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2012-05-18 10:49:35 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2012-05-22 10:51:53 +0200
commit53a1087d1321758ab1dc0a6ad737c135249bd5e6 (patch)
treeab0f9596da64a1907690b324bd05416c585eaf8c
parentb9d9bb7ba85e3b3ea0e06f0876272c0e3bebd144 (diff)
downloadqt-creator-53a1087d1321758ab1dc0a6ad737c135249bd5e6.tar.gz
Move SSH support into a dedicated library.
It does not belong into libUtils, which is a collection of small unrelated utility classes. Task-number: QTCREATORBUG-7218 Change-Id: Id92b9f28678afec93e6f07166adfde6550f38072 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
-rw-r--r--qtcreator.qbp1
-rw-r--r--src/libs/libs.pro1
-rw-r--r--src/libs/ssh/sftpchannel.cpp (renamed from src/libs/utils/ssh/sftpchannel.cpp)18
-rw-r--r--src/libs/ssh/sftpchannel.h (renamed from src/libs/utils/ssh/sftpchannel.h)14
-rw-r--r--src/libs/ssh/sftpchannel_p.h (renamed from src/libs/utils/ssh/sftpchannel_p.h)12
-rw-r--r--src/libs/ssh/sftpdefs.cpp (renamed from src/libs/utils/ssh/sftpdefs.cpp)2
-rw-r--r--src/libs/ssh/sftpdefs.h (renamed from src/libs/utils/ssh/sftpdefs.h)10
-rw-r--r--src/libs/ssh/sftpfilesystemmodel.cpp (renamed from src/libs/utils/ssh/sftpfilesystemmodel.cpp)42
-rw-r--r--src/libs/ssh/sftpfilesystemmodel.h (renamed from src/libs/utils/ssh/sftpfilesystemmodel.h)14
-rw-r--r--src/libs/ssh/sftpincomingpacket.cpp (renamed from src/libs/utils/ssh/sftpincomingpacket.cpp)4
-rw-r--r--src/libs/ssh/sftpincomingpacket_p.h (renamed from src/libs/utils/ssh/sftpincomingpacket_p.h)4
-rw-r--r--src/libs/ssh/sftpoperation.cpp (renamed from src/libs/utils/ssh/sftpoperation.cpp)4
-rw-r--r--src/libs/ssh/sftpoperation_p.h (renamed from src/libs/utils/ssh/sftpoperation_p.h)4
-rw-r--r--src/libs/ssh/sftpoutgoingpacket.cpp (renamed from src/libs/utils/ssh/sftpoutgoingpacket.cpp)4
-rw-r--r--src/libs/ssh/sftpoutgoingpacket_p.h (renamed from src/libs/utils/ssh/sftpoutgoingpacket_p.h)4
-rw-r--r--src/libs/ssh/sftppacket.cpp (renamed from src/libs/utils/ssh/sftppacket.cpp)4
-rw-r--r--src/libs/ssh/sftppacket_p.h (renamed from src/libs/utils/ssh/sftppacket_p.h)4
-rw-r--r--src/libs/ssh/ssh.pri2
-rw-r--r--src/libs/ssh/ssh.pro67
-rw-r--r--src/libs/ssh/ssh.qbs51
-rw-r--r--src/libs/ssh/ssh_dependencies.pri1
-rw-r--r--src/libs/ssh/ssh_global.h49
-rw-r--r--src/libs/ssh/sshbotanconversions_p.h (renamed from src/libs/utils/ssh/sshbotanconversions_p.h)4
-rw-r--r--src/libs/ssh/sshcapabilities.cpp (renamed from src/libs/utils/ssh/sshcapabilities.cpp)4
-rw-r--r--src/libs/ssh/sshcapabilities_p.h (renamed from src/libs/utils/ssh/sshcapabilities_p.h)4
-rw-r--r--src/libs/ssh/sshchannel.cpp (renamed from src/libs/utils/ssh/sshchannel.cpp)4
-rw-r--r--src/libs/ssh/sshchannel_p.h (renamed from src/libs/utils/ssh/sshchannel_p.h)4
-rw-r--r--src/libs/ssh/sshchannelmanager.cpp (renamed from src/libs/utils/ssh/sshchannelmanager.cpp)10
-rw-r--r--src/libs/ssh/sshchannelmanager_p.h (renamed from src/libs/utils/ssh/sshchannelmanager_p.h)4
-rw-r--r--src/libs/ssh/sshconnection.cpp (renamed from src/libs/utils/ssh/sshconnection.cpp)44
-rw-r--r--src/libs/ssh/sshconnection.h (renamed from src/libs/utils/ssh/sshconnection.h)18
-rw-r--r--src/libs/ssh/sshconnection_p.h (renamed from src/libs/utils/ssh/sshconnection_p.h)8
-rw-r--r--src/libs/ssh/sshconnectionmanager.cpp (renamed from src/libs/utils/ssh/sshconnectionmanager.cpp)4
-rw-r--r--src/libs/ssh/sshconnectionmanager.h (renamed from src/libs/utils/ssh/sshconnectionmanager.h)8
-rw-r--r--src/libs/ssh/sshcryptofacility.cpp (renamed from src/libs/utils/ssh/sshcryptofacility.cpp)4
-rw-r--r--src/libs/ssh/sshcryptofacility_p.h (renamed from src/libs/utils/ssh/sshcryptofacility_p.h)4
-rw-r--r--src/libs/ssh/ssherrors.h (renamed from src/libs/utils/ssh/ssherrors.h)4
-rw-r--r--src/libs/ssh/sshexception_p.h (renamed from src/libs/utils/ssh/sshexception_p.h)4
-rw-r--r--src/libs/ssh/sshincomingpacket.cpp (renamed from src/libs/utils/ssh/sshincomingpacket.cpp)4
-rw-r--r--src/libs/ssh/sshincomingpacket_p.h (renamed from src/libs/utils/ssh/sshincomingpacket_p.h)4
-rw-r--r--src/libs/ssh/sshkeycreationdialog.cpp (renamed from src/libs/utils/ssh/sshkeycreationdialog.cpp)49
-rw-r--r--src/libs/ssh/sshkeycreationdialog.h (renamed from src/libs/utils/ssh/sshkeycreationdialog.h)11
-rw-r--r--src/libs/ssh/sshkeycreationdialog.ui (renamed from src/libs/utils/ssh/sshkeycreationdialog.ui)57
-rw-r--r--src/libs/ssh/sshkeyexchange.cpp (renamed from src/libs/utils/ssh/sshkeyexchange.cpp)4
-rw-r--r--src/libs/ssh/sshkeyexchange_p.h (renamed from src/libs/utils/ssh/sshkeyexchange_p.h)4
-rw-r--r--src/libs/ssh/sshkeygenerator.cpp (renamed from src/libs/utils/ssh/sshkeygenerator.cpp)4
-rw-r--r--src/libs/ssh/sshkeygenerator.h (renamed from src/libs/utils/ssh/sshkeygenerator.h)8
-rw-r--r--src/libs/ssh/sshkeypasswordretriever.cpp (renamed from src/libs/utils/ssh/sshkeypasswordretriever.cpp)8
-rw-r--r--src/libs/ssh/sshkeypasswordretriever_p.h (renamed from src/libs/utils/ssh/sshkeypasswordretriever_p.h)4
-rw-r--r--src/libs/ssh/sshoutgoingpacket.cpp (renamed from src/libs/utils/ssh/sshoutgoingpacket.cpp)4
-rw-r--r--src/libs/ssh/sshoutgoingpacket_p.h (renamed from src/libs/utils/ssh/sshoutgoingpacket_p.h)4
-rw-r--r--src/libs/ssh/sshpacket.cpp (renamed from src/libs/utils/ssh/sshpacket.cpp)4
-rw-r--r--src/libs/ssh/sshpacket_p.h (renamed from src/libs/utils/ssh/sshpacket_p.h)4
-rw-r--r--src/libs/ssh/sshpacketparser.cpp (renamed from src/libs/utils/ssh/sshpacketparser.cpp)4
-rw-r--r--src/libs/ssh/sshpacketparser_p.h (renamed from src/libs/utils/ssh/sshpacketparser_p.h)4
-rw-r--r--src/libs/ssh/sshpseudoterminal.h (renamed from src/libs/utils/ssh/sshpseudoterminal.h)8
-rw-r--r--src/libs/ssh/sshremoteprocess.cpp (renamed from src/libs/utils/ssh/sshremoteprocess.cpp)12
-rw-r--r--src/libs/ssh/sshremoteprocess.h (renamed from src/libs/utils/ssh/sshremoteprocess.h)8
-rw-r--r--src/libs/ssh/sshremoteprocess_p.h (renamed from src/libs/utils/ssh/sshremoteprocess_p.h)6
-rw-r--r--src/libs/ssh/sshremoteprocessrunner.cpp (renamed from src/libs/utils/ssh/sshremoteprocessrunner.cpp)42
-rw-r--r--src/libs/ssh/sshremoteprocessrunner.h (renamed from src/libs/utils/ssh/sshremoteprocessrunner.h)12
-rw-r--r--src/libs/ssh/sshsendfacility.cpp (renamed from src/libs/utils/ssh/sshsendfacility.cpp)4
-rw-r--r--src/libs/ssh/sshsendfacility_p.h (renamed from src/libs/utils/ssh/sshsendfacility_p.h)4
-rw-r--r--src/libs/utils/utils-lib.pri60
-rw-r--r--src/libs/utils/utils.pro3
-rw-r--r--src/libs/utils/utils.qbs59
-rw-r--r--src/libs/utils/utils_dependencies.pri1
-rw-r--r--src/plugins/analyzerbase/analyzermanager.cpp2
-rw-r--r--src/plugins/analyzerbase/analyzerstartparameters.h4
-rw-r--r--src/plugins/analyzerbase/startremotedialog.cpp10
-rw-r--r--src/plugins/analyzerbase/startremotedialog.h4
-rw-r--r--src/plugins/cpaster/cpaster.qbs2
-rw-r--r--src/plugins/debugger/debugger.qbs2
-rw-r--r--src/plugins/debugger/debugger_dependencies.pri1
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp4
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h4
-rw-r--r--src/plugins/debugger/gdb/remotegdbprocess.cpp27
-rw-r--r--src/plugins/debugger/gdb/remotegdbprocess.h16
-rw-r--r--src/plugins/debugger/lldb/lldbenginehost.cpp12
-rw-r--r--src/plugins/debugger/lldb/lldbenginehost.h18
-rw-r--r--src/plugins/git/git.qbs2
-rw-r--r--src/plugins/madde/maddedevicetester.cpp4
-rw-r--r--src/plugins/madde/maddedevicetester.h4
-rw-r--r--src/plugins/madde/maddeuploadandinstallpackagesteps.cpp2
-rw-r--r--src/plugins/madde/maemodeploybymountsteps.cpp2
-rw-r--r--src/plugins/madde/maemodeploymentmounter.cpp6
-rw-r--r--src/plugins/madde/maemodeploymentmounter.h6
-rw-r--r--src/plugins/madde/maemodeviceconfigwizard.cpp11
-rw-r--r--src/plugins/madde/maemopublisherfremantlefree.cpp4
-rw-r--r--src/plugins/madde/maemopublisherfremantlefree.h8
-rw-r--r--src/plugins/madde/maemoqemumanager.h14
-rw-r--r--src/plugins/madde/maemoremotecopyfacility.cpp6
-rw-r--r--src/plugins/madde/maemoremotecopyfacility.h8
-rw-r--r--src/plugins/madde/maemoremotemounter.cpp5
-rw-r--r--src/plugins/madde/maemoremotemounter.h12
-rw-r--r--src/plugins/madde/maemorunconfiguration.cpp2
-rw-r--r--src/plugins/madde/maemosshrunner.cpp4
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp8
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxdeployservice.h4
-rw-r--r--src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp2
-rw-r--r--src/plugins/remotelinux/genericdirectuploadservice.cpp14
-rw-r--r--src/plugins/remotelinux/genericdirectuploadservice.h4
-rw-r--r--src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp5
-rw-r--r--src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp4
-rw-r--r--src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp1
-rw-r--r--src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h4
-rw-r--r--src/plugins/remotelinux/linuxdeviceconfiguration.cpp4
-rw-r--r--src/plugins/remotelinux/linuxdeviceconfiguration.h10
-rw-r--r--src/plugins/remotelinux/linuxdevicetester.cpp8
-rw-r--r--src/plugins/remotelinux/linuxdevicetester.h4
-rw-r--r--src/plugins/remotelinux/packageuploader.cpp12
-rw-r--r--src/plugins/remotelinux/packageuploader.h12
-rw-r--r--src/plugins/remotelinux/publickeydeploymentdialog.cpp2
-rw-r--r--src/plugins/remotelinux/remotelinux.qbs2
-rw-r--r--src/plugins/remotelinux/remotelinuxapplicationrunner.cpp17
-rw-r--r--src/plugins/remotelinux/remotelinuxapplicationrunner.h8
-rw-r--r--src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp4
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp2
-rw-r--r--src/plugins/remotelinux/remotelinuxenvironmentreader.cpp12
-rw-r--r--src/plugins/remotelinux/remotelinuxenvironmentreader.h4
-rw-r--r--src/plugins/remotelinux/remotelinuxpackageinstaller.cpp8
-rw-r--r--src/plugins/remotelinux/remotelinuxprocesslist.cpp4
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfiguration.cpp1
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfiguration.h4
-rw-r--r--src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp9
-rw-r--r--src/plugins/remotelinux/sshkeydeployer.cpp4
-rw-r--r--src/plugins/remotelinux/sshkeydeployer.h4
-rw-r--r--src/plugins/remotelinux/startgdbserverdialog.cpp5
-rw-r--r--src/plugins/valgrind/callgrind/callgrindcontroller.cpp10
-rw-r--r--src/plugins/valgrind/callgrind/callgrindcontroller.h16
-rw-r--r--src/plugins/valgrind/valgrindprocess.cpp34
-rw-r--r--src/plugins/valgrind/valgrindprocess.h20
-rw-r--r--src/plugins/valgrind/valgrindrunner.cpp10
-rw-r--r--src/plugins/valgrind/valgrindrunner.h6
-rw-r--r--tests/manual/ssh/errorhandling/main.cpp14
-rw-r--r--tests/manual/ssh/remoteprocess/argumentscollector.cpp5
-rw-r--r--tests/manual/ssh/remoteprocess/argumentscollector.h6
-rw-r--r--tests/manual/ssh/remoteprocess/main.cpp6
-rw-r--r--tests/manual/ssh/remoteprocess/remoteprocesstest.cpp14
-rw-r--r--tests/manual/ssh/remoteprocess/remoteprocesstest.h14
-rw-r--r--tests/manual/ssh/sftp/argumentscollector.cpp3
-rw-r--r--tests/manual/ssh/sftp/argumentscollector.h3
-rw-r--r--tests/manual/ssh/sftp/main.cpp9
-rw-r--r--tests/manual/ssh/sftp/parameters.h4
-rw-r--r--tests/manual/ssh/sftp/sftptest.cpp14
-rw-r--r--tests/manual/ssh/sftp/sftptest.h40
-rw-r--r--tests/manual/ssh/sftpfsmodel/main.cpp6
-rw-r--r--tests/manual/ssh/sftpfsmodel/window.cpp10
-rw-r--r--tests/manual/ssh/sftpfsmodel/window.h8
-rw-r--r--tests/manual/ssh/shell/main.cpp6
-rw-r--r--tests/manual/ssh/shell/shell.cpp10
-rw-r--r--tests/manual/ssh/shell/shell.h8
-rw-r--r--tests/manual/ssh/ssh.pri9
153 files changed, 800 insertions, 725 deletions
diff --git a/qtcreator.qbp b/qtcreator.qbp
index cd6307a39d..9e2206b569 100644
--- a/qtcreator.qbp
+++ b/qtcreator.qbp
@@ -23,6 +23,7 @@ Project {
"src/libs/qmldebug/qmldebug.qbs",
"src/libs/qtcomponents/styleitem/styleitem.qbs",
"src/libs/symbianutils/symbianutils.qbs",
+ "src/libs/ssh/ssh.qbs",
"src/libs/utils/utils.qbs",
"src/libs/zeroconf/zeroconf.qbs",
"src/plugins/analyzerbase/analyzerbase.qbs",
diff --git a/src/libs/libs.pro b/src/libs/libs.pro
index 374c06f937..b8a7e4e742 100644
--- a/src/libs/libs.pro
+++ b/src/libs/libs.pro
@@ -16,6 +16,7 @@ SUBDIRS = \
glsl \
qmleditorwidgets \
qtcomponents/styleitem \
+ ssh \
zeroconf
win32:SUBDIRS += utils/process_ctrlc_stub.pro
diff --git a/src/libs/utils/ssh/sftpchannel.cpp b/src/libs/ssh/sftpchannel.cpp
index 585265745d..c4a2181868 100644
--- a/src/libs/utils/ssh/sftpchannel.cpp
+++ b/src/libs/ssh/sftpchannel.cpp
@@ -41,7 +41,7 @@
#include <QFile>
/*!
- \class Utils::SftpChannel
+ \class QSsh::SftpChannel
\brief This class provides SFTP operations.
@@ -65,7 +65,7 @@
Note that directory names must not have a trailing slash.
*/
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
const quint32 ProtocolVersion = 3;
@@ -93,13 +93,13 @@ SftpChannel::SftpChannel(quint32 channelId,
Qt::QueuedConnection);
connect(d, SIGNAL(initializationFailed(QString)), this,
SIGNAL(initializationFailed(QString)), Qt::QueuedConnection);
- connect(d, SIGNAL(dataAvailable(Utils::SftpJobId,QString)), this,
- SIGNAL(dataAvailable(Utils::SftpJobId,QString)), Qt::QueuedConnection);
- connect(d, SIGNAL(fileInfoAvailable(Utils::SftpJobId,QList<Utils::SftpFileInfo>)), this,
- SIGNAL(fileInfoAvailable(Utils::SftpJobId,QList<Utils::SftpFileInfo>)),
+ connect(d, SIGNAL(dataAvailable(QSsh::SftpJobId,QString)), this,
+ SIGNAL(dataAvailable(QSsh::SftpJobId,QString)), Qt::QueuedConnection);
+ connect(d, SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)), this,
+ SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)),
Qt::QueuedConnection);
- connect(d, SIGNAL(finished(Utils::SftpJobId,QString)), this,
- SIGNAL(finished(Utils::SftpJobId,QString)), Qt::QueuedConnection);
+ connect(d, SIGNAL(finished(QSsh::SftpJobId,QString)), this,
+ SIGNAL(finished(QSsh::SftpJobId,QString)), Qt::QueuedConnection);
connect(d, SIGNAL(closed()), this, SIGNAL(closed()), Qt::QueuedConnection);
}
@@ -977,4 +977,4 @@ void SftpChannelPrivate::spawnReadRequests(const SftpDownload::Ptr &job)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sftpchannel.h b/src/libs/ssh/sftpchannel.h
index 31e99c3147..e1a5605023 100644
--- a/src/libs/utils/ssh/sftpchannel.h
+++ b/src/libs/ssh/sftpchannel.h
@@ -36,14 +36,14 @@
#include "sftpdefs.h"
#include "sftpincomingpacket_p.h"
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QByteArray>
#include <QObject>
#include <QSharedPointer>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SftpChannelPrivate;
@@ -51,7 +51,7 @@ class SshChannelManager;
class SshSendFacility;
} // namespace Internal
-class QTCREATOR_UTILS_EXPORT SftpChannel : public QObject
+class QSSH_EXPORT SftpChannel : public QObject
{
Q_OBJECT
@@ -90,17 +90,17 @@ signals:
void closed();
// error.isEmpty <=> finished successfully
- void finished(Utils::SftpJobId job, const QString &error = QString());
+ void finished(QSsh::SftpJobId job, const QString &error = QString());
// TODO: Also emit for each file copied by uploadDir().
- void dataAvailable(Utils::SftpJobId job, const QString &data);
+ void dataAvailable(QSsh::SftpJobId job, const QString &data);
/*
* This signal is emitted as a result of:
* - statFile() (with the list having exactly one element)
* - listDirectory() (potentially more than once)
*/
- void fileInfoAvailable(Utils::SftpJobId job, const QList<Utils::SftpFileInfo> &fileInfoList);
+ void fileInfoAvailable(QSsh::SftpJobId job, const QList<QSsh::SftpFileInfo> &fileInfoList);
private:
SftpChannel(quint32 channelId, Internal::SshSendFacility &sendFacility);
@@ -108,6 +108,6 @@ private:
Internal::SftpChannelPrivate *d;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPCHANNEL_H
diff --git a/src/libs/utils/ssh/sftpchannel_p.h b/src/libs/ssh/sftpchannel_p.h
index c2b2f79b18..040a39262a 100644
--- a/src/libs/utils/ssh/sftpchannel_p.h
+++ b/src/libs/ssh/sftpchannel_p.h
@@ -42,14 +42,14 @@
#include <QByteArray>
#include <QMap>
-namespace Utils {
+namespace QSsh {
class SftpChannel;
namespace Internal {
class SftpChannelPrivate : public AbstractSshChannel
{
Q_OBJECT
- friend class Utils::SftpChannel;
+ friend class QSsh::SftpChannel;
public:
enum SftpState { Inactive, SubsystemRequested, InitSent, Initialized };
@@ -63,9 +63,9 @@ signals:
void initialized();
void initializationFailed(const QString &reason);
void closed();
- void finished(Utils::SftpJobId job, const QString &error = QString());
- void dataAvailable(Utils::SftpJobId job, const QString &data);
- void fileInfoAvailable(Utils::SftpJobId job, const QList<Utils::SftpFileInfo> &fileInfoList);
+ void finished(QSsh::SftpJobId job, const QString &error = QString());
+ void dataAvailable(QSsh::SftpJobId job, const QString &data);
+ void fileInfoAvailable(QSsh::SftpJobId job, const QList<QSsh::SftpFileInfo> &fileInfoList);
private:
typedef QMap<SftpJobId, AbstractSftpOperation::Ptr> JobMap;
@@ -130,6 +130,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPCHANNEL_P_H
diff --git a/src/libs/utils/ssh/sftpdefs.cpp b/src/libs/ssh/sftpdefs.cpp
index 8dfed93406..f8c1b957b9 100644
--- a/src/libs/utils/ssh/sftpdefs.cpp
+++ b/src/libs/ssh/sftpdefs.cpp
@@ -32,4 +32,4 @@
#include "sftpdefs.h"
-namespace Utils { const SftpJobId SftpInvalidJob = 0; }
+namespace QSsh { const SftpJobId SftpInvalidJob = 0; }
diff --git a/src/libs/utils/ssh/sftpdefs.h b/src/libs/ssh/sftpdefs.h
index 85087e126a..c383b12472 100644
--- a/src/libs/utils/ssh/sftpdefs.h
+++ b/src/libs/ssh/sftpdefs.h
@@ -33,15 +33,15 @@
#ifndef SFTPDEFS_H
#define SFTPDEFS_H
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QFile>
#include <QString>
-namespace Utils {
+namespace QSsh {
typedef quint32 SftpJobId;
-QTCREATOR_UTILS_EXPORT extern const SftpJobId SftpInvalidJob;
+QSSH_EXPORT extern const SftpJobId SftpInvalidJob;
enum SftpOverwriteMode {
SftpOverwriteExisting, SftpAppendToExisting, SftpSkipExisting
@@ -49,7 +49,7 @@ enum SftpOverwriteMode {
enum SftpFileType { FileTypeRegular, FileTypeDirectory, FileTypeOther, FileTypeUnknown };
-class QTCREATOR_UTILS_EXPORT SftpFileInfo
+class QSSH_EXPORT SftpFileInfo
{
public:
SftpFileInfo() : type(FileTypeUnknown), sizeValid(false), permissionsValid(false) { }
@@ -64,6 +64,6 @@ public:
bool permissionsValid;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPDEFS_H
diff --git a/src/libs/utils/ssh/sftpfilesystemmodel.cpp b/src/libs/ssh/sftpfilesystemmodel.cpp
index d077c698cb..6d24c1b8c6 100644
--- a/src/libs/utils/ssh/sftpfilesystemmodel.cpp
+++ b/src/libs/ssh/sftpfilesystemmodel.cpp
@@ -35,15 +35,13 @@
#include "sshconnection.h"
#include "sshconnectionmanager.h"
-#include <utils/qtcassert.h>
-
#include <QFileInfo>
#include <QHash>
#include <QIcon>
#include <QList>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
@@ -79,7 +77,7 @@ SftpFileNode *indexToFileNode(const QModelIndex &index)
SftpDirNode *indexToDirNode(const QModelIndex &index)
{
SftpFileNode * const fileNode = indexToFileNode(index);
- QTC_CHECK(fileNode);
+ QSSH_ASSERT(fileNode);
return dynamic_cast<SftpDirNode *>(fileNode);
}
@@ -116,9 +114,9 @@ SftpFileSystemModel::~SftpFileSystemModel()
void SftpFileSystemModel::setSshConnection(const SshConnectionParameters &sshParams)
{
- QTC_ASSERT(!d->sshConnection, return);
+ QSSH_ASSERT_AND_RETURN(!d->sshConnection);
d->sshConnection = SshConnectionManager::instance().acquireConnection(sshParams);
- connect(d->sshConnection.data(), SIGNAL(error(Utils::SshError)),
+ connect(d->sshConnection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleSshConnectionFailure()));
if (d->sshConnection->state() == SshConnection::Connected) {
handleSshConnectionEstablished();
@@ -148,10 +146,10 @@ QString SftpFileSystemModel::rootDirectory() const
SftpJobId SftpFileSystemModel::downloadFile(const QModelIndex &index, const QString &targetFilePath)
{
- QTC_ASSERT(d->rootNode, return SftpInvalidJob);
+ QSSH_ASSERT_AND_RETURN_VALUE(d->rootNode, SftpInvalidJob);
const SftpFileNode * const fileNode = indexToFileNode(index);
- QTC_ASSERT(fileNode, return SftpInvalidJob);
- QTC_ASSERT(fileNode->fileInfo.type == FileTypeRegular, return SftpInvalidJob);
+ QSSH_ASSERT_AND_RETURN_VALUE(fileNode, SftpInvalidJob);
+ QSSH_ASSERT_AND_RETURN_VALUE(fileNode->fileInfo.type == FileTypeRegular, SftpInvalidJob);
const SftpJobId jobId = d->sftpChannel->downloadFile(fileNode->path, targetFilePath,
SftpOverwriteExisting);
if (jobId != SftpInvalidJob)
@@ -217,8 +215,8 @@ QModelIndex SftpFileSystemModel::index(int row, int column, const QModelIndex &p
if (!parent.isValid())
return createIndex(row, column, d->rootNode);
const SftpDirNode * const parentNode = indexToDirNode(parent);
- QTC_ASSERT(parentNode, return QModelIndex());
- QTC_ASSERT(row < parentNode->children.count(), return QModelIndex());
+ QSSH_ASSERT_AND_RETURN_VALUE(parentNode, QModelIndex());
+ QSSH_ASSERT_AND_RETURN_VALUE(row < parentNode->children.count(), QModelIndex());
SftpFileNode * const childNode = parentNode->children.at(row);
return createIndex(row, column, childNode);
}
@@ -229,14 +227,14 @@ QModelIndex SftpFileSystemModel::parent(const QModelIndex &child) const
return QModelIndex();
const SftpFileNode * const childNode = indexToFileNode(child);
- QTC_ASSERT(childNode, return QModelIndex());
+ QSSH_ASSERT_AND_RETURN_VALUE(childNode, QModelIndex());
if (childNode == d->rootNode)
return QModelIndex();
SftpDirNode * const parentNode = childNode->parent;
if (parentNode == d->rootNode)
return createIndex(0, 0, d->rootNode);
const SftpDirNode * const grandParentNode = parentNode->parent;
- QTC_ASSERT(grandParentNode, return QModelIndex());
+ QSSH_ASSERT_AND_RETURN_VALUE(grandParentNode, QModelIndex());
return createIndex(grandParentNode->children.indexOf(parentNode), 0, parentNode);
}
@@ -290,10 +288,10 @@ void SftpFileSystemModel::handleSshConnectionFailure()
void SftpFileSystemModel::handleSftpChannelInitialized()
{
connect(d->sftpChannel.data(),
- SIGNAL(fileInfoAvailable(Utils::SftpJobId,QList<Utils::SftpFileInfo>)),
- SLOT(handleFileInfo(Utils::SftpJobId,QList<Utils::SftpFileInfo>)));
- connect(d->sftpChannel.data(), SIGNAL(finished(Utils::SftpJobId,QString)),
- SLOT(handleSftpJobFinished(Utils::SftpJobId,QString)));
+ SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)),
+ SLOT(handleFileInfo(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)));
+ connect(d->sftpChannel.data(), SIGNAL(finished(QSsh::SftpJobId,QString)),
+ SLOT(handleSftpJobFinished(QSsh::SftpJobId,QString)));
statRootDirectory();
}
@@ -317,7 +315,7 @@ void SftpFileSystemModel::handleSftpChannelInitializationFailed(const QString &r
void SftpFileSystemModel::handleFileInfo(SftpJobId jobId, const QList<SftpFileInfo> &fileInfoList)
{
if (jobId == d->statJobId) {
- QTC_ASSERT(!d->rootNode, return);
+ QSSH_ASSERT_AND_RETURN(!d->rootNode);
beginInsertRows(QModelIndex(), 0, 0);
d->rootNode = new SftpDirNode;
d->rootNode->path = d->rootDirectory;
@@ -328,7 +326,7 @@ void SftpFileSystemModel::handleFileInfo(SftpJobId jobId, const QList<SftpFileIn
return;
}
SftpDirNode * const parentNode = d->lsOps.value(jobId);
- QTC_ASSERT(parentNode, return);
+ QSSH_ASSERT_AND_RETURN(parentNode);
QList<SftpFileInfo> filteredList;
foreach (const SftpFileInfo &fi, fileInfoList) {
if (fi.name != QLatin1String(".") && fi.name != QLatin1String(".."))
@@ -370,7 +368,7 @@ void SftpFileSystemModel::handleSftpJobFinished(SftpJobId jobId, const QString &
DirNodeHash::Iterator it = d->lsOps.find(jobId);
if (it != d->lsOps.end()) {
- QTC_CHECK(it.value()->lsState == SftpDirNode::LsRunning);
+ QSSH_ASSERT(it.value()->lsState == SftpDirNode::LsRunning);
it.value()->lsState = SftpDirNode::LsFinished;
if (!errorMessage.isEmpty())
emit sftpOperationFailed(tr("Error listing contents of directory '%1': %2")
@@ -380,9 +378,9 @@ void SftpFileSystemModel::handleSftpJobFinished(SftpJobId jobId, const QString &
}
const int jobIndex = d->externalJobs.indexOf(jobId);
- QTC_ASSERT(jobIndex != -1, return);
+ QSSH_ASSERT_AND_RETURN(jobIndex != -1);
d->externalJobs.removeAt(jobIndex);
emit sftpOperationFinished(jobId, errorMessage);
}
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sftpfilesystemmodel.h b/src/libs/ssh/sftpfilesystemmodel.h
index f4b83799cd..43690cff3f 100644
--- a/src/libs/utils/ssh/sftpfilesystemmodel.h
+++ b/src/libs/ssh/sftpfilesystemmodel.h
@@ -34,17 +34,17 @@
#include "sftpdefs.h"
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QAbstractItemModel>
-namespace Utils {
+namespace QSsh {
class SshConnectionParameters;
namespace Internal { class SftpFileSystemModelPrivate; }
// Very simple read-only model. Symbolic links are not followed.
-class QTCREATOR_UTILS_EXPORT SftpFileSystemModel : public QAbstractItemModel
+class QSSH_EXPORT SftpFileSystemModel : public QAbstractItemModel
{
Q_OBJECT
public:
@@ -80,15 +80,15 @@ signals:
void connectionError(const QString &errorMessage);
// Success <=> error.isEmpty().
- void sftpOperationFinished(Utils::SftpJobId, const QString &error);
+ void sftpOperationFinished(QSsh::SftpJobId, const QString &error);
private slots:
void handleSshConnectionEstablished();
void handleSshConnectionFailure();
void handleSftpChannelInitialized();
void handleSftpChannelInitializationFailed(const QString &reason);
- void handleFileInfo(Utils::SftpJobId jobId, const QList<Utils::SftpFileInfo> &fileInfoList);
- void handleSftpJobFinished(Utils::SftpJobId jobId, const QString &errorMessage);
+ void handleFileInfo(QSsh::SftpJobId jobId, const QList<QSsh::SftpFileInfo> &fileInfoList);
+ void handleSftpJobFinished(QSsh::SftpJobId jobId, const QString &errorMessage);
private:
int columnCount(const QModelIndex &parent = QModelIndex()) const;
@@ -105,6 +105,6 @@ private:
Internal::SftpFileSystemModelPrivate * const d;
};
-} // namespace Utils;
+} // namespace QSsh;
#endif // SFTPFILESYSTEMMODEL_H
diff --git a/src/libs/utils/ssh/sftpincomingpacket.cpp b/src/libs/ssh/sftpincomingpacket.cpp
index e90bb39d4e..8b878bb699 100644
--- a/src/libs/utils/ssh/sftpincomingpacket.cpp
+++ b/src/libs/ssh/sftpincomingpacket.cpp
@@ -35,7 +35,7 @@
#include "sshexception_p.h"
#include "sshpacketparser_p.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
SftpIncomingPacket::SftpIncomingPacket() : m_length(0)
@@ -222,4 +222,4 @@ SftpFileAttributes SftpIncomingPacket::asFileAttributes(quint32 &offset) const
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sftpincomingpacket_p.h b/src/libs/ssh/sftpincomingpacket_p.h
index f1b271ead7..7f62ffcdce 100644
--- a/src/libs/utils/ssh/sftpincomingpacket_p.h
+++ b/src/libs/ssh/sftpincomingpacket_p.h
@@ -35,7 +35,7 @@
#include "sftppacket_p.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
struct SftpHandleResponse {
@@ -109,6 +109,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPINCOMINGPACKET_P_H
diff --git a/src/libs/utils/ssh/sftpoperation.cpp b/src/libs/ssh/sftpoperation.cpp
index 733741a9cb..1ad62e0dfa 100644
--- a/src/libs/utils/ssh/sftpoperation.cpp
+++ b/src/libs/ssh/sftpoperation.cpp
@@ -36,7 +36,7 @@
#include <QFile>
-namespace Utils {
+namespace QSsh {
namespace Internal {
AbstractSftpOperation::AbstractSftpOperation(SftpJobId jobId) : jobId(jobId)
@@ -224,4 +224,4 @@ SftpOutgoingPacket &SftpUploadFile::initialPacket(SftpOutgoingPacket &packet)
SftpUploadDir::~SftpUploadDir() {}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sftpoperation_p.h b/src/libs/ssh/sftpoperation_p.h
index eeaa69ac10..43baa4fb6f 100644
--- a/src/libs/utils/ssh/sftpoperation_p.h
+++ b/src/libs/ssh/sftpoperation_p.h
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
class QFile;
QT_END_NAMESPACE
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SftpOutgoingPacket;
@@ -249,6 +249,6 @@ struct SftpUploadDir
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPOPERATION_P_H
diff --git a/src/libs/utils/ssh/sftpoutgoingpacket.cpp b/src/libs/ssh/sftpoutgoingpacket.cpp
index 38412e6643..722cc98006 100644
--- a/src/libs/utils/ssh/sftpoutgoingpacket.cpp
+++ b/src/libs/ssh/sftpoutgoingpacket.cpp
@@ -38,7 +38,7 @@
#include <limits>
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
@@ -226,4 +226,4 @@ SftpOutgoingPacket &SftpOutgoingPacket::finalize()
const quint32 SftpOutgoingPacket::DefaultPermissions = std::numeric_limits<quint32>::max();
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sftpoutgoingpacket_p.h b/src/libs/ssh/sftpoutgoingpacket_p.h
index d58128d89a..d53f2dcc0e 100644
--- a/src/libs/utils/ssh/sftpoutgoingpacket_p.h
+++ b/src/libs/ssh/sftpoutgoingpacket_p.h
@@ -36,7 +36,7 @@
#include "sftppacket_p.h"
#include "sftpdefs.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SftpOutgoingPacket : public AbstractSftpPacket
@@ -89,6 +89,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPOUTGOINGPACKET_P_H
diff --git a/src/libs/utils/ssh/sftppacket.cpp b/src/libs/ssh/sftppacket.cpp
index 1ea448e2ac..205f7ae0ca 100644
--- a/src/libs/utils/ssh/sftppacket.cpp
+++ b/src/libs/ssh/sftppacket.cpp
@@ -34,7 +34,7 @@
#include "sshpacketparser_p.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
const quint32 AbstractSftpPacket::MaxDataSize = 32000;
@@ -53,4 +53,4 @@ quint32 AbstractSftpPacket::requestId() const
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sftppacket_p.h b/src/libs/ssh/sftppacket_p.h
index 9666ef1e11..2a8345f7b5 100644
--- a/src/libs/utils/ssh/sftppacket_p.h
+++ b/src/libs/ssh/sftppacket_p.h
@@ -37,7 +37,7 @@
#include <QList>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
enum SftpPacketType {
@@ -114,6 +114,6 @@ protected:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SFTPPACKET_P_H
diff --git a/src/libs/ssh/ssh.pri b/src/libs/ssh/ssh.pri
new file mode 100644
index 0000000000..fe58b81cba
--- /dev/null
+++ b/src/libs/ssh/ssh.pri
@@ -0,0 +1,2 @@
+include(ssh_dependencies.pri)
+LIBS *= -l$$qtLibraryName(QtcSsh)
diff --git a/src/libs/ssh/ssh.pro b/src/libs/ssh/ssh.pro
new file mode 100644
index 0000000000..2df5b0430b
--- /dev/null
+++ b/src/libs/ssh/ssh.pro
@@ -0,0 +1,67 @@
+TEMPLATE = lib
+TARGET = QtcSsh
+QT += gui network
+DEFINES += QSSH_LIBRARY
+
+include(../../qtcreatorlibrary.pri)
+include(ssh_dependencies.pri)
+
+SOURCES = $$PWD/sshsendfacility.cpp \
+ $$PWD/sshremoteprocess.cpp \
+ $$PWD/sshpacketparser.cpp \
+ $$PWD/sshpacket.cpp \
+ $$PWD/sshoutgoingpacket.cpp \
+ $$PWD/sshkeygenerator.cpp \
+ $$PWD/sshkeyexchange.cpp \
+ $$PWD/sshincomingpacket.cpp \
+ $$PWD/sshcryptofacility.cpp \
+ $$PWD/sshconnection.cpp \
+ $$PWD/sshchannelmanager.cpp \
+ $$PWD/sshchannel.cpp \
+ $$PWD/sshcapabilities.cpp \
+ $$PWD/sftppacket.cpp \
+ $$PWD/sftpoutgoingpacket.cpp \
+ $$PWD/sftpoperation.cpp \
+ $$PWD/sftpincomingpacket.cpp \
+ $$PWD/sftpdefs.cpp \
+ $$PWD/sftpchannel.cpp \
+ $$PWD/sshremoteprocessrunner.cpp \
+ $$PWD/sshconnectionmanager.cpp \
+ $$PWD/sshkeypasswordretriever.cpp \
+ $$PWD/sftpfilesystemmodel.cpp \
+ $$PWD/sshkeycreationdialog.cpp
+
+HEADERS = $$PWD/sshsendfacility_p.h \
+ $$PWD/sshremoteprocess.h \
+ $$PWD/sshremoteprocess_p.h \
+ $$PWD/sshpacketparser_p.h \
+ $$PWD/sshpacket_p.h \
+ $$PWD/sshoutgoingpacket_p.h \
+ $$PWD/sshkeygenerator.h \
+ $$PWD/sshkeyexchange_p.h \
+ $$PWD/sshincomingpacket_p.h \
+ $$PWD/sshexception_p.h \
+ $$PWD/ssherrors.h \
+ $$PWD/sshcryptofacility_p.h \
+ $$PWD/sshconnection.h \
+ $$PWD/sshconnection_p.h \
+ $$PWD/sshchannelmanager_p.h \
+ $$PWD/sshchannel_p.h \
+ $$PWD/sshcapabilities_p.h \
+ $$PWD/sshbotanconversions_p.h \
+ $$PWD/sftppacket_p.h \
+ $$PWD/sftpoutgoingpacket_p.h \
+ $$PWD/sftpoperation_p.h \
+ $$PWD/sftpincomingpacket_p.h \
+ $$PWD/sftpdefs.h \
+ $$PWD/sftpchannel.h \
+ $$PWD/sftpchannel_p.h \
+ $$PWD/sshremoteprocessrunner.h \
+ $$PWD/sshconnectionmanager.h \
+ $$PWD/sshpseudoterminal.h \
+ $$PWD/sshkeypasswordretriever_p.h \
+ $$PWD/sftpfilesystemmodel.h \
+ $$PWD/sshkeycreationdialog.h \
+ $$PWD/ssh_global.h
+
+FORMS = $$PWD/sshkeycreationdialog.ui
diff --git a/src/libs/ssh/ssh.qbs b/src/libs/ssh/ssh.qbs
new file mode 100644
index 0000000000..ff108d4967
--- /dev/null
+++ b/src/libs/ssh/ssh.qbs
@@ -0,0 +1,51 @@
+import qbs.base 1.0
+import "../QtcLibrary.qbs" as QtcLibrary
+
+QtcLibrary {
+ name: "QtcSsh"
+
+ cpp.defines: ["QSSH_LIBRARY"]
+ cpp.includePaths: [ ".", "..",
+ "../..",
+ "../3rdparty/botan/build",
+ buildDirectory
+ ]
+
+ Depends { name: "cpp" }
+ Depends { name: "Qt"; submodules: ['gui', 'network' ] }
+ Depends { name: "Botan" }
+
+ files: [
+ "sftpchannel.h", "sftpchannel_p.h", "sftpchannel.cpp",
+ "sftpdefs.cpp", "sftpdefs.h",
+ "sftpincomingpacket.cpp", "sftpincomingpacket_p.h",
+ "sftpoperation.cpp", "sftpoperation_p.h",
+ "sftpoutgoingpacket.cpp", "sftpoutgoingpacket_p.h",
+ "sftppacket.cpp", "sftppacket_p.h",
+ "sshcapabilities_p.h", "sshcapabilities.cpp",
+ "sshchannel.cpp", "sshchannel_p.h",
+ "sshchannelmanager.cpp", "sshchannelmanager_p.h",
+ "sshconnection.h", "sshconnection_p.h", "sshconnection.cpp",
+ "sshconnectionmanager.cpp", "sshconnectionmanager.h",
+ "sshcryptofacility.cpp", "sshcryptofacility_p.h",
+ "sshkeyexchange.cpp", "sshkeyexchange_p.h",
+ "sshkeypasswordretriever_p.h",
+ "sshoutgoingpacket.cpp", "sshoutgoingpacket_p.h",
+ "sshpacket.cpp", "sshpacket_p.h",
+ "sshpacketparser.cpp", "sshpacketparser_p.h",
+ "sshremoteprocess.cpp", "sshremoteprocess.h", "sshremoteprocess_p.h",
+ "sshremoteprocessrunner.cpp", "sshremoteprocessrunner.h",
+ "sshsendfacility.cpp", "sshsendfacility_p.h",
+ "sshkeypasswordretriever.cpp",
+ "sshkeygenerator.cpp", "sshkeygenerator.h",
+ "sshkeycreationdialog.cpp", "sshkeycreationdialog.h", "sshkeycreationdialog.ui",
+ "sshincomingpacket_p.h", "sshincomingpacket.cpp",
+ "ssherrors.h",
+ "sshexception_p.h",
+ "sshpseudoterminal.h",
+ "sshbotanconversions_p.h"
+ ]
+
+ ProductModule { Depends { name: "Qt"; submodules: ["widgets", "network"] } }
+}
+
diff --git a/src/libs/ssh/ssh_dependencies.pri b/src/libs/ssh/ssh_dependencies.pri
new file mode 100644
index 0000000000..e2a3c96f45
--- /dev/null
+++ b/src/libs/ssh/ssh_dependencies.pri
@@ -0,0 +1 @@
+include(../3rdparty/botan/botan.pri)
diff --git a/src/libs/ssh/ssh_global.h b/src/libs/ssh/ssh_global.h
new file mode 100644
index 0000000000..ca89d2dcfd
--- /dev/null
+++ b/src/libs/ssh/ssh_global.h
@@ -0,0 +1,49 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this file.
+** Please review the following information to ensure the GNU Lesser General
+** Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**************************************************************************/
+
+#ifndef SSH_GLOBAL_H
+#define SSH_GLOBAL_H
+
+#include <QtGlobal>
+
+#if defined(QSSH_LIBRARY)
+# define QSSH_EXPORT Q_DECL_EXPORT
+#else
+# define QSSH_EXPORT Q_DECL_IMPORT
+#endif
+
+#define QSSH_PRINT_WARNING qWarning("Soft assert at %s:%d", __FILE__, __LINE__)
+#define QSSH_ASSERT(cond) do { if (!(cond)) { QSSH_PRINT_WARNING; } } while (false)
+#define QSSH_ASSERT_AND_RETURN(cond) do { if (!(cond)) { QSSH_PRINT_WARNING; return; } } while (false)
+#define QSSH_ASSERT_AND_RETURN_VALUE(cond, value) do { if (!(cond)) { QSSH_PRINT_WARNING; return value; } } while (false)
+
+#endif // SSH_GLOBAL_H
diff --git a/src/libs/utils/ssh/sshbotanconversions_p.h b/src/libs/ssh/sshbotanconversions_p.h
index 60c9ed8a65..ea52148693 100644
--- a/src/libs/utils/ssh/sshbotanconversions_p.h
+++ b/src/libs/ssh/sshbotanconversions_p.h
@@ -38,7 +38,7 @@
#include <botan/rng.h>
#include <botan/secmem.h>
-namespace Utils {
+namespace QSsh {
namespace Internal {
inline const Botan::byte *convertByteArray(const QByteArray &a)
@@ -97,6 +97,6 @@ inline quint32 botanHMacKeyLen(const QByteArray &rfcAlgoName)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // BYTEARRAYCONVERSIONS_P_H
diff --git a/src/libs/utils/ssh/sshcapabilities.cpp b/src/libs/ssh/sshcapabilities.cpp
index a5aa08ea77..340fedcf4f 100644
--- a/src/libs/utils/ssh/sshcapabilities.cpp
+++ b/src/libs/ssh/sshcapabilities.cpp
@@ -37,7 +37,7 @@
#include <QCoreApplication>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
@@ -103,4 +103,4 @@ QByteArray SshCapabilities::findBestMatch(const QList<QByteArray> &myCapabilitie
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshcapabilities_p.h b/src/libs/ssh/sshcapabilities_p.h
index cf322e6711..c36163e6a9 100644
--- a/src/libs/utils/ssh/sshcapabilities_p.h
+++ b/src/libs/ssh/sshcapabilities_p.h
@@ -36,7 +36,7 @@
#include <QByteArray>
#include <QList>
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshCapabilities
@@ -70,6 +70,6 @@ public:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // CAPABILITIES_P_H
diff --git a/src/libs/utils/ssh/sshchannel.cpp b/src/libs/ssh/sshchannel.cpp
index 80e564c5cb..0d8fbfbaae 100644
--- a/src/libs/utils/ssh/sshchannel.cpp
+++ b/src/libs/ssh/sshchannel.cpp
@@ -39,7 +39,7 @@
#include <QTimer>
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
@@ -260,4 +260,4 @@ quint32 AbstractSshChannel::maxDataSize() const
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshchannel_p.h b/src/libs/ssh/sshchannel_p.h
index 89e43d032b..70e55d9c8f 100644
--- a/src/libs/utils/ssh/sshchannel_p.h
+++ b/src/libs/ssh/sshchannel_p.h
@@ -39,7 +39,7 @@
QT_FORWARD_DECLARE_CLASS(QTimer)
-namespace Utils {
+namespace QSsh {
namespace Internal {
struct SshChannelExitSignal;
@@ -119,6 +119,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHCHANNEL_P_H
diff --git a/src/libs/utils/ssh/sshchannelmanager.cpp b/src/libs/ssh/sshchannelmanager.cpp
index 3ce488e2bc..409f2a586f 100644
--- a/src/libs/utils/ssh/sshchannelmanager.cpp
+++ b/src/libs/ssh/sshchannelmanager.cpp
@@ -41,7 +41,7 @@
#include <QList>
-namespace Utils {
+namespace QSsh {
namespace Internal {
SshChannelManager::SshChannelManager(SshSendFacility &sendFacility,
@@ -149,21 +149,21 @@ AbstractSshChannel *SshChannelManager::lookupChannel(quint32 channelId,
return it == m_channels.end() ? 0 : it.value();
}
-Utils::SshRemoteProcess::Ptr SshChannelManager::createRemoteProcess(const QByteArray &command)
+QSsh::SshRemoteProcess::Ptr SshChannelManager::createRemoteProcess(const QByteArray &command)
{
SshRemoteProcess::Ptr proc(new SshRemoteProcess(command, m_nextLocalChannelId++, m_sendFacility));
insertChannel(proc->d, proc);
return proc;
}
-Utils::SshRemoteProcess::Ptr SshChannelManager::createRemoteShell()
+QSsh::SshRemoteProcess::Ptr SshChannelManager::createRemoteShell()
{
SshRemoteProcess::Ptr proc(new SshRemoteProcess(m_nextLocalChannelId++, m_sendFacility));
insertChannel(proc->d, proc);
return proc;
}
-Utils::SftpChannel::Ptr SshChannelManager::createSftpChannel()
+QSsh::SftpChannel::Ptr SshChannelManager::createSftpChannel()
{
SftpChannel::Ptr sftp(new SftpChannel(m_nextLocalChannelId++, m_sendFacility));
insertChannel(sftp->d, sftp);
@@ -195,4 +195,4 @@ void SshChannelManager::removeChannel(ChannelIterator it)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshchannelmanager_p.h b/src/libs/ssh/sshchannelmanager_p.h
index ab88206a73..9cc88e9dd6 100644
--- a/src/libs/utils/ssh/sshchannelmanager_p.h
+++ b/src/libs/ssh/sshchannelmanager_p.h
@@ -37,7 +37,7 @@
#include <QObject>
#include <QSharedPointer>
-namespace Utils {
+namespace QSsh {
class SftpChannel;
class SshRemoteProcess;
@@ -92,6 +92,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHCHANNELLAYER_P_H
diff --git a/src/libs/utils/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp
index a69353801f..a9ee712ec5 100644
--- a/src/libs/utils/ssh/sshconnection.cpp
+++ b/src/libs/ssh/sshconnection.cpp
@@ -40,9 +40,6 @@
#include "sshexception_p.h"
#include "sshkeyexchange_p.h"
-#include <utils/qtcassert.h>
-#include <utils/fileutils.h>
-
#include <botan/exceptn.h>
#include <botan/init.h>
@@ -53,7 +50,7 @@
#include <QTcpSocket>
/*!
- \class Utils::SshConnection
+ \class QSsh::SshConnection
\brief This class provides an SSH connection, implementing protocol version 2.0
@@ -61,7 +58,7 @@
It operates asynchronously (non-blocking) and is not thread-safe.
*/
-namespace Utils {
+namespace QSsh {
namespace {
const QByteArray ClientId("SSH-2.0-QtCreator\r\n");
@@ -74,10 +71,10 @@ namespace {
QMutexLocker locker(&staticInitMutex);
if (!staticInitializationsDone) {
Botan::LibraryInitializer::initialize("thread_safe=true");
- qRegisterMetaType<Utils::SshError>("Utils::SshError");
- qRegisterMetaType<Utils::SftpJobId>("Utils::SftpJobId");
- qRegisterMetaType<Utils::SftpFileInfo>("Utils::SftpFileInfo");
- qRegisterMetaType<QList <Utils::SftpFileInfo> >("QList<Utils::SftpFileInfo>");
+ qRegisterMetaType<QSsh::SshError>("QSsh::SshError");
+ qRegisterMetaType<QSsh::SftpJobId>("QSsh::SftpJobId");
+ qRegisterMetaType<QSsh::SftpFileInfo>("QSsh::SftpFileInfo");
+ qRegisterMetaType<QList <QSsh::SftpFileInfo> >("QList<QSsh::SftpFileInfo>");
staticInitializationsDone = true;
}
}
@@ -98,12 +95,12 @@ static inline bool equals(const SshConnectionParameters &p1, const SshConnection
&& p1.timeout == p2.timeout && p1.port == p2.port;
}
-QTCREATOR_UTILS_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2)
+bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2)
{
return equals(p1, p2);
}
-QTCREATOR_UTILS_EXPORT bool operator!=(const SshConnectionParameters &p1, const SshConnectionParameters &p2)
+bool operator!=(const SshConnectionParameters &p1, const SshConnectionParameters &p2)
{
return !equals(p1, p2);
}
@@ -125,8 +122,8 @@ SshConnection::SshConnection(const SshConnectionParameters &serverInfo)
SIGNAL(dataAvailable(QString)), Qt::QueuedConnection);
connect(d, SIGNAL(disconnected()), this, SIGNAL(disconnected()),
Qt::QueuedConnection);
- connect(d, SIGNAL(error(Utils::SshError)), this,
- SIGNAL(error(Utils::SshError)), Qt::QueuedConnection);
+ connect(d, SIGNAL(error(QSsh::SshError)), this,
+ SIGNAL(error(QSsh::SshError)), Qt::QueuedConnection);
}
void SshConnection::connectToHost()
@@ -169,7 +166,7 @@ SshConnectionParameters SshConnection::connectionParameters() const
SshConnectionInfo SshConnection::connectionInfo() const
{
- QTC_ASSERT(state() == Connected, return SshConnectionInfo());
+ QSSH_ASSERT_AND_RETURN_VALUE(state() == Connected, SshConnectionInfo());
return SshConnectionInfo(d->m_socket->localAddress(), d->m_socket->localPort(),
d->m_socket->peerAddress(), d->m_socket->peerPort());
@@ -184,19 +181,19 @@ SshConnection::~SshConnection()
QSharedPointer<SshRemoteProcess> SshConnection::createRemoteProcess(const QByteArray &command)
{
- QTC_ASSERT(state() == Connected, return QSharedPointer<SshRemoteProcess>());
+ QSSH_ASSERT_AND_RETURN_VALUE(state() == Connected, QSharedPointer<SshRemoteProcess>());
return d->createRemoteProcess(command);
}
QSharedPointer<SshRemoteProcess> SshConnection::createRemoteShell()
{
- QTC_ASSERT(state() == Connected, return QSharedPointer<SshRemoteProcess>());
+ QSSH_ASSERT_AND_RETURN_VALUE(state() == Connected, QSharedPointer<SshRemoteProcess>());
return d->createRemoteShell();
}
QSharedPointer<SftpChannel> SshConnection::createSftpChannel()
{
- QTC_ASSERT(state() == Connected, return QSharedPointer<SftpChannel>());
+ QSSH_ASSERT_AND_RETURN_VALUE(state() == Connected, QSharedPointer<SftpChannel>());
return d->createSftpChannel();
}
@@ -632,7 +629,7 @@ void SshConnectionPrivate::sendKeepAlivePacket()
void SshConnectionPrivate::connectToHost()
{
- QTC_ASSERT(m_state == SocketUnconnected, return);
+ QSSH_ASSERT_AND_RETURN(m_state == SocketUnconnected);
m_incomingData.clear();
m_incomingPacket.reset();
@@ -700,13 +697,14 @@ bool SshConnectionPrivate::canUseSocket() const
void SshConnectionPrivate::createPrivateKey()
{
- Utils::FileReader reader;
if (m_connParams.privateKeyFile.isEmpty())
throw SshClientException(SshKeyFileError, tr("No private key file given."));
- if (!reader.fetch(m_connParams.privateKeyFile))
+ QFile keyFile(m_connParams.privateKeyFile);
+ if (!keyFile.open(QIODevice::ReadOnly)) {
throw SshClientException(SshKeyFileError,
- tr("Private key file error: %1").arg(reader.errorString()));
- m_sendFacility.createAuthenticationKey(reader.data());
+ tr("Private key file error: %1").arg(keyFile.errorString()));
+ }
+ m_sendFacility.createAuthenticationKey(keyFile.readAll());
}
QSharedPointer<SshRemoteProcess> SshConnectionPrivate::createRemoteProcess(const QByteArray &command)
@@ -727,4 +725,4 @@ QSharedPointer<SftpChannel> SshConnectionPrivate::createSftpChannel()
const quint64 SshConnectionPrivate::InvalidSeqNr = static_cast<quint64>(-1);
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h
index 211502f585..b631c3e707 100644
--- a/src/libs/utils/ssh/sshconnection.h
+++ b/src/libs/ssh/sshconnection.h
@@ -35,7 +35,7 @@
#include "ssherrors.h"
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QByteArray>
#include <QObject>
@@ -43,7 +43,7 @@
#include <QString>
#include <QHostAddress>
-namespace Utils {
+namespace QSsh {
class SftpChannel;
class SshRemoteProcess;
@@ -51,7 +51,7 @@ namespace Internal {
class SshConnectionPrivate;
} // namespace Internal
-class QTCREATOR_UTILS_EXPORT SshConnectionParameters
+class QSSH_EXPORT SshConnectionParameters
{
public:
enum ProxyType { DefaultProxy, NoProxy };
@@ -68,10 +68,10 @@ public:
ProxyType proxyType;
};
-QTCREATOR_UTILS_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
-QTCREATOR_UTILS_EXPORT bool operator!=(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
+QSSH_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
+QSSH_EXPORT bool operator!=(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
-class QTCREATOR_UTILS_EXPORT SshConnectionInfo
+class QSSH_EXPORT SshConnectionInfo
{
public:
SshConnectionInfo() : localPort(0), peerPort(0) {}
@@ -84,7 +84,7 @@ public:
quint16 peerPort;
};
-class QTCREATOR_UTILS_EXPORT SshConnection : public QObject
+class QSSH_EXPORT SshConnection : public QObject
{
Q_OBJECT
@@ -111,7 +111,7 @@ signals:
void connected();
void disconnected();
void dataAvailable(const QString &message);
- void error(Utils::SshError);
+ void error(QSsh::SshError);
private:
SshConnection(const SshConnectionParameters &serverInfo);
@@ -119,6 +119,6 @@ private:
Internal::SshConnectionPrivate *d;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHCONNECTION_H
diff --git a/src/libs/utils/ssh/sshconnection_p.h b/src/libs/ssh/sshconnection_p.h
index 4756e05202..b1765e0ec5 100644
--- a/src/libs/utils/ssh/sshconnection_p.h
+++ b/src/libs/ssh/sshconnection_p.h
@@ -52,7 +52,7 @@ QT_END_NAMESPACE
namespace Botan { class Exception; }
-namespace Utils {
+namespace QSsh {
class SftpChannel;
namespace Internal {
@@ -80,7 +80,7 @@ enum SshKeyExchangeState {
class SshConnectionPrivate : public QObject
{
Q_OBJECT
- friend class Utils::SshConnection;
+ friend class QSsh::SshConnection;
public:
SshConnectionPrivate(SshConnection *conn,
const SshConnectionParameters &serverInfo);
@@ -100,7 +100,7 @@ signals:
void connected();
void disconnected();
void dataAvailable(const QString &message);
- void error(Utils::SshError);
+ void error(QSsh::SshError);
private:
Q_SLOT void handleSocketConnected();
@@ -172,6 +172,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHCONNECTION_P_H
diff --git a/src/libs/utils/ssh/sshconnectionmanager.cpp b/src/libs/ssh/sshconnectionmanager.cpp
index 8c1c8cd03e..2f5167a048 100644
--- a/src/libs/utils/ssh/sshconnectionmanager.cpp
+++ b/src/libs/ssh/sshconnectionmanager.cpp
@@ -41,7 +41,7 @@
#include <QObject>
#include <QThread>
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshConnectionManagerPrivate : public QObject
@@ -222,6 +222,6 @@ void SshConnectionManager::forceNewConnection(const SshConnectionParameters &ssh
d->forceNewConnection(sshParams);
}
-} // namespace Utils
+} // namespace QSsh
#include "sshconnectionmanager.moc"
diff --git a/src/libs/utils/ssh/sshconnectionmanager.h b/src/libs/ssh/sshconnectionmanager.h
index 3b26d6c83b..f6f7c39228 100644
--- a/src/libs/utils/ssh/sshconnectionmanager.h
+++ b/src/libs/ssh/sshconnectionmanager.h
@@ -33,17 +33,17 @@
#ifndef SSHCONNECTIONMANAGER_H
#define SSHCONNECTIONMANAGER_H
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QScopedPointer>
#include <QSharedPointer>
-namespace Utils {
+namespace QSsh {
class SshConnection;
class SshConnectionParameters;
namespace Internal { class SshConnectionManagerPrivate; }
-class QTCREATOR_UTILS_EXPORT SshConnectionManager
+class QSSH_EXPORT SshConnectionManager
{
friend class Internal::SshConnectionManagerPrivate;
public:
@@ -63,6 +63,6 @@ private:
const QScopedPointer<Internal::SshConnectionManagerPrivate> d;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHCONNECTIONMANAGER_H
diff --git a/src/libs/utils/ssh/sshcryptofacility.cpp b/src/libs/ssh/sshcryptofacility.cpp
index d5386d91c6..a795a6f56e 100644
--- a/src/libs/utils/ssh/sshcryptofacility.cpp
+++ b/src/libs/ssh/sshcryptofacility.cpp
@@ -58,7 +58,7 @@
using namespace Botan;
-namespace Utils {
+namespace QSsh {
namespace Internal {
SshAbstractCryptoFacility::SshAbstractCryptoFacility()
@@ -384,4 +384,4 @@ void SshDecryptionFacility::decrypt(QByteArray &data, quint32 offset,
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshcryptofacility_p.h b/src/libs/ssh/sshcryptofacility_p.h
index b19c18b9f4..6784f6b05b 100644
--- a/src/libs/utils/ssh/sshcryptofacility_p.h
+++ b/src/libs/ssh/sshcryptofacility_p.h
@@ -50,7 +50,7 @@ namespace Botan {
class PK_Signing_Key;
}
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshKeyExchange;
@@ -152,6 +152,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHABSTRACTCRYPTOFACILITY_P_H
diff --git a/src/libs/utils/ssh/ssherrors.h b/src/libs/ssh/ssherrors.h
index c2b32a3c76..d4ea7f82c4 100644
--- a/src/libs/utils/ssh/ssherrors.h
+++ b/src/libs/ssh/ssherrors.h
@@ -33,7 +33,7 @@
#ifndef SSHERRORS_P_H
#define SSHERRORS_P_H
-namespace Utils {
+namespace QSsh {
enum SshError {
SshNoError, SshSocketError, SshTimeoutError, SshProtocolError,
@@ -41,6 +41,6 @@ enum SshError {
SshClosedByServerError, SshInternalError
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHERRORS_P_H
diff --git a/src/libs/utils/ssh/sshexception_p.h b/src/libs/ssh/sshexception_p.h
index e21c9d9fc9..4cfdfcd9c2 100644
--- a/src/libs/utils/ssh/sshexception_p.h
+++ b/src/libs/ssh/sshexception_p.h
@@ -39,7 +39,7 @@
#include <QCoreApplication>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
enum SshErrorCode {
@@ -87,6 +87,6 @@ struct SshClientException
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHEXCEPTION_P_H
diff --git a/src/libs/utils/ssh/sshincomingpacket.cpp b/src/libs/ssh/sshincomingpacket.cpp
index feb9560e31..22db307404 100644
--- a/src/libs/utils/ssh/sshincomingpacket.cpp
+++ b/src/libs/ssh/sshincomingpacket.cpp
@@ -34,7 +34,7 @@
#include "sshcapabilities_p.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
const QByteArray SshIncomingPacket::ExitStatusType("exit-status");
@@ -460,4 +460,4 @@ void SshIncomingPacket::calculateLength() const
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshincomingpacket_p.h b/src/libs/ssh/sshincomingpacket_p.h
index e632881d9b..84d58783ed 100644
--- a/src/libs/utils/ssh/sshincomingpacket_p.h
+++ b/src/libs/ssh/sshincomingpacket_p.h
@@ -41,7 +41,7 @@
#include <QList>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshKeyExchange;
@@ -190,6 +190,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHINCOMINGPACKET_P_H
diff --git a/src/libs/utils/ssh/sshkeycreationdialog.cpp b/src/libs/ssh/sshkeycreationdialog.cpp
index 6e53f7e734..ab5595a49a 100644
--- a/src/libs/utils/ssh/sshkeycreationdialog.cpp
+++ b/src/libs/ssh/sshkeycreationdialog.cpp
@@ -33,30 +33,27 @@
#include "sshkeygenerator.h"
-#include <utils/fileutils.h>
-
#include <QDir>
#include <QFile>
+#include <QFileDialog>
#include <QFileInfo>
#include <QApplication>
#include <QDesktopServices>
#include <QMessageBox>
-namespace Utils {
+namespace QSsh {
SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent)
: QDialog(parent), m_keyGenerator(0), m_ui(new Ui::SshKeyCreationDialog)
{
m_ui->setupUi(this);
- m_ui->privateKeyFilePathChooser->setExpectedKind(PathChooser::File);
const QString defaultPath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation)
+ QLatin1String("/.ssh/qtc_id");
- m_ui->privateKeyFilePathChooser->setPath(defaultPath);
- filePathChanged();
+ setPrivateKeyFile(defaultPath);
connect(m_ui->rsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged()));
connect(m_ui->dsa, SIGNAL(toggled(bool)), this, SLOT(keyTypeChanged()));
- connect(m_ui->privateKeyFilePathChooser, SIGNAL(changed(QString)), SLOT(filePathChanged()));
+ connect(m_ui->privateKeyFileButton, SIGNAL(clicked()), SLOT(handleBrowseButtonClicked()));
connect(m_ui->generateButton, SIGNAL(clicked()), this, SLOT(generateKeys()));
}
@@ -92,10 +89,18 @@ void SshKeyCreationDialog::generateKeys()
}
}
-void SshKeyCreationDialog::filePathChanged()
+void SshKeyCreationDialog::handleBrowseButtonClicked()
+{
+ const QString filePath = QFileDialog::getSaveFileName(this, tr("Choose Private Key File Name"));
+ if (!filePath.isEmpty())
+ setPrivateKeyFile(filePath);
+}
+
+void SshKeyCreationDialog::setPrivateKeyFile(const QString &filePath)
{
+ m_ui->privateKeyFileValueLabel->setText(filePath);
m_ui->generateButton->setEnabled(!privateKeyFilePath().isEmpty());
- m_ui->publicKeyFileLabel->setText(privateKeyFilePath() + QLatin1String(".pub"));
+ m_ui->publicKeyFileLabel->setText(filePath + QLatin1String(".pub"));
}
void SshKeyCreationDialog::saveKeys()
@@ -107,21 +112,29 @@ void SshKeyCreationDialog::saveKeys()
return;
}
- FileSaver privSaver(privateKeyFilePath());
- privSaver.write(m_keyGenerator->privateKey());
- if (!privSaver.finalize(this))
+ QFile privateKeyFile(privateKeyFilePath());
+ if (!privateKeyFile.open(QIODevice::WriteOnly)
+ || !privateKeyFile.write(m_keyGenerator->privateKey())) {
+ QMessageBox::critical(this, tr("Saving Private Key File failed"),
+ tr("The private key file could not be saved: %1").arg(privateKeyFile.errorString()));
return;
+ }
QFile::setPermissions(privateKeyFilePath(), QFile::ReadOwner | QFile::WriteOwner);
- FileSaver pubSaver(publicKeyFilePath());
- pubSaver.write(m_keyGenerator->publicKey());
- if (pubSaver.finalize(this))
- accept();
+ QFile publicKeyFile(publicKeyFilePath());
+ if (!publicKeyFile.open(QIODevice::WriteOnly)
+ || !publicKeyFile.write(m_keyGenerator->publicKey())) {
+ QMessageBox::critical(this, tr("Saving Public Key File failed"),
+ tr("The public key file could not be saved: %1").arg(publicKeyFile.errorString()));
+ return;
+ }
+
+ accept();
}
QString SshKeyCreationDialog::privateKeyFilePath() const
{
- return m_ui->privateKeyFilePathChooser->path();
+ return m_ui->privateKeyFileValueLabel->text();
}
QString SshKeyCreationDialog::publicKeyFilePath() const
@@ -129,4 +142,4 @@ QString SshKeyCreationDialog::publicKeyFilePath() const
return m_ui->publicKeyFileLabel->text();
}
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshkeycreationdialog.h b/src/libs/ssh/sshkeycreationdialog.h
index b8985294a1..7f30792a3f 100644
--- a/src/libs/utils/ssh/sshkeycreationdialog.h
+++ b/src/libs/ssh/sshkeycreationdialog.h
@@ -32,16 +32,16 @@
#ifndef SSHKEYCREATIONDIALOG_H
#define SSHKEYCREATIONDIALOG_H
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QDialog>
-namespace Utils {
+namespace QSsh {
class SshKeyGenerator;
namespace Ui { class SshKeyCreationDialog; }
-class QTCREATOR_UTILS_EXPORT SshKeyCreationDialog : public QDialog
+class QSSH_EXPORT SshKeyCreationDialog : public QDialog
{
Q_OBJECT
public:
@@ -54,9 +54,10 @@ public:
private slots:
void keyTypeChanged();
void generateKeys();
- void filePathChanged();
+ void handleBrowseButtonClicked();
private:
+ void setPrivateKeyFile(const QString &filePath);
void saveKeys();
private:
@@ -64,6 +65,6 @@ private:
Ui::SshKeyCreationDialog *m_ui;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHKEYCREATIONDIALOG_H
diff --git a/src/libs/utils/ssh/sshkeycreationdialog.ui b/src/libs/ssh/sshkeycreationdialog.ui
index 9e20d07f9b..d49681e65b 100644
--- a/src/libs/utils/ssh/sshkeycreationdialog.ui
+++ b/src/libs/ssh/sshkeycreationdialog.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>Utils::SshKeyCreationDialog</class>
- <widget class="QDialog" name="Utils::SshKeyCreationDialog">
+ <class>QSsh::SshKeyCreationDialog</class>
+ <widget class="QDialog" name="QSsh::SshKeyCreationDialog">
<property name="enabled">
<bool>true</bool>
</property>
@@ -82,7 +82,7 @@
</item>
</layout>
</item>
- <item row="2" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="keySize">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@@ -98,7 +98,7 @@
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QComboBox" name="comboBox">
@@ -134,24 +134,52 @@
</item>
</layout>
</item>
- <item row="6" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="privateKeyFileLabel">
<property name="text">
<string>Private key file:</string>
</property>
</widget>
</item>
- <item row="8" column="0">
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLabel" name="privateKeyFileValueLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="privateKeyFileButton">
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Public key file:</string>
</property>
</widget>
</item>
- <item row="6" column="1">
- <widget class="Utils::PathChooser" name="privateKeyFilePathChooser" native="true"/>
- </item>
- <item row="8" column="1">
+ <item row="3" column="1">
<widget class="QLabel" name="publicKeyFileLabel">
<property name="text">
<string/>
@@ -222,19 +250,12 @@
</item>
</layout>
</widget>
- <customwidgets>
- <customwidget>
- <class>Utils::PathChooser</class>
- <extends>QWidget</extends>
- <header location="global">utils/pathchooser.h</header>
- </customwidget>
- </customwidgets>
<resources/>
<connections>
<connection>
<sender>closeButton</sender>
<signal>clicked()</signal>
- <receiver>Utils::SshKeyCreationDialog</receiver>
+ <receiver>QSsh::SshKeyCreationDialog</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
diff --git a/src/libs/utils/ssh/sshkeyexchange.cpp b/src/libs/ssh/sshkeyexchange.cpp
index 29a6a36f35..333f394dea 100644
--- a/src/libs/utils/ssh/sshkeyexchange.cpp
+++ b/src/libs/ssh/sshkeyexchange.cpp
@@ -51,7 +51,7 @@
using namespace Botan;
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
@@ -222,4 +222,4 @@ void SshKeyExchange::sendNewKeysPacket(const SshIncomingPacket &dhReply,
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshkeyexchange_p.h b/src/libs/ssh/sshkeyexchange_p.h
index 83be2fad86..eb6a13f30a 100644
--- a/src/libs/utils/ssh/sshkeyexchange_p.h
+++ b/src/libs/ssh/sshkeyexchange_p.h
@@ -40,7 +40,7 @@
namespace Botan { class HashFunction; }
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshSendFacility;
@@ -85,6 +85,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHKEYEXCHANGE_P_H
diff --git a/src/libs/utils/ssh/sshkeygenerator.cpp b/src/libs/ssh/sshkeygenerator.cpp
index 0165644960..f71a2232c7 100644
--- a/src/libs/utils/ssh/sshkeygenerator.cpp
+++ b/src/libs/ssh/sshkeygenerator.cpp
@@ -50,7 +50,7 @@
#include <string>
-namespace Utils {
+namespace QSsh {
using namespace Botan;
using namespace Internal;
@@ -198,4 +198,4 @@ QString SshKeyGenerator::getPassword() const
return result == QDialog::Accepted ? password : QString();
}
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshkeygenerator.h b/src/libs/ssh/sshkeygenerator.h
index 506039e3bc..09bf1804ed 100644
--- a/src/libs/utils/ssh/sshkeygenerator.h
+++ b/src/libs/ssh/sshkeygenerator.h
@@ -33,7 +33,7 @@
#ifndef SSHKEYGENERATOR_H
#define SSHKEYGENERATOR_H
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QCoreApplication>
#include <QSharedPointer>
@@ -43,9 +43,9 @@ namespace Botan {
class RandomNumberGenerator;
}
-namespace Utils {
+namespace QSsh {
-class QTCREATOR_UTILS_EXPORT SshKeyGenerator
+class QSSH_EXPORT SshKeyGenerator
{
Q_DECLARE_TR_FUNCTIONS(SshKeyGenerator)
public:
@@ -80,6 +80,6 @@ private:
EncryptionMode m_encryptionMode;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHKEYGENERATOR_H
diff --git a/src/libs/utils/ssh/sshkeypasswordretriever.cpp b/src/libs/ssh/sshkeypasswordretriever.cpp
index 7c00751ec6..5e725c7f55 100644
--- a/src/libs/utils/ssh/sshkeypasswordretriever.cpp
+++ b/src/libs/ssh/sshkeypasswordretriever.cpp
@@ -37,7 +37,7 @@
#include <iostream>
-namespace Utils {
+namespace QSsh {
namespace Internal {
std::string SshKeyPasswordRetriever::get_passphrase(const std::string &, const std::string &,
@@ -47,8 +47,8 @@ std::string SshKeyPasswordRetriever::get_passphrase(const std::string &, const s
if (hasGui) {
bool ok;
const QString &password = QInputDialog::getText(0,
- QCoreApplication::translate("Utils::Ssh", "Password Required"),
- QCoreApplication::translate("Utils::Ssh", "Please enter the password for your private key."),
+ QCoreApplication::translate("QSsh::Ssh", "Password Required"),
+ QCoreApplication::translate("QSsh::Ssh", "Please enter the password for your private key."),
QLineEdit::Password, QString(), &ok);
result = ok ? OK : CANCEL_ACTION;
return std::string(password.toLocal8Bit().data());
@@ -62,4 +62,4 @@ std::string SshKeyPasswordRetriever::get_passphrase(const std::string &, const s
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshkeypasswordretriever_p.h b/src/libs/ssh/sshkeypasswordretriever_p.h
index 505badb536..b3a0b0f09e 100644
--- a/src/libs/utils/ssh/sshkeypasswordretriever_p.h
+++ b/src/libs/ssh/sshkeypasswordretriever_p.h
@@ -36,7 +36,7 @@
#include <string>
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshKeyPasswordRetriever : public Botan::User_Interface
@@ -47,6 +47,6 @@ public:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // KEYPASSWORDRETRIEVER_H
diff --git a/src/libs/utils/ssh/sshoutgoingpacket.cpp b/src/libs/ssh/sshoutgoingpacket.cpp
index e79f65a60e..04a38d9927 100644
--- a/src/libs/utils/ssh/sshoutgoingpacket.cpp
+++ b/src/libs/ssh/sshoutgoingpacket.cpp
@@ -37,7 +37,7 @@
#include <QtEndian>
-namespace Utils {
+namespace QSsh {
namespace Internal {
SshOutgoingPacket::SshOutgoingPacket(const SshEncryptionFacility &encrypter,
@@ -322,4 +322,4 @@ QByteArray SshOutgoingPacket::encodeNameList(const QList<QByteArray> &list)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshoutgoingpacket_p.h b/src/libs/ssh/sshoutgoingpacket_p.h
index 546c5f247b..4a12218ebc 100644
--- a/src/libs/utils/ssh/sshoutgoingpacket_p.h
+++ b/src/libs/ssh/sshoutgoingpacket_p.h
@@ -37,7 +37,7 @@
#include "sshpseudoterminal.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshEncryptionFacility;
@@ -103,6 +103,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHOUTGOINGPACKET_P_H
diff --git a/src/libs/utils/ssh/sshpacket.cpp b/src/libs/ssh/sshpacket.cpp
index 7af1f25078..3e6e408587 100644
--- a/src/libs/utils/ssh/sshpacket.cpp
+++ b/src/libs/ssh/sshpacket.cpp
@@ -41,7 +41,7 @@
#include <cctype>
-namespace Utils {
+namespace QSsh {
namespace Internal {
const quint32 AbstractSshPacket::PaddingLengthOffset = 4;
@@ -165,4 +165,4 @@ void AbstractSshPacket::setLengthField(QByteArray &data)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshpacket_p.h b/src/libs/ssh/sshpacket_p.h
index 594f13c744..22a7a9e826 100644
--- a/src/libs/utils/ssh/sshpacket_p.h
+++ b/src/libs/ssh/sshpacket_p.h
@@ -41,7 +41,7 @@
#include <botan/bigint.h>
-namespace Utils {
+namespace QSsh {
namespace Internal {
enum SshPacketType {
@@ -141,6 +141,6 @@ protected:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHPACKET_P_H
diff --git a/src/libs/utils/ssh/sshpacketparser.cpp b/src/libs/ssh/sshpacketparser.cpp
index ee12803930..c5197fc01c 100644
--- a/src/libs/utils/ssh/sshpacketparser.cpp
+++ b/src/libs/ssh/sshpacketparser.cpp
@@ -34,7 +34,7 @@
#include <cctype>
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace { quint32 size(const QByteArray &data) { return data.size(); } }
@@ -153,4 +153,4 @@ Botan::BigInt SshPacketParser::asBigInt(const QByteArray &data, quint32 *offset)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshpacketparser_p.h b/src/libs/ssh/sshpacketparser_p.h
index a1e0e7eab9..775dc5e975 100644
--- a/src/libs/utils/ssh/sshpacketparser_p.h
+++ b/src/libs/ssh/sshpacketparser_p.h
@@ -39,7 +39,7 @@
#include <QList>
#include <QString>
-namespace Utils {
+namespace QSsh {
namespace Internal {
struct SshNameList
@@ -79,6 +79,6 @@ public:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHPACKETPARSER_P_H
diff --git a/src/libs/utils/ssh/sshpseudoterminal.h b/src/libs/ssh/sshpseudoterminal.h
index 263bcd574d..23875ef939 100644
--- a/src/libs/utils/ssh/sshpseudoterminal.h
+++ b/src/libs/ssh/sshpseudoterminal.h
@@ -33,14 +33,14 @@
#ifndef SSHPSEUDOTERMINAL_H
#define SSHPSEUDOTERMINAL_H
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QByteArray>
#include <QHash>
-namespace Utils {
+namespace QSsh {
-class QTCREATOR_UTILS_EXPORT SshPseudoTerminal
+class QSSH_EXPORT SshPseudoTerminal
{
public:
explicit SshPseudoTerminal(const QByteArray &termType = "vt100",
@@ -115,6 +115,6 @@ class QTCREATOR_UTILS_EXPORT SshPseudoTerminal
ModeMap modes;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHPSEUDOTERMINAL_H
diff --git a/src/libs/utils/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp
index 813e1f824c..1bcba171fe 100644
--- a/src/libs/utils/ssh/sshremoteprocess.cpp
+++ b/src/libs/ssh/sshremoteprocess.cpp
@@ -38,15 +38,13 @@
#include <botan/exceptn.h>
-#include <utils/qtcassert.h>
-
#include <QTimer>
#include <cstring>
#include <cstdlib>
/*!
- \class Utils::SshRemoteProcess
+ \class QSsh::SshRemoteProcess
\brief This class implements an SSH channel for running a remote process.
@@ -58,7 +56,7 @@
no synchronous mode.
*/
-namespace Utils {
+namespace QSsh {
const struct {
SshRemoteProcess::Signal signalEnum;
@@ -181,7 +179,7 @@ void SshRemoteProcess::addToEnvironment(const QByteArray &var, const QByteArray
void SshRemoteProcess::requestTerminal(const SshPseudoTerminal &terminal)
{
- QTC_ASSERT(d->channelState() == Internal::SshRemoteProcessPrivate::Inactive, return);
+ QSSH_ASSERT_AND_RETURN(d->channelState() == Internal::SshRemoteProcessPrivate::Inactive);
d->m_useTerminal = true;
d->m_terminal = terminal;
}
@@ -206,7 +204,7 @@ void SshRemoteProcess::sendSignal(Signal signal)
if (signalMap[i].signalEnum == signal)
signalString = signalMap[i].signalString;
}
- QTC_ASSERT(signalString, return);
+ QSSH_ASSERT_AND_RETURN(signalString);
d->m_sendFacility.sendChannelSignalPacket(d->remoteChannel(), signalString);
}
} catch (Botan::Exception &e) {
@@ -383,4 +381,4 @@ void SshRemoteProcessPrivate::handleExitSignal(const SshChannelExitSignal &signa
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshremoteprocess.h b/src/libs/ssh/sshremoteprocess.h
index ed4e96e5d7..16c8f7a191 100644
--- a/src/libs/utils/ssh/sshremoteprocess.h
+++ b/src/libs/ssh/sshremoteprocess.h
@@ -33,7 +33,7 @@
#ifndef SSHREMOTECOMMAND_H
#define SSHREMOTECOMMAND_H
-#include <utils/utils_global.h>
+#include "ssh_global.h"
#include <QProcess>
#include <QSharedPointer>
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
class QByteArray;
QT_END_NAMESPACE
-namespace Utils {
+namespace QSsh {
class SshPseudoTerminal;
namespace Internal {
class SshChannelManager;
@@ -51,7 +51,7 @@ class SshSendFacility;
} // namespace Internal
// TODO: ProcessChannel
-class QTCREATOR_UTILS_EXPORT SshRemoteProcess : public QIODevice
+class QSSH_EXPORT SshRemoteProcess : public QIODevice
{
Q_OBJECT
@@ -125,6 +125,6 @@ private:
Internal::SshRemoteProcessPrivate *d;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHREMOTECOMMAND_H
diff --git a/src/libs/utils/ssh/sshremoteprocess_p.h b/src/libs/ssh/sshremoteprocess_p.h
index eba60a6ac1..1e64c307e2 100644
--- a/src/libs/utils/ssh/sshremoteprocess_p.h
+++ b/src/libs/ssh/sshremoteprocess_p.h
@@ -41,7 +41,7 @@
#include <QPair>
#include <QProcess>
-namespace Utils {
+namespace QSsh {
class SshRemoteProcess;
namespace Internal {
@@ -50,7 +50,7 @@ class SshSendFacility;
class SshRemoteProcessPrivate : public AbstractSshChannel
{
Q_OBJECT
- friend class Utils::SshRemoteProcess;
+ friend class QSsh::SshRemoteProcess;
public:
enum ProcessState {
NotYetStarted, ExecRequested, StartFailed, Running, Exited
@@ -109,6 +109,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHREMOTEPROCESS_P_H
diff --git a/src/libs/utils/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp
index 16d77c471e..5af53eab4c 100644
--- a/src/libs/utils/ssh/sshremoteprocessrunner.cpp
+++ b/src/libs/ssh/sshremoteprocessrunner.cpp
@@ -35,16 +35,14 @@
#include "sshconnectionmanager.h"
#include "sshpseudoterminal.h"
-#include <utils/qtcassert.h>
-
/*!
- \class Utils::SshRemoteProcessRunner
+ \class QSsh::SshRemoteProcessRunner
\brief Convenience class for running a remote process over an SSH connection.
*/
-namespace Utils {
+namespace QSsh {
namespace Internal {
namespace {
enum State { Inactive, Connecting, Connected, ProcessRunning };
@@ -60,7 +58,7 @@ public:
bool m_runInTerminal;
SshPseudoTerminal m_terminal;
QByteArray m_command;
- Utils::SshError m_lastConnectionError;
+ QSsh::SshError m_lastConnectionError;
QString m_lastConnectionErrorString;
SshRemoteProcess::ExitStatus m_exitStatus;
SshRemoteProcess::Signal m_exitSignal;
@@ -88,7 +86,7 @@ SshRemoteProcessRunner::~SshRemoteProcessRunner()
void SshRemoteProcessRunner::run(const QByteArray &command,
const SshConnectionParameters &sshParams)
{
- QTC_ASSERT(d->m_state == Inactive, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == Inactive);
d->m_runInTerminal = false;
runInternal(command, sshParams);
@@ -114,8 +112,8 @@ void SshRemoteProcessRunner::runInternal(const QByteArray &command,
d->m_exitCode = -1;
d->m_command = command;
d->m_connection = SshConnectionManager::instance().acquireConnection(sshParams);
- connect(d->m_connection.data(), SIGNAL(error(Utils::SshError)),
- SLOT(handleConnectionError(Utils::SshError)));
+ connect(d->m_connection.data(), SIGNAL(error(QSsh::SshError)),
+ SLOT(handleConnectionError(QSsh::SshError)));
connect(d->m_connection.data(), SIGNAL(disconnected()), SLOT(handleDisconnected()));
if (d->m_connection->state() == SshConnection::Connected) {
handleConnected();
@@ -128,7 +126,7 @@ void SshRemoteProcessRunner::runInternal(const QByteArray &command,
void SshRemoteProcessRunner::handleConnected()
{
- QTC_ASSERT(d->m_state == Connecting, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == Connecting);
setState(Connected);
d->m_process = d->m_connection->createRemoteProcess(d->m_command);
@@ -141,7 +139,7 @@ void SshRemoteProcessRunner::handleConnected()
d->m_process->start();
}
-void SshRemoteProcessRunner::handleConnectionError(Utils::SshError error)
+void SshRemoteProcessRunner::handleConnectionError(QSsh::SshError error)
{
d->m_lastConnectionError = error;
d->m_lastConnectionErrorString = d->m_connection->errorString();
@@ -151,14 +149,14 @@ void SshRemoteProcessRunner::handleConnectionError(Utils::SshError error)
void SshRemoteProcessRunner::handleDisconnected()
{
- QTC_ASSERT(d->m_state == Connecting || d->m_state == Connected
- || d->m_state == ProcessRunning, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == Connecting || d->m_state == Connected
+ || d->m_state == ProcessRunning);
setState(Inactive);
}
void SshRemoteProcessRunner::handleProcessStarted()
{
- QTC_ASSERT(d->m_state == Connected, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == Connected);
setState(ProcessRunning);
emit processStarted();
@@ -169,14 +167,14 @@ void SshRemoteProcessRunner::handleProcessFinished(int exitStatus)
d->m_exitStatus = static_cast<SshRemoteProcess::ExitStatus>(exitStatus);
switch (d->m_exitStatus) {
case SshRemoteProcess::FailedToStart:
- QTC_ASSERT(d->m_state == Connected, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == Connected);
break;
case SshRemoteProcess::KilledBySignal:
- QTC_ASSERT(d->m_state == ProcessRunning, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == ProcessRunning);
d->m_exitSignal = d->m_process->exitSignal();
break;
case SshRemoteProcess::ExitedNormally:
- QTC_ASSERT(d->m_state == ProcessRunning, return);
+ QSSH_ASSERT_AND_RETURN(d->m_state == ProcessRunning);
d->m_exitCode = d->m_process->exitCode();
break;
default:
@@ -230,19 +228,19 @@ bool SshRemoteProcessRunner::isProcessRunning() const
SshRemoteProcess::ExitStatus SshRemoteProcessRunner::processExitStatus() const
{
- QTC_CHECK(!isProcessRunning());
+ QSSH_ASSERT(!isProcessRunning());
return d->m_exitStatus;
}
SshRemoteProcess::Signal SshRemoteProcessRunner::processExitSignal() const
{
- QTC_CHECK(processExitStatus() == SshRemoteProcess::KilledBySignal);
+ QSSH_ASSERT(processExitStatus() == SshRemoteProcess::KilledBySignal);
return d->m_exitSignal;
}
int SshRemoteProcessRunner::processExitCode() const
{
- QTC_CHECK(processExitStatus() == SshRemoteProcess::ExitedNormally);
+ QSSH_ASSERT(processExitStatus() == SshRemoteProcess::ExitedNormally);
return d->m_exitCode;
}
@@ -253,13 +251,13 @@ QString SshRemoteProcessRunner::processErrorString() const
void SshRemoteProcessRunner::writeDataToProcess(const QByteArray &data)
{
- QTC_ASSERT(isProcessRunning(), return);
+ QSSH_ASSERT(isProcessRunning());
d->m_process->write(data);
}
void SshRemoteProcessRunner::sendSignalToProcess(SshRemoteProcess::Signal signal)
{
- QTC_ASSERT(isProcessRunning(), return);
+ QSSH_ASSERT(isProcessRunning());
d->m_process->sendSignal(signal);
}
@@ -268,4 +266,4 @@ void SshRemoteProcessRunner::cancel()
setState(Inactive);
}
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshremoteprocessrunner.h b/src/libs/ssh/sshremoteprocessrunner.h
index 54bcf6d910..57d755bc0f 100644
--- a/src/libs/utils/ssh/sshremoteprocessrunner.h
+++ b/src/libs/ssh/sshremoteprocessrunner.h
@@ -36,12 +36,12 @@
#include "sshconnection.h"
#include "sshremoteprocess.h"
-namespace Utils {
+namespace QSsh {
namespace Internal {
class SshRemoteProcessRunnerPrivate;
} // namespace Internal
-class QTCREATOR_UTILS_EXPORT SshRemoteProcessRunner : public QObject
+class QSSH_EXPORT SshRemoteProcessRunner : public QObject
{
Q_OBJECT
@@ -54,7 +54,7 @@ public:
const SshConnectionParameters &sshParams);
QByteArray command() const;
- Utils::SshError lastConnectionError() const;
+ QSsh::SshError lastConnectionError() const;
QString lastConnectionErrorString() const;
bool isProcessRunning() const;
@@ -68,7 +68,7 @@ public:
private slots:
void handleConnected();
- void handleConnectionError(Utils::SshError error);
+ void handleConnectionError(QSsh::SshError error);
void handleDisconnected();
void handleProcessStarted();
void handleProcessFinished(int exitStatus);
@@ -83,12 +83,12 @@ signals:
void processClosed(int exitStatus); // values are of type SshRemoteProcess::ExitStatus
private:
- void runInternal(const QByteArray &command, const Utils::SshConnectionParameters &sshParams);
+ void runInternal(const QByteArray &command, const QSsh::SshConnectionParameters &sshParams);
void setState(int newState);
Internal::SshRemoteProcessRunnerPrivate * const d;
};
-} // namespace Utils
+} // namespace QSsh
#endif // SSHREMOTEPROCESSRUNNER_H
diff --git a/src/libs/utils/ssh/sshsendfacility.cpp b/src/libs/ssh/sshsendfacility.cpp
index 771d145405..2797dce1df 100644
--- a/src/libs/utils/ssh/sshsendfacility.cpp
+++ b/src/libs/ssh/sshsendfacility.cpp
@@ -37,7 +37,7 @@
#include <QTcpSocket>
-namespace Utils {
+namespace QSsh {
namespace Internal {
SshSendFacility::SshSendFacility(QTcpSocket *socket)
@@ -219,4 +219,4 @@ void SshSendFacility::sendChannelClosePacket(quint32 remoteChannel)
}
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
diff --git a/src/libs/utils/ssh/sshsendfacility_p.h b/src/libs/ssh/sshsendfacility_p.h
index b7a243d3cc..2801d2a454 100644
--- a/src/libs/utils/ssh/sshsendfacility_p.h
+++ b/src/libs/ssh/sshsendfacility_p.h
@@ -41,7 +41,7 @@ class QTcpSocket;
QT_END_NAMESPACE
-namespace Utils {
+namespace QSsh {
class SshPseudoTerminal;
namespace Internal {
@@ -96,6 +96,6 @@ private:
};
} // namespace Internal
-} // namespace Utils
+} // namespace QSsh
#endif // SSHCONNECTIONOUTSTATE_P_H
diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri
index 69050825cd..807f72cf5f 100644
--- a/src/libs/utils/utils-lib.pri
+++ b/src/libs/utils/utils-lib.pri
@@ -5,7 +5,7 @@ dll {
}
INCLUDEPATH += $$PWD
-QT += network script
+QT += script network
CONFIG += exceptions # used by portlist.cpp, textfileformat.cpp, and ssh/*
@@ -67,30 +67,6 @@ SOURCES += $$PWD/environment.cpp \
$$PWD/fileinprojectfinder.cpp \
$$PWD/ipaddresslineedit.cpp \
$$PWD/statuslabel.cpp \
- $$PWD/ssh/sshsendfacility.cpp \
- $$PWD/ssh/sshremoteprocess.cpp \
- $$PWD/ssh/sshpacketparser.cpp \
- $$PWD/ssh/sshpacket.cpp \
- $$PWD/ssh/sshoutgoingpacket.cpp \
- $$PWD/ssh/sshkeygenerator.cpp \
- $$PWD/ssh/sshkeyexchange.cpp \
- $$PWD/ssh/sshincomingpacket.cpp \
- $$PWD/ssh/sshcryptofacility.cpp \
- $$PWD/ssh/sshconnection.cpp \
- $$PWD/ssh/sshchannelmanager.cpp \
- $$PWD/ssh/sshchannel.cpp \
- $$PWD/ssh/sshcapabilities.cpp \
- $$PWD/ssh/sftppacket.cpp \
- $$PWD/ssh/sftpoutgoingpacket.cpp \
- $$PWD/ssh/sftpoperation.cpp \
- $$PWD/ssh/sftpincomingpacket.cpp \
- $$PWD/ssh/sftpdefs.cpp \
- $$PWD/ssh/sftpchannel.cpp \
- $$PWD/ssh/sshremoteprocessrunner.cpp \
- $$PWD/ssh/sshconnectionmanager.cpp \
- $$PWD/ssh/sshkeypasswordretriever.cpp \
- $$PWD/ssh/sftpfilesystemmodel.cpp \
- $$PWD/ssh/sshkeycreationdialog.cpp \
$$PWD/outputformatter.cpp \
$$PWD/flowlayout.cpp \
$$PWD/networkaccessmanager.cpp \
@@ -172,37 +148,6 @@ HEADERS += \
$$PWD/annotateditemdelegate.h \
$$PWD/fileinprojectfinder.h \
$$PWD/ipaddresslineedit.h \
- $$PWD/ssh/sshsendfacility_p.h \
- $$PWD/ssh/sshremoteprocess.h \
- $$PWD/ssh/sshremoteprocess_p.h \
- $$PWD/ssh/sshpacketparser_p.h \
- $$PWD/ssh/sshpacket_p.h \
- $$PWD/ssh/sshoutgoingpacket_p.h \
- $$PWD/ssh/sshkeygenerator.h \
- $$PWD/ssh/sshkeyexchange_p.h \
- $$PWD/ssh/sshincomingpacket_p.h \
- $$PWD/ssh/sshexception_p.h \
- $$PWD/ssh/ssherrors.h \
- $$PWD/ssh/sshcryptofacility_p.h \
- $$PWD/ssh/sshconnection.h \
- $$PWD/ssh/sshconnection_p.h \
- $$PWD/ssh/sshchannelmanager_p.h \
- $$PWD/ssh/sshchannel_p.h \
- $$PWD/ssh/sshcapabilities_p.h \
- $$PWD/ssh/sshbotanconversions_p.h \
- $$PWD/ssh/sftppacket_p.h \
- $$PWD/ssh/sftpoutgoingpacket_p.h \
- $$PWD/ssh/sftpoperation_p.h \
- $$PWD/ssh/sftpincomingpacket_p.h \
- $$PWD/ssh/sftpdefs.h \
- $$PWD/ssh/sftpchannel.h \
- $$PWD/ssh/sftpchannel_p.h \
- $$PWD/ssh/sshremoteprocessrunner.h \
- $$PWD/ssh/sshconnectionmanager.h \
- $$PWD/ssh/sshpseudoterminal.h \
- $$PWD/ssh/sshkeypasswordretriever_p.h \
- $$PWD/ssh/sftpfilesystemmodel.h \
- $$PWD/ssh/sshkeycreationdialog.h \
$$PWD/statuslabel.h \
$$PWD/outputformatter.h \
$$PWD/outputformat.h \
@@ -221,7 +166,6 @@ HEADERS += \
FORMS += $$PWD/filewizardpage.ui \
$$PWD/projectintropage.ui \
$$PWD/newclasswidget.ui \
- $$PWD/submiteditorwidget.ui \
- $$PWD/ssh/sshkeycreationdialog.ui
+ $$PWD/submiteditorwidget.ui
RESOURCES += $$PWD/utils.qrc
diff --git a/src/libs/utils/utils.pro b/src/libs/utils/utils.pro
index 8841790040..7829c45097 100644
--- a/src/libs/utils/utils.pro
+++ b/src/libs/utils/utils.pro
@@ -1,7 +1,6 @@
TEMPLATE = lib
TARGET = Utils
-QT += gui \
- network
+QT += gui network
include(../../qtcreatorlibrary.pri)
include(utils_dependencies.pri)
diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs
index c96f6c222b..1d64d6f28e 100644
--- a/src/libs/utils/utils.qbs
+++ b/src/libs/utils/utils.qbs
@@ -7,8 +7,6 @@ QtcLibrary {
cpp.defines: ["QTCREATOR_UTILS_LIB"]
cpp.includePaths: [ ".", "..",
"../..",
- "../3rdparty/botan/build",
- "ssh",
buildDirectory
]
@@ -23,7 +21,6 @@ QtcLibrary {
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ['widgets', 'network', 'script', 'concurrent'] }
- Depends { name: "Botan" }
Depends { name: "app_version_header" }
files: [
@@ -178,60 +175,6 @@ QtcLibrary {
"images/crumblepath-segment.png",
"images/removesubmitfield.png",
"images/triangle_vert.png",
- "ssh/sftpchannel.h",
- "ssh/sftpchannel_p.h",
- "ssh/sftpdefs.cpp",
- "ssh/sftpdefs.h",
- "ssh/sftpincomingpacket.cpp",
- "ssh/sftpincomingpacket_p.h",
- "ssh/sftpoperation.cpp",
- "ssh/sftpoperation_p.h",
- "ssh/sftpoutgoingpacket.cpp",
- "ssh/sftpoutgoingpacket_p.h",
- "ssh/sftppacket.cpp",
- "ssh/sftppacket_p.h",
- "ssh/sshbotanconversions_p.h",
- "ssh/sshcapabilities_p.h",
- "ssh/sshchannel.cpp",
- "ssh/sshchannel_p.h",
- "ssh/sshchannelmanager.cpp",
- "ssh/sshchannelmanager_p.h",
- "ssh/sshconnection.h",
- "ssh/sshconnection_p.h",
- "ssh/sshconnectionmanager.cpp",
- "ssh/sshconnectionmanager.h",
- "ssh/sshcryptofacility.cpp",
- "ssh/sshcryptofacility_p.h",
- "ssh/ssherrors.h",
- "ssh/sshexception_p.h",
- "ssh/sshincomingpacket_p.h",
- "ssh/sshkeyexchange.cpp",
- "ssh/sshkeyexchange_p.h",
- "ssh/sshkeypasswordretriever_p.h",
- "ssh/sshoutgoingpacket.cpp",
- "ssh/sshoutgoingpacket_p.h",
- "ssh/sshpacket.cpp",
- "ssh/sshpacket_p.h",
- "ssh/sshpacketparser.cpp",
- "ssh/sshpacketparser_p.h",
- "ssh/sshpseudoterminal.h",
- "ssh/sshremoteprocess.cpp",
- "ssh/sshremoteprocess.h",
- "ssh/sshremoteprocess_p.h",
- "ssh/sshremoteprocessrunner.cpp",
- "ssh/sshremoteprocessrunner.h",
- "ssh/sshsendfacility.cpp",
- "ssh/sshsendfacility_p.h",
- "ssh/sshkeypasswordretriever.cpp",
- "ssh/sftpchannel.cpp",
- "ssh/sshcapabilities.cpp",
- "ssh/sshconnection.cpp",
- "ssh/sshincomingpacket.cpp",
- "ssh/sshkeygenerator.cpp",
- "ssh/sshkeygenerator.h",
- "ssh/sshkeycreationdialog.cpp",
- "ssh/sshkeycreationdialog.h",
- "ssh/sshkeycreationdialog.ui"
]
Group {
@@ -260,7 +203,7 @@ QtcLibrary {
}
ProductModule {
- Depends { name: "Qt"; submodules: ["concurrent", "widgets", "network"] }
+ Depends { name: "Qt"; submodules: ["concurrent", "widgets" ] }
}
}
diff --git a/src/libs/utils/utils_dependencies.pri b/src/libs/utils/utils_dependencies.pri
index e2a3c96f45..e69de29bb2 100644
--- a/src/libs/utils/utils_dependencies.pri
+++ b/src/libs/utils/utils_dependencies.pri
@@ -1 +0,0 @@
-include(../3rdparty/botan/botan.pri)
diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp
index 7a0ccbb6cc..3b5f2f17e0 100644
--- a/src/plugins/analyzerbase/analyzermanager.cpp
+++ b/src/plugins/analyzerbase/analyzermanager.cpp
@@ -74,7 +74,7 @@
#include <utils/qtcassert.h>
#include <utils/checkablemessagebox.h>
#include <utils/statuslabel.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QVariant>
#include <QDebug>
diff --git a/src/plugins/analyzerbase/analyzerstartparameters.h b/src/plugins/analyzerbase/analyzerstartparameters.h
index d84bd95771..91a5c8b8aa 100644
--- a/src/plugins/analyzerbase/analyzerstartparameters.h
+++ b/src/plugins/analyzerbase/analyzerstartparameters.h
@@ -39,7 +39,7 @@
#include <QMetaType>
#include <coreplugin/id.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <utils/environment.h>
namespace Analyzer {
@@ -54,7 +54,7 @@ public:
{}
StartMode startMode;
- Utils::SshConnectionParameters connParams;
+ QSsh::SshConnectionParameters connParams;
Core::Id toolId;
QString debuggee;
diff --git a/src/plugins/analyzerbase/startremotedialog.cpp b/src/plugins/analyzerbase/startremotedialog.cpp
index 25b784f607..9436add8ba 100644
--- a/src/plugins/analyzerbase/startremotedialog.cpp
+++ b/src/plugins/analyzerbase/startremotedialog.cpp
@@ -35,7 +35,7 @@
#include "ui_startremotedialog.h"
#include <coreplugin/icore.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QPushButton>
@@ -113,16 +113,16 @@ void StartRemoteDialog::validate()
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid);
}
-Utils::SshConnectionParameters StartRemoteDialog::sshParams() const
+QSsh::SshConnectionParameters StartRemoteDialog::sshParams() const
{
- Utils::SshConnectionParameters params;
+ QSsh::SshConnectionParameters params;
params.host = m_ui->host->text();
params.userName = m_ui->user->text();
if (m_ui->keyFile->isValid()) {
- params.authenticationType = Utils::SshConnectionParameters::AuthenticationByKey;
+ params.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey;
params.privateKeyFile = m_ui->keyFile->path();
} else {
- params.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
+ params.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
params.password = m_ui->password->text();
}
params.port = m_ui->port->value();
diff --git a/src/plugins/analyzerbase/startremotedialog.h b/src/plugins/analyzerbase/startremotedialog.h
index 8e74fafb1e..e827d2e0d2 100644
--- a/src/plugins/analyzerbase/startremotedialog.h
+++ b/src/plugins/analyzerbase/startremotedialog.h
@@ -37,7 +37,7 @@
#include <QDialog>
-namespace Utils { class SshConnectionParameters; }
+namespace QSsh { class SshConnectionParameters; }
namespace Analyzer {
@@ -52,7 +52,7 @@ public:
explicit StartRemoteDialog(QWidget *parent = 0);
virtual ~StartRemoteDialog();
- Utils::SshConnectionParameters sshParams() const;
+ QSsh::SshConnectionParameters sshParams() const;
QString executable() const;
QString arguments() const;
QString workingDirectory() const;
diff --git a/src/plugins/cpaster/cpaster.qbs b/src/plugins/cpaster/cpaster.qbs
index c3d596066d..230d02a127 100644
--- a/src/plugins/cpaster/cpaster.qbs
+++ b/src/plugins/cpaster/cpaster.qbs
@@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "CodePaster"
- Depends { name: "qt"; submodules: ['widgets'] }
+ Depends { name: "qt"; submodules: ['widgets', 'network'] }
Depends { name: "Core" }
Depends { name: "TextEditor" }
diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs
index d5124f9050..9cf8b36f30 100644
--- a/src/plugins/debugger/debugger.qbs
+++ b/src/plugins/debugger/debugger.qbs
@@ -16,6 +16,7 @@ QtcPlugin {
Depends { name: "symbianutils" }
Depends { name: "QmlJS" }
Depends { name: "QmlDebug" }
+ Depends { name: "QtcSsh" }
Depends { name: "cpp" }
cpp.defines: ["DEBUGGER_LIBRARY"]
@@ -314,6 +315,7 @@ QtcPlugin {
ProductModule {
Depends { name: "cpp" }
+ Depends { name: "QtcSsh" }
cpp.includePaths: ["."]
}
}
diff --git a/src/plugins/debugger/debugger_dependencies.pri b/src/plugins/debugger/debugger_dependencies.pri
index 0fcdf49d33..e99a0c39f5 100644
--- a/src/plugins/debugger/debugger_dependencies.pri
+++ b/src/plugins/debugger/debugger_dependencies.pri
@@ -8,3 +8,4 @@ include(../../libs/cplusplus/cplusplus.pri)
include(../../libs/utils/utils.pri)
include(../../libs/symbianutils/symbianutils.pri)
include(../../libs/qmljs/qmljs.pri)
+include(../../libs/ssh/ssh.pri)
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index b09ee58486..648b31639d 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1842,9 +1842,9 @@ void DebuggerPluginPrivate::startRemoteEngine()
sp.connParams.password = dlg.password();
sp.connParams.timeout = 5;
- sp.connParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
+ sp.connParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
sp.connParams.port = 22;
- sp.connParams.proxyType = Utils::SshConnectionParameters::NoProxy;
+ sp.connParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
sp.executable = dlg.inferiorPath();
sp.serverStartScript = dlg.enginePath();
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index 4f5ba16ba2..fbb7424bf6 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -36,7 +36,7 @@
#include "debugger_global.h"
#include "debuggerconstants.h"
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <utils/environment.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -119,7 +119,7 @@ public:
QByteArray remoteSourcesDir;
QString remoteMountPoint;
QString localMountDir;
- Utils::SshConnectionParameters connParams;
+ QSsh::SshConnectionParameters connParams;
bool requestRemoteSetup;
QString debuggerCommand;
diff --git a/src/plugins/debugger/gdb/remotegdbprocess.cpp b/src/plugins/debugger/gdb/remotegdbprocess.cpp
index cc510c2f88..a5e53ddd9f 100644
--- a/src/plugins/debugger/gdb/remotegdbprocess.cpp
+++ b/src/plugins/debugger/gdb/remotegdbprocess.cpp
@@ -36,18 +36,19 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
-#include <utils/ssh/sshconnectionmanager.h>
+#include <ssh/sshconnectionmanager.h>
#include <QFileInfo>
#include <ctype.h>
+using namespace QSsh;
using namespace Utils;
namespace Debugger {
namespace Internal {
-RemoteGdbProcess::RemoteGdbProcess(const Utils::SshConnectionParameters &connParams,
+RemoteGdbProcess::RemoteGdbProcess(const QSsh::SshConnectionParameters &connParams,
RemotePlainGdbAdapter *adapter, QObject *parent)
: AbstractGdbProcess(parent), m_connParams(connParams),
m_state(Inactive), m_adapter(adapter)
@@ -92,7 +93,7 @@ void RemoteGdbProcess::realStart(const QString &cmd, const QStringList &args,
m_errorOutput.clear();
m_inputToSend.clear();
m_conn = SshConnectionManager::instance().acquireConnection(m_connParams);
- connect(m_conn.data(), SIGNAL(error(Utils::SshError)), this,
+ connect(m_conn.data(), SIGNAL(error(QSsh::SshError)), this,
SLOT(handleConnectionError()));
if (m_conn->state() == SshConnection::Connected) {
handleConnected();
@@ -130,7 +131,7 @@ void RemoteGdbProcess::handleFifoCreationFinished(int exitStatus)
return;
QTC_ASSERT(m_state == CreatingFifo, return);
- if (exitStatus != Utils::SshRemoteProcess::ExitedNormally) {
+ if (exitStatus != QSsh::SshRemoteProcess::ExitedNormally) {
emitErrorExit(tr("Could not create FIFO."));
} else {
setState(StartingFifoReader);
@@ -172,7 +173,7 @@ void RemoteGdbProcess::handleAppOutputReaderStarted()
void RemoteGdbProcess::handleAppOutputReaderFinished(int exitStatus)
{
- if (exitStatus != Utils::SshRemoteProcess::ExitedNormally)
+ if (exitStatus != QSsh::SshRemoteProcess::ExitedNormally)
emitErrorExit(tr("Application output reader unexpectedly finished."));
}
@@ -192,15 +193,15 @@ void RemoteGdbProcess::handleGdbFinished(int exitStatus)
QTC_ASSERT(m_state == RunningGdb, return);
switch (exitStatus) {
- case Utils::SshRemoteProcess::FailedToStart:
+ case QSsh::SshRemoteProcess::FailedToStart:
m_error = tr("Remote GDB failed to start.");
setState(Inactive);
emit startFailed();
break;
- case Utils::SshRemoteProcess::KilledBySignal:
+ case QSsh::SshRemoteProcess::KilledBySignal:
emitErrorExit(tr("Remote GDB crashed."));
break;
- case Utils::SshRemoteProcess::ExitedNormally:
+ case QSsh::SshRemoteProcess::ExitedNormally:
const int exitCode = m_gdbProc->exitCode();
setState(Inactive);
emit finished(exitCode, QProcess::NormalExit);
@@ -229,7 +230,7 @@ qint64 RemoteGdbProcess::write(const QByteArray &data)
void RemoteGdbProcess::kill()
{
if (m_state == RunningGdb) {
- Utils::SshRemoteProcess::Ptr killProc
+ QSsh::SshRemoteProcess::Ptr killProc
= m_conn->createRemoteProcess("pkill -SIGKILL -x gdb");
killProc->start();
} else {
@@ -246,7 +247,7 @@ void RemoteGdbProcess::interruptInferior()
{
QTC_ASSERT(m_state == RunningGdb, return);
- Utils::SshRemoteProcess::Ptr intProc
+ QSsh::SshRemoteProcess::Ptr intProc
= m_conn->createRemoteProcess("pkill -x -SIGINT gdb");
intProc->start();
}
@@ -386,15 +387,15 @@ void RemoteGdbProcess::setState(State newState)
if (m_state == Inactive) {
if (m_gdbProc) {
disconnect(m_gdbProc.data(), 0, this, 0);
- m_gdbProc = Utils::SshRemoteProcess::Ptr();
+ m_gdbProc = QSsh::SshRemoteProcess::Ptr();
}
if (m_appOutputReader) {
disconnect(m_appOutputReader.data(), 0, this, 0);
- m_appOutputReader = Utils::SshRemoteProcess::Ptr();
+ m_appOutputReader = QSsh::SshRemoteProcess::Ptr();
}
if (m_fifoCreator) {
disconnect(m_fifoCreator.data(), 0, this, 0);
- m_fifoCreator = Utils::SshRemoteProcess::Ptr();
+ m_fifoCreator = QSsh::SshRemoteProcess::Ptr();
}
disconnect(m_conn.data(), 0, this, 0);
SshConnectionManager::instance().releaseConnection(m_conn);
diff --git a/src/plugins/debugger/gdb/remotegdbprocess.h b/src/plugins/debugger/gdb/remotegdbprocess.h
index b9888a5441..8dba88e191 100644
--- a/src/plugins/debugger/gdb/remotegdbprocess.h
+++ b/src/plugins/debugger/gdb/remotegdbprocess.h
@@ -35,8 +35,8 @@
#include "abstractgdbprocess.h"
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
#include <QByteArray>
#include <QQueue>
@@ -50,7 +50,7 @@ class RemoteGdbProcess : public AbstractGdbProcess
{
Q_OBJECT
public:
- RemoteGdbProcess(const Utils::SshConnectionParameters &server,
+ RemoteGdbProcess(const QSsh::SshConnectionParameters &server,
RemotePlainGdbAdapter *adapter, QObject *parent = 0);
virtual QByteArray readAllStandardOutput();
@@ -106,11 +106,11 @@ private:
void emitErrorExit(const QString &error);
void setState(State newState);
- Utils::SshConnectionParameters m_connParams;
- Utils::SshConnection::Ptr m_conn;
- Utils::SshRemoteProcess::Ptr m_gdbProc;
- Utils::SshRemoteProcess::Ptr m_appOutputReader;
- Utils::SshRemoteProcess::Ptr m_fifoCreator;
+ QSsh::SshConnectionParameters m_connParams;
+ QSsh::SshConnection::Ptr m_conn;
+ QSsh::SshRemoteProcess::Ptr m_gdbProc;
+ QSsh::SshRemoteProcess::Ptr m_appOutputReader;
+ QSsh::SshRemoteProcess::Ptr m_fifoCreator;
QByteArray m_gdbOutput;
QByteArray m_errorOutput;
QString m_command;
diff --git a/src/plugins/debugger/lldb/lldbenginehost.cpp b/src/plugins/debugger/lldb/lldbenginehost.cpp
index 17d4b9be51..9e36567ee8 100644
--- a/src/plugins/debugger/lldb/lldbenginehost.cpp
+++ b/src/plugins/debugger/lldb/lldbenginehost.cpp
@@ -64,7 +64,7 @@
namespace Debugger {
namespace Internal {
-SshIODevice::SshIODevice(Utils::SshRemoteProcessRunner *r)
+SshIODevice::SshIODevice(QSsh::SshRemoteProcessRunner *r)
: runner(r)
, buckethead(0)
{
@@ -150,9 +150,9 @@ LldbEngineHost::LldbEngineHost(const DebuggerStartParameters &startParameters)
if (startParameters.startMode == StartRemoteEngine)
{
m_guestProcess = 0;
- Utils::SshRemoteProcessRunner * const runner = new Utils::SshRemoteProcessRunner;
- connect (runner, SIGNAL(connectionError(Utils::SshError)),
- this, SLOT(sshConnectionError(Utils::SshError)));
+ QSsh::SshRemoteProcessRunner * const runner = new QSsh::SshRemoteProcessRunner;
+ connect (runner, SIGNAL(connectionError(QSsh::SshError)),
+ this, SLOT(sshConnectionError(QSsh::SshError)));
runner->run(startParameters.serverStartScript.toUtf8(), startParameters.connParams);
setGuestDevice(new SshIODevice(runner));
} else {
@@ -199,7 +199,7 @@ LldbEngineHost::~LldbEngineHost()
if (m_ssh && m_ssh->isProcessRunning()) {
// TODO: openssh doesn't do that
- m_ssh->sendSignalToProcess(Utils::SshRemoteProcess::KillSignal);
+ m_ssh->sendSignalToProcess(QSsh::SshRemoteProcess::KillSignal);
}
}
@@ -212,7 +212,7 @@ void LldbEngineHost::nuke()
m_guestProcess->kill();
notifyEngineSpontaneousShutdown();
}
-void LldbEngineHost::sshConnectionError(Utils::SshError e)
+void LldbEngineHost::sshConnectionError(QSsh::SshError e)
{
showStatusMessage(tr("SSH connection error: %1").arg(e));
}
diff --git a/src/plugins/debugger/lldb/lldbenginehost.h b/src/plugins/debugger/lldb/lldbenginehost.h
index 2978033849..5b301b3962 100644
--- a/src/plugins/debugger/lldb/lldbenginehost.h
+++ b/src/plugins/debugger/lldb/lldbenginehost.h
@@ -34,10 +34,10 @@
#define DEBUGGER_LLDBENGINE_HOST_H
#include "ipcenginehost.h"
-#include <utils/ssh/ssherrors.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/ssherrors.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QProcess>
#include <QQueue>
@@ -49,7 +49,7 @@ class SshIODevice : public QIODevice
{
Q_OBJECT
public:
- SshIODevice(Utils::SshRemoteProcessRunner *r);
+ SshIODevice(QSsh::SshRemoteProcessRunner *r);
~SshIODevice();
virtual qint64 bytesAvailable () const;
virtual qint64 writeData (const char * data, qint64 maxSize);
@@ -59,8 +59,8 @@ private slots:
void outputAvailable(const QByteArray &output);
void errorOutputAvailable(const QByteArray &output);
private:
- Utils::SshRemoteProcessRunner *runner;
- Utils::SshRemoteProcess::Ptr proc;
+ QSsh::SshRemoteProcessRunner *runner;
+ QSsh::SshRemoteProcess::Ptr proc;
int buckethead;
QQueue<QByteArray> buckets;
QByteArray startupbuffer;
@@ -76,11 +76,11 @@ public:
private:
QProcess *m_guestProcess;
- Utils::SshRemoteProcessRunner *m_ssh;
+ QSsh::SshRemoteProcessRunner *m_ssh;
protected:
void nuke();
private slots:
- void sshConnectionError(Utils::SshError);
+ void sshConnectionError(QSsh::SshError);
void finished(int, QProcess::ExitStatus);
void stderrReady();
};
diff --git a/src/plugins/git/git.qbs b/src/plugins/git/git.qbs
index 8f61ffb9b6..3b05df1a78 100644
--- a/src/plugins/git/git.qbs
+++ b/src/plugins/git/git.qbs
@@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "Git"
- Depends { name: "qt"; submodules: ['widgets'] }
+ Depends { name: "qt"; submodules: ['widgets', 'network'] }
Depends { name: "Core" }
Depends { name: "TextEditor" }
Depends { name: "Find" }
diff --git a/src/plugins/madde/maddedevicetester.cpp b/src/plugins/madde/maddedevicetester.cpp
index 3fa4b96189..7a8ba98549 100644
--- a/src/plugins/madde/maddedevicetester.cpp
+++ b/src/plugins/madde/maddedevicetester.cpp
@@ -36,12 +36,12 @@
#include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QRegExp>
using namespace RemoteLinux;
-using namespace Utils;
+using namespace QSsh;
namespace Madde {
namespace Internal {
diff --git a/src/plugins/madde/maddedevicetester.h b/src/plugins/madde/maddedevicetester.h
index 2dc176ae36..46248f2c64 100644
--- a/src/plugins/madde/maddedevicetester.h
+++ b/src/plugins/madde/maddedevicetester.h
@@ -36,7 +36,7 @@
#include <QByteArray>
-namespace Utils {
+namespace QSsh {
class SshRemoteProcessRunner;
}
@@ -73,7 +73,7 @@ private:
RemoteLinux::GenericLinuxDeviceTester * const m_genericTester;
State m_state;
TestResult m_result;
- Utils::SshRemoteProcessRunner *m_processRunner;
+ QSsh::SshRemoteProcessRunner *m_processRunner;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_deviceConfiguration;
QByteArray m_stdout;
QByteArray m_stderr;
diff --git a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp
index d1b224d4a5..348fb58f31 100644
--- a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp
+++ b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp
@@ -42,7 +42,7 @@
#include <qtsupport/baseqtversion.h>
#include <remotelinux/abstractuploadandinstallpackageservice.h>
#include <remotelinux/linuxdeviceconfiguration.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
using namespace RemoteLinux;
diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp
index 3407aae74a..35469614ad 100644
--- a/src/plugins/madde/maemodeploybymountsteps.cpp
+++ b/src/plugins/madde/maemodeploybymountsteps.cpp
@@ -48,7 +48,7 @@
#include <remotelinux/deploymentinfo.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QFileInfo>
#include <QList>
diff --git a/src/plugins/madde/maemodeploymentmounter.cpp b/src/plugins/madde/maemodeploymentmounter.cpp
index 5a43ec4c8d..94a42e14b2 100644
--- a/src/plugins/madde/maemodeploymentmounter.cpp
+++ b/src/plugins/madde/maemodeploymentmounter.cpp
@@ -39,11 +39,11 @@
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinuxusedportsgatherer.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
using namespace Qt4ProjectManager;
using namespace RemoteLinux;
-using namespace Utils;
+using namespace QSsh;
namespace Madde {
namespace Internal {
@@ -82,7 +82,7 @@ void MaemoDeploymentMounter::setupMounts(const SshConnection::Ptr &connection,
m_devConf = devConf;
m_mounter->setConnection(m_connection, m_devConf);
m_buildConfig = bc;
- connect(m_connection.data(), SIGNAL(error(Utils::SshError)),
+ connect(m_connection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionError()));
setState(UnmountingOldDirs);
unmount();
diff --git a/src/plugins/madde/maemodeploymentmounter.h b/src/plugins/madde/maemodeploymentmounter.h
index 8e58628ffa..57e9320801 100644
--- a/src/plugins/madde/maemodeploymentmounter.h
+++ b/src/plugins/madde/maemodeploymentmounter.h
@@ -41,7 +41,7 @@
#include <QObject>
#include <QSharedPointer>
-namespace Utils { class SshConnection; }
+namespace QSsh { class SshConnection; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace RemoteLinux {
@@ -61,7 +61,7 @@ public:
~MaemoDeploymentMounter();
// Connection must be in connected state.
- void setupMounts(const QSharedPointer<Utils::SshConnection> &connection,
+ void setupMounts(const QSharedPointer<QSsh::SshConnection> &connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
const QList<MaemoMountSpecification> &mountSpecs,
const Qt4ProjectManager::Qt4BuildConfiguration *bc);
@@ -93,7 +93,7 @@ private:
void setState(State newState);
State m_state;
- QSharedPointer<Utils::SshConnection> m_connection;
+ QSharedPointer<QSsh::SshConnection> m_connection;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf;
MaemoRemoteMounter * const m_mounter;
RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer;
diff --git a/src/plugins/madde/maemodeviceconfigwizard.cpp b/src/plugins/madde/maemodeviceconfigwizard.cpp
index 0db737173e..40628569eb 100644
--- a/src/plugins/madde/maemodeviceconfigwizard.cpp
+++ b/src/plugins/madde/maemodeviceconfigwizard.cpp
@@ -45,7 +45,7 @@
#include <remotelinux/linuxdevicetestdialog.h>
#include <remotelinux/sshkeydeployer.h>
#include <utils/fileutils.h>
-#include <utils/ssh/sshkeygenerator.h>
+#include <ssh/sshkeygenerator.h>
#include <QDir>
#include <QFile>
@@ -56,6 +56,7 @@
using namespace ProjectExplorer;
using namespace RemoteLinux;
+using namespace QSsh;
using namespace Utils;
namespace Madde {
@@ -443,7 +444,7 @@ private:
Q_SLOT void deployKey()
{
- using namespace Utils;
+ using namespace QSsh;
m_ui->deviceAddressLineEdit->setEnabled(false);
m_ui->passwordLineEdit->setEnabled(false);
m_ui->deployButton->setEnabled(false);
@@ -561,19 +562,19 @@ IDevice::Ptr MaemoDeviceConfigWizard::device()
{
bool doTest;
QString freePortsSpec;
- Utils::SshConnectionParameters sshParams;
+ QSsh::SshConnectionParameters sshParams;
sshParams.userName = defaultUser(d->wizardData.deviceType);
sshParams.host = d->wizardData.hostName;
sshParams.port = d->wizardData.sshPort;
if (d->wizardData.machineType == LinuxDeviceConfiguration::Emulator) {
- sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
+ sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
sshParams.password = d->wizardData.deviceType == Core::Id(MeeGoOsType)
? QLatin1String("meego") : QString();
sshParams.timeout = 30;
freePortsSpec = QLatin1String("13219,14168");
doTest = false;
} else {
- sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByKey;
+ sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey;
sshParams.privateKeyFile = d->wizardData.privateKeyFilePath;
sshParams.timeout = 10;
freePortsSpec = QLatin1String("10000-10100");
diff --git a/src/plugins/madde/maemopublisherfremantlefree.cpp b/src/plugins/madde/maemopublisherfremantlefree.cpp
index 896a138513..30c5679cef 100644
--- a/src/plugins/madde/maemopublisherfremantlefree.cpp
+++ b/src/plugins/madde/maemopublisherfremantlefree.cpp
@@ -47,7 +47,7 @@
#include <remotelinux/deploymentinfo.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QCoreApplication>
#include <QDir>
@@ -59,7 +59,7 @@
using namespace Core;
using namespace Qt4ProjectManager;
using namespace RemoteLinux;
-using namespace Utils;
+using namespace QSsh;
namespace Madde {
namespace Internal {
diff --git a/src/plugins/madde/maemopublisherfremantlefree.h b/src/plugins/madde/maemopublisherfremantlefree.h
index 298612fba5..39a692e964 100644
--- a/src/plugins/madde/maemopublisherfremantlefree.h
+++ b/src/plugins/madde/maemopublisherfremantlefree.h
@@ -32,7 +32,7 @@
#ifndef MAEMOPUBLISHERFREMANTLEFREE_H
#define MAEMOPUBLISHERFREMANTLEFREE_H
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QObject>
#include <QProcess>
@@ -45,7 +45,7 @@ namespace Qt4ProjectManager {
class Qt4BuildConfiguration;
}
-namespace Utils {
+namespace QSsh {
class SshRemoteProcessRunner;
}
@@ -118,9 +118,9 @@ private:
State m_state;
QString m_tmpProjectDir;
QProcess *m_process;
- Utils::SshConnectionParameters m_sshParams;
+ QSsh::SshConnectionParameters m_sshParams;
QString m_remoteDir;
- Utils::SshRemoteProcessRunner *m_uploader;
+ QSsh::SshRemoteProcessRunner *m_uploader;
QByteArray m_scpOutput;
QList<QString> m_filesToUpload;
QString m_resultString;
diff --git a/src/plugins/madde/maemoqemumanager.h b/src/plugins/madde/maemoqemumanager.h
index a5c61b7899..1c6c635a79 100644
--- a/src/plugins/madde/maemoqemumanager.h
+++ b/src/plugins/madde/maemoqemumanager.h
@@ -45,10 +45,6 @@
QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QStringList)
-namespace Utils {
-class FileSystemWatcher;
-}
-
namespace ProjectExplorer {
class BuildConfiguration;
class Project;
@@ -56,13 +52,9 @@ class RunConfiguration;
class Target;
}
-namespace QtSupport {
-class BaseQtVersion;
-}
-
-namespace RemoteLinux {
-class RemoteLinuxRunConfiguration;
-}
+namespace QtSupport { class BaseQtVersion; }
+namespace RemoteLinux { class RemoteLinuxRunConfiguration; }
+namespace Utils { class FileSystemWatcher; }
namespace Madde {
namespace Internal {
diff --git a/src/plugins/madde/maemoremotecopyfacility.cpp b/src/plugins/madde/maemoremotecopyfacility.cpp
index 574a2efcba..3a267e591c 100644
--- a/src/plugins/madde/maemoremotecopyfacility.cpp
+++ b/src/plugins/madde/maemoremotecopyfacility.cpp
@@ -34,13 +34,13 @@
#include "maemoglobal.h"
#include <remotelinux/linuxdeviceconfiguration.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QDir>
using namespace RemoteLinux;
-using namespace Utils;
+using namespace QSsh;
namespace Madde {
namespace Internal {
diff --git a/src/plugins/madde/maemoremotecopyfacility.h b/src/plugins/madde/maemoremotecopyfacility.h
index 2a19950e5d..b0b4c51fab 100644
--- a/src/plugins/madde/maemoremotecopyfacility.h
+++ b/src/plugins/madde/maemoremotecopyfacility.h
@@ -40,7 +40,7 @@
#include <QSharedPointer>
#include <QString>
-namespace Utils {
+namespace QSsh {
class SshConnection;
class SshRemoteProcessRunner;
}
@@ -59,7 +59,7 @@ public:
explicit MaemoRemoteCopyFacility(QObject *parent = 0);
~MaemoRemoteCopyFacility();
- void copyFiles(const QSharedPointer<Utils::SshConnection> &connection,
+ void copyFiles(const QSharedPointer<QSsh::SshConnection> &connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
const QList<RemoteLinux::DeployableFile> &deployables, const QString &mountPoint);
void cancel();
@@ -81,8 +81,8 @@ private:
void copyNextFile();
void setFinished();
- Utils::SshRemoteProcessRunner *m_copyRunner;
- Utils::SshRemoteProcessRunner *m_killProcess;
+ QSsh::SshRemoteProcessRunner *m_copyRunner;
+ QSsh::SshRemoteProcessRunner *m_killProcess;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf;
QList<RemoteLinux::DeployableFile> m_deployables;
QString m_mountPoint;
diff --git a/src/plugins/madde/maemoremotemounter.cpp b/src/plugins/madde/maemoremotemounter.cpp
index c8de89c90a..fec15a2e8a 100644
--- a/src/plugins/madde/maemoremotemounter.cpp
+++ b/src/plugins/madde/maemoremotemounter.cpp
@@ -35,8 +35,8 @@
#include "maemoglobal.h"
#include "qt4maemotarget.h"
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/baseqtversion.h>
#include <remotelinux/linuxdeviceconfiguration.h>
@@ -47,6 +47,7 @@
using namespace Qt4ProjectManager;
using namespace RemoteLinux;
+using namespace QSsh;
using namespace Utils;
namespace Madde {
diff --git a/src/plugins/madde/maemoremotemounter.h b/src/plugins/madde/maemoremotemounter.h
index 8c4fa5c00d..5644d40712 100644
--- a/src/plugins/madde/maemoremotemounter.h
+++ b/src/plugins/madde/maemoremotemounter.h
@@ -43,13 +43,13 @@
QT_FORWARD_DECLARE_CLASS(QTimer)
-namespace Utils {
-class PortList;
+namespace QSsh {
class SftpChannel;
class SshConnection;
class SshRemoteProcess;
}
+namespace Utils { class PortList; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace RemoteLinux {
@@ -68,7 +68,7 @@ public:
~MaemoRemoteMounter();
// Must already be connected.
- void setConnection(const QSharedPointer<Utils::SshConnection> &connection,
+ void setConnection(const QSharedPointer<QSsh::SshConnection> &connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf);
void setBuildConfiguration(const Qt4ProjectManager::Qt4BuildConfiguration *bc);
@@ -123,11 +123,11 @@ private:
int remotePort;
};
- QSharedPointer<Utils::SshConnection> m_connection;
+ QSharedPointer<QSsh::SshConnection> m_connection;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf;
QList<MountInfo> m_mountSpecs;
- QSharedPointer<Utils::SshRemoteProcess> m_mountProcess;
- QSharedPointer<Utils::SshRemoteProcess> m_unmountProcess;
+ QSharedPointer<QSsh::SshRemoteProcess> m_mountProcess;
+ QSharedPointer<QSsh::SshRemoteProcess> m_unmountProcess;
typedef QSharedPointer<QProcess> ProcPtr;
QList<ProcPtr> m_utfsServers;
diff --git a/src/plugins/madde/maemorunconfiguration.cpp b/src/plugins/madde/maemorunconfiguration.cpp
index c71bb6ba28..d548b49735 100644
--- a/src/plugins/madde/maemorunconfiguration.cpp
+++ b/src/plugins/madde/maemorunconfiguration.cpp
@@ -42,7 +42,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <utils/portlist.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QDir>
#include <QFileInfo>
diff --git a/src/plugins/madde/maemosshrunner.cpp b/src/plugins/madde/maemosshrunner.cpp
index 219b93515a..5d29a169fb 100644
--- a/src/plugins/madde/maemosshrunner.cpp
+++ b/src/plugins/madde/maemosshrunner.cpp
@@ -38,11 +38,11 @@
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
using namespace Qt4ProjectManager;
using namespace RemoteLinux;
-using namespace Utils;
+using namespace QSsh;
namespace Madde {
namespace Internal {
diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp
index 33433d61f8..70d45ff453 100644
--- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp
+++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp
@@ -36,8 +36,8 @@
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshconnectionmanager.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshconnectionmanager.h>
#include <QDateTime>
#include <QFileInfo>
@@ -45,7 +45,7 @@
#include <QString>
using namespace Qt4ProjectManager;
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
@@ -263,7 +263,7 @@ void AbstractRemoteLinuxDeployService::handleDeviceSetupDone(bool success)
d->state = Connecting;
d->connection = SshConnectionManager::instance().acquireConnection(d->deviceConfiguration->sshParameters());
- connect(d->connection.data(), SIGNAL(error(Utils::SshError)),
+ connect(d->connection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure()));
if (d->connection->state() == SshConnection::Connected) {
handleConnected();
diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h
index e0f4fb5d3f..8ea3120c8b 100644
--- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h
+++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h
@@ -39,7 +39,7 @@
#include <QVariantMap>
QT_FORWARD_DECLARE_CLASS(QString)
-namespace Utils { class SshConnection; }
+namespace QSsh { class SshConnection; }
namespace Qt4ProjectManager {
class Qt4BuildConfiguration;
@@ -82,7 +82,7 @@ signals:
protected:
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
- QSharedPointer<Utils::SshConnection> connection() const;
+ QSharedPointer<QSsh::SshConnection> connection() const;
void saveDeploymentTimeStamp(const DeployableFile &deployableFile);
bool hasChangedSinceLastDeployment(const DeployableFile &deployableFile) const;
diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp
index cc70ffb79b..a7fc3dc9b4 100644
--- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp
+++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp
@@ -37,7 +37,7 @@
#include "remotelinuxpackageinstaller.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QFileInfo>
#include <QString>
diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp
index 72a0e6aec0..74ada44f94 100644
--- a/src/plugins/remotelinux/genericdirectuploadservice.cpp
+++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp
@@ -34,16 +34,16 @@
#include "deployablefile.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sftpchannel.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sftpchannel.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
#include <QDir>
#include <QFileInfo>
#include <QList>
#include <QString>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
@@ -131,8 +131,8 @@ void GenericDirectUploadService::handleSftpInitialized()
}
Q_ASSERT(!d->filesToUpload.isEmpty());
- connect(d->uploader.data(), SIGNAL(finished(Utils::SftpJobId,QString)),
- SLOT(handleUploadFinished(Utils::SftpJobId,QString)));
+ connect(d->uploader.data(), SIGNAL(finished(QSsh::SftpJobId,QString)),
+ SLOT(handleUploadFinished(QSsh::SftpJobId,QString)));
d->state = Uploading;
uploadNextFile();
}
@@ -146,7 +146,7 @@ void GenericDirectUploadService::handleSftpInitializationFailed(const QString &m
handleDeploymentDone();
}
-void GenericDirectUploadService::handleUploadFinished(Utils::SftpJobId jobId, const QString &errorMsg)
+void GenericDirectUploadService::handleUploadFinished(QSsh::SftpJobId jobId, const QString &errorMsg)
{
Q_UNUSED(jobId);
diff --git a/src/plugins/remotelinux/genericdirectuploadservice.h b/src/plugins/remotelinux/genericdirectuploadservice.h
index 320afb6a45..1f697ca98a 100644
--- a/src/plugins/remotelinux/genericdirectuploadservice.h
+++ b/src/plugins/remotelinux/genericdirectuploadservice.h
@@ -35,7 +35,7 @@
#include "abstractremotelinuxdeployservice.h"
#include "remotelinux_export.h"
-#include <utils/ssh/sftpdefs.h>
+#include <ssh/sftpdefs.h>
#include <QList>
@@ -66,7 +66,7 @@ public:
private slots:
void handleSftpInitialized();
void handleSftpInitializationFailed(const QString &errorMessage);
- void handleUploadFinished(Utils::SftpJobId jobId, const QString &errorMsg);
+ void handleUploadFinished(QSsh::SftpJobId jobId, const QString &errorMsg);
void handleMkdirFinished(int exitStatus);
void handleLnFinished(int exitStatus);
void handleStdOutData();
diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp
index 3a270c7490..f7e4850d15 100644
--- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp
+++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp
@@ -33,12 +33,13 @@
#include "ui_genericlinuxdeviceconfigurationwidget.h"
#include <utils/portlist.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshkeycreationdialog.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshkeycreationdialog.h>
#include <QTextStream>
using namespace RemoteLinux;
+using namespace QSsh;
using namespace Utils;
GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget(
diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp
index 6d8be5cd03..764a4d5761 100644
--- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp
+++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp
@@ -38,7 +38,7 @@
#include <utils/portlist.h>
using namespace ProjectExplorer;
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
@@ -76,7 +76,7 @@ GenericLinuxDeviceConfigurationWizard::~GenericLinuxDeviceConfigurationWizard()
IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device()
{
- Utils::SshConnectionParameters sshParams;
+ QSsh::SshConnectionParameters sshParams;
sshParams.host = d->setupPage.hostName();
sshParams.userName = d->setupPage.userName();
sshParams.port = 22;
diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp
index b4ba390c6d..e7ea64e155 100644
--- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp
+++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp
@@ -50,6 +50,7 @@ public:
} // namespace Internal
+using namespace QSsh;
using namespace Utils;
GenericLinuxDeviceConfigurationWizardSetupPage::GenericLinuxDeviceConfigurationWizardSetupPage(QWidget *parent) :
diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h
index e5b22c5feb..71930503c3 100644
--- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h
+++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h
@@ -33,7 +33,7 @@
#include "remotelinux_export.h"
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QWizardPage>
@@ -57,7 +57,7 @@ public:
QString configurationName() const;
QString hostName() const;
QString userName() const;
- Utils::SshConnectionParameters::AuthenticationType authenticationType() const;
+ QSsh::SshConnectionParameters::AuthenticationType authenticationType() const;
QString password() const;
QString privateKeyFilePath() const;
diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.cpp b/src/plugins/remotelinux/linuxdeviceconfiguration.cpp
index a478926755..d05fc3a23a 100644
--- a/src/plugins/remotelinux/linuxdeviceconfiguration.cpp
+++ b/src/plugins/remotelinux/linuxdeviceconfiguration.cpp
@@ -39,13 +39,15 @@
#include "remotelinux_constants.h"
#include <utils/portlist.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <utils/qtcassert.h>
#include <QDesktopServices>
#include <QStringList>
+using namespace QSsh;
using namespace Utils;
+
typedef SshConnectionParameters::AuthenticationType AuthType;
namespace RemoteLinux {
diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.h b/src/plugins/remotelinux/linuxdeviceconfiguration.h
index 6fa22eb9be..ab9bcdceed 100644
--- a/src/plugins/remotelinux/linuxdeviceconfiguration.h
+++ b/src/plugins/remotelinux/linuxdeviceconfiguration.h
@@ -38,10 +38,8 @@
#include <QCoreApplication>
-namespace Utils {
-class SshConnectionParameters;
-class PortList;
-}
+namespace QSsh { class SshConnectionParameters; }
+namespace Utils { class PortList; }
namespace RemoteLinux {
namespace Internal {
@@ -60,10 +58,10 @@ public:
~LinuxDeviceConfiguration();
Utils::PortList freePorts() const;
- Utils::SshConnectionParameters sshParameters() const;
+ QSsh::SshConnectionParameters sshParameters() const;
MachineType machineType() const;
- void setSshParameters(const Utils::SshConnectionParameters &sshParameters);
+ void setSshParameters(const QSsh::SshConnectionParameters &sshParameters);
void setFreePorts(const Utils::PortList &freePorts);
static QString defaultPrivateKeyFilePath();
diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp
index e7b32afa51..6a9845e8dc 100644
--- a/src/plugins/remotelinux/linuxdevicetester.cpp
+++ b/src/plugins/remotelinux/linuxdevicetester.cpp
@@ -35,10 +35,10 @@
#include "remotelinuxusedportsgatherer.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sshremoteprocess.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
@@ -86,7 +86,7 @@ void GenericLinuxDeviceTester::testDevice(const LinuxDeviceConfiguration::ConstP
d->deviceConfiguration = deviceConfiguration;
d->connection = SshConnection::create(deviceConfiguration->sshParameters());
connect(d->connection.data(), SIGNAL(connected()), SLOT(handleConnected()));
- connect(d->connection.data(), SIGNAL(error(Utils::SshError)),
+ connect(d->connection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure()));
emit progressMessage(tr("Connecting to host..."));
diff --git a/src/plugins/remotelinux/linuxdevicetester.h b/src/plugins/remotelinux/linuxdevicetester.h
index 7e2ef787ab..58a3f10ed7 100644
--- a/src/plugins/remotelinux/linuxdevicetester.h
+++ b/src/plugins/remotelinux/linuxdevicetester.h
@@ -39,7 +39,7 @@
QT_FORWARD_DECLARE_CLASS(QString)
-namespace Utils {
+namespace QSsh {
class SshConnection;
}
@@ -80,7 +80,7 @@ public:
void testDevice(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration);
void stopTest();
- QSharedPointer<Utils::SshConnection> connection() const;
+ QSharedPointer<QSsh::SshConnection> connection() const;
private slots:
void handleConnected();
diff --git a/src/plugins/remotelinux/packageuploader.cpp b/src/plugins/remotelinux/packageuploader.cpp
index 4e17ad1104..fbdb058def 100644
--- a/src/plugins/remotelinux/packageuploader.cpp
+++ b/src/plugins/remotelinux/packageuploader.cpp
@@ -33,10 +33,10 @@
#include "packageuploader.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sftpchannel.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sftpchannel.h>
+#include <ssh/sshconnection.h>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
@@ -61,15 +61,15 @@ void PackageUploader::uploadPackage(const SshConnection::Ptr &connection,
m_localFilePath = localFilePath;
m_remoteFilePath = remoteFilePath;
m_connection = connection;
- connect(m_connection.data(), SIGNAL(error(Utils::SshError)),
+ connect(m_connection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure()));
m_uploader = m_connection->createSftpChannel();
connect(m_uploader.data(), SIGNAL(initialized()), this,
SLOT(handleSftpChannelInitialized()));
connect(m_uploader.data(), SIGNAL(initializationFailed(QString)), this,
SLOT(handleSftpChannelInitializationFailed(QString)));
- connect(m_uploader.data(), SIGNAL(finished(Utils::SftpJobId,QString)),
- this, SLOT(handleSftpJobFinished(Utils::SftpJobId,QString)));
+ connect(m_uploader.data(), SIGNAL(finished(QSsh::SftpJobId,QString)),
+ this, SLOT(handleSftpJobFinished(QSsh::SftpJobId,QString)));
m_uploader->initialize();
}
diff --git a/src/plugins/remotelinux/packageuploader.h b/src/plugins/remotelinux/packageuploader.h
index 3c671257bd..d29adf80b5 100644
--- a/src/plugins/remotelinux/packageuploader.h
+++ b/src/plugins/remotelinux/packageuploader.h
@@ -37,9 +37,9 @@
#include <QSharedPointer>
#include <QString>
-#include <utils/ssh/sftpdefs.h>
+#include <ssh/sftpdefs.h>
-namespace Utils {
+namespace QSsh {
class SftpChannel;
class SshConnection;
}
@@ -55,7 +55,7 @@ public:
~PackageUploader();
// Connection has to be established already.
- void uploadPackage(const QSharedPointer<Utils::SshConnection> &connection,
+ void uploadPackage(const QSharedPointer<QSsh::SshConnection> &connection,
const QString &localFilePath, const QString &remoteFilePath);
void cancelUpload();
@@ -67,7 +67,7 @@ private slots:
void handleConnectionFailure();
void handleSftpChannelInitialized();
void handleSftpChannelInitializationFailed(const QString &error);
- void handleSftpJobFinished(Utils::SftpJobId job, const QString &error);
+ void handleSftpJobFinished(QSsh::SftpJobId job, const QString &error);
private:
enum State { InitializingSftp, Uploading, Inactive };
@@ -76,8 +76,8 @@ private:
void setState(State newState);
State m_state;
- QSharedPointer<Utils::SshConnection> m_connection;
- QSharedPointer<Utils::SftpChannel> m_uploader;
+ QSharedPointer<QSsh::SshConnection> m_connection;
+ QSharedPointer<QSsh::SftpChannel> m_uploader;
QString m_localFilePath;
QString m_remoteFilePath;
};
diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp
index 605e6a49a4..6b10673884 100644
--- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp
+++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp
@@ -34,7 +34,7 @@
#include "sshkeydeployer.h"
#include <coreplugin/icore.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QTimer>
#include <QFileDialog>
diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs
index e3ae54956c..84e1151e0e 100644
--- a/src/plugins/remotelinux/remotelinux.qbs
+++ b/src/plugins/remotelinux/remotelinux.qbs
@@ -11,6 +11,7 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "Qt4ProjectManager" }
Depends { name: "QtSupport" }
+ Depends { name: "QtcSsh" }
Depends { name: "cpp" }
cpp.includePaths: [
@@ -133,6 +134,7 @@ QtcPlugin {
ProductModule {
Depends { name: "Core" }
+ Depends { name: "QtcSsh" }
}
}
diff --git a/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp b/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp
index 1485db51c5..95101ec82a 100644
--- a/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp
+++ b/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp
@@ -37,13 +37,14 @@
#include <utils/portlist.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshconnectionmanager.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshconnectionmanager.h>
+#include <ssh/sshremoteprocess.h>
#include <limits>
using namespace Qt4ProjectManager;
+using namespace QSsh;
using namespace Utils;
namespace RemoteLinux {
@@ -79,9 +80,9 @@ public:
const QString commandPrefix;
const PortList initialFreePorts;
- Utils::SshConnection::Ptr connection;
- Utils::SshRemoteProcess::Ptr runner;
- Utils::SshRemoteProcess::Ptr cleaner;
+ QSsh::SshConnection::Ptr connection;
+ QSsh::SshRemoteProcess::Ptr runner;
+ QSsh::SshRemoteProcess::Ptr cleaner;
PortList freePorts;
int exitStatus;
@@ -400,13 +401,13 @@ void AbstractRemoteLinuxApplicationRunner::handleDeviceSetupDone(bool success)
d->exitStatus = -1;
d->freePorts = d->initialFreePorts;
connect(d->connection.data(), SIGNAL(connected()), SLOT(handleConnected()));
- connect(d->connection.data(), SIGNAL(error(Utils::SshError)),
+ connect(d->connection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure()));
if (d->connection->state() == SshConnection::Connected) {
handleConnected();
} else {
emit reportProgress(tr("Connecting to device..."));
- if (d->connection->state() == Utils::SshConnection::Unconnected)
+ if (d->connection->state() == QSsh::SshConnection::Unconnected)
d->connection->connectToHost();
}
}
diff --git a/src/plugins/remotelinux/remotelinuxapplicationrunner.h b/src/plugins/remotelinux/remotelinuxapplicationrunner.h
index 92f2b053c0..0961b9ab1a 100644
--- a/src/plugins/remotelinux/remotelinuxapplicationrunner.h
+++ b/src/plugins/remotelinux/remotelinuxapplicationrunner.h
@@ -36,10 +36,8 @@
#include <QObject>
#include <QSharedPointer>
-namespace Utils {
-class PortList;
-class SshConnection;
-}
+namespace QSsh { class SshConnection; }
+namespace Utils { class PortList; }
namespace RemoteLinux {
class LinuxDeviceConfiguration;
@@ -64,7 +62,7 @@ public:
void startExecution(const QByteArray &remoteCall);
- QSharedPointer<Utils::SshConnection> connection() const;
+ QSharedPointer<QSsh::SshConnection> connection() const;
QSharedPointer<const LinuxDeviceConfiguration> devConfig() const;
const RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const;
Utils::PortList *freePorts();
diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp
index 29653c84bd..11d2bc435b 100644
--- a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp
+++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp
@@ -34,11 +34,11 @@
#include "linuxdeviceconfiguration.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QString>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 73344d11bc..176df268e5 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -47,7 +47,7 @@
#include <QPointer>
#include <QSharedPointer>
-using namespace Utils;
+using namespace QSsh;
using namespace Debugger;
using namespace ProjectExplorer;
diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp
index 0703e97b0c..5fd0213aed 100644
--- a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp
+++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp
@@ -33,7 +33,7 @@
#include "linuxdeviceconfiguration.h"
#include "remotelinuxrunconfiguration.h"
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
namespace RemoteLinux {
namespace Internal {
@@ -60,7 +60,7 @@ void RemoteLinuxEnvironmentReader::start(const QString &environmentSetupCommand)
return;
m_stop = false;
if (!m_remoteProcessRunner)
- m_remoteProcessRunner = new Utils::SshRemoteProcessRunner(this);
+ m_remoteProcessRunner = new QSsh::SshRemoteProcessRunner(this);
connect(m_remoteProcessRunner, SIGNAL(connectionError()), SLOT(handleConnectionFailure()));
connect(m_remoteProcessRunner, SIGNAL(processClosed(int)), SLOT(remoteProcessFinished(int)));
connect(m_remoteProcessRunner, SIGNAL(processOutputAvailable(QByteArray)),
@@ -102,16 +102,16 @@ void RemoteLinuxEnvironmentReader::handleCurrentDeviceConfigChanged()
void RemoteLinuxEnvironmentReader::remoteProcessFinished(int exitCode)
{
- Q_ASSERT(exitCode == Utils::SshRemoteProcess::FailedToStart
- || exitCode == Utils::SshRemoteProcess::KilledBySignal
- || exitCode == Utils::SshRemoteProcess::ExitedNormally);
+ Q_ASSERT(exitCode == QSsh::SshRemoteProcess::FailedToStart
+ || exitCode == QSsh::SshRemoteProcess::KilledBySignal
+ || exitCode == QSsh::SshRemoteProcess::ExitedNormally);
if (m_stop)
return;
disconnect(m_remoteProcessRunner, 0, this, 0);
m_env.clear();
- if (exitCode == Utils::SshRemoteProcess::ExitedNormally) {
+ if (exitCode == QSsh::SshRemoteProcess::ExitedNormally) {
if (!m_remoteOutput.isEmpty()) {
m_env = Utils::Environment(m_remoteOutput.split(QLatin1Char('\n'),
QString::SkipEmptyParts));
diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.h b/src/plugins/remotelinux/remotelinuxenvironmentreader.h
index 5e80faf697..7f49be8edb 100644
--- a/src/plugins/remotelinux/remotelinuxenvironmentreader.h
+++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.h
@@ -37,7 +37,7 @@
#include <QObject>
#include <QSharedPointer>
-namespace Utils {
+namespace QSsh {
class SshRemoteProcessRunner;
}
@@ -80,7 +80,7 @@ private:
Utils::Environment m_env;
QSharedPointer<const LinuxDeviceConfiguration> m_devConfig;
RemoteLinuxRunConfiguration *m_runConfig;
- Utils::SshRemoteProcessRunner *m_remoteProcessRunner;
+ QSsh::SshRemoteProcessRunner *m_remoteProcessRunner;
};
} // namespace Internal
diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
index b2c7d20c3a..3a060d2185 100644
--- a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
+++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp
@@ -34,11 +34,11 @@
#include "linuxdeviceconfiguration.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QByteArray>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
@@ -50,8 +50,8 @@ public:
bool isRunning;
LinuxDeviceConfiguration::ConstPtr deviceConfig;
- Utils::SshRemoteProcessRunner *installer;
- Utils::SshRemoteProcessRunner *killProcess;
+ QSsh::SshRemoteProcessRunner *installer;
+ QSsh::SshRemoteProcessRunner *killProcess;
};
} // namespace Internal
diff --git a/src/plugins/remotelinux/remotelinuxprocesslist.cpp b/src/plugins/remotelinux/remotelinuxprocesslist.cpp
index 29c4deb321..347f17d0f8 100644
--- a/src/plugins/remotelinux/remotelinuxprocesslist.cpp
+++ b/src/plugins/remotelinux/remotelinuxprocesslist.cpp
@@ -33,12 +33,12 @@
#include "linuxdeviceconfiguration.h"
#include <utils/qtcassert.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QByteArray>
#include <QString>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
index 03e935c8c4..f39af40b42 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
+++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
@@ -51,6 +51,7 @@
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
+using namespace QSsh;
using namespace Utils;
namespace RemoteLinux {
diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.h b/src/plugins/remotelinux/remotelinuxrunconfiguration.h
index 77ad9b16e3..55ae2a740a 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfiguration.h
+++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.h
@@ -44,9 +44,7 @@ class Qt4BaseTarget;
class Qt4ProFileNode;
} // namespace Qt4ProjectManager
-namespace Utils {
-class PortList;
-}
+namespace Utils { class PortList; }
namespace RemoteLinux {
class LinuxDeviceConfiguration;
diff --git a/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp b/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp
index 23c442b52d..5dc94bbc68 100644
--- a/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp
+++ b/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp
@@ -34,12 +34,13 @@
#include <utils/portlist.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshconnectionmanager.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshconnectionmanager.h>
+#include <ssh/sshremoteprocess.h>
#include <QString>
+using namespace QSsh;
using namespace Utils;
namespace RemoteLinux {
@@ -75,7 +76,7 @@ void RemoteLinuxUsedPortsGatherer::start(const LinuxDeviceConfiguration::ConstPt
QTC_ASSERT(!d->connection, return);
d->portsToCheck = devConf->freePorts();
d->connection = SshConnectionManager::instance().acquireConnection(devConf->sshParameters());
- connect(d->connection.data(), SIGNAL(error(Utils::SshError)), SLOT(handleConnectionError()));
+ connect(d->connection.data(), SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
if (d->connection->state() == SshConnection::Connected) {
handleConnectionEstablished();
return;
diff --git a/src/plugins/remotelinux/sshkeydeployer.cpp b/src/plugins/remotelinux/sshkeydeployer.cpp
index 955373c266..fcdd31a8dd 100644
--- a/src/plugins/remotelinux/sshkeydeployer.cpp
+++ b/src/plugins/remotelinux/sshkeydeployer.cpp
@@ -30,13 +30,13 @@
**************************************************************************/
#include "sshkeydeployer.h"
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <utils/fileutils.h>
#include <QFile>
#include <QSharedPointer>
-using namespace Utils;
+using namespace QSsh;
namespace RemoteLinux {
namespace Internal {
diff --git a/src/plugins/remotelinux/sshkeydeployer.h b/src/plugins/remotelinux/sshkeydeployer.h
index 5debd0e194..28c9d262eb 100644
--- a/src/plugins/remotelinux/sshkeydeployer.h
+++ b/src/plugins/remotelinux/sshkeydeployer.h
@@ -35,7 +35,7 @@
#include <QObject>
-namespace Utils {
+namespace QSsh {
class SshConnectionParameters;
}
@@ -52,7 +52,7 @@ public:
explicit SshKeyDeployer(QObject *parent = 0);
~SshKeyDeployer();
- void deployPublicKey(const Utils::SshConnectionParameters &sshParams,
+ void deployPublicKey(const QSsh::SshConnectionParameters &sshParams,
const QString &keyFilePath);
void stopDeployment();
diff --git a/src/plugins/remotelinux/startgdbserverdialog.cpp b/src/plugins/remotelinux/startgdbserverdialog.cpp
index 2723658693..9cc6d5d06c 100644
--- a/src/plugins/remotelinux/startgdbserverdialog.cpp
+++ b/src/plugins/remotelinux/startgdbserverdialog.cpp
@@ -43,8 +43,8 @@
#include <utils/pathchooser.h>
#include <utils/portlist.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QVariant>
#include <QSettings>
@@ -70,6 +70,7 @@
using namespace Core;
using namespace ProjectExplorer;
+using namespace QSsh;
using namespace Utils;
const char LastSysroot[] = "RemoteLinux/LastSysroot";
diff --git a/src/plugins/valgrind/callgrind/callgrindcontroller.cpp b/src/plugins/valgrind/callgrind/callgrindcontroller.cpp
index ea765081bf..8cbd1a124d 100644
--- a/src/plugins/valgrind/callgrind/callgrindcontroller.cpp
+++ b/src/plugins/valgrind/callgrind/callgrindcontroller.cpp
@@ -38,7 +38,7 @@
#include <valgrindprocess.h>
#include <utils/qtcassert.h>
-#include <utils/ssh/sftpchannel.h>
+#include <ssh/sftpchannel.h>
#include <QTemporaryFile>
@@ -236,8 +236,8 @@ void CallgrindController::foundRemoteFile()
m_remoteFile = m_findRemoteFile->readAllStandardOutput().trimmed();
m_sftp = m_ssh->createSftpChannel();
- connect(m_sftp.data(), SIGNAL(finished(Utils::SftpJobId,QString)),
- this, SLOT(sftpJobFinished(Utils::SftpJobId,QString)));
+ connect(m_sftp.data(), SIGNAL(finished(QSsh::SftpJobId,QString)),
+ this, SLOT(sftpJobFinished(QSsh::SftpJobId,QString)));
connect(m_sftp.data(), SIGNAL(initialized()), this, SLOT(sftpInitialized()));
m_sftp->initialize();
}
@@ -251,10 +251,10 @@ void CallgrindController::sftpInitialized()
dataFile.setAutoRemove(false);
dataFile.close();
- m_downloadJob = m_sftp->downloadFile(m_remoteFile, m_tempDataFile, Utils::SftpOverwriteExisting);
+ m_downloadJob = m_sftp->downloadFile(m_remoteFile, m_tempDataFile, QSsh::SftpOverwriteExisting);
}
-void CallgrindController::sftpJobFinished(Utils::SftpJobId job, const QString &error)
+void CallgrindController::sftpJobFinished(QSsh::SftpJobId job, const QString &error)
{
QTC_ASSERT(job == m_downloadJob, return);
diff --git a/src/plugins/valgrind/callgrind/callgrindcontroller.h b/src/plugins/valgrind/callgrind/callgrindcontroller.h
index a8b66f7418..55bc6134ea 100644
--- a/src/plugins/valgrind/callgrind/callgrindcontroller.h
+++ b/src/plugins/valgrind/callgrind/callgrindcontroller.h
@@ -37,9 +37,9 @@
#include <qprocess.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
-#include <utils/ssh/sftpchannel.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
+#include <ssh/sftpchannel.h>
namespace Valgrind {
@@ -89,7 +89,7 @@ private Q_SLOTS:
void foundRemoteFile();
void sftpInitialized();
- void sftpJobFinished(Utils::SftpJobId job, const QString &error);
+ void sftpJobFinished(QSsh::SftpJobId job, const QString &error);
private:
void cleanupTempFile();
@@ -102,11 +102,11 @@ private:
Option m_lastOption;
// remote callgrind support
- Utils::SshConnection::Ptr m_ssh;
+ QSsh::SshConnection::Ptr m_ssh;
QString m_tempDataFile;
- Utils::SshRemoteProcess::Ptr m_findRemoteFile;
- Utils::SftpChannel::Ptr m_sftp;
- Utils::SftpJobId m_downloadJob;
+ QSsh::SshRemoteProcess::Ptr m_findRemoteFile;
+ QSsh::SftpChannel::Ptr m_sftp;
+ QSsh::SftpJobId m_downloadJob;
QByteArray m_remoteFile;
};
diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp
index b85a720487..b739f35a5a 100644
--- a/src/plugins/valgrind/valgrindprocess.cpp
+++ b/src/plugins/valgrind/valgrindprocess.cpp
@@ -148,7 +148,7 @@ void LocalValgrindProcess::readyReadStandardOutput()
////////////////////////
-RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnectionParameters &sshParams,
+RemoteValgrindProcess::RemoteValgrindProcess(const QSsh::SshConnectionParameters &sshParams,
QObject *parent)
: ValgrindProcess(parent)
, m_params(sshParams)
@@ -156,7 +156,7 @@ RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnectionParameter
, m_pid(0)
{}
-RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnection::Ptr &connection, QObject *parent)
+RemoteValgrindProcess::RemoteValgrindProcess(const QSsh::SshConnection::Ptr &connection, QObject *parent)
: ValgrindProcess(parent)
, m_params(connection->connectionParameters())
, m_connection(connection)
@@ -179,14 +179,14 @@ void RemoteValgrindProcess::run(const QString &valgrindExecutable, const QString
// connect to host and wait for connection
if (!m_connection)
- m_connection = Utils::SshConnection::create(m_params);
+ m_connection = QSsh::SshConnection::create(m_params);
- if (m_connection->state() != Utils::SshConnection::Connected) {
+ if (m_connection->state() != QSsh::SshConnection::Connected) {
connect(m_connection.data(), SIGNAL(connected()),
this, SLOT(connected()));
- connect(m_connection.data(), SIGNAL(error(Utils::SshError)),
- this, SLOT(error(Utils::SshError)));
- if (m_connection->state() == Utils::SshConnection::Unconnected)
+ connect(m_connection.data(), SIGNAL(error(QSsh::SshError)),
+ this, SLOT(error(QSsh::SshError)));
+ if (m_connection->state() == QSsh::SshConnection::Unconnected)
m_connection->connectToHost();
} else {
connected();
@@ -195,7 +195,7 @@ void RemoteValgrindProcess::run(const QString &valgrindExecutable, const QString
void RemoteValgrindProcess::connected()
{
- QTC_ASSERT(m_connection->state() == Utils::SshConnection::Connected, return);
+ QTC_ASSERT(m_connection->state() == QSsh::SshConnection::Connected, return);
// connected, run command
QString cmd;
@@ -219,14 +219,14 @@ void RemoteValgrindProcess::connected()
m_process->start();
}
-Utils::SshConnection::Ptr RemoteValgrindProcess::connection() const
+QSsh::SshConnection::Ptr RemoteValgrindProcess::connection() const
{
return m_connection;
}
void RemoteValgrindProcess::processStarted()
{
- QTC_ASSERT(m_connection->state() == Utils::SshConnection::Connected, return);
+ QTC_ASSERT(m_connection->state() == QSsh::SshConnection::Connected, return);
// find out what PID our process has
@@ -278,10 +278,10 @@ void RemoteValgrindProcess::standardError()
emit processOutput(m_process->readAllStandardError(), Utils::StdErrFormat);
}
-void RemoteValgrindProcess::error(Utils::SshError error)
+void RemoteValgrindProcess::error(QSsh::SshError error)
{
switch (error) {
- case Utils::SshTimeoutError:
+ case QSsh::SshTimeoutError:
m_error = QProcess::Timedout;
break;
default:
@@ -294,7 +294,7 @@ void RemoteValgrindProcess::error(Utils::SshError error)
void RemoteValgrindProcess::close()
{
- QTC_ASSERT(m_connection->state() == Utils::SshConnection::Connected, return);
+ QTC_ASSERT(m_connection->state() == QSsh::SshConnection::Connected, return);
if (m_process) {
if (m_pid) {
const QString killTemplate = QString("kill -%2 %1" // kill
@@ -304,7 +304,7 @@ void RemoteValgrindProcess::close()
const QString brutalKill = killTemplate.arg("SIGKILL");
const QString remoteCall = niceKill + QLatin1String("; sleep 1; ") + brutalKill;
- Utils::SshRemoteProcess::Ptr cleanup = m_connection->createRemoteProcess(remoteCall.toUtf8());
+ QSsh::SshRemoteProcess::Ptr cleanup = m_connection->createRemoteProcess(remoteCall.toUtf8());
cleanup->start();
}
}
@@ -315,12 +315,12 @@ void RemoteValgrindProcess::closed(int status)
QTC_ASSERT(m_process, return);
m_errorString = m_process->errorString();
- if (status == Utils::SshRemoteProcess::FailedToStart) {
+ if (status == QSsh::SshRemoteProcess::FailedToStart) {
m_error = QProcess::FailedToStart;
emit ValgrindProcess::error(QProcess::FailedToStart);
- } else if (status == Utils::SshRemoteProcess::ExitedNormally) {
+ } else if (status == QSsh::SshRemoteProcess::ExitedNormally) {
emit finished(m_process->exitCode(), QProcess::NormalExit);
- } else if (status == Utils::SshRemoteProcess::KilledBySignal) {
+ } else if (status == QSsh::SshRemoteProcess::KilledBySignal) {
m_error = QProcess::Crashed;
emit finished(m_process->exitCode(), QProcess::CrashExit);
}
diff --git a/src/plugins/valgrind/valgrindprocess.h b/src/plugins/valgrind/valgrindprocess.h
index 857ead960e..18927f47b1 100644
--- a/src/plugins/valgrind/valgrindprocess.h
+++ b/src/plugins/valgrind/valgrindprocess.h
@@ -36,8 +36,8 @@
#define VALGRIND_RUNNER_P_H
#include <utils/qtcprocess.h>
-#include <utils/ssh/sshremoteprocess.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
#include <utils/outputformat.h>
namespace Valgrind {
@@ -118,9 +118,9 @@ class RemoteValgrindProcess : public ValgrindProcess
Q_OBJECT
public:
- explicit RemoteValgrindProcess(const Utils::SshConnectionParameters &sshParams,
+ explicit RemoteValgrindProcess(const QSsh::SshConnectionParameters &sshParams,
QObject *parent = 0);
- explicit RemoteValgrindProcess(const Utils::SshConnection::Ptr &connection,
+ explicit RemoteValgrindProcess(const QSsh::SshConnection::Ptr &connection,
QObject *parent = 0);
virtual bool isRunning() const;
@@ -139,21 +139,21 @@ public:
virtual qint64 pid() const;
- Utils::SshConnection::Ptr connection() const;
+ QSsh::SshConnection::Ptr connection() const;
private slots:
void closed(int);
void connected();
- void error(Utils::SshError error);
+ void error(QSsh::SshError error);
void processStarted();
void findPIDOutputReceived();
void standardOutput();
void standardError();
private:
- Utils::SshConnectionParameters m_params;
- Utils::SshConnection::Ptr m_connection;
- Utils::SshRemoteProcess::Ptr m_process;
+ QSsh::SshConnectionParameters m_params;
+ QSsh::SshConnection::Ptr m_connection;
+ QSsh::SshRemoteProcess::Ptr m_process;
QString m_workingDir;
QString m_valgrindExe;
QStringList m_valgrindArgs;
@@ -162,7 +162,7 @@ private:
QString m_errorString;
QProcess::ProcessError m_error;
qint64 m_pid;
- Utils::SshRemoteProcess::Ptr m_findPID;
+ QSsh::SshRemoteProcess::Ptr m_findPID;
};
} // namespace Valgrind
diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp
index 25a0c8aad0..5900c28b52 100644
--- a/src/plugins/valgrind/valgrindrunner.cpp
+++ b/src/plugins/valgrind/valgrindrunner.cpp
@@ -38,8 +38,8 @@
#include <utils/qtcassert.h>
#include <utils/environment.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
#include <QEventLoop>
@@ -70,7 +70,7 @@ public:
QString debuggeeArguments;
QString workingdir;
Analyzer::StartMode startMode;
- Utils::SshConnectionParameters connParams;
+ QSsh::SshConnectionParameters connParams;
};
void ValgrindRunner::Private::run(ValgrindProcess *_process)
@@ -178,12 +178,12 @@ void ValgrindRunner::setStartMode(Analyzer::StartMode startMode)
d->startMode = startMode;
}
-const Utils::SshConnectionParameters &ValgrindRunner::connectionParameters() const
+const QSsh::SshConnectionParameters &ValgrindRunner::connectionParameters() const
{
return d->connParams;
}
-void ValgrindRunner::setConnectionParameters(const Utils::SshConnectionParameters &connParams)
+void ValgrindRunner::setConnectionParameters(const QSsh::SshConnectionParameters &connParams)
{
d->connParams = connParams;
}
diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h
index 1531024cef..12917c930c 100644
--- a/src/plugins/valgrind/valgrindrunner.h
+++ b/src/plugins/valgrind/valgrindrunner.h
@@ -38,7 +38,7 @@
#include <analyzerbase/analyzerconstants.h>
#include <utils/outputformat.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QProcess>
@@ -76,8 +76,8 @@ public:
void setStartMode(Analyzer::StartMode startMode);
Analyzer::StartMode startMode() const;
- void setConnectionParameters(const Utils::SshConnectionParameters &connParams);
- const Utils::SshConnectionParameters &connectionParameters() const;
+ void setConnectionParameters(const QSsh::SshConnectionParameters &connParams);
+ const QSsh::SshConnectionParameters &connectionParameters() const;
void waitForFinished() const;
diff --git a/tests/manual/ssh/errorhandling/main.cpp b/tests/manual/ssh/errorhandling/main.cpp
index b999877f2c..67f0a4faaa 100644
--- a/tests/manual/ssh/errorhandling/main.cpp
+++ b/tests/manual/ssh/errorhandling/main.cpp
@@ -30,9 +30,9 @@
**
**************************************************************************/
-#include <utils/ssh/sftpchannel.h>
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sftpchannel.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
#include <QCoreApplication>
#include <QList>
@@ -40,7 +40,7 @@
#include <QPair>
#include <QTimer>
-using namespace Utils;
+using namespace QSsh;
class Test : public QObject {
Q_OBJECT
@@ -129,7 +129,7 @@ private slots:
qApp->quit();
}
- void handleError(Utils::SshError error)
+ void handleError(QSsh::SshError error)
{
if (m_testSet.isEmpty()) {
qDebug("Error: Received error %d, but no test was running.", error);
@@ -173,8 +173,8 @@ private:
SLOT(handleDisconnected()));
connect(m_connection.data(), SIGNAL(dataAvailable(QString)), this,
SLOT(handleDataAvailable(QString)));
- connect(m_connection.data(), SIGNAL(error(Utils::SshError)), this,
- SLOT(handleError(Utils::SshError)));
+ connect(m_connection.data(), SIGNAL(error(QSsh::SshError)), this,
+ SLOT(handleError(QSsh::SshError)));
const TestItem &nextItem = m_testSet.first();
m_timeoutTimer.stop();
m_timeoutTimer.setInterval(qMax(10000, nextItem.params.timeout * 1000));
diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.cpp b/tests/manual/ssh/remoteprocess/argumentscollector.cpp
index 64cc0ef883..b5acea9968 100644
--- a/tests/manual/ssh/remoteprocess/argumentscollector.cpp
+++ b/tests/manual/ssh/remoteprocess/argumentscollector.cpp
@@ -36,15 +36,16 @@
#include <iostream>
+using namespace QSsh;
+
using namespace std;
-using namespace Utils;
ArgumentsCollector::ArgumentsCollector(const QStringList &args)
: m_arguments(args)
{
}
-Utils::SshConnectionParameters ArgumentsCollector::collect(bool &success) const
+QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const
{
SshConnectionParameters parameters;
try {
diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.h b/tests/manual/ssh/remoteprocess/argumentscollector.h
index e2dc69e0b3..d7189597f1 100644
--- a/tests/manual/ssh/remoteprocess/argumentscollector.h
+++ b/tests/manual/ssh/remoteprocess/argumentscollector.h
@@ -33,7 +33,7 @@
#ifndef ARGUMENTSCOLLECTOR_H
#define ARGUMENTSCOLLECTOR_H
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QStringList>
@@ -41,7 +41,7 @@ class ArgumentsCollector
{
public:
ArgumentsCollector(const QStringList &args);
- Utils::SshConnectionParameters collect(bool &success) const;
+ QSsh::SshConnectionParameters collect(bool &success) const;
private:
struct ArgumentErrorException
{
@@ -54,7 +54,7 @@ private:
bool checkAndSetIntArg(int &pos, int &val, bool &alreadyGiven,
const char *opt) const;
bool checkForNoProxy(int &pos,
- Utils::SshConnectionParameters::ProxyType &type,
+ QSsh::SshConnectionParameters::ProxyType &type,
bool &alreadyGiven) const;
const QStringList m_arguments;
diff --git a/tests/manual/ssh/remoteprocess/main.cpp b/tests/manual/ssh/remoteprocess/main.cpp
index 01203bd2d0..0fac815a29 100644
--- a/tests/manual/ssh/remoteprocess/main.cpp
+++ b/tests/manual/ssh/remoteprocess/main.cpp
@@ -33,7 +33,7 @@
#include "argumentscollector.h"
#include "remoteprocesstest.h"
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QCoreApplication>
#include <QObject>
@@ -42,13 +42,11 @@
#include <cstdlib>
#include <iostream>
-using namespace Utils;
-
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
bool parseSuccess;
- const Utils::SshConnectionParameters &parameters
+ const QSsh::SshConnectionParameters &parameters
= ArgumentsCollector(app.arguments()).collect(parseSuccess);
if (!parseSuccess)
return EXIT_FAILURE;
diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp b/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp
index 47eaaee77b..2f0557491a 100644
--- a/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp
+++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp
@@ -32,7 +32,7 @@
#include "remoteprocesstest.h"
-#include <utils/ssh/sshpseudoterminal.h>
+#include <ssh/sshpseudoterminal.h>
#include <QCoreApplication>
#include <QTextStream>
@@ -40,7 +40,7 @@
#include <iostream>
-using namespace Utils;
+using namespace QSsh;
const QByteArray StderrOutput("ChannelTest");
@@ -93,8 +93,8 @@ void RemoteProcessTest::handleProcessStarted()
} else {
m_started = true;
if (m_state == TestingCrash) {
- Utils::SshRemoteProcessRunner * const killer
- = new Utils::SshRemoteProcessRunner(this);
+ QSsh::SshRemoteProcessRunner * const killer
+ = new QSsh::SshRemoteProcessRunner(this);
killer->run("pkill -9 sleep", m_sshParams);
} else if (m_state == TestingIoDevice) {
connect(m_catProcess.data(), SIGNAL(readyRead()), SLOT(handleReadyRead()));
@@ -214,9 +214,9 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
}
std::cout << "Ok.\nTesting I/O device functionality... " << std::flush;
m_state = TestingIoDevice;
- m_sshConnection = Utils::SshConnection::create(m_sshParams);
+ m_sshConnection = QSsh::SshConnection::create(m_sshParams);
connect(m_sshConnection.data(), SIGNAL(connected()), SLOT(handleConnected()));
- connect(m_sshConnection.data(), SIGNAL(error(Utils::SshError)),
+ connect(m_sshConnection.data(), SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionError()));
m_sshConnection->connectToHost();
m_timeoutTimer->start();
@@ -308,7 +308,7 @@ void RemoteProcessTest::handleReadyRead()
<< qPrintable(testString()) << "', got '" << qPrintable(data) << "'." << std::endl;
qApp->exit(1);
}
- Utils::SshRemoteProcessRunner * const killer = new Utils::SshRemoteProcessRunner(this);
+ QSsh::SshRemoteProcessRunner * const killer = new QSsh::SshRemoteProcessRunner(this);
killer->run("pkill -9 cat", m_sshParams);
break;
}
diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.h b/tests/manual/ssh/remoteprocess/remoteprocesstest.h
index e203eaea63..0eb59ab0f6 100644
--- a/tests/manual/ssh/remoteprocess/remoteprocesstest.h
+++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.h
@@ -33,7 +33,7 @@
#ifndef REMOTEPROCESSTEST_H
#define REMOTEPROCESSTEST_H
-#include <utils/ssh/sshremoteprocessrunner.h>
+#include <ssh/sshremoteprocessrunner.h>
#include <QObject>
@@ -44,7 +44,7 @@ class RemoteProcessTest : public QObject
{
Q_OBJECT
public:
- RemoteProcessTest(const Utils::SshConnectionParameters &params);
+ RemoteProcessTest(const QSsh::SshConnectionParameters &params);
~RemoteProcessTest();
void run();
@@ -70,13 +70,13 @@ private:
void handleSuccessfulCrashTest();
void handleSuccessfulIoTest();
- const Utils::SshConnectionParameters m_sshParams;
+ const QSsh::SshConnectionParameters m_sshParams;
QTimer * const m_timeoutTimer;
QTextStream *m_textStream;
- Utils::SshRemoteProcessRunner * const m_remoteRunner;
- Utils::SshRemoteProcess::Ptr m_catProcess;
- Utils::SshRemoteProcess::Ptr m_echoProcess;
- Utils::SshConnection::Ptr m_sshConnection;
+ QSsh::SshRemoteProcessRunner * const m_remoteRunner;
+ QSsh::SshRemoteProcess::Ptr m_catProcess;
+ QSsh::SshRemoteProcess::Ptr m_echoProcess;
+ QSsh::SshConnection::Ptr m_sshConnection;
QByteArray m_remoteStdout;
QByteArray m_remoteStderr;
QByteArray m_remoteData;
diff --git a/tests/manual/ssh/sftp/argumentscollector.cpp b/tests/manual/ssh/sftp/argumentscollector.cpp
index d51a00c3d6..a10fea0ee4 100644
--- a/tests/manual/ssh/sftp/argumentscollector.cpp
+++ b/tests/manual/ssh/sftp/argumentscollector.cpp
@@ -34,8 +34,9 @@
#include <iostream>
+using namespace QSsh;
+
using namespace std;
-using namespace Utils;
ArgumentsCollector::ArgumentsCollector(const QStringList &args)
: m_arguments(args)
diff --git a/tests/manual/ssh/sftp/argumentscollector.h b/tests/manual/ssh/sftp/argumentscollector.h
index 62fb79061d..ca67456b89 100644
--- a/tests/manual/ssh/sftp/argumentscollector.h
+++ b/tests/manual/ssh/sftp/argumentscollector.h
@@ -53,8 +53,7 @@ private:
bool checkAndSetStringArg(int &pos, QString &arg, const char *opt) const;
bool checkAndSetIntArg(int &pos, int &val, bool &alreadyGiven,
const char *opt) const;
- bool checkForNoProxy(int &pos,
- Utils::SshConnectionParameters::ProxyType &type,
+ bool checkForNoProxy(int &pos, QSsh::SshConnectionParameters::ProxyType &type,
bool &alreadyGiven) const;
const QStringList m_arguments;
diff --git a/tests/manual/ssh/sftp/main.cpp b/tests/manual/ssh/sftp/main.cpp
index 8a0a244b91..231cb14909 100644
--- a/tests/manual/ssh/sftp/main.cpp
+++ b/tests/manual/ssh/sftp/main.cpp
@@ -33,8 +33,8 @@
#include "argumentscollector.h"
#include "sftptest.h"
-#include <utils/ssh/sftpchannel.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sftpchannel.h>
+#include <ssh/sshconnection.h>
#include <QCoreApplication>
#include <QObject>
@@ -43,14 +43,11 @@
#include <cstdlib>
#include <iostream>
-using namespace Utils;
-
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
bool parseSuccess;
- const Parameters parameters
- = ArgumentsCollector(app.arguments()).collect(parseSuccess);
+ const Parameters parameters = ArgumentsCollector(app.arguments()).collect(parseSuccess);
if (!parseSuccess)
return EXIT_FAILURE;
SftpTest sftpTest(parameters);
diff --git a/tests/manual/ssh/sftp/parameters.h b/tests/manual/ssh/sftp/parameters.h
index 81b473239c..7a29245269 100644
--- a/tests/manual/ssh/sftp/parameters.h
+++ b/tests/manual/ssh/sftp/parameters.h
@@ -33,10 +33,10 @@
#ifndef PARAMETERS_H
#define PARAMETERS_H
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
struct Parameters {
- Utils::SshConnectionParameters sshParams;
+ QSsh::SshConnectionParameters sshParams;
int smallFileCount;
int bigFileSize;
};
diff --git a/tests/manual/ssh/sftp/sftptest.cpp b/tests/manual/ssh/sftp/sftptest.cpp
index 8083ce0498..b1372d6f3c 100644
--- a/tests/manual/ssh/sftp/sftptest.cpp
+++ b/tests/manual/ssh/sftp/sftptest.cpp
@@ -40,7 +40,7 @@
#include <iostream>
-using namespace Utils;
+using namespace QSsh;
SftpTest::SftpTest(const Parameters &params)
: m_parameters(params), m_state(Inactive), m_error(false),
@@ -64,7 +64,7 @@ void SftpTest::run()
m_connection = SshConnection::create(m_parameters.sshParams);
connect(m_connection.data(), SIGNAL(connected()), this,
SLOT(handleConnected()));
- connect(m_connection.data(), SIGNAL(error(Utils::SshError)), this,
+ connect(m_connection.data(), SIGNAL(error(QSsh::SshError)), this,
SLOT(handleError()));
connect(m_connection.data(), SIGNAL(disconnected()), this,
SLOT(handleDisconnected()));
@@ -87,11 +87,11 @@ void SftpTest::handleConnected()
SLOT(handleChannelInitialized()));
connect(m_channel.data(), SIGNAL(initializationFailed(QString)), this,
SLOT(handleChannelInitializationFailure(QString)));
- connect(m_channel.data(), SIGNAL(finished(Utils::SftpJobId,QString)),
- this, SLOT(handleJobFinished(Utils::SftpJobId,QString)));
+ connect(m_channel.data(), SIGNAL(finished(QSsh::SftpJobId,QString)),
+ this, SLOT(handleJobFinished(QSsh::SftpJobId,QString)));
connect(m_channel.data(),
- SIGNAL(fileInfoAvailable(Utils::SftpJobId,QList<Utils::SftpFileInfo>)),
- SLOT(handleFileInfo(Utils::SftpJobId,QList<Utils::SftpFileInfo>)));
+ SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)),
+ SLOT(handleFileInfo(QSsh::SftpJobId,QList<QSsh::SftpFileInfo>)));
connect(m_channel.data(), SIGNAL(closed()), this,
SLOT(handleChannelClosed()));
m_state = InitializingChannel;
@@ -200,7 +200,7 @@ void SftpTest::handleChannelClosed()
m_connection->disconnectFromHost();
}
-void SftpTest::handleJobFinished(Utils::SftpJobId job, const QString &error)
+void SftpTest::handleJobFinished(QSsh::SftpJobId job, const QString &error)
{
switch (m_state) {
case UploadingSmall:
diff --git a/tests/manual/ssh/sftp/sftptest.h b/tests/manual/ssh/sftp/sftptest.h
index ca84e850c2..8ca5a3dff4 100644
--- a/tests/manual/ssh/sftp/sftptest.h
+++ b/tests/manual/ssh/sftp/sftptest.h
@@ -35,8 +35,8 @@
#include "parameters.h"
-#include <utils/ssh/sftpchannel.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sftpchannel.h>
+#include <ssh/sshconnection.h>
#include <QElapsedTimer>
#include <QHash>
@@ -60,12 +60,12 @@ private slots:
void handleDisconnected();
void handleChannelInitialized();
void handleChannelInitializationFailure(const QString &reason);
- void handleJobFinished(Utils::SftpJobId job, const QString &error);
- void handleFileInfo(Utils::SftpJobId job, const QList<Utils::SftpFileInfo> &fileInfoList);
+ void handleJobFinished(QSsh::SftpJobId job, const QString &error);
+ void handleFileInfo(QSsh::SftpJobId job, const QList<QSsh::SftpFileInfo> &fileInfoList);
void handleChannelClosed();
private:
- typedef QHash<Utils::SftpJobId, QString> JobMap;
+ typedef QHash<QSsh::SftpJobId, QString> JobMap;
typedef QSharedPointer<QFile> FilePtr;
enum State {
Inactive, Connecting, InitializingChannel, UploadingSmall, DownloadingSmall,
@@ -78,36 +78,36 @@ private:
QString cmpFileName(const QString &localFileName) const;
QString remoteFilePath(const QString &localFileName) const;
void earlyDisconnectFromHost();
- bool checkJobId(Utils::SftpJobId job, Utils::SftpJobId expectedJob, const char *activity);
- bool handleJobFinished(Utils::SftpJobId job, JobMap &jobMap,
+ bool checkJobId(QSsh::SftpJobId job, QSsh::SftpJobId expectedJob, const char *activity);
+ bool handleJobFinished(QSsh::SftpJobId job, JobMap &jobMap,
const QString &error, const char *activity);
- bool handleJobFinished(Utils::SftpJobId job, Utils::SftpJobId expectedJob, const QString &error,
+ bool handleJobFinished(QSsh::SftpJobId job, QSsh::SftpJobId expectedJob, const QString &error,
const char *activity);
- bool handleBigJobFinished(Utils::SftpJobId job, Utils::SftpJobId expectedJob,
+ bool handleBigJobFinished(QSsh::SftpJobId job, QSsh::SftpJobId expectedJob,
const QString &error, const char *activity);
bool compareFiles(QFile *orig, QFile *copy);
const Parameters m_parameters;
State m_state;
bool m_error;
- Utils::SshConnection::Ptr m_connection;
- Utils::SftpChannel::Ptr m_channel;
+ QSsh::SshConnection::Ptr m_connection;
+ QSsh::SftpChannel::Ptr m_channel;
QList<FilePtr> m_localSmallFiles;
JobMap m_smallFilesUploadJobs;
JobMap m_smallFilesDownloadJobs;
JobMap m_smallFilesRemovalJobs;
FilePtr m_localBigFile;
- Utils::SftpJobId m_bigFileUploadJob;
- Utils::SftpJobId m_bigFileDownloadJob;
- Utils::SftpJobId m_bigFileRemovalJob;
- Utils::SftpJobId m_mkdirJob;
- Utils::SftpJobId m_statDirJob;
- Utils::SftpJobId m_lsDirJob;
- Utils::SftpJobId m_rmDirJob;
+ QSsh::SftpJobId m_bigFileUploadJob;
+ QSsh::SftpJobId m_bigFileDownloadJob;
+ QSsh::SftpJobId m_bigFileRemovalJob;
+ QSsh::SftpJobId m_mkdirJob;
+ QSsh::SftpJobId m_statDirJob;
+ QSsh::SftpJobId m_lsDirJob;
+ QSsh::SftpJobId m_rmDirJob;
QElapsedTimer m_bigJobTimer;
QString m_remoteDirPath;
- Utils::SftpFileInfo m_dirInfo;
- QList<Utils::SftpFileInfo> m_dirContents;
+ QSsh::SftpFileInfo m_dirInfo;
+ QList<QSsh::SftpFileInfo> m_dirContents;
};
diff --git a/tests/manual/ssh/sftpfsmodel/main.cpp b/tests/manual/ssh/sftpfsmodel/main.cpp
index 4525c0b30e..655a00d74f 100644
--- a/tests/manual/ssh/sftpfsmodel/main.cpp
+++ b/tests/manual/ssh/sftpfsmodel/main.cpp
@@ -31,14 +31,12 @@
**************************************************************************/
#include "window.h"
-#include <utils/ssh/sftpfilesystemmodel.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sftpfilesystemmodel.h>
+#include <ssh/sshconnection.h>
#include <QApplication>
#include <QTreeView>
-using namespace Utils;
-
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
diff --git a/tests/manual/ssh/sftpfsmodel/window.cpp b/tests/manual/ssh/sftpfsmodel/window.cpp
index d3ca3dccda..ee3637bb2f 100644
--- a/tests/manual/ssh/sftpfsmodel/window.cpp
+++ b/tests/manual/ssh/sftpfsmodel/window.cpp
@@ -34,8 +34,8 @@
#include "modeltest.h"
-#include <utils/ssh/sftpfilesystemmodel.h>
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sftpfilesystemmodel.h>
+#include <ssh/sshconnection.h>
#include <QApplication>
#include <QDir>
@@ -45,7 +45,7 @@
#include <QItemSelectionModel>
#include <QString>
-using namespace Utils;
+using namespace QSsh;
SftpFsWindow::SftpFsWindow(QWidget *parent) : QDialog(parent), m_ui(new Ui::Window)
{
@@ -75,8 +75,8 @@ void SftpFsWindow::connectToHost()
connect(m_fsModel, SIGNAL(sftpOperationFailed(QString)),
SLOT(handleSftpOperationFailed(QString)));
connect(m_fsModel, SIGNAL(connectionError(QString)), SLOT(handleConnectionError(QString)));
- connect(m_fsModel, SIGNAL(sftpOperationFinished(Utils::SftpJobId,QString)),
- SLOT(handleSftpOperationFinished(Utils::SftpJobId,QString)));
+ connect(m_fsModel, SIGNAL(sftpOperationFinished(QSsh::SftpJobId,QString)),
+ SLOT(handleSftpOperationFinished(QSsh::SftpJobId,QString)));
m_fsModel->setSshConnection(sshParams);
m_ui->fsView->setModel(m_fsModel);
}
diff --git a/tests/manual/ssh/sftpfsmodel/window.h b/tests/manual/ssh/sftpfsmodel/window.h
index b403df0582..5e6d5ee4a9 100644
--- a/tests/manual/ssh/sftpfsmodel/window.h
+++ b/tests/manual/ssh/sftpfsmodel/window.h
@@ -29,7 +29,7 @@
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
-#include <utils/ssh/sftpdefs.h>
+#include <ssh/sftpdefs.h>
#include <QDialog>
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
namespace Ui { class Window; }
QT_END_NAMESPACE
-namespace Utils { class SftpFileSystemModel; }
+namespace QSsh { class SftpFileSystemModel; }
class SftpFsWindow : public QDialog
{
@@ -51,9 +51,9 @@ private slots:
void downloadFile();
void handleConnectionError(const QString &errorMessage);
void handleSftpOperationFailed(const QString &errorMessage);
- void handleSftpOperationFinished(Utils::SftpJobId jobId, const QString &error);
+ void handleSftpOperationFinished(QSsh::SftpJobId jobId, const QString &error);
private:
- Utils::SftpFileSystemModel *m_fsModel;
+ QSsh::SftpFileSystemModel *m_fsModel;
Ui::Window *m_ui;
};
diff --git a/tests/manual/ssh/shell/main.cpp b/tests/manual/ssh/shell/main.cpp
index ba51eae3c0..4767d2cb7a 100644
--- a/tests/manual/ssh/shell/main.cpp
+++ b/tests/manual/ssh/shell/main.cpp
@@ -32,7 +32,7 @@
#include "../remoteprocess/argumentscollector.h"
#include "shell.h"
-#include <utils/ssh/sshconnection.h>
+#include <ssh/sshconnection.h>
#include <QCoreApplication>
#include <QObject>
@@ -41,13 +41,11 @@
#include <cstdlib>
#include <iostream>
-using namespace Utils;
-
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
bool parseSuccess;
- const Utils::SshConnectionParameters &parameters
+ const QSsh::SshConnectionParameters &parameters
= ArgumentsCollector(app.arguments()).collect(parseSuccess);
if (!parseSuccess)
return EXIT_FAILURE;
diff --git a/tests/manual/ssh/shell/shell.cpp b/tests/manual/ssh/shell/shell.cpp
index fe5a58dd8c..392f4af29c 100644
--- a/tests/manual/ssh/shell/shell.cpp
+++ b/tests/manual/ssh/shell/shell.cpp
@@ -31,8 +31,8 @@
**************************************************************************/
#include "shell.h"
-#include <utils/ssh/sshconnection.h>
-#include <utils/ssh/sshremoteprocess.h>
+#include <ssh/sshconnection.h>
+#include <ssh/sshremoteprocess.h>
#include <QCoreApplication>
#include <QFile>
@@ -41,16 +41,16 @@
#include <cstdlib>
#include <iostream>
-using namespace Utils;
+using namespace QSsh;
-Shell::Shell(const Utils::SshConnectionParameters &parameters, QObject *parent)
+Shell::Shell(const QSsh::SshConnectionParameters &parameters, QObject *parent)
: QObject(parent),
m_connection(SshConnection::create(parameters)),
m_stdin(new QFile(this))
{
connect(m_connection.data(), SIGNAL(connected()), SLOT(handleConnected()));
connect(m_connection.data(), SIGNAL(dataAvailable(QString)), SLOT(handleShellMessage(QString)));
- connect(m_connection.data(), SIGNAL(error(Utils::SshError)), SLOT(handleConnectionError()));
+ connect(m_connection.data(), SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
}
Shell::~Shell()
diff --git a/tests/manual/ssh/shell/shell.h b/tests/manual/ssh/shell/shell.h
index 6ab410cc66..9e6e5c364b 100644
--- a/tests/manual/ssh/shell/shell.h
+++ b/tests/manual/ssh/shell/shell.h
@@ -35,7 +35,7 @@
#include <QObject>
#include <QSharedPointer>
-namespace Utils {
+namespace QSsh {
class SshConnection;
class SshConnectionParameters;
class SshRemoteProcess;
@@ -51,7 +51,7 @@ class Shell : public QObject
{
Q_OBJECT
public:
- Shell(const Utils::SshConnectionParameters &parameters, QObject *parent = 0);
+ Shell(const QSsh::SshConnectionParameters &parameters, QObject *parent = 0);
~Shell();
void run();
@@ -67,8 +67,8 @@ private slots:
void handleStdin();
private:
- QSharedPointer<Utils::SshConnection> m_connection;
- QSharedPointer<Utils::SshRemoteProcess> m_shell;
+ QSharedPointer<QSsh::SshConnection> m_connection;
+ QSharedPointer<QSsh::SshRemoteProcess> m_shell;
QFile * const m_stdin;
};
diff --git a/tests/manual/ssh/ssh.pri b/tests/manual/ssh/ssh.pri
index b27a328c0c..f4c70a5d74 100644
--- a/tests/manual/ssh/ssh.pri
+++ b/tests/manual/ssh/ssh.pri
@@ -1,16 +1,13 @@
QT = core network
include (../../../qtcreator.pri)
-include (../../../src/plugins/coreplugin/coreplugin.pri)
-
-LIBS += -L$$IDE_PLUGIN_PATH/Nokia
+include (../../../src/libs/ssh/ssh.pri)
macx:QMAKE_LFLAGS += -Wl,-rpath,\"$$IDE_BIN_PATH/..\"
INCLUDEPATH *= $$IDE_SOURCE_TREE/src/plugins
-LIBS *= -L$$IDE_LIBRARY_PATH/Nokia
+LIBS *= -L$$IDE_LIBRARY_PATH
unix {
- QMAKE_LFLAGS += -Wl,-rpath,\"$$IDE_PLUGIN_PATH/..\"
- QMAKE_LFLAGS += -Wl,-rpath,\"$$IDE_PLUGIN_PATH/Nokia\"
+ QMAKE_LFLAGS += -Wl,-rpath,\"$$IDE_LIBRARY_PATH\"
}
CONFIG += console