diff options
-rw-r--r-- | src/libs/ssh/sshconnection.cpp | 4 | ||||
-rw-r--r-- | src/libs/ssh/sshconnection.h | 2 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocess.cpp | 6 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocess.h | 6 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocessrunner.cpp | 11 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocessrunner.h | 8 | ||||
-rw-r--r-- | src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/devicesupport/sshdeviceprocesslist.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp | 10 | ||||
-rw-r--r-- | src/plugins/qnx/qnxdevicetester.cpp | 5 | ||||
-rw-r--r-- | src/plugins/remotelinux/genericdirectuploadservice.cpp | 5 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxpackageinstaller.cpp | 4 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxsignaloperation.cpp | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/rsyncdeploystep.cpp | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/sshkeydeployer.cpp | 5 |
17 files changed, 33 insertions, 45 deletions
diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index 703d20932ca..fbacad8842b 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -309,7 +309,7 @@ SshConnection::~SshConnection() delete d; } -SshRemoteProcessPtr SshConnection::createRemoteProcess(const QByteArray &command) +SshRemoteProcessPtr SshConnection::createRemoteProcess(const QString &command) { QTC_ASSERT(state() == Connected, return SshRemoteProcessPtr()); return SshRemoteProcessPtr(new SshRemoteProcess(command, d->connectionArgs())); @@ -317,7 +317,7 @@ SshRemoteProcessPtr SshConnection::createRemoteProcess(const QByteArray &command SshRemoteProcessPtr SshConnection::createRemoteShell() { - return createRemoteProcess(QByteArray()); + return createRemoteProcess({}); } SftpTransferPtr SshConnection::createUpload(const FilesToTransfer &files, diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h index 1b5775682e9..89af4d71d9d 100644 --- a/src/libs/ssh/sshconnection.h +++ b/src/libs/ssh/sshconnection.h @@ -111,7 +111,7 @@ public: bool sharingEnabled() const; ~SshConnection(); - SshRemoteProcessPtr createRemoteProcess(const QByteArray &command); + SshRemoteProcessPtr createRemoteProcess(const QString &command); SshRemoteProcessPtr createRemoteShell(); SftpTransferPtr createUpload(const FilesToTransfer &files, FileTransferErrorHandling errorHandlingMode); diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp index a769484735c..635f23e1503 100644 --- a/src/libs/ssh/sshremoteprocess.cpp +++ b/src/libs/ssh/sshremoteprocess.cpp @@ -54,13 +54,13 @@ using namespace Internal; struct SshRemoteProcess::SshRemoteProcessPrivate { - QByteArray remoteCommand; + QString remoteCommand; QStringList connectionArgs; QString displayName; bool useTerminal = false; }; -SshRemoteProcess::SshRemoteProcess(const QByteArray &command, const QStringList &connectionArgs) +SshRemoteProcess::SshRemoteProcess(const QString &command, const QStringList &connectionArgs) : d(new SshRemoteProcessPrivate) { d->remoteCommand = command; @@ -127,7 +127,7 @@ QStringList SshRemoteProcess::fullLocalCommandLine() const if (!d->displayName.isEmpty()) args.prepend("-X"); if (!d->remoteCommand.isEmpty()) - args << QLatin1String(d->remoteCommand); + args << d->remoteCommand; args.prepend(SshSettings::sshFilePath().toString()); return args; } diff --git a/src/libs/ssh/sshremoteprocess.h b/src/libs/ssh/sshremoteprocess.h index 82dd1b9dcbe..02ab3546fdc 100644 --- a/src/libs/ssh/sshremoteprocess.h +++ b/src/libs/ssh/sshremoteprocess.h @@ -30,10 +30,6 @@ #include <QStringList> -QT_BEGIN_NAMESPACE -class QByteArray; -QT_END_NAMESPACE - namespace QSsh { class SshConnection; @@ -56,7 +52,7 @@ signals: void done(const QString &error); private: - SshRemoteProcess(const QByteArray &command, const QStringList &connectionArgs); + SshRemoteProcess(const QString &command, const QStringList &connectionArgs); void doStart(); struct SshRemoteProcessPrivate; diff --git a/src/libs/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp index 11b75f6a254..7a062e6ab86 100644 --- a/src/libs/ssh/sshremoteprocessrunner.cpp +++ b/src/libs/ssh/sshremoteprocessrunner.cpp @@ -50,7 +50,7 @@ public: SshRemoteProcessPtr m_process; SshConnection *m_connection; bool m_runInTerminal; - QByteArray m_command; + QString m_command; QString m_lastConnectionErrorString; QProcess::ExitStatus m_exitStatus; QByteArray m_stdout; @@ -76,8 +76,7 @@ SshRemoteProcessRunner::~SshRemoteProcessRunner() delete d; } -void SshRemoteProcessRunner::run(const QByteArray &command, - const SshConnectionParameters &sshParams) +void SshRemoteProcessRunner::run(const QString &command, const SshConnectionParameters &sshParams) { QTC_ASSERT(d->m_state == Inactive, return); @@ -85,14 +84,14 @@ void SshRemoteProcessRunner::run(const QByteArray &command, runInternal(command, sshParams); } -void SshRemoteProcessRunner::runInTerminal(const QByteArray &command, +void SshRemoteProcessRunner::runInTerminal(const QString &command, const SshConnectionParameters &sshParams) { d->m_runInTerminal = true; runInternal(command, sshParams); } -void SshRemoteProcessRunner::runInternal(const QByteArray &command, +void SshRemoteProcessRunner::runInternal(const QString &command, const SshConnectionParameters &sshParams) { setState(Connecting); @@ -197,7 +196,7 @@ void SshRemoteProcessRunner::setState(int newState) } } -QByteArray SshRemoteProcessRunner::command() const { return d->m_command; } +QString SshRemoteProcessRunner::command() const { return d->m_command; } QString SshRemoteProcessRunner::lastConnectionErrorString() const { return d->m_lastConnectionErrorString; } diff --git a/src/libs/ssh/sshremoteprocessrunner.h b/src/libs/ssh/sshremoteprocessrunner.h index 029fb6bb3df..082f30ed57f 100644 --- a/src/libs/ssh/sshremoteprocessrunner.h +++ b/src/libs/ssh/sshremoteprocessrunner.h @@ -39,9 +39,9 @@ public: SshRemoteProcessRunner(QObject *parent = 0); ~SshRemoteProcessRunner(); - void run(const QByteArray &command, const SshConnectionParameters &sshParams); - void runInTerminal(const QByteArray &command, const SshConnectionParameters &sshParams); - QByteArray command() const; + void run(const QString &command, const SshConnectionParameters &sshParams); + void runInTerminal(const QString &command, const SshConnectionParameters &sshParams); + QString command() const; QString lastConnectionErrorString() const; @@ -69,7 +69,7 @@ private: void handleProcessFinished(const QString &error); void handleStdout(); void handleStderr(); - void runInternal(const QByteArray &command, const QSsh::SshConnectionParameters &sshParams); + void runInternal(const QString &command, const QSsh::SshConnectionParameters &sshParams); void setState(int newState); Internal::SshRemoteProcessRunnerPrivate * const d; diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index 14414f05893..030e4057a3d 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -188,7 +188,7 @@ void SshDeviceProcess::handleConnected() d->process = runInTerminal() && d->runnable.executable.isEmpty() ? d->connection->createRemoteShell() - : d->connection->createRemoteProcess(fullCommandLine(d->runnable).toUtf8()); + : d->connection->createRemoteProcess(fullCommandLine(d->runnable)); const QString display = d->displayName(); if (!display.isEmpty()) d->process->requestX11Forwarding(display); diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocesslist.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocesslist.cpp index c1c7b0a45f7..d8107458fd5 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocesslist.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocesslist.cpp @@ -54,7 +54,7 @@ void SshDeviceProcessList::doUpdate() this, &SshDeviceProcessList::handleConnectionError); connect(&d->process, &SshRemoteProcessRunner::processClosed, this, &SshDeviceProcessList::handleListProcessFinished); - d->process.run(listProcessesCommandLine().toUtf8(), device()->sshParameters()); + d->process.run(listProcessesCommandLine(), device()->sshParameters()); } void SshDeviceProcessList::doKillProcess(const DeviceProcessItem &process) diff --git a/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp b/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp index 0e4a0b6ff56..4263a1e4985 100644 --- a/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp +++ b/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp @@ -292,12 +292,9 @@ void QnxDeployQtLibrariesDialog::checkRemoteDirectoryExistance() QTC_CHECK(m_state == Inactive); m_state = CheckingRemoteDirectory; - m_ui->deployLogWindow->appendPlainText(tr("Checking existence of \"%1\"") .arg(fullRemoteDirectory())); - - const QByteArray cmd = "test -d " + fullRemoteDirectory().toLatin1(); - m_processRunner->run(cmd, m_device->sshParameters()); + m_processRunner->run("test -d " + fullRemoteDirectory(), m_device->sshParameters()); } void QnxDeployQtLibrariesDialog::removeRemoteDirectory() @@ -305,11 +302,8 @@ void QnxDeployQtLibrariesDialog::removeRemoteDirectory() QTC_CHECK(m_state == CheckingRemoteDirectory); m_state = RemovingRemoteDirectory; - m_ui->deployLogWindow->appendPlainText(tr("Removing \"%1\"").arg(fullRemoteDirectory())); - - const QByteArray cmd = "rm -rf " + fullRemoteDirectory().toLatin1(); - m_processRunner->run(cmd, m_device->sshParameters()); + m_processRunner->run("rm -rf " + fullRemoteDirectory(), m_device->sshParameters()); } } // namespace Internal diff --git a/src/plugins/qnx/qnxdevicetester.cpp b/src/plugins/qnx/qnxdevicetester.cpp index b1374519d8a..5196043ad2b 100644 --- a/src/plugins/qnx/qnxdevicetester.cpp +++ b/src/plugins/qnx/qnxdevicetester.cpp @@ -113,8 +113,7 @@ void QnxDeviceTester::handleGenericTestFinished(TestResult result) m_state = VarRunTest; emit progressMessage(tr("Checking that files can be created in /var/run...")); m_processRunner->run(QStringLiteral("rm %1 > /dev/null 2>&1; echo ABC > %1 && rm %1") - .arg("/var/run/qtc_xxxx.pid") - .toLatin1(), + .arg("/var/run/qtc_xxxx.pid"), m_deviceConfiguration->sshParameters()); } @@ -189,7 +188,7 @@ void QnxDeviceTester::testNextCommand() QString command = m_commandsToTest[m_currentCommandIndex]; emit progressMessage(tr("Checking for %1...").arg(command)); - m_processRunner->run("command -v " + command.toLatin1(), m_deviceConfiguration->sshParameters()); + m_processRunner->run("command -v " + command, m_deviceConfiguration->sshParameters()); } void QnxDeviceTester::setFinished() diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp index 014ed5db620..84779d373eb 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.cpp +++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp @@ -238,8 +238,7 @@ void GenericDirectUploadService::queryFiles() continue; } // We'd like to use --format=%Y, but it's not supported by busybox. - const QByteArray statCmd = "stat -t " - + Utils::QtcProcess::quoteArgUnix(file.remoteFilePath()).toUtf8(); + const QString statCmd = "stat -t " + Utils::QtcProcess::quoteArgUnix(file.remoteFilePath()); SshRemoteProcess * const statProc = connection()->createRemoteProcess(statCmd).release(); statProc->setParent(this); connect(statProc, &SshRemoteProcess::done, this, @@ -328,7 +327,7 @@ void GenericDirectUploadService::chmod() const QString command = QLatin1String("chmod a+x ") + Utils::QtcProcess::quoteArgUnix(f.remoteFilePath()); SshRemoteProcess * const chmodProc - = connection()->createRemoteProcess(command.toUtf8()).release(); + = connection()->createRemoteProcess(command).release(); chmodProc->setParent(this); connect(chmodProc, &SshRemoteProcess::done, this, [this, chmodProc, state = d->state](const QString &error) { diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp index 8b1fb6dfe8a..e1d2447c510 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp @@ -122,7 +122,7 @@ void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy() this, &RemoteLinuxCheckForFreeDiskSpaceService::handleStdErr); const QString command = QString::fromLatin1("df -k %1 |tail -n 1 |sed 's/ */ /g' " "|cut -d ' ' -f 4").arg(d->pathToCheck); - d->processRunner->run(command.toUtf8(), deviceConfiguration()->sshParameters()); + d->processRunner->run(command, deviceConfiguration()->sshParameters()); } void RemoteLinuxCheckForFreeDiskSpaceService::stopDeployment() diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp index c385f2a4ba2..471ace1a0e6 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp @@ -91,7 +91,7 @@ void RemoteLinuxCustomCommandDeployService::doDeploy() emit progressMessage(tr("Starting remote command \"%1\"...").arg(d->commandLine)); d->state = Running; - d->runner->run(d->commandLine.toUtf8(), deviceConfiguration()->sshParameters()); + d->runner->run(d->commandLine, deviceConfiguration()->sshParameters()); } void RemoteLinuxCustomCommandDeployService::stopDeployment() diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp index 4d3439931bb..bf27f6d03ea 100644 --- a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp +++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp @@ -76,7 +76,7 @@ void AbstractRemoteLinuxPackageInstaller::installPackage(const IDevice::ConstPtr QString cmdLine = installCommandLine(packageFilePath); if (removePackageFile) cmdLine += QLatin1String(" && (rm ") + packageFilePath + QLatin1String(" || :)"); - d->installer->run(cmdLine.toUtf8(), deviceConfig->sshParameters()); + d->installer->run(cmdLine, deviceConfig->sshParameters()); d->isRunning = true; } @@ -86,7 +86,7 @@ void AbstractRemoteLinuxPackageInstaller::cancelInstallation() if (!d->killProcess) d->killProcess = new SshRemoteProcessRunner(this); - d->killProcess->run(cancelInstallationCommandLine().toUtf8(), d->deviceConfig->sshParameters()); + d->killProcess->run(cancelInstallationCommandLine(), d->deviceConfig->sshParameters()); setFinished(); } diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp index 64e1f5b2d3b..5a5def6bb31 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp @@ -60,7 +60,7 @@ void RemoteLinuxSignalOperation::run(const QString &command) this, &RemoteLinuxSignalOperation::runnerProcessFinished); connect(m_runner, &QSsh::SshRemoteProcessRunner::connectionError, this, &RemoteLinuxSignalOperation::runnerConnectionError); - m_runner->run(command.toLatin1(), m_sshParameters); + m_runner->run(command, m_sshParameters); } void RemoteLinuxSignalOperation::finish() diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 8c0900d750b..644ad1c3d6b 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -101,7 +101,7 @@ void RsyncDeployService::createRemoteDirectories() remoteDirs.sort(); remoteDirs.removeDuplicates(); m_mkdir = connection()->createRemoteProcess("mkdir -p " + QtcProcess::Arguments - ::createUnixArgs(remoteDirs).toString().toUtf8()); + ::createUnixArgs(remoteDirs).toString()); connect(m_mkdir.get(), &SshRemoteProcess::done, this, [this](const QString &error) { QString userError; if (!error.isEmpty()) diff --git a/src/plugins/remotelinux/sshkeydeployer.cpp b/src/plugins/remotelinux/sshkeydeployer.cpp index 7581a720185..2c73ffeff1b 100644 --- a/src/plugins/remotelinux/sshkeydeployer.cpp +++ b/src/plugins/remotelinux/sshkeydeployer.cpp @@ -67,9 +67,10 @@ void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams, this, &SshKeyDeployer::handleConnectionFailure); connect(&d->deployProcess, &SshRemoteProcessRunner::processClosed, this, &SshKeyDeployer::handleKeyUploadFinished); - const QByteArray command = "test -d .ssh " + const QString command = "test -d .ssh " "|| mkdir .ssh && chmod 0700 .ssh && echo '" - + reader.data() + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys"; + + QString::fromLocal8Bit(reader.data()) + + "' >> .ssh/authorized_keys && chmod 0600 .ssh/authorized_keys"; d->deployProcess.run(command, sshParams); } |