SSH: Use Utils::PathChooser::browseButtonLabel() for button

We have not used this yet to avoid depending on Utils. Now that the
depedency is there anyway, we can use this simplification.

Change-Id: Ic3ff8174aaebc4da289daf1ab4331a10536cdf98
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Robert Loehning
2020-10-26 18:59:45 +01:00
parent 2b32b2e440
commit eef708192e

View File

@@ -29,6 +29,7 @@
#include "sshsettings.h" #include "sshsettings.h"
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/pathchooser.h>
#include <QApplication> #include <QApplication>
#include <QDir> #include <QDir>
@@ -45,12 +46,7 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent)
: QDialog(parent), m_ui(new Ui::SshKeyCreationDialog) : QDialog(parent), m_ui(new Ui::SshKeyCreationDialog)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
// Not using Utils::PathChooser::browseButtonLabel to avoid dependency m_ui->privateKeyFileButton->setText(Utils::PathChooser::browseButtonLabel());
#ifdef Q_OS_MAC
m_ui->privateKeyFileButton->setText(tr("Choose..."));
#else
m_ui->privateKeyFileButton->setText(tr("Browse..."));
#endif
const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
+ QLatin1String("/.ssh/qtc_id"); + QLatin1String("/.ssh/qtc_id");
setPrivateKeyFile(defaultPath); setPrivateKeyFile(defaultPath);