summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2011-01-21 13:16:31 +0100
committerChristian Kandeler <christian.kandeler@nokia.com>2011-01-21 13:21:36 +0100
commite8c5de1547b69a6217eb64c6a715fc2bb467db64 (patch)
tree291fe4f348c0032629fe392c4c8d165ef6d1823d
parent3ff03ea9419e0070c4a71dce933e0986bc7d87ea (diff)
downloadqt-creator-e8c5de1547b69a6217eb64c6a715fc2bb467db64.tar.gz
Maemo: Don't upload utfs-client anymore.
It's now a part of mad-developer and should be on the device already.
-rw-r--r--src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp80
-rw-r--r--src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h12
2 files changed, 5 insertions, 87 deletions
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
index fb74055afc..a60f3d49c4 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
@@ -37,7 +37,6 @@
#include "maemousedportsgatherer.h"
#include "qt4maemotarget.h"
-#include <coreplugin/ssh/sftpchannel.h>
#include <coreplugin/ssh/sshconnection.h>
#include <coreplugin/ssh/sshremoteprocess.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
@@ -53,8 +52,7 @@ namespace Qt4ProjectManager {
namespace Internal {
MaemoRemoteMounter::MaemoRemoteMounter(QObject *parent)
- : QObject(parent), m_utfsServerTimer(new QTimer(this)),
- m_uploadJobId(SftpInvalidJob), m_state(Inactive)
+ : QObject(parent), m_utfsServerTimer(new QTimer(this)), m_state(Inactive)
{
connect(m_utfsServerTimer, SIGNAL(timeout()), this,
SLOT(handleUtfsServerTimeout()));
@@ -109,7 +107,7 @@ void MaemoRemoteMounter::mount(MaemoPortList *freePorts,
} else {
m_freePorts = freePorts;
m_portsGatherer = portsGatherer;
- deployUtfsClient();
+ startUtfsClients();
}
}
@@ -183,73 +181,6 @@ void MaemoRemoteMounter::stop()
setState(Inactive);
}
-void MaemoRemoteMounter::deployUtfsClient()
-{
- emit reportProgress(tr("Setting up SFTP connection..."));
- m_utfsClientUploader = m_connection->createSftpChannel();
- connect(m_utfsClientUploader.data(), SIGNAL(initialized()), this,
- SLOT(handleUploaderInitialized()));
- connect(m_utfsClientUploader.data(), SIGNAL(initializationFailed(QString)),
- this, SLOT(handleUploaderInitializationFailed(QString)));
- m_utfsClientUploader->initialize();
-
- setState(UploaderInitializing);
-}
-
-void MaemoRemoteMounter::handleUploaderInitializationFailed(const QString &reason)
-{
- ASSERT_STATE(QList<State>() << UploaderInitializing << Inactive);
-
- if (m_state == UploaderInitializing) {
- emit error(tr("Failed to establish SFTP connection: %1").arg(reason));
- setState(Inactive);
- }
-}
-
-void MaemoRemoteMounter::handleUploaderInitialized()
-{
- ASSERT_STATE(QList<State>() << UploaderInitializing << Inactive);
- if (m_state == Inactive)
- return;
-
- emit reportProgress(tr("Uploading UTFS client..."));
- connect(m_utfsClientUploader.data(),
- SIGNAL(finished(Core::SftpJobId, QString)), this,
- SLOT(handleUploadFinished(Core::SftpJobId, QString)));
- const QString localFile
- = m_maddeRoot + QLatin1String("/madlib/armel/utfs-client");
- m_uploadJobId = m_utfsClientUploader->uploadFile(localFile,
- utfsClientOnDevice(), SftpOverwriteExisting);
- if (m_uploadJobId == SftpInvalidJob) {
- setState(Inactive);
- emit error(tr("Could not upload UTFS client (%1).").arg(localFile));
- } else {
- setState(UploadRunning);
- }
-}
-
-void MaemoRemoteMounter::handleUploadFinished(Core::SftpJobId jobId,
- const QString &errorMsg)
-{
- ASSERT_STATE(QList<State>() << UploadRunning << Inactive);
-
- if (m_state == Inactive)
- return;
-
- if (jobId != m_uploadJobId) {
- qWarning("Warning: unknown upload job %d finished.", jobId);
- return;
- }
-
- m_uploadJobId = SftpInvalidJob;
- if (!errorMsg.isEmpty()) {
- emit reportProgress(tr("Could not upload UTFS client (%1), continuing anyway.")
- .arg(errorMsg));
- }
-
- startUtfsClients();
-}
-
void MaemoRemoteMounter::startUtfsClients()
{
const QString chmodFuse
@@ -412,8 +343,7 @@ void MaemoRemoteMounter::handleUmountStderr(const QByteArray &output)
QString MaemoRemoteMounter::utfsClientOnDevice() const
{
- return MaemoGlobal::homeDirOnDevice(m_connection->connectionParameters().uname)
- + QLatin1String("/utfs-client");
+ return QLatin1String("/usr/lib/mad-developer/utfs-client");
}
QString MaemoRemoteMounter::utfsServer() const
@@ -452,10 +382,6 @@ void MaemoRemoteMounter::setState(State newState)
{
if (newState == Inactive) {
m_utfsServerTimer->stop();
- if (m_utfsClientUploader) {
- disconnect(m_utfsClientUploader.data(), 0, this, 0);
- m_utfsClientUploader->closeChannel();
- }
if (m_mountProcess) {
disconnect(m_mountProcess.data(), 0, this, 0);
m_mountProcess->closeChannel();
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h b/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
index a921c20acf..7aa2226b47 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
@@ -37,8 +37,6 @@
#include "maemodeviceconfigurations.h"
#include "maemomountspecification.h"
-#include <coreplugin/ssh/sftpdefs.h>
-
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QProcess>
@@ -86,9 +84,6 @@ signals:
void debugOutput(const QString &output);
private slots:
- void handleUploaderInitialized();
- void handleUploaderInitializationFailed(const QString &reason);
- void handleUploadFinished(Core::SftpJobId jobId, const QString &error);
void handleUtfsClientsStarted();
void handleUtfsClientsFinished(int exitStatus);
void handleUtfsClientStderr(const QByteArray &output);
@@ -103,13 +98,12 @@ private slots:
private:
enum State {
- Inactive, Unmounting, UploaderInitializing, UploadRunning,
- UtfsClientsStarting, UtfsClientsStarted, UtfsServersStarted
+ Inactive, Unmounting, UtfsClientsStarting, UtfsClientsStarted,
+ UtfsServersStarted
};
void setState(State newState);
- void deployUtfsClient();
void startUtfsClients();
void killUtfsServer(QProcess *proc);
void killAllUtfsServers();
@@ -128,10 +122,8 @@ private:
QSharedPointer<Core::SshConnection> m_connection;
QList<MountInfo> m_mountSpecs;
- QSharedPointer<Core::SftpChannel> m_utfsClientUploader;
QSharedPointer<Core::SshRemoteProcess> m_mountProcess;
QSharedPointer<Core::SshRemoteProcess> m_unmountProcess;
- Core::SftpJobId m_uploadJobId;
typedef QSharedPointer<QProcess> ProcPtr;
QList<ProcPtr> m_utfsServers;