forked from qt-creator/qt-creator
Code model: Update on changes from the versioning system.
Add state logic to CppCodeModelManagerInterface, making it aware whether an indexer is running, protect the update methods from another invocation while running. Add changed signals to IVersionControl and VCSManager and wire them to the update methods. Add a menu action for manually updating. Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: con <qtc-committer@nokia.com>
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <QtCore/QtConcurrentRun>
|
||||
@@ -97,6 +98,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
|
||||
// Objects
|
||||
m_modelManager = new CppModelManager(this);
|
||||
Core::VCSManager *vcsManager = core->vcsManager();
|
||||
connect(vcsManager, SIGNAL(repositoryChanged(QString)),
|
||||
m_modelManager, SLOT(updateModifiedSourceFiles()));
|
||||
connect(vcsManager, SIGNAL(filesChanged(QStringList)),
|
||||
m_modelManager, SLOT(updateModifiedSourceFiles()));
|
||||
addAutoReleasedObject(m_modelManager);
|
||||
|
||||
m_completion = new CppCodeCompletion(m_modelManager);
|
||||
|
||||
Reference in New Issue
Block a user