forked from qt-creator/qt-creator
VCS: Make initialization of a repo trigger updateActions
Make initialization/cloning of a repo trigger an updateActions. This is needed to e.g. enable git actions after a git repo is created. Reviewed-by: Hugues Delorme Change-Id: Ia8513a216e584fe8e512fdd5d6215aa96c075f3f Reviewed-on: http://codereview.qt-project.org/4878 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
@@ -166,6 +167,9 @@ bool VCSBaseClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
QString output = QString::fromLocal8Bit(outputData);
|
||||
output.remove(QLatin1Char('\r'));
|
||||
VCSBase::VCSBaseOutputWindow::instance()->append(output);
|
||||
|
||||
resetCachedVcsInfo(workingDirectory);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -178,7 +182,9 @@ bool VCSBaseClient::synchronousClone(const QString &workingDir,
|
||||
args << vcsCommandString(CloneCommand)
|
||||
<< extraOptions << srcLocation << dstLocation;
|
||||
QByteArray stdOut;
|
||||
return vcsFullySynchronousExec(workingDir, args, &stdOut);
|
||||
const bool cloneOk = vcsFullySynchronousExec(workingDir, args, &stdOut);
|
||||
resetCachedVcsInfo(workingDir);
|
||||
return cloneOk;
|
||||
}
|
||||
|
||||
bool VCSBaseClient::synchronousAdd(const QString &workingDir, const QString &filename,
|
||||
@@ -567,6 +573,12 @@ VCSBase::VCSBaseEditorWidget *VCSBaseClient::createVCSEditor(const QString &kind
|
||||
return baseEditor;
|
||||
}
|
||||
|
||||
void VCSBaseClient::resetCachedVcsInfo(const QString &workingDir)
|
||||
{
|
||||
Core::VcsManager *vcsManager = d->m_core->vcsManager();
|
||||
vcsManager->resetVersionControlForDirectory(workingDir);
|
||||
}
|
||||
|
||||
void VCSBaseClient::enqueueJob(const QSharedPointer<VCSJob> &job)
|
||||
{
|
||||
if (!d->m_jobManager) {
|
||||
|
||||
Reference in New Issue
Block a user