diff options
29 files changed, 76 insertions, 108 deletions
diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 137764f9f4..6253dad0b4 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -637,7 +637,7 @@ void BazaarPlugin::commitFromEditor() { // Close the submit editor m_submitActionTriggered = true; - Core::ICore::editorManager()->closeEditor(); + Core::EditorManager::closeEditor(); } bool BazaarPlugin::submitEditorAboutToClose() diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 3d6fff3028..256121c92d 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -128,10 +128,9 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) this, SLOT(bookmarkMarginActionTriggered())); // EditorManager - QObject *editorManager = Core::ICore::editorManager(); - connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(editorAboutToClose(Core::IEditor*)), this, SLOT(editorAboutToClose(Core::IEditor*))); - connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(editorOpened(Core::IEditor*))); return true; diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 92dd15208c..5d0931a8bf 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -155,10 +155,9 @@ EditorView *EditorView::findNextView() void EditorView::closeView() { - EditorManager *em = ICore::editorManager(); IEditor *editor = currentEditor(); if (editor) - em->closeEditor(editor); + EditorManager::closeEditor(editor); } void EditorView::showEditorStatusBar(const QString &id, @@ -226,7 +225,7 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &histo void EditorView::paintEvent(QPaintEvent *) { - EditorView *editorView = ICore::editorManager()->currentEditorView(); + EditorView *editorView = EditorManager::currentEditorView(); if (editorView != this) return; @@ -251,7 +250,7 @@ void EditorView::mousePressEvent(QMouseEvent *e) void EditorView::focusInEvent(QFocusEvent *) { - ICore::editorManager()->setCurrentView(this); + EditorManager::setCurrentView(this); } void EditorView::addEditor(IEditor *editor) @@ -459,18 +458,17 @@ void EditorView::updateCurrentPositionInNavigationHistory() void EditorView::goBackInNavigationHistory() { - EditorManager *em = ICore::editorManager(); updateCurrentPositionInNavigationHistory(); while (m_currentNavigationHistoryPosition > 0) { --m_currentNavigationHistoryPosition; EditLocation location = m_navigationHistory.at(m_currentNavigationHistoryPosition); IEditor *editor = 0; if (location.document) { - editor = em->activateEditorForDocument(this, location.document, + editor = EditorManager::activateEditorForDocument(this, location.document, EditorManager::IgnoreNavigationHistory); } if (!editor) { - editor = em->openEditor(this, location.fileName, location.id, + editor = EditorManager::openEditor(this, location.fileName, location.id, EditorManager::IgnoreNavigationHistory); if (!editor) { m_navigationHistory.removeAt(m_currentNavigationHistoryPosition); @@ -485,7 +483,6 @@ void EditorView::goBackInNavigationHistory() void EditorView::goForwardInNavigationHistory() { - EditorManager *em = ICore::editorManager(); updateCurrentPositionInNavigationHistory(); if (m_currentNavigationHistoryPosition >= m_navigationHistory.size()-1) return; @@ -493,11 +490,11 @@ void EditorView::goForwardInNavigationHistory() EditLocation location = m_navigationHistory.at(m_currentNavigationHistoryPosition); IEditor *editor = 0; if (location.document) { - editor = em->activateEditorForDocument(this, location.document, + editor = EditorManager::activateEditorForDocument(this, location.document, EditorManager::IgnoreNavigationHistory); } if (!editor) { - editor = em->openEditor(this, location.fileName, location.id, EditorManager::IgnoreNavigationHistory); + editor = EditorManager::openEditor(this, location.fileName, location.id, EditorManager::IgnoreNavigationHistory); if (!editor) { //TODO qDebug() << Q_FUNC_INFO << "can't open file" << location.fileName; @@ -607,12 +604,11 @@ void SplitterOrView::split(Qt::Orientation orientation) m_layout->removeWidget(m_view); EditorView *editorView = m_view; m_view = 0; - EditorManager *em = ICore::editorManager(); - Core::IEditor *e = editorView->currentEditor(); + IEditor *e = editorView->currentEditor(); SplitterOrView *view = 0; SplitterOrView *otherView = 0; - Core::IEditor *duplicate = e && e->duplicateSupported() ? em->duplicateEditor(e) : 0; + IEditor *duplicate = e && e->duplicateSupported() ? EditorManager::duplicateEditor(e) : 0; m_splitter->addWidget((view = new SplitterOrView(duplicate))); m_splitter->addWidget((otherView = new SplitterOrView(editorView))); @@ -630,9 +626,9 @@ void SplitterOrView::split(Qt::Orientation orientation) } if (e) - em->activateEditor(otherView->view(), e); + EditorManager::activateEditor(otherView->view(), e); else - em->setCurrentView(otherView->view()); + EditorManager::setCurrentView(otherView->view()); } void SplitterOrView::unsplitAll() @@ -657,7 +653,7 @@ void SplitterOrView::unsplitAll() void SplitterOrView::unsplitAll_helper() { if (m_view) - ICore::editorManager()->emptyView(m_view); + EditorManager::emptyView(m_view); if (m_splitter) { for (int i = 0; i < m_splitter->count(); ++i) { if (SplitterOrView *splitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(i))) @@ -672,7 +668,6 @@ void SplitterOrView::unsplit() return; Q_ASSERT(m_splitter->count() == 1); - EditorManager *em = ICore::editorManager(); SplitterOrView *childSplitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(0)); QSplitter *oldSplitter = m_splitter; m_splitter = 0; @@ -692,7 +687,7 @@ void SplitterOrView::unsplit() m_view->addEditor(e); m_view->setCurrentEditor(e); } - em->emptyView(childView); + EditorManager::emptyView(childView); } else { m_view = childSplitterOrView->takeView(); m_view->setParentSplitterOrView(this); @@ -715,7 +710,7 @@ void SplitterOrView::unsplit() m_layout->setCurrentWidget(m_view); } delete oldSplitter; - em->setCurrentView(findFirstView()); + EditorManager::setCurrentView(findFirstView()); } @@ -772,27 +767,26 @@ void SplitterOrView::restoreState(const QByteArray &state) static_cast<SplitterOrView*>(m_splitter->widget(0))->restoreState(first); static_cast<SplitterOrView*>(m_splitter->widget(1))->restoreState(second); } else if (mode == "editor" || mode == "currenteditor") { - EditorManager *em = ICore::editorManager(); QString fileName; QString id; QByteArray editorState; stream >> fileName >> id >> editorState; if (!QFile::exists(fileName)) return; - IEditor *e = em->openEditor(view(), fileName, Id::fromString(id), Core::EditorManager::IgnoreNavigationHistory + IEditor *e = EditorManager::openEditor(view(), fileName, Id::fromString(id), Core::EditorManager::IgnoreNavigationHistory | Core::EditorManager::DoNotChangeCurrentEditor); if (!e) { DocumentModel::Entry *entry = EditorManager::documentModel()->firstRestoredDocument(); if (entry) - em->activateEditorForEntry(view(), entry, Core::EditorManager::IgnoreNavigationHistory + EditorManager::activateEditorForEntry(view(), entry, Core::EditorManager::IgnoreNavigationHistory | Core::EditorManager::DoNotChangeCurrentEditor); } if (e) { e->restoreState(editorState); if (mode == "currenteditor") - em->setCurrentEditor(e); + EditorManager::setCurrentEditor(e); } } } diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index f2b3768bff..68105dd0c7 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -422,11 +422,6 @@ MessageManager *ICore::messageManager() return m_mainwindow->messageManager(); } -EditorManager *ICore::editorManager() -{ - return m_mainwindow->editorManager(); -} - ProgressManager *ICore::progressManager() { return m_mainwindow->progressManager(); diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 8cf899dde4..b636bf2648 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -96,7 +96,6 @@ public: static QT_DEPRECATED ActionManager *actionManager(); // Use Actionmanager::... directly. static QT_DEPRECATED DocumentManager *documentManager(); // Use DocumentManager::... directly. static QT_DEPRECATED MessageManager *messageManager(); // Use MessageManager::... directly. - static EditorManager *editorManager(); static ProgressManager *progressManager(); static QT_DEPRECATED VariableManager *variableManager(); // Use VariableManager::... directly. static VcsManager *vcsManager(); diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 13e0bfb93c..0028560125 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -286,7 +286,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err connect(Core::ICore::progressManager(), SIGNAL(allTasksFinished(QString)), this, SLOT(onAllTasksFinished(QString))); - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*))); + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*))); readSettings(); return true; diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp index aa1d71b025..03c29dec85 100644 --- a/src/plugins/cpptools/cppcurrentdocumentfilter.cpp +++ b/src/plugins/cpptools/cppcurrentdocumentfilter.cpp @@ -36,7 +36,7 @@ using namespace CppTools::Internal; using namespace CPlusPlus; -CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager) +CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager) : m_modelManager(manager) { setId("Methods in current Document"); @@ -51,9 +51,9 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Cor connect(manager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), this, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr))); - connect(editorManager, SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(onCurrentEditorChanged(Core::IEditor*))); - connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(editorAboutToClose(Core::IEditor*)), this, SLOT(onEditorAboutToClose(Core::IEditor*))); } diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.h b/src/plugins/cpptools/cppcurrentdocumentfilter.h index 3466f0e0c1..d23c8e9c7d 100644 --- a/src/plugins/cpptools/cppcurrentdocumentfilter.h +++ b/src/plugins/cpptools/cppcurrentdocumentfilter.h @@ -33,10 +33,7 @@ #include <locator/ilocatorfilter.h> -namespace Core { -class EditorManager; -class IEditor; -} +namespace Core { class IEditor; } namespace CppTools { namespace Internal { @@ -48,7 +45,7 @@ class CppCurrentDocumentFilter : public Locator::ILocatorFilter Q_OBJECT public: - CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager); + explicit CppCurrentDocumentFilter(CppModelManager *manager); ~CppCurrentDocumentFilter() {} QList<Locator::FilterEntry> matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry); diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index fbdabd69f5..be08a9afff 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -104,7 +104,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) addAutoReleasedObject(new CppLocatorFilter(modelManager)); addAutoReleasedObject(new CppClassesFilter(modelManager)); addAutoReleasedObject(new CppFunctionsFilter(modelManager)); - addAutoReleasedObject(new CppCurrentDocumentFilter(modelManager, Core::ICore::editorManager())); + addAutoReleasedObject(new CppCurrentDocumentFilter(modelManager)); addAutoReleasedObject(new CppFileSettingsPage(m_fileSettings)); addAutoReleasedObject(new SymbolsFindFilter(modelManager)); addAutoReleasedObject(new CppCodeStyleSettingsPage); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index fec22e0a44..5aa338b165 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -3223,10 +3223,9 @@ void DebuggerPluginPrivate::extensionsInitialized() SLOT(updateDebugActions())); // EditorManager - QObject *editorManager = ICore::editorManager(); - connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), SLOT(editorOpened(Core::IEditor*))); - connect(editorManager, SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(updateBreakMenuItem(Core::IEditor*))); // Application interaction diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index 0c9314f79a..1b1a9001c3 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -169,7 +169,7 @@ FormEditorW::FormEditorW() : m_settingsPages.append(settingsPage); } - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(currentEditorChanged(Core::IEditor*))); connect(m_shortcutMapper, SIGNAL(mapped(QObject*)), this, SLOT(updateShortcut(QObject*))); @@ -289,7 +289,7 @@ void FormEditorW::fullInit() delete initTime; } - connect(Core::ICore::editorManager(), SIGNAL(editorsClosed(QList<Core::IEditor*>)), + connect(Core::EditorManager::instance(), SIGNAL(editorsClosed(QList<Core::IEditor*>)), SLOT(closeFormEditorsForXmlEditors(QList<Core::IEditor*>))); // Nest toolbar and editor widget m_editorWidget = new EditorWidget(this); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 24006eefd7..ab3bc866ed 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1041,7 +1041,7 @@ FakeVimPluginPrivate::~FakeVimPluginPrivate() void FakeVimPluginPrivate::onCoreAboutToClose() { // Don't attach to editors anymore. - disconnect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), + disconnect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(editorOpened(Core::IEditor*))); } @@ -1051,8 +1051,6 @@ void FakeVimPluginPrivate::aboutToShutdown() bool FakeVimPluginPrivate::initialize() { - EditorManager *editorManager = ICore::editorManager(); - //m_wordCompletion = new WordCompletion; //q->addAutoReleasedObject(m_wordCompletion); m_wordProvider = new FakeVimCompletionAssistProvider; @@ -1102,9 +1100,9 @@ bool FakeVimPluginPrivate::initialize() connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(onCoreAboutToClose())); // EditorManager - connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(editorAboutToClose(Core::IEditor*)), this, SLOT(editorAboutToClose(Core::IEditor*))); - connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(editorOpened(Core::IEditor*))); connect(theFakeVimSetting(ConfigUseFakeVim), SIGNAL(valueChanged(QVariant)), @@ -1867,17 +1865,16 @@ void FakeVimPluginPrivate::handleDelayedQuit(bool forced, IEditor *editor) { // This tries to simulate vim behaviour. But the models of vim and // Qt Creator core do not match well... - EditorManager *editorManager = ICore::editorManager(); - if (editorManager->hasSplitter()) + if (EditorManager::hasSplitter()) triggerAction(Core::Constants::REMOVE_CURRENT_SPLIT); else - editorManager->closeEditor(editor, !forced); + EditorManager::closeEditor(editor, !forced); } void FakeVimPluginPrivate::handleDelayedQuitAll(bool forced) { triggerAction(Core::Constants::REMOVE_ALL_SPLITS); - ICore::editorManager()->closeAllEditors(!forced); + EditorManager::closeAllEditors(!forced); } void FakeVimPluginPrivate::moveToMatchingParenthesis(bool *moved, bool *forward, diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index f9cdd9d3cd..f3e567e42b 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1053,7 +1053,7 @@ void GitPlugin::submitCurrentLog() { // Close the submit editor m_submitActionTriggered = true; - Core::ICore::editorManager()->closeEditor(); + Core::EditorManager::closeEditor(); } bool GitPlugin::submitEditorAboutToClose() diff --git a/src/plugins/locator/filesystemfilter.cpp b/src/plugins/locator/filesystemfilter.cpp index d25d45a2a3..d7c978a1e4 100644 --- a/src/plugins/locator/filesystemfilter.cpp +++ b/src/plugins/locator/filesystemfilter.cpp @@ -53,8 +53,8 @@ QList<FilterEntry> *categorize(const QString &entry, const QString &candidate, } // anynoumous namespace -FileSystemFilter::FileSystemFilter(EditorManager *editorManager, LocatorWidget *locatorWidget) - : m_editorManager(editorManager), m_locatorWidget(locatorWidget), m_includeHidden(true) +FileSystemFilter::FileSystemFilter(LocatorWidget *locatorWidget) + : m_locatorWidget(locatorWidget), m_includeHidden(true) { setId("Files in file system"); setDisplayName(tr("Files in File System")); diff --git a/src/plugins/locator/filesystemfilter.h b/src/plugins/locator/filesystemfilter.h index 6a4f9db7b3..0ee126bd0d 100644 --- a/src/plugins/locator/filesystemfilter.h +++ b/src/plugins/locator/filesystemfilter.h @@ -38,8 +38,6 @@ #include <QByteArray> #include <QFutureInterface> -namespace Core { class EditorManager; } - namespace Locator { namespace Internal { @@ -50,7 +48,7 @@ class FileSystemFilter : public Locator::ILocatorFilter Q_OBJECT public: - FileSystemFilter(Core::EditorManager *editorManager, LocatorWidget *locatorWidget); + explicit FileSystemFilter(LocatorWidget *locatorWidget); QList<Locator::FilterEntry> matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry); void accept(Locator::FilterEntry selection) const; QByteArray saveState() const; @@ -59,7 +57,6 @@ public: void refresh(QFutureInterface<void> &) {} private: - Core::EditorManager *m_editorManager; LocatorWidget *m_locatorWidget; bool m_includeHidden; }; diff --git a/src/plugins/locator/locatorplugin.cpp b/src/plugins/locator/locatorplugin.cpp index d1b4e5a85c..9c46d8ac03 100644 --- a/src/plugins/locator/locatorplugin.cpp +++ b/src/plugins/locator/locatorplugin.cpp @@ -122,10 +122,10 @@ bool LocatorPlugin::initialize(const QStringList &, QString *) addObject(new LocatorManager(m_locatorWidget)); - m_openDocumentsFilter = new OpenDocumentsFilter(Core::ICore::editorManager()); + m_openDocumentsFilter = new OpenDocumentsFilter; addObject(m_openDocumentsFilter); - m_fileSystemFilter = new FileSystemFilter(Core::ICore::editorManager(), m_locatorWidget); + m_fileSystemFilter = new FileSystemFilter(m_locatorWidget); addObject(m_fileSystemFilter); m_executeFilter = new ExecuteFilter(); diff --git a/src/plugins/locator/opendocumentsfilter.cpp b/src/plugins/locator/opendocumentsfilter.cpp index 54a873e8f4..85ead6f064 100644 --- a/src/plugins/locator/opendocumentsfilter.cpp +++ b/src/plugins/locator/opendocumentsfilter.cpp @@ -40,17 +40,16 @@ using namespace Locator; using namespace Locator::Internal; using namespace Utils; -OpenDocumentsFilter::OpenDocumentsFilter(EditorManager *editorManager) : - m_editorManager(editorManager) +OpenDocumentsFilter::OpenDocumentsFilter() { setId("Open documents"); setDisplayName(tr("Open Documents")); setShortcutString(QString(QLatin1Char('o'))); setIncludedByDefault(true); - connect(m_editorManager, SIGNAL(editorOpened(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(refreshInternally())); - connect(m_editorManager, SIGNAL(editorsClosed(QList<Core::IEditor*>)), + connect(EditorManager::instance(), SIGNAL(editorsClosed(QList<Core::IEditor*>)), this, SLOT(refreshInternally())); } diff --git a/src/plugins/locator/opendocumentsfilter.h b/src/plugins/locator/opendocumentsfilter.h index 9a861d3a54..a42f8fca50 100644 --- a/src/plugins/locator/opendocumentsfilter.h +++ b/src/plugins/locator/opendocumentsfilter.h @@ -38,10 +38,6 @@ #include <QList> #include <QFutureInterface> -namespace Core { - class EditorManager; -} - namespace Locator { namespace Internal { @@ -50,7 +46,7 @@ class OpenDocumentsFilter : public Locator::ILocatorFilter Q_OBJECT public: - explicit OpenDocumentsFilter(Core::EditorManager *editorManager); + OpenDocumentsFilter(); QList<Locator::FilterEntry> matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry); void accept(Locator::FilterEntry selection) const; void refresh(QFutureInterface<void> &future); @@ -59,8 +55,6 @@ public slots: void refreshInternally(); private: - Core::EditorManager *m_editorManager; - QList<Core::DocumentModel::Entry> m_editors; }; diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index e9abc55f2f..b4f5b33813 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -596,7 +596,7 @@ void MercurialPlugin::commitFromEditor() { // Close the submit editor m_submitActionTriggered = true; - Core::ICore::editorManager()->closeEditor(); + Core::EditorManager::closeEditor(); } bool MercurialPlugin::submitEditorAboutToClose() diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 4b5bd7d558..08cf75b64e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1087,7 +1087,7 @@ void ProjectExplorerPlugin::closeAllProjects() if (debug) qDebug() << "ProjectExplorerPlugin::closeAllProject"; - if (!Core::ICore::editorManager()->closeAllEditors()) + if (!Core::EditorManager::closeAllEditors()) return; // Action has been cancelled d->m_session->closeAllProjects(); diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 802e56cc60..cc1f22285f 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -87,15 +87,13 @@ SessionManager::SessionManager(QObject *parent) connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(saveActiveMode(Core::IMode*))); - EditorManager *em = ICore::editorManager(); - - connect(em, SIGNAL(editorCreated(Core::IEditor*,QString)), + connect(EditorManager::instance(), SIGNAL(editorCreated(Core::IEditor*,QString)), this, SLOT(configureEditor(Core::IEditor*,QString))); connect(ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project*)), this, SLOT(updateWindowTitle())); - connect(em, SIGNAL(editorOpened(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(markSessionFileDirty())); - connect(em, SIGNAL(editorsClosed(QList<Core::IEditor*>)), + connect(EditorManager::instance(), SIGNAL(editorsClosed(QList<Core::IEditor*>)), this, SLOT(markSessionFileDirty())); } @@ -339,7 +337,7 @@ bool SessionManager::save() ++i; } data.insert(QLatin1String("ProjectDependencies"), QVariant(depMap)); - data.insert(QLatin1String("EditorSettings"), ICore::editorManager()->saveState().toBase64()); + data.insert(QLatin1String("EditorSettings"), EditorManager::saveState().toBase64()); QMap<QString, QVariant>::const_iterator it, end; end = m_values.constEnd(); @@ -536,14 +534,14 @@ void SessionManager::updateWindowTitle() { if (isDefaultSession(m_sessionName)) { if (Project *currentProject = ProjectExplorerPlugin::currentProject()) - ICore::editorManager()->setWindowTitleAddition(currentProject->displayName()); + EditorManager::setWindowTitleAddition(currentProject->displayName()); else - ICore::editorManager()->setWindowTitleAddition(QString()); + EditorManager::setWindowTitleAddition(QString()); } else { QString sessionName = m_sessionName; if (sessionName.isEmpty()) sessionName = tr("Untitled"); - ICore::editorManager()->setWindowTitleAddition(sessionName); + EditorManager::setWindowTitleAddition(sessionName); } } @@ -782,8 +780,7 @@ void SessionManager::restoreEditors(const Utils::PersistentSettingsReader &reade { const QVariant &editorsettings = reader.restoreValue(QLatin1String("EditorSettings")); if (editorsettings.isValid()) { - ICore::editorManager()->restoreState( - QByteArray::fromBase64(editorsettings.toByteArray())); + EditorManager::restoreState(QByteArray::fromBase64(editorsettings.toByteArray())); sessionLoadingProgress(); } } @@ -841,7 +838,7 @@ bool SessionManager::loadSession(const QString &session) } // Clean up - if (!ICore::editorManager()->closeAllEditors()) { + if (!EditorManager::closeAllEditors()) { m_loadingSession = false; return false; } diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index 8d97ed0d4c..feaffda659 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -152,12 +152,12 @@ void QmlDesignerPlugin::createDesignModeWidget() m_shortCutManager.registerActions(qmlDesignerMainContext, qmlDesignerFormEditorContext, qmlDesignerNavigatorContext); - connect(Core::ICore::editorManager(), + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(onCurrentEditorChanged(Core::IEditor*))); - connect(Core::ICore::editorManager(), + connect(Core::EditorManager::instance(), SIGNAL(editorsClosed(QList<Core::IEditor*>)), this, SLOT(onTextEditorsClosed(QList<Core::IEditor*>))); diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index d6f50bfae7..4f3b9c0604 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -78,28 +78,29 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex SLOT(toggleRightSidebar())); // Revert to saved + QObject *em = Core::EditorManager::instance(); Core::ActionManager::registerAction(&m_revertToSavedAction,Core::Constants::REVERTTOSAVED, qmlDesignerMainContext); - connect(&m_revertToSavedAction, SIGNAL(triggered()), Core::ICore::editorManager(), SLOT(revertToSaved())); + connect(&m_revertToSavedAction, SIGNAL(triggered()), em, SLOT(revertToSaved())); //Save Core::ActionManager::registerAction(&m_saveAction, Core::Constants::SAVE, qmlDesignerMainContext); - connect(&m_saveAction, SIGNAL(triggered()), Core::ICore::editorManager(), SLOT(saveDocument())); + connect(&m_saveAction, SIGNAL(triggered()), em, SLOT(saveDocument())); //Save As Core::ActionManager::registerAction(&m_saveAsAction, Core::Constants::SAVEAS, qmlDesignerMainContext); - connect(&m_saveAsAction, SIGNAL(triggered()), Core::ICore::editorManager(), SLOT(saveDocumentAs())); + connect(&m_saveAsAction, SIGNAL(triggered()), em, SLOT(saveDocumentAs())); //Close Editor Core::ActionManager::registerAction(&m_closeCurrentEditorAction, Core::Constants::CLOSE, qmlDesignerMainContext); - connect(&m_closeCurrentEditorAction, SIGNAL(triggered()), Core::ICore::editorManager(), SLOT(closeEditor())); + connect(&m_closeCurrentEditorAction, SIGNAL(triggered()), em, SLOT(closeEditor())); //Close All Core::ActionManager::registerAction(&m_closeAllEditorsAction, Core::Constants::CLOSEALL, qmlDesignerMainContext); - connect(&m_closeAllEditorsAction, SIGNAL(triggered()), Core::ICore::editorManager(), SLOT(closeAllEditors())); + connect(&m_closeAllEditorsAction, SIGNAL(triggered()), em, SLOT(closeAllEditors())); //Close All Others Action Core::ActionManager::registerAction(&m_closeOtherEditorsAction, Core::Constants::CLOSEOTHERS, qmlDesignerMainContext); - connect(&m_closeOtherEditorsAction, SIGNAL(triggered()), Core::ICore::editorManager(), SLOT(closeOtherEditors())); + connect(&m_closeOtherEditorsAction, SIGNAL(triggered()), em, SLOT(closeOtherEditors())); // Undo / Redo Core::ActionManager::registerAction(&m_undoAction, Core::Constants::UNDO, qmlDesignerMainContext); diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index 6973b39b7f..32ef1b0e8d 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -242,7 +242,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e addAutoReleasedObject(new QuickToolBar); addAutoReleasedObject(new Internal::QuickToolBarSettingsPage); - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*))); + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*))); return true; } diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index e7a37ec0e4..2019aba61c 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -43,7 +43,7 @@ using namespace Core; BaseHoverHandler::BaseHoverHandler(QObject *parent) : QObject(parent), m_diagnosticTooltip(false) { // Listen for editor opened events in order to connect to tooltip/helpid requests - connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), this, SLOT(editorOpened(Core::IEditor*))); } diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp index 87e2c86179..ca7fdadea3 100644 --- a/src/plugins/texteditor/findincurrentfile.cpp +++ b/src/plugins/texteditor/findincurrentfile.cpp @@ -44,7 +44,7 @@ using namespace TextEditor::Internal; FindInCurrentFile::FindInCurrentFile() : m_currentDocument(0) { - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(handleFileChange(Core::IEditor*))); handleFileChange(Core::EditorManager::currentEditor()); } diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 4342bdc4b4..9168ea4664 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -107,7 +107,7 @@ TextEditorActionHandler::TextEditorActionHandler(const char *context, m_contextId(context), m_initialized(false) { - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(updateCurrentEditor(Core::IEditor*))); } diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index b72f3c5690..a55688c7a4 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -311,7 +311,7 @@ void CallgrindToolPrivate::selectFunction(const Function *func) if (QFile::exists(func->file())) { ///TODO: custom position support? int line = func->lineNumber(); - Core::EditorManager::openEditorAt(func->file(), qMax(line, 0)); + EditorManager::openEditorAt(func->file(), qMax(line, 0)); } } @@ -493,7 +493,7 @@ CallgrindTool::CallgrindTool(QObject *parent) d = new CallgrindToolPrivate(this); setObjectName(QLatin1String("CallgrindTool")); - connect(Core::ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), + connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)), d, SLOT(editorOpened(Core::IEditor*))); } @@ -846,7 +846,7 @@ void CallgrindToolPrivate::showParserResults(const ParseData *data) AnalyzerManager::showStatusMessage(msg); } -void CallgrindToolPrivate::editorOpened(Core::IEditor *editor) +void CallgrindToolPrivate::editorOpened(IEditor *editor) { TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor); if (!textEditor) diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 0b1247e892..7931049360 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -206,9 +206,9 @@ public slots: StateListener::StateListener(QObject *parent) : QObject(parent) { - connect(Core::ICore::editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(slotStateChanged())); - connect(Core::ICore::editorManager(), SIGNAL(currentDocumentStateChanged()), + connect(Core::EditorManager::instance(), SIGNAL(currentDocumentStateChanged()), this, SLOT(slotStateChanged())); connect(Core::ICore::vcsManager(), SIGNAL(repositoryChanged(QString)), this, SLOT(slotStateChanged())); |