forked from qt-creator/qt-creator
Use QtcProcess for ssh key gen
Change-Id: I5a1ddf7f6773467c57571fe385fc1969e347c582 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -30,10 +30,10 @@
|
|||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProcess>
|
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -90,12 +90,12 @@ void SshKeyCreationDialog::generateKeys()
|
|||||||
}
|
}
|
||||||
const QString keyTypeString = QLatin1String(m_ui->rsa->isChecked() ? "rsa": "ecdsa");
|
const QString keyTypeString = QLatin1String(m_ui->rsa->isChecked() ? "rsa": "ecdsa");
|
||||||
QApplication::setOverrideCursor(Qt::BusyCursor);
|
QApplication::setOverrideCursor(Qt::BusyCursor);
|
||||||
QProcess keygen;
|
QtcProcess keygen;
|
||||||
const QStringList args{"-t", keyTypeString, "-b", m_ui->comboBox->currentText(),
|
const QStringList args{"-t", keyTypeString, "-b", m_ui->comboBox->currentText(),
|
||||||
"-N", QString(), "-f", privateKeyFilePath().path()};
|
"-N", QString(), "-f", privateKeyFilePath().path()};
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
keygen.start(SshSettings::keygenFilePath().toString(), args);
|
keygen.setCommand({SshSettings::keygenFilePath(), args});
|
||||||
keygen.closeWriteChannel();
|
keygen.start();
|
||||||
if (!keygen.waitForStarted() || !keygen.waitForFinished())
|
if (!keygen.waitForStarted() || !keygen.waitForFinished())
|
||||||
errorMsg = keygen.errorString();
|
errorMsg = keygen.errorString();
|
||||||
else if (keygen.exitCode() != 0)
|
else if (keygen.exitCode() != 0)
|
||||||
|
Reference in New Issue
Block a user