forked from qt-creator/qt-creator
QnxDevice: Don't use SshDeviceProcess
Use QtcProcess with a path on qnx device instead. Fix QtcProcess::runBlocking() for remotes. Change-Id: Ic9364037835b247479f4b4329e40a314e09d5492 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
This commit is contained in:
@@ -33,20 +33,14 @@
|
|||||||
#include "qnxdeviceprocess.h"
|
#include "qnxdeviceprocess.h"
|
||||||
#include "qnxdevicewizard.h"
|
#include "qnxdevicewizard.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/sshdeviceprocess.h>
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
|
||||||
|
|
||||||
#include <remotelinux/sshprocessinterface.h>
|
#include <remotelinux/sshprocessinterface.h>
|
||||||
|
|
||||||
#include <ssh/sshconnection.h>
|
|
||||||
#include <utils/port.h>
|
#include <utils/port.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QStringList>
|
|
||||||
#include <QThread>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace RemoteLinux;
|
using namespace RemoteLinux;
|
||||||
@@ -153,18 +147,10 @@ int QnxDevice::qnxVersion() const
|
|||||||
|
|
||||||
void QnxDevice::updateVersionNumber() const
|
void QnxDevice::updateVersionNumber() const
|
||||||
{
|
{
|
||||||
QEventLoop eventLoop;
|
QtcProcess versionNumberProcess;
|
||||||
SshDeviceProcess versionNumberProcess(sharedFromThis());
|
|
||||||
QObject::connect(&versionNumberProcess, &QtcProcess::done, &eventLoop, &QEventLoop::quit);
|
|
||||||
|
|
||||||
versionNumberProcess.setCommand({"uname", {"-r"}});
|
versionNumberProcess.setCommand({mapToGlobalPath("uname"), {"-r"}});
|
||||||
versionNumberProcess.start();
|
versionNumberProcess.runBlocking(EventLoopMode::On);
|
||||||
|
|
||||||
bool isGuiThread = QThread::currentThread() == QCoreApplication::instance()->thread();
|
|
||||||
if (isGuiThread)
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
|
|
||||||
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
|
|
||||||
|
|
||||||
QByteArray output = versionNumberProcess.readAllStandardOutput();
|
QByteArray output = versionNumberProcess.readAllStandardOutput();
|
||||||
QString versionMessage = QString::fromLatin1(output);
|
QString versionMessage = QString::fromLatin1(output);
|
||||||
@@ -176,9 +162,6 @@ void QnxDevice::updateVersionNumber() const
|
|||||||
int patch = match.captured(3).toInt();
|
int patch = match.captured(3).toInt();
|
||||||
m_versionNumber = (major << 16)|(minor<<8)|(patch);
|
m_versionNumber = (major << 16)|(minor<<8)|(patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isGuiThread)
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxDevice::fromMap(const QVariantMap &map)
|
void QnxDevice::fromMap(const QVariantMap &map)
|
||||||
|
Reference in New Issue
Block a user