Commit 60fa56db authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Initialize remote model directory even when no remotes found



Task-number: QTCREATORBUG-9789
Change-Id: If3626e244b9d85ad670d586438710e17bba8e927
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 044a78f7
......@@ -118,16 +118,15 @@ RemoteDialog::~RemoteDialog()
void RemoteDialog::refresh(const QString &repository, bool force)
{
if (m_repository == repository && !force)
if (m_remoteModel->workingDirectory() == repository && !force)
return;
// Refresh
m_repository = repository;
m_ui->repositoryLabel->setText(StashDialog::msgRepositoryLabel(m_repository));
if (m_repository.isEmpty()) {
m_ui->repositoryLabel->setText(StashDialog::msgRepositoryLabel(repository));
if (repository.isEmpty()) {
m_remoteModel->clear();
} else {
QString errorMessage;
if (!m_remoteModel->refresh(m_repository, &errorMessage))
if (!m_remoteModel->refresh(repository, &errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
}
}
......
......@@ -92,8 +92,6 @@ private:
RemoteModel *m_remoteModel;
RemoteAdditionDialog *m_addDialog;
QString m_repository;
};
} // namespace Internal
......
......@@ -177,6 +177,8 @@ void RemoteModel::clear()
bool RemoteModel::refresh(const QString &workingDirectory, QString *errorMessage)
{
m_workingDirectory = workingDirectory;
// get list of remotes.
QMap<QString,QString> remotesList =
m_client->synchronousRemotesList(workingDirectory, errorMessage);
......@@ -184,7 +186,6 @@ bool RemoteModel::refresh(const QString &workingDirectory, QString *errorMessage
if (remotesList.isEmpty())
return false;
m_workingDirectory = workingDirectory;
beginResetModel();
m_remotes.clear();
foreach (const QString &remoteName, remotesList.keys()) {
......
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