diff options
author | hjk <[email protected]> | 2012-01-24 15:36:40 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2012-01-24 18:48:47 +0100 |
commit | 4a21f0c3c8b30cd0bc5957110506e304c629a99b (patch) | |
tree | 3d2477e3f1485ccaa319557bb2229e3f34324867 /src/plugins/vcsbase/vcsbaseplugin.cpp | |
parent | c14a4756a92586424f0f1a00c6134e441db50afd (diff) |
Use new static ICore interface.
Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <[email protected]>
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseplugin.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseplugin.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index f7ed1f6a4e6..b4670ffba71 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -209,12 +209,11 @@ public slots: StateListener::StateListener(QObject *parent) : QObject(parent) { - Core::ICore *core = Core::ICore::instance(); - connect(core->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(slotStateChanged())); - connect(core->editorManager(), SIGNAL(currentEditorStateChanged(Core::IEditor*)), + connect(Core::ICore::editorManager(), SIGNAL(currentEditorStateChanged(Core::IEditor*)), this, SLOT(slotStateChanged())); - connect(core->vcsManager(), SIGNAL(repositoryChanged(QString)), + connect(Core::ICore::vcsManager(), SIGNAL(repositoryChanged(QString)), this, SLOT(slotStateChanged())); if (ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance()) @@ -233,14 +232,13 @@ static inline QString displayNameOfEditor(const QString &fileName) void StateListener::slotStateChanged() { const ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance(); - const Core::ICore *core = Core::ICore::instance(); - Core::VcsManager *vcsManager = core->vcsManager(); + Core::VcsManager *vcsManager = Core::ICore::vcsManager(); // Get the current file. Are we on a temporary submit editor indicated by // temporary path prefix or does the file contains a hash, indicating a project // folder? State state; - Core::EditorManager *em = core->editorManager(); + Core::EditorManager *em = Core::ICore::editorManager(); if (!em || !em->currentEditor() || !em->currentEditor()->file()) state.currentFile.clear(); else @@ -625,7 +623,7 @@ void VcsBasePlugin::promptToDeleteCurrentFile() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) - const bool rc = Core::ICore::instance()->vcsManager()->promptToDelete(versionControl(), state.currentFile()); + const bool rc = Core::ICore::vcsManager()->promptToDelete(versionControl(), state.currentFile()); if (!rc) QMessageBox::warning(0, tr("Version Control"), tr("The file '%1' could not be deleted."). @@ -648,12 +646,12 @@ void VcsBasePlugin::createRepository() if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::instance()->currentProject()) directory = QFileInfo(currentProject->file()->fileName()).absolutePath(); // Prompt for a directory that is not under version control yet - QMainWindow *mw = Core::ICore::instance()->mainWindow(); + QMainWindow *mw = Core::ICore::mainWindow(); do { directory = QFileDialog::getExistingDirectory(mw, tr("Choose Repository Directory"), directory); if (directory.isEmpty()) return; - const Core::IVersionControl *managingControl = Core::ICore::instance()->vcsManager()->findVersionControlForDirectory(directory); + const Core::IVersionControl *managingControl = Core::ICore::vcsManager()->findVersionControlForDirectory(directory); if (managingControl == 0) break; const QString question = tr("The directory '%1' is already managed by a version control system (%2)." |