diff options
author | hjk <[email protected]> | 2012-01-24 18:57:39 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2012-01-24 19:20:13 +0100 |
commit | b0b105d5758e85d08057edc2e914a7f2060bfe3f (patch) | |
tree | 1206d80383fd6e4b53673f901dec224c38a824f5 /src/plugins/vcsbase/vcsbaseplugin.cpp | |
parent | ecd9f3c4395b099c3d38c4762427fbd822888e9c (diff) |
ProjectExplorer: make currentProject static
This saves one function call compared to the instance()->currentProject()
pattern and is typically less to type on the caller site.
Change-Id: I65568f30205fc90e2aaca7e8e7f0192241df8c85
Reviewed-by: Daniel Teske <[email protected]>
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseplugin.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseplugin.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index b4670ffba71..7e422dc87e2 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -231,7 +231,6 @@ static inline QString displayNameOfEditor(const QString &fileName) void StateListener::slotStateChanged() { - const ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance(); Core::VcsManager *vcsManager = Core::ICore::vcsManager(); // Get the current file. Are we on a temporary submit editor indicated by @@ -280,7 +279,7 @@ void StateListener::slotStateChanged() } // Check for project, find the control Core::IVersionControl *projectControl = 0; - if (const ProjectExplorer::Project *currentProject = pe->currentProject()) { + if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::currentProject()) { state.currentProjectPath = currentProject->projectDirectory(); state.currentProjectName = currentProject->displayName(); projectControl = vcsManager->findVersionControlForDirectory(state.currentProjectPath, @@ -643,7 +642,7 @@ void VcsBasePlugin::createRepository() QTC_ASSERT(d->m_versionControl->supportsOperation(Core::IVersionControl::CreateRepositoryOperation), return); // Find current starting directory QString directory; - if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::instance()->currentProject()) + if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::currentProject()) directory = QFileInfo(currentProject->file()->fileName()).absolutePath(); // Prompt for a directory that is not under version control yet QMainWindow *mw = Core::ICore::mainWindow(); |