Commit 4276bd33 authored by Al Williams's avatar Al Williams Committed by Tomaz Canabrava
Browse files

Fix error when trying to edit the editable parts of an imported ssh host with a user name/key.

BUG:455290
parent dd52d722
Pipeline #192487 passed with stage
in 2 minutes and 11 seconds
......@@ -148,7 +148,7 @@ void SSHManagerTreeWidget::addSshInfo()
void SSHManagerTreeWidget::saveEdit()
{
SSHConfigurationData data;
// SSHConfigurationData data; (not used?)
auto [error, errorString] = checkFields();
if (error) {
ui->errorPanel->setText(errorString);
......@@ -178,6 +178,8 @@ SSHConfigurationData SSHManagerTreeWidget::info() const
data.profileName = ui->profile->currentText().trimmed();
data.username = ui->username->text().trimmed();
data.useSshConfig = ui->useSshConfig->checkState() == Qt::Checked;
// if ui->username is enabled then we were not imported!
data.importedFromSshConfig=!ui->username->isEnabled();
return data;
}
......@@ -352,7 +354,8 @@ std::pair<bool, QString> SSHManagerTreeWidget::checkFields() const
}
if (ui->useSshConfig->checkState() == Qt::Checked) {
if (ui->sshkey->text().count() || ui->username->text().count()) {
// If ui->username is not enabled then this was an autopopulated entry and we should not complain
if (ui->username->isEnabled() && (ui->sshkey->text().count() || ui->username->text().count())) {
error = true;
errorString += li + i18n("If Use Ssh Config is set, do not specify sshkey or username.") + il;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment