Maemo: Make SSH connection error messages a bit more helpful.

Task-number: QTCREATORBUG-3225
This commit is contained in:
Christian Kandeler
2010-11-30 10:55:44 +01:00
parent 80f640fbb3
commit 8a89a8bd8e
4 changed files with 38 additions and 8 deletions

View File

@@ -29,6 +29,9 @@
#include "maemoglobal.h"
#include "maemodeviceconfigurations.h"
#include <coreplugin/ssh/sshconnection.h>
#include <utils/environment.h>
#include <QtCore/QCoreApplication>
@@ -79,6 +82,23 @@ QString MaemoGlobal::remoteEnvironment(const QList<Utils::EnvironmentItem> &list
return env.mid(0, env.size() - 1);
}
QString MaemoGlobal::failedToConnectToServerMessage(const Core::SshConnection::Ptr &connection,
const MaemoDeviceConfig &deviceConfig)
{
QString errorMsg = TR("Could not connect to host: %1")
.arg(connection->errorString());
if (deviceConfig.type == MaemoDeviceConfig::Simulator) {
if (connection->errorState() == Core::SshTimeoutError
|| connection->errorState() == Core::SshSocketError) {
errorMsg += TR("\nDid you start Qemu?");
}
} else if (connection->errorState() == Core::SshTimeoutError) {
errorMsg += TR("\nIs the device connected and set up for network access?");
}
return errorMsg;
}
bool MaemoGlobal::removeRecursively(const QString &filePath, QString &error)
{
QFileInfo fileInfo(filePath);