Commit 94548a1e authored by Milian Wolff's avatar Milian Wolff Committed by hjk
Browse files

move src/plugins/coreplugin/ssh to src/lib/utils/ssh



Merge-request: 253
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 3b2804d0
......@@ -3,6 +3,7 @@ CONFIG += ordered
QT += core gui
SUBDIRS = \
3rdparty \
qtconcurrent \
aggregation \
extensionsystem \
......@@ -13,8 +14,7 @@ SUBDIRS = \
qmljs \
glsl \
qmleditorwidgets \
symbianutils \
3rdparty
symbianutils
# Windows: Compile Qt Creator CDB extension if Debugging tools can be detected.
win32 {
......
......@@ -41,7 +41,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
namespace Core {
namespace Utils {
namespace Internal {
namespace {
......@@ -70,10 +70,10 @@ SftpChannel::SftpChannel(quint32 channelId,
Qt::QueuedConnection);
connect(d, SIGNAL(initializationFailed(QString)), this,
SIGNAL(initializationFailed(QString)), Qt::QueuedConnection);
connect(d, SIGNAL(dataAvailable(Core::SftpJobId, QString)), this,
SIGNAL(dataAvailable(Core::SftpJobId, QString)), Qt::QueuedConnection);
connect(d, SIGNAL(finished(Core::SftpJobId,QString)), this,
SIGNAL(finished(Core::SftpJobId,QString)), Qt::QueuedConnection);
connect(d, SIGNAL(dataAvailable(Utils::SftpJobId, QString)), this,
SIGNAL(dataAvailable(Utils::SftpJobId, QString)), Qt::QueuedConnection);
connect(d, SIGNAL(finished(Utils::SftpJobId,QString)), this,
SIGNAL(finished(Utils::SftpJobId,QString)), Qt::QueuedConnection);
connect(d, SIGNAL(closed()), this, SIGNAL(closed()), Qt::QueuedConnection);
}
......@@ -882,4 +882,4 @@ void SftpChannelPrivate::spawnReadRequests(const SftpDownload::Ptr &job)
}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -37,14 +37,14 @@
#include "sftpdefs.h"
#include "sftpincomingpacket_p.h"
#include <coreplugin/core_global.h>
#include <utils/utils_global.h>
#include <QtCore/QByteArray>
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include <QtCore/QString>
namespace Core {
namespace Utils {
namespace Internal {
class SftpChannelPrivate;
......@@ -71,7 +71,7 @@ class SshSendFacility;
* non-empty error string.
* Note that directory names must not have a trailing slash.
*/
class CORE_EXPORT SftpChannel : public QObject
class QTCREATOR_UTILS_EXPORT SftpChannel : public QObject
{
Q_OBJECT
......@@ -108,14 +108,14 @@ signals:
void closed();
// error.isEmpty <=> finished successfully
void finished(Core::SftpJobId job, const QString &error = QString());
void finished(Utils::SftpJobId job, const QString &error = QString());
/*
* This signal is only emitted by the "List Directory" operation,
* one file at a time.
// TODO: Also emit for each file copied by uploadDir().
*/
void dataAvailable(Core::SftpJobId job, const QString &data);
void dataAvailable(Utils::SftpJobId job, const QString &data);
private:
SftpChannel(quint32 channelId, Internal::SshSendFacility &sendFacility);
......@@ -123,6 +123,6 @@ private:
Internal::SftpChannelPrivate *d;
};
} // namespace Core
} // namespace Utils
#endif // SFTPCHANNEL_H
......@@ -43,14 +43,14 @@
#include <QtCore/QByteArray>
#include <QtCore/QMap>
namespace Core {
namespace Utils {
class SftpChannel;
namespace Internal {
class SftpChannelPrivate : public AbstractSshChannel
{
Q_OBJECT
friend class Core::SftpChannel;
friend class Utils::SftpChannel;
public:
enum SftpState { Inactive, SubsystemRequested, InitSent, Initialized };
......@@ -64,8 +64,8 @@ signals:
void initialized();
void initializationFailed(const QString &reason);
void closed();
void finished(Core::SftpJobId job, const QString &error = QString());
void dataAvailable(Core::SftpJobId job, const QString &data);
void finished(Utils::SftpJobId job, const QString &error = QString());
void dataAvailable(Utils::SftpJobId job, const QString &data);
private:
typedef QMap<SftpJobId, AbstractSftpOperation::Ptr> JobMap;
......@@ -128,6 +128,6 @@ private:
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // SFTPCHANNEL_P_H
......@@ -33,4 +33,4 @@
#include "sftpdefs.h"
namespace Core { const SftpJobId SftpInvalidJob = 0; }
namespace Utils { const SftpJobId SftpInvalidJob = 0; }
......@@ -34,19 +34,19 @@
#ifndef SFTPDEFS_H
#define SFTPDEFS_H
#include <coreplugin/core_global.h>
#include <utils/utils_global.h>
#include <QtCore/QtGlobal>
namespace Core {
namespace Utils {
typedef quint32 SftpJobId;
CORE_EXPORT extern const SftpJobId SftpInvalidJob;
QTCREATOR_UTILS_EXPORT extern const SftpJobId SftpInvalidJob;
enum SftpOverwriteMode {
SftpOverwriteExisting, SftpAppendToExisting, SftpSkipExisting
};
} // namespace Core
} // namespace Utils
#endif // SFTPDEFS_H
......@@ -36,7 +36,7 @@
#include "sshexception_p.h"
#include "sshpacketparser_p.h"
namespace Core {
namespace Utils {
namespace Internal {
namespace {
......@@ -231,4 +231,4 @@ SftpFileAttributes SftpIncomingPacket::asFileAttributes(quint32 &offset) const
}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -36,7 +36,7 @@
#include "sftppacket_p.h"
namespace Core {
namespace Utils {
namespace Internal {
struct SftpHandleResponse {
......@@ -110,6 +110,6 @@ private:
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // SFTPINCOMINGPACKET_P_H
......@@ -37,7 +37,7 @@
#include <QtCore/QFile>
namespace Core {
namespace Utils {
namespace Internal {
AbstractSftpOperation::AbstractSftpOperation(SftpJobId jobId) : jobId(jobId)
......@@ -184,4 +184,4 @@ SftpOutgoingPacket &SftpUploadFile::initialPacket(SftpOutgoingPacket &packet)
SftpUploadDir::~SftpUploadDir() {}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
class QFile;
QT_END_NAMESPACE
namespace Core {
namespace Utils {
namespace Internal {
class SftpOutgoingPacket;
......@@ -227,6 +227,6 @@ struct SftpUploadDir
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // SFTPOPERATION_P_H
......@@ -37,7 +37,7 @@
#include <QtCore/QtEndian>
namespace Core {
namespace Utils {
namespace Internal {
namespace {
......@@ -203,4 +203,4 @@ SftpOutgoingPacket &SftpOutgoingPacket::finalize()
}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -37,7 +37,7 @@
#include "sftppacket_p.h"
#include "sftpdefs.h"
namespace Core {
namespace Utils {
namespace Internal {
class SftpOutgoingPacket : public AbstractSftpPacket
......@@ -82,6 +82,6 @@ private:
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // SFTPOUTGOINGPACKET_P_H
......@@ -35,7 +35,7 @@
#include "sshpacketparser_p.h"
namespace Core {
namespace Utils {
namespace Internal {
const quint32 AbstractSftpPacket::MaxDataSize = 32000;
......@@ -55,4 +55,4 @@ quint32 AbstractSftpPacket::requestId() const
}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -38,7 +38,7 @@
#include <QtCore/QList>
#include <QtCore/QString>
namespace Core {
namespace Utils {
namespace Internal {
enum SftpPacketType {
......@@ -107,6 +107,6 @@ protected:
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // SFTPPACKET_P_H
......@@ -39,7 +39,7 @@
#include <botan/rng.h>
#include <botan/secmem.h>
namespace Core {
namespace Utils {
namespace Internal {
inline const Botan::byte *convertByteArray(const QByteArray &a)
......@@ -96,6 +96,6 @@ inline quint32 botanHMacKeyLen(const QByteArray &rfcAlgoName)
}
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // BYTEARRAYCONVERSIONS_P_H
......@@ -38,7 +38,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QString>
namespace Core {
namespace Utils {
namespace Internal {
namespace {
......@@ -104,4 +104,4 @@ QByteArray SshCapabilities::findBestMatch(const QList<QByteArray> &myCapabilitie
}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -37,7 +37,7 @@
#include <QtCore/QByteArray>
#include <QtCore/QList>
namespace Core {
namespace Utils {
namespace Internal {
class SshCapabilities
......@@ -71,6 +71,6 @@ public:
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // CAPABILITIES_P_H
......@@ -40,7 +40,7 @@
#include <QtCore/QTimer>
namespace Core {
namespace Utils {
namespace Internal {
namespace {
......@@ -261,4 +261,4 @@ quint32 AbstractSshChannel::maxDataSize() const
}
} // namespace Internal
} // namespace Core
} // namespace Utils
......@@ -40,7 +40,7 @@
QT_FORWARD_DECLARE_CLASS(QTimer)
namespace Core {
namespace Utils {
namespace Internal {
struct SshChannelExitSignal;
......@@ -124,6 +124,6 @@ private:
};
} // namespace Internal
} // namespace Core
} // namespace Utils
#endif // SSHCHANNEL_P_H
......@@ -42,7 +42,7 @@
#include <QtCore/QList>
namespace Core {
namespace Utils {
namespace Internal {
SshChannelManager::SshChannelManager(SshSendFacility &sendFacility,
......@@ -150,14 +150,14 @@ AbstractSshChannel *SshChannelManager::lookupChannel(quint32 channelId,
return it == m_channels.end() ? 0 : it.value();
}
Core::SshRemoteProcess::Ptr SshChannelManager::createRemoteProcess(const QByteArray &command)
Utils::SshRemoteProcess::Ptr SshChannelManager::createRemoteProcess(const QByteArray &command)
{
SshRemoteProcess::Ptr proc(new SshRemoteProcess(command, m_nextLocalChannelId++, m_sendFacility));
insertChannel(proc->d, proc);
return proc;
}
Core::SftpChannel::Ptr SshChannelManager::createSftpChannel()
Utils::SftpChannel::Ptr SshChannelManager::createSftpChannel()
{
SftpChannel::Ptr sftp(new SftpChannel(m_nextLocalChannelId++, m_sendFacility));
insertChannel(sftp->d, sftp);
......@@ -189,4 +189,4 @@ void SshChannelManager::removeChannel(ChannelIterator it)
}
} // namespace Internal
} // namespace Core
} // namespace Utils
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment