PerfProfiler: Use QtcProcess instead of IDevice::createProcess()

And pass a device path to command instead. The QtcProcess
should automatically select the device's process implementation
when the process is running.

Change-Id: Id3fed8656999af58ce1a5ba0632f94c3dc76ab04
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-04-29 17:08:17 +02:00
parent ddb4ecae32
commit 645d71b3db
3 changed files with 7 additions and 12 deletions

View File

@@ -89,15 +89,15 @@ void PerfTracePointDialog::runScript()
m_ui->privilegesChooser->setEnabled(false);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
m_process.reset(m_device->createProcess(this));
m_process.reset(new QtcProcess(this));
m_process->setWriteData(m_ui->textEdit->toPlainText().toUtf8());
m_ui->textEdit->clear();
const QString elevate = m_ui->privilegesChooser->currentText();
if (elevate != QLatin1String("n.a."))
m_process->setCommand({FilePath::fromString(elevate), {"sh"}});
m_process->setCommand({m_device->mapToGlobalPath(FilePath::fromString(elevate)), {"sh"}});
else
m_process->setCommand({"sh", {}});
m_process->setCommand({m_device->mapToGlobalPath("sh"), {}});
connect(m_process.get(), &QtcProcess::done, this, &PerfTracePointDialog::handleProcessDone);
m_process->start();