Commit 7c7ccdc7 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Gerrit: Do not run plink executable in accessor of OptionsWidget.



Do not run the process every time the user presses 'Ok' or 'Apply'
in the settings page, do it only if the gerrit parameters actually
changed. Also check for empty binary.

Change-Id: I934616e5d9b20404278f1fd9fc751ff161030cd8
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 557c73ad
......@@ -73,6 +73,7 @@ void GerritOptionsPage::apply()
const GerritParameters newParameters = w->parameters();
if (newParameters != *m_parameters) {
*m_parameters = newParameters;
m_parameters->setPortFlagBySshType();
m_parameters->toSettings(Core::ICore::instance()->settings());
}
}
......@@ -124,7 +125,6 @@ GerritParameters GerritOptionsWidget::parameters() const
result.port = m_portSpinBox->value();
result.additionalQueries = m_additionalQueriesLineEdit->text().trimmed();
result.https = m_httpsCheckBox->isChecked();
result.setPortFlagBySshType();
return result;
}
......
......@@ -89,9 +89,12 @@ static inline QString detectSsh()
void GerritParameters::setPortFlagBySshType()
{
const QString version = Utils::PathChooser::toolVersion(ssh, QStringList(QLatin1String("-V")));
portFlag = (version.contains(QLatin1String("plink"), Qt::CaseInsensitive)) ?
QLatin1String("-P") : QLatin1String(defaultPortFlag);
bool isPlink = false;
if (!ssh.isEmpty()) {
const QString version = Utils::PathChooser::toolVersion(ssh, QStringList(QLatin1String("-V")));
isPlink = version.contains(QLatin1String("plink"), Qt::CaseInsensitive);
}
portFlag = isPlink ? QLatin1String("-P") : QLatin1String(defaultPortFlag);
}
GerritParameters::GerritParameters()
......
Markdown is supported
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