Gerrit: Update remotes on settings change

If the user is changed, we need to refresh at least the fallback server.

Task-number: QTCREATORBUG-20536
Change-Id: If21830ae5607907db9aaee164bc85b971ff93010
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2018-05-31 22:16:46 +03:00
committed by Orgad Shaneh
parent 4a868d6a18
commit 909f30f006
5 changed files with 30 additions and 1 deletions

View File

@@ -216,6 +216,23 @@ void GerritDialog::refresh()
m_ui->treeView->sortByColumn(-1);
}
void GerritDialog::scheduleUpdateRemotes()
{
if (isVisible())
updateRemotes();
else
m_shouldUpdateRemotes = true;
}
void GerritDialog::showEvent(QShowEvent *event)
{
QDialog::showEvent(event);
if (m_shouldUpdateRemotes) {
m_shouldUpdateRemotes = false;
updateRemotes();
}
}
void GerritDialog::remoteChanged()
{
const GerritServer server = m_ui->remoteComboBox->currentServer();