aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authordt <[email protected]>2009-01-22 11:37:43 +0100
committerdt <[email protected]>2009-01-22 11:37:43 +0100
commit3bcbd0782b5ab0f0a02f20f6a630f4214d6dc2eb (patch)
treebf8714910285464eeca5a9abfb890e697e598389 /src/plugins
parent38471eebfe0239c8d83f2b8c87dac639185c7e04 (diff)
parent592560b5786a6596d2b8114512967ab485ad307c (diff)
Merge branch 'master' of [email protected]:creator/mainline
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bineditor/bineditorplugin.cpp25
-rw-r--r--src/plugins/bineditor/bineditorplugin.h7
-rw-r--r--src/plugins/bookmarks/bookmarkmanager.cpp7
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp7
-rw-r--r--src/plugins/coreplugin/actionmanager/commandsfile.cpp3
-rw-r--r--src/plugins/coreplugin/basefilewizard.cpp2
-rw-r--r--src/plugins/coreplugin/coreplugin.cpp2
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp6
-rw-r--r--src/plugins/coreplugin/editormanager/openeditorsview.cpp3
-rw-r--r--src/plugins/coreplugin/filemanager.cpp2
-rw-r--r--src/plugins/cpaster/cpasterplugin.cpp8
-rw-r--r--src/plugins/cppeditor/cppeditor.cpp12
-rw-r--r--src/plugins/cppeditor/cppplugin.cpp16
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp2
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp9
-rw-r--r--src/plugins/designer/formeditorfactory.cpp2
-rw-r--r--src/plugins/fakevim/fakevimhandler.cpp121
-rw-r--r--src/plugins/find/currentdocumentfind.cpp4
-rw-r--r--src/plugins/find/currentdocumentfind.h5
-rw-r--r--src/plugins/find/findplugin.cpp12
-rw-r--r--src/plugins/find/findplugin.h1
-rw-r--r--src/plugins/find/findtoolbar.cpp1
-rw-r--r--src/plugins/find/searchresultwindow.cpp15
-rw-r--r--src/plugins/find/searchresultwindow.h4
-rw-r--r--src/plugins/git/gitplugin.cpp3
-rw-r--r--src/plugins/perforce/perforceplugin.cpp28
-rw-r--r--src/plugins/projectexplorer/foldernavigationwidget.cpp2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp12
-rw-r--r--src/plugins/projectexplorer/projecttreewidget.cpp2
-rw-r--r--src/plugins/projectexplorer/taskwindow.cpp4
-rw-r--r--src/plugins/qt4projectmanager/profileeditor.cpp12
-rw-r--r--src/plugins/qt4projectmanager/profileeditorfactory.cpp4
-rw-r--r--src/plugins/qt4projectmanager/qt4projectmanager.cpp4
-rw-r--r--src/plugins/qtscripteditor/qtscripteditorfactory.cpp3
-rw-r--r--src/plugins/quickopen/basefilefilter.cpp3
-rw-r--r--src/plugins/resourceeditor/resourceeditorfactory.cpp5
-rw-r--r--src/plugins/resourceeditor/resourceeditorplugin.cpp2
-rw-r--r--src/plugins/subversion/subversionplugin.cpp22
-rw-r--r--src/plugins/texteditor/basefilefind.cpp3
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp3
-rw-r--r--src/plugins/texteditor/basetextmark.cpp5
-rw-r--r--src/plugins/texteditor/plaintexteditor.cpp15
-rw-r--r--src/plugins/texteditor/plaintexteditorfactory.cpp4
-rw-r--r--src/plugins/texteditor/texteditoractionhandler.cpp2
-rw-r--r--src/plugins/texteditor/texteditorplugin.cpp3
-rw-r--r--src/plugins/vcsbase/basevcseditorfactory.cpp3
-rw-r--r--src/plugins/vcsbase/basevcssubmiteditorfactory.cpp4
-rw-r--r--src/plugins/vcsbase/vcsbaseeditor.cpp13
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.cpp3
49 files changed, 196 insertions, 244 deletions
diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp
index 8a4198b4bf0..7d7e3c9f7e0 100644
--- a/src/plugins/bineditor/bineditorplugin.cpp
+++ b/src/plugins/bineditor/bineditorplugin.cpp
@@ -234,12 +234,11 @@ public:
BinEditorInterface(BinEditor *parent)
: Core::IEditor(parent)
{
- Core::ICore *core = Core::ICore::instance();
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_editor = parent;
m_file = new BinEditorFile(parent);
- m_context << core->uniqueIDManager()->
- uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
- m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
+ m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
+ m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
QHBoxLayout *l = new QHBoxLayout;
@@ -320,8 +319,8 @@ QString BinEditorFactory::kind() const
Core::IFile *BinEditorFactory::open(const QString &fileName)
{
- Core::ICore *core = Core::ICore::instance();
- Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
+ Core::EditorManager *em = Core::EditorManager::instance();
+ Core::IEditor *iface = em->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
@@ -339,27 +338,17 @@ QStringList BinEditorFactory::mimeTypes() const
///////////////////////////////// BinEditorPlugin //////////////////////////////////
-BinEditorPlugin *BinEditorPlugin::m_instance = 0;
-
BinEditorPlugin::BinEditorPlugin()
{
m_undoAction = m_redoAction = m_copyAction = m_selectAllAction = 0;
- m_instance = this;
}
BinEditorPlugin::~BinEditorPlugin()
{
- m_instance = 0;
-}
-
-BinEditorPlugin *BinEditorPlugin::instance()
-{
- return m_instance;
}
QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title)
{
-
QAction *result = new QAction(title, this);
Core::ICore::instance()->actionManager()->registerAction(result, id, m_context);
return result;
@@ -384,8 +373,8 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
editor->setEditorInterface(editorInterface);
- Core::ICore *core = Core::ICore::instance();
- m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
if (!m_undoAction) {
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
this, SLOT(undoAction()),
diff --git a/src/plugins/bineditor/bineditorplugin.h b/src/plugins/bineditor/bineditorplugin.h
index ddc4333acdb..a7c78269707 100644
--- a/src/plugins/bineditor/bineditorplugin.h
+++ b/src/plugins/bineditor/bineditorplugin.h
@@ -43,7 +43,6 @@
#include <QtGui/QAction>
namespace Core {
-class ICore;
class IWizard;
}
@@ -61,8 +60,6 @@ public:
BinEditorPlugin();
~BinEditorPlugin();
- static BinEditorPlugin *instance();
-
bool initialize(const QStringList &arguments, QString *error_message = 0);
void extensionsInitialized();
@@ -77,6 +74,7 @@ private slots:
void updateActions();
void updateCurrentEditor(Core::IContext *object);
+
private:
QList<int> m_context;
QAction *registerNewAction(const QString &id, const QString &title = QString());
@@ -90,9 +88,6 @@ private:
friend class BinEditorFactory;
Core::IEditor *createEditor(QWidget *parent);
- static BinEditorPlugin *m_instance;
-
- Core::ICore *m_core;
typedef QList<Core::IWizard *> WizardList;
WizardList m_wizards;
BinEditorFactory *m_factory;
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp
index 3d9ea294d92..fa8eaefa55c 100644
--- a/src/plugins/bookmarks/bookmarkmanager.cpp
+++ b/src/plugins/bookmarks/bookmarkmanager.cpp
@@ -293,8 +293,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
BookmarkContext::BookmarkContext(BookmarkView *widget)
: m_bookmarkView(widget)
{
- Core::ICore *core = ICore::instance();
- m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
+ m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
}
QList<int> BookmarkContext::context() const
@@ -509,7 +508,7 @@ void BookmarkManager::documentPrevNext(bool next)
nextLine = markLine;
}
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
em->addCurrentPositionToNavigationHistory(true);
if (next) {
if (nextLine == -1)
@@ -554,7 +553,7 @@ void BookmarkManager::prev()
TextEditor::ITextEditor *BookmarkManager::currentTextEditor() const
{
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
Core::IEditor *currEditor = em->currentEditor();
if (!currEditor)
return 0;
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp
index 96170439d4e..d8511011c36 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp
@@ -36,7 +36,6 @@
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
-#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/environment.h>
@@ -48,9 +47,9 @@ using namespace CMakeProjectManager::Internal;
CMakeManager::CMakeManager(CMakeSettingsPage *cmakeSettingsPage)
: m_settingsPage(cmakeSettingsPage)
{
- Core::ICore *core = Core::ICore::instance();
- m_projectContext = core->uniqueIDManager()->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
- m_projectLanguage = core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_projectContext = uidm->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
+ m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
}
CMakeSettingsPage::~CMakeSettingsPage()
diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.cpp b/src/plugins/coreplugin/actionmanager/commandsfile.cpp
index 85d7d172a1d..8fc086079bb 100644
--- a/src/plugins/coreplugin/actionmanager/commandsfile.cpp
+++ b/src/plugins/coreplugin/actionmanager/commandsfile.cpp
@@ -109,8 +109,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
QDomElement root = doc.createElement("mapping");
doc.appendChild(root);
- for (int i = 0; i < items.count(); ++i) {
- ShortcutItem *item = items.at(i);
+ foreach (const ShortcutItem *item, items) {
QDomElement ctag = doc.createElement("shortcut");
ctag.setAttribute(QLatin1String("id"), idmanager->stringForUniqueIdentifier(item->m_cmd->id()));
root.appendChild(ctag);
diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp
index 17cf04615b5..7a7279cfe49 100644
--- a/src/plugins/coreplugin/basefilewizard.cpp
+++ b/src/plugins/coreplugin/basefilewizard.cpp
@@ -509,7 +509,7 @@ bool BaseFileWizard::postGenerateFiles(const GeneratedFiles &l, QString *errorMe
{
// File mode: open the editors in file mode and ensure editor pane
const Core::GeneratedFiles::const_iterator cend = l.constEnd();
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
for (Core::GeneratedFiles::const_iterator it = l.constBegin(); it != cend; ++it) {
if (!em->openEditor(it->path(), it->editorKind())) {
*errorMessage = tr("Failed to open an editor for %1").arg(it->path());
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index b947b54827c..c6bc596b282 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -85,7 +85,7 @@ bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_me
m_welcomeMode = new WelcomeMode;
addObject(m_welcomeMode);
- EditorManager *editorManager = qobject_cast<EditorManager*>(m_mainWindow->editorManager());
+ EditorManager *editorManager = m_mainWindow->editorManager();
m_editMode = new EditMode(editorManager);
addObject(m_editMode);
}
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index d3aac99cb5d..77092e343eb 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -599,8 +599,7 @@ QList<IEditor*>
return found.toList();
}
-QList<IFile *>
- EditorManager::filesForEditors(QList<IEditor *> editors) const
+QList<IFile *> EditorManager::filesForEditors(QList<IEditor *> editors) const
{
QSet<IEditor *> handledEditors;
QList<IFile *> files;
@@ -925,9 +924,8 @@ QStringList EditorManager::getOpenFileNames() const
void EditorManager::ensureEditorManagerVisible()
{
- if (!isVisible()) {
+ if (!isVisible())
m_d->m_core->modeManager()->activateMode(Constants::MODE_EDIT);
- }
}
IEditor *EditorManager::newFile(const QString &editorKind,
diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp
index 77e44faaa05..a7119c74547 100644
--- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp
+++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp
@@ -223,8 +223,7 @@ void OpenEditorsWidget::closeEditors()
core->fileManager()->saveModifiedFiles(selectedFiles, &cancelled);
if (cancelled)
return;
- core->editorManager()->
- closeEditors(selectedEditors);
+ core->editorManager()->closeEditors(selectedEditors);
updateEditorList();
}
diff --git a/src/plugins/coreplugin/filemanager.cpp b/src/plugins/coreplugin/filemanager.cpp
index d94649cba5a..c503dbd7dd8 100644
--- a/src/plugins/coreplugin/filemanager.cpp
+++ b/src/plugins/coreplugin/filemanager.cpp
@@ -509,7 +509,7 @@ void FileManager::syncWithEditor(Core::IContext *context)
if (!context)
return;
- Core::IEditor *editor = Core::ICore::instance()->editorManager()->currentEditor();
+ Core::IEditor *editor = Core::EditorManager::instance()->currentEditor();
if (editor && (editor->widget() == context->widget()))
setCurrentFile(editor->file()->fileName());
}
diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index af4cbabbbe8..4558ccaae88 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -84,8 +84,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
// Create the globalcontext list to register actions accordingly
QList<int> globalcontext;
- globalcontext << ICore::instance()->uniqueIDManager()->
- uniqueIdentifier(Core::Constants::C_GLOBAL);
+ globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL);
// Create the settings Page
m_settingsPage = new SettingsPage();
@@ -129,7 +128,7 @@ void CodepasterPlugin::post()
{
if (m_poster)
delete m_poster;
- IEditor* editor = ICore::instance()->editorManager()->currentEditor();
+ IEditor* editor = EditorManager::instance()->currentEditor();
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return;
@@ -240,8 +239,7 @@ void CustomFetcher::customRequestFinished(int, bool error)
QByteArray data = body();
if (!m_listWidget) {
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id);
- ICore::instance()->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR
- , &title, data);
+ EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data);
} else {
m_listWidget->clear();
QStringList lines = QString(data).split(QLatin1Char('\n'));
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 0a9cf3958b2..87d229d6f4e 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -139,10 +139,10 @@ QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &contex
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
: BaseTextEditorEditable(editor)
{
- Core::ICore *core = Core::ICore::instance();
- m_context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
- m_context << core->uniqueIDManager()->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
- m_context << core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_context << uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
+ m_context << uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
+ m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
CPPEditor::CPPEditor(QWidget *parent)
@@ -334,10 +334,10 @@ void CPPEditor::jumpToMethod(int)
if (! symbol)
return;
- Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory(true);
+ Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(true);
int line = symbol->line();
gotoLine(line);
- Core::ICore::instance()->editorManager()->addCurrentPositionToNavigationHistory();
+ Core::EditorManager::instance()->addCurrentPositionToNavigationHistory();
setFocus();
}
diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp
index 3d09e02fc02..e600de92c58 100644
--- a/src/plugins/cppeditor/cppplugin.cpp
+++ b/src/plugins/cppeditor/cppplugin.cpp
@@ -88,7 +88,7 @@ QString CppPluginEditorFactory::kind() const
Core::IFile *CppPluginEditorFactory::open(const QString &fileName)
{
- Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
@@ -238,20 +238,18 @@ void CppPlugin::extensionsInitialized()
void CppPlugin::switchDeclarationDefinition()
{
- Core::ICore *core = Core::ICore::instance();
- CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
- if (editor) {
+ Core::EditorManager *em = Core::EditorManager::instance();
+ CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget());
+ if (editor)
editor->switchDeclarationDefinition();
- }
}
void CppPlugin::jumpToDefinition()
{
- Core::ICore *core = Core::ICore::instance();
- CPPEditor *editor = qobject_cast<CPPEditor*>(core->editorManager()->currentEditor()->widget());
- if (editor) {
+ Core::EditorManager *em = Core::EditorManager::instance();
+ CPPEditor *editor = qobject_cast<CPPEditor*>(em->currentEditor()->widget());
+ if (editor)
editor->jumpToDefinition();
- }
}
Q_EXPORT_PLUGIN(CppPlugin)
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp
index c28c4a8127d..3a8c271a098 100644
--- a/src/plugins/cpptools/cpptoolsplugin.cpp
+++ b/src/plugins/cpptools/cpptoolsplugin.cpp
@@ -147,7 +147,7 @@ void CppToolsPlugin::shutdown()
void CppToolsPlugin::switchHeaderSource()
{
- Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
+ Core::EditorManager *editorManager = Core::EditorManager::instance();
Core::IEditor *editor = editorManager->currentEditor();
QString otherFile = correspondingHeaderOrSource(editor->file()->fileName());
if (!otherFile.isEmpty()) {
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index a42c1038204..07904b8efa3 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -723,18 +723,17 @@ void DebuggerPlugin::activatePreviousMode()
void DebuggerPlugin::activateDebugMode()
{
- ICore *core = ICore::instance();
- Core::ModeManager *modeManager = core->modeManager();
+ ModeManager *modeManager = ModeManager::instance();
m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName());
modeManager->activateMode(QLatin1String(MODE_DEBUG));
}
void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object)
{
- ICore *core = ICore::instance();
- if (!core || !core->editorManager())
+ EditorManager *editorManager = EditorManager::instance();
+ if (!editorManager)
return;
- Core::IEditor *editor = core->editorManager()->currentEditor();
+ Core::IEditor *editor = editorManager->currentEditor();
ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return;
diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp
index b07140eff61..df3c59adfa3 100644
--- a/src/plugins/designer/formeditorfactory.cpp
+++ b/src/plugins/designer/formeditorfactory.cpp
@@ -63,7 +63,7 @@ QString FormEditorFactory::kind() const
Core::IFile *FormEditorFactory::open(const QString &fileName)
{
- Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp
index 32663da298e..f6e9d759708 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -137,20 +137,20 @@ enum MoveType
struct EditOperation
{
- EditOperation() : m_position(-1), m_itemCount(0) {}
- int m_position;
- int m_itemCount; // used to combine several operations
- QString m_from;
- QString m_to;
+ EditOperation() : position(-1), itemCount(0) {}
+ int position;
+ int itemCount; // used to combine several operations
+ QString from;
+ QString to;
};
QDebug &operator<<(QDebug &ts, const EditOperation &op)
{
- if (op.m_itemCount > 0) {
- ts << "\n EDIT BLOCK WITH " << op.m_itemCount << " ITEMS";
+ if (op.itemCount > 0) {
+ ts << "\n EDIT BLOCK WITH " << op.itemCount << " ITEMS";
} else {
- ts << "\n EDIT AT " << op.m_position
- << "\n FROM " << op.m_from << "\n TO " << op.m_to;
+ ts << "\n EDIT AT " << op.position
+ << "\n FROM " << op.from << "\n TO " << op.to;
}
return ts;
}
@@ -367,6 +367,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
quit();
return true;
}
+ m_mode = CommandMode;
return false;
}
@@ -1356,9 +1357,9 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
m_tc.setPosition(positionForLine(beginLine));
EditOperation op;
// FIXME: broken for "upward selection"
- op.m_position = m_tc.position();
- op.m_from = text;
- op.m_to = result;
+ op.position = m_tc.position();
+ op.from = text;
+ op.to = result;
recordOperation(op);
enterCommandMode();
@@ -1748,60 +1749,52 @@ QWidget *FakeVimHandler::Private::editor() const
void FakeVimHandler::Private::undo()
{
-#if 0
- EDITOR(undo());
-#else
if (m_undoStack.isEmpty()) {
showBlackMessage(tr("Already at oldest change"));
} else {
EditOperation op = m_undoStack.pop();
//qDebug() << "UNDO " << op;
- if (op.m_itemCount > 0) {
- for (int i = op.m_itemCount; --i >= 0; )
+ if (op.itemCount > 0) {
+ for (int i = op.itemCount; --i >= 0; )
undo();
} else {
- m_tc.setPosition(op.m_position, MoveAnchor);
- if (!op.m_to.isEmpty()) {
- m_tc.setPosition(op.m_position + op.m_to.size(), KeepAnchor);
- m_tc.deleteChar();
+ m_tc.setPosition(op.position, MoveAnchor);
+ if (!op.to.isEmpty()) {
+ m_tc.setPosition(op.position + op.to.size(), KeepAnchor);
+ m_tc.removeSelectedText();
}
- if (!op.m_from.isEmpty())
- m_tc.insertText(op.m_from);
- m_tc.setPosition(op.m_position, MoveAnchor);
+ if (!op.from.isEmpty())
+ m_tc.insertText(op.from);
+ m_tc.setPosition(op.position, MoveAnchor);
}
m_redoStack.push(op);
showBlackMessage(QString());
}
-#endif
}
void FakeVimHandler::Private::redo()
{
-#if 0
- EDITOR(redo());
-#else
if (m_redoStack.isEmpty()) {
showBlackMessage(tr("Already at newest change"));
} else {
EditOperation op = m_redoStack.pop();
//qDebug() << "REDO " << op;
- if (op.m_itemCount > 0) {
- for (int i = op.m_itemCount; --i >= 0; )
+ if (op.itemCount > 0) {
+ for (int i = op.itemCount; --i >= 0; )
redo();
} else {
- m_tc.setPosition(op.m_position, MoveAnchor);
- if (!op.m_from.isEmpty()) {
- m_tc.setPosition(op.m_position + op.m_from.size(), KeepAnchor);
- m_tc.deleteChar();
+ m_tc.setPosition(op.position, MoveAnchor);
+ if (!op.from.isEmpty()) {
+ m_tc.setPosition(op.position + op.from.size(), KeepAnchor);
+ m_tc.removeSelectedText();
}
- if (!op.m_to.isEmpty())
- m_tc.insertText(op.m_to);
- m_tc.setPosition(op.m_position, MoveAnchor);
+ if (!op.to.isEmpty())
+ m_tc.insertText(op.to);
+ m_tc.setPosition(op.position, MoveAnchor);
}
m_undoStack.push(op);
showBlackMessage(QString());
}
-#endif
}
void FakeVimHandler::Private::recordBeginGroup()
@@ -1809,29 +1802,37 @@ void FakeVimHandler::Private::recordBeginGroup()
//qDebug() << "PUSH";
m_undoGroupStack.push(m_undoStack.size());
EditOperation op;
- op.m_position = m_tc.position();
+ op.position = m_tc.position();
recordOperation(op);
}
void FakeVimHandler::Private::recordEndGroup()
{
+ if (m_undoGroupStack.isEmpty()) {
+ qWarning("fakevim: undo groups not balanced.\n");
+ return;
+ }
EditOperation op;
- op.m_itemCount = m_undoStack.size() - m_undoGroupStack.pop();
- //qDebug() << "POP " << op.m_itemCount;
+ op.itemCount = m_undoStack.size() - m_undoGroupStack.pop();
+ //qDebug() << "POP " << op.itemCount << m_undoStack;
recordOperation(op);
}
QString FakeVimHandler::Private::recordRemoveSelectedText()
{
EditOperation op;
- //qDebug() << "1 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
- m_tc.setPosition(anchor(), KeepAnchor);
- op.m_position = qMin(position(), anchor());
- //qDebug() << "2 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
- op.m_from = m_tc.selection().toPlainText();
+ //qDebug() << "POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
+ int pos = m_tc.position();
+ if (pos == anchor())
+ return QString();
+ m_tc.setPosition(anchor(), MoveAnchor);
+ m_tc.setPosition(pos, KeepAnchor);
+ op.position = qMin(pos, anchor());
+ op.from = m_tc.selection().toPlainText();
+ //qDebug() << "OP: " << op;
recordOperation(op);
- m_tc.deleteChar();
- return op.m_from;
+ m_tc.removeSelectedText();
+ return op.from;
}
void FakeVimHandler::Private::recordRemoveNextChar()
@@ -1844,15 +1845,20 @@ void FakeVimHandler::Private::recordRemoveNextChar()
void FakeVimHandler::Private::recordInsertText(const QString &data)
{
EditOperation op;
- op.m_position = m_tc.position();
- op.m_to = data;
+ op.position = m_tc.position();
+ op.to = data;
recordOperation(op);
m_tc.insertText(data);
}
void FakeVimHandler::Private::recordOperation(const EditOperation &op)
{
- //qDebug() << "OP: " << op;
+ // No need to record operations that actually do not change anything.
+ if (op.from.isEmpty() && op.to.isEmpty() && op.itemCount == 0)
+ return;
+ // No need to create groups with only one member.
+ if (op.itemCount == 1)
+ return;
m_undoStack.push(op);
m_redoStack.clear();
}
@@ -1860,16 +1866,16 @@ void FakeVimHandler::Private::recordOperation(const EditOperation &op)
void FakeVimHandler::Private::recordMove(int position, int nestedCount)
{
EditOperation op;
- op.m_position = position;
- op.m_itemCount = nestedCount;
+ op.position = position;
+ op.itemCount = nestedCount;
recordOperation(op);
}
void FakeVimHandler::Private::recordInsert(int position, const QString &data)
{
EditOperation op;
- op.m_position = position;
- op.m_to = data;
+ op.position = position;
+ op.to = data;
recordOperation(op);
}
@@ -1884,8 +1890,8 @@ void FakeVimHandler::Private::recordRemove(int position, int length)
void FakeVimHandler::Private::recordRemove(int position, const QString &data)
{
EditOperation op;
- op.m_position = position;
- op.m_from = data;
+ op.position = position;
+ op.from = data;
recordOperation(op);
}
@@ -1894,6 +1900,7 @@ void FakeVimHandler::Private::enterInsertMode()
EDITOR(setOverwriteMode(false));
m_mode = InsertMode;
m_lastInsertion.clear();
+ recordBeginGroup();
}
void FakeVimHandler::Private::enterCommandMode()
diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp
index b51504db7df..7c9532eb17f 100644
--- a/src/plugins/find/currentdocumentfind.cpp
+++ b/src/plugins/find/currentdocumentfind.cpp
@@ -45,8 +45,8 @@ using namespace Core;
using namespace Find;
using namespace Find::Internal;
-CurrentDocumentFind::CurrentDocumentFind(ICore *core)
- : m_core(core), m_currentFind(0)
+CurrentDocumentFind::CurrentDocumentFind()
+ : m_currentFind(0)
{
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*)));
diff --git a/src/plugins/find/currentdocumentfind.h b/src/plugins/find/currentdocumentfind.h
index 2f41acbe7b0..c5674db6632 100644
--- a/src/plugins/find/currentdocumentfind.h
+++ b/src/plugins/find/currentdocumentfind.h
@@ -36,8 +36,6 @@
#include "ifindfilter.h"
-#include <coreplugin/icore.h>
-
#include <QtCore/QPointer>
#include <QtGui/QWidget>
@@ -49,7 +47,7 @@ class CurrentDocumentFind : public QObject
Q_OBJECT
public:
- CurrentDocumentFind(Core::ICore *core);
+ CurrentDocumentFind();
void resetIncrementalSearch();
void clearResults();
@@ -83,7 +81,6 @@ private slots:
private:
void removeFindSupportConnections();
- Core::ICore *m_core;
QPointer<IFindSupport> m_currentFind;
QPointer<QWidget> m_currentWidget;
};
diff --git a/src/plugins/find/findplugin.cpp b/src/plugins/find/findplugin.cpp
index fb6c9c53b71..879acc7bda3 100644
--- a/src/plugins/find/findplugin.cpp
+++ b/src/plugins/find/findplugin.cpp
@@ -42,6 +42,7 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
+#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
@@ -77,14 +78,13 @@ FindPlugin::~FindPlugin()
bool FindPlugin::initialize(const QStringList &, QString *)
{
- Core::ICore *core = Core::ICore::instance();
setupMenu();
- m_currentDocumentFind = new CurrentDocumentFind(core);
+ m_currentDocumentFind = new CurrentDocumentFind;
m_findToolBar = new FindToolBar(this, m_currentDocumentFind);
m_findDialog = new FindToolWindow(this);
- SearchResultWindow *searchResultWindow = new SearchResultWindow(core);
+ SearchResultWindow *searchResultWindow = new SearchResultWindow;
addAutoReleasedObject(searchResultWindow);
return true;
}
@@ -126,8 +126,7 @@ void FindPlugin::openFindFilter()
void FindPlugin::setupMenu()
{
- Core::ICore *core = Core::ICore::instance();
- Core::ActionManager *am = core->actionManager();
+ Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
@@ -150,8 +149,7 @@ void FindPlugin::setupMenu()
void FindPlugin::setupFilterMenuItems()
{
- Core::ICore *core = Core::ICore::instance();
- Core::ActionManager *am = core->actionManager();
+ Core::ActionManager *am = Core::ICore::instance()->actionManager();
QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
Core::Command *cmd;
diff --git a/src/plugins/find/findplugin.h b/src/plugins/find/findplugin.h
index 9b2ac1f4aa6..28639476b95 100644
--- a/src/plugins/find/findplugin.h
+++ b/src/plugins/find/findplugin.h
@@ -38,7 +38,6 @@
#include "ifindfilter.h"
#include "findtoolbar.h"
-#include <coreplugin/icore.h>
#include <extensionsystem/iplugin.h>
#include <QtCore/QHash>
diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp
index 5af25e496d4..a8d96531604 100644
--- a/src/plugins/find/findtoolbar.cpp
+++ b/src/plugins/find/findtoolbar.cpp
@@ -37,6 +37,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/findplaceholder.h>
+#include <coreplugin/icore.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp
index 57cd669515b..a979e9b39c9 100644
--- a/src/plugins/find/searchresultwindow.cpp
+++ b/src/plugins/find/searchresultwindow.cpp
@@ -34,6 +34,8 @@
#include "searchresultwindow.h"
#include "searchresulttreemodel.h"
+#include <coreplugin/icore.h>
+
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QSettings>
@@ -46,10 +48,9 @@ using namespace Find::Internal;
static const QString SETTINGSKEYSECTIONNAME("SearchResults");
static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
-SearchResultWindow::SearchResultWindow(Core::ICore *core) :
- m_core(core),
- m_widget(new QStackedWidget())
+SearchResultWindow::SearchResultWindow()
{
+ m_widget = new QStackedWidget;
m_widget->setWindowTitle(name());
m_searchResultTreeView = new SearchResultTreeView(m_widget);
@@ -173,8 +174,8 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
void SearchResultWindow::readSettings(void)
{
- if (m_core && m_core->settings()) {
- QSettings *s = m_core->settings();
+ QSettings *s = Core::ICore::instance()->settings();
+ if (s) {
s->beginGroup(SETTINGSKEYSECTIONNAME);
m_expandCollapseToolButton->setChecked(s->value(SETTINGSKEYEXPANDRESULTS, m_initiallyExpand).toBool());
s->endGroup();
@@ -183,8 +184,8 @@ void SearchResultWindow::readSettings(void)
void SearchResultWindow::writeSettings(void)
{
- if (m_core && m_core->settings()) {
- QSettings *s = m_core->settings();
+ QSettings *s = Core::ICore::instance()->settings();
+ if (s) {
s->beginGroup(SETTINGSKEYSECTIONNAME);
s->setValue(SETTINGSKEYEXPANDRESULTS, m_expandCollapseToolButton->isChecked());
s->endGroup();
diff --git a/src/plugins/find/searchresultwindow.h b/src/plugins/find/searchresultwindow.h
index c167727ea05..e7923b5cc8c 100644
--- a/src/plugins/find/searchresultwindow.h
+++ b/src/plugins/find/searchresultwindow.h
@@ -38,7 +38,6 @@
#include "searchresulttreeview.h"
#include <coreplugin/ioutputpane.h>
-#include <coreplugin/icore.h>
#include <QtCore/QThread>
#include <QtCore/QStringList>
@@ -65,7 +64,7 @@ class FIND_EXPORT SearchResultWindow : public Core::IOutputPane
Q_OBJECT
public:
- SearchResultWindow(Core::ICore *core);
+ SearchResultWindow();
~SearchResultWindow();
QWidget *outputWidget(QWidget *);
@@ -97,7 +96,6 @@ private:
Internal::SearchResultTreeView *m_searchResultTreeView;
QListWidget *m_noMatchesFoundDisplay;
- Core::ICore *m_core;
QToolButton *m_expandCollapseToolButton;
static const bool m_initiallyExpand = false;
QStackedWidget *m_widget;
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index f00f6d711ef..11823909585 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -236,8 +236,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_gitClient = new GitClient(this);
// Create the globalcontext list to register actions accordingly
QList<int> globalcontext;
- globalcontext << m_core->uniqueIDManager()->
- uniqueIdentifier(Core::Constants::C_GLOBAL);
+ globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL);
// Create the output Window
m_outputWindow = new GitOutputWindow();
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 23db7b2862a..7d126c4bb94 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -241,8 +241,8 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
globalcontext << Core::Constants::C_GLOBAL_ID;
QList<int> perforcesubmitcontext;
- perforcesubmitcontext <<
- Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
+ perforcesubmitcontext << Core::UniqueIDManager::instance()->
+ uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
Core::Command *command;
QAction *tmpaction;
@@ -467,7 +467,7 @@ void PerforcePlugin::diffAllOpened()
void PerforcePlugin::printOpenedFileList()
{
- Core::IEditor *e = Core::ICore::instance()->editorManager()->currentEditor();
+ Core::IEditor *e = Core::EditorManager::instance()->currentEditor();
if (e)
e->widget()->setFocus();
PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
@@ -542,9 +542,9 @@ void PerforcePlugin::submit()
Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames)
{
- Core::IEditor *editor =
- Core::ICore::instance()->editorManager()->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
- Core::ICore::instance()->editorManager()->ensureEditorManagerVisible();
+ Core::EditorManager *editorManager = Core::EditorManager::instance();
+ Core::IEditor *editor = editorManager->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
+ editorManager->ensureEditorManagerVisible();
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, return 0);
submitEditor->restrictToProjectFiles(depotFileNames);
@@ -841,9 +841,9 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q
if (Perforce::Constants::debug)
qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
QString s = title;
- Core::IEditor *ediface = Core::ICore::instance()->editorManager()->
+ Core::IEditor *editor = Core::EditorManager::instance()->
newFile(kind, &s, output.toLocal8Bit());
- PerforceEditor *e = qobject_cast<PerforceEditor*>(ediface->widget());
+ PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget());
if (!e)
return 0;
s.replace(QLatin1Char(' '), QLatin1Char('_'));
@@ -857,7 +857,7 @@ QStringList PerforcePlugin::environment() const
{
QStringList newEnv = QProcess::systemEnvironment();
const QString name = "P4DIFF";
- for (int i=0; i<newEnv.count(); ++i) {
+ for (int i = 0; i < newEnv.count(); ++i) {
if (newEnv.at(i).startsWith(name)) {
newEnv.removeAt(i);
return newEnv;
@@ -889,7 +889,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
diffname = fi.fileName();
}
- foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors()) {
+ foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors()) {
if (ed->property("originalFileName").toString() == fileName) {
existingEditor = ed;
displayInEditor = false;
@@ -912,7 +912,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname)
} else if (!displayInEditor && existingEditor) {
if (existingEditor) {
existingEditor->createNew(result.stdOut);
- Core::ICore::instance()->editorManager()->setCurrentEditor(existingEditor);
+ Core::EditorManager::instance()->setCurrentEditor(existingEditor);
}
}
}
@@ -930,7 +930,7 @@ void PerforcePlugin::describe(const QString & source, const QString &n)
void PerforcePlugin::submitCurrentLog()
{
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
em->closeEditors(QList<Core::IEditor*>() << em->currentEditor());
}
@@ -1004,8 +1004,8 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor)
void PerforcePlugin::openFiles(const QStringList &files)
{
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
- foreach (QString s, files)
+ Core::EditorManager *em = Core::EditorManager::instance();
+ foreach (const QString &s, files)
em->openEditor(clientFilePath(s));
em->ensureEditorManagerVisible();
}
diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp
index 1cb9979538c..29b0fbe1cd1 100644
--- a/src/plugins/projectexplorer/foldernavigationwidget.cpp
+++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp
@@ -170,7 +170,7 @@ void FolderNavigationWidget::openItem(const QModelIndex &index)
setCurrentTitle(QDir(m_dirModel->filePath(srcIndex)));
} else {
const QString filePath = m_dirModel->filePath(srcIndex);
- Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
+ Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->openEditor(filePath);
editorManager->ensureEditorManagerVisible();
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 5b60ab1db0d..69b642bc425 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -870,7 +870,7 @@ bool ProjectExplorerPlugin::openProjects(const QStringList &fileNames)
updateActions();
- Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_EDIT);
+ Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT);
QApplication::restoreOverrideCursor();
return true;
@@ -986,7 +986,7 @@ void ProjectExplorerPlugin::restoreSession()
}
// update welcome page
- Core::ModeManager *modeManager = Core::ICore::instance()->modeManager();
+ Core::ModeManager *modeManager = Core::ModeManager::instance();
connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*)));
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) {
updateWelcomePage(welcomeMode);
@@ -1618,9 +1618,9 @@ void ProjectExplorerPlugin::openFile()
{
if (m_currentNode)
return;
- Core::ICore *core = Core::ICore::instance();
- core->editorManager()->openEditor(m_currentNode->path());
- core->editorManager()->ensureEditorManagerVisible();
+ Core::EditorManager *em = Core::EditorManager::instance();
+ em->openEditor(m_currentNode->path());
+ em->ensureEditorManagerVisible();
}
void ProjectExplorerPlugin::removeFile()
@@ -1802,7 +1802,7 @@ void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action)
qWarning() << "Editor Factory not attached to action, can't happen"<<editorFactory;
return;
}
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
em->openEditor(currentNode()->path(), editorFactory->kind());
em->ensureEditorManagerVisible();
}
diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp
index dc6db614996..3329f80788a 100644
--- a/src/plugins/projectexplorer/projecttreewidget.cpp
+++ b/src/plugins/projectexplorer/projecttreewidget.cpp
@@ -291,7 +291,7 @@ void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
{
Node *node = m_model->nodeForIndex(mainIndex);
if (node->nodeType() == FileNodeType) {
- Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
+ Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->openEditor(node->path());
editorManager->ensureEditorManagerVisible();
}
diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp
index 03243abb5ca..0091c82f2d4 100644
--- a/src/plugins/projectexplorer/taskwindow.cpp
+++ b/src/plugins/projectexplorer/taskwindow.cpp
@@ -578,8 +578,8 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
TaskWindowContext::TaskWindowContext(QWidget *widget)
: m_taskList(widget)
{
- Core::ICore *core = Core::ICore::instance();
- m_context << core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
}
QList<int> TaskWindowContext::context() const
diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp
index 12750868c4b..3cab2eaaca5 100644
--- a/src/plugins/qt4projectmanager/profileeditor.cpp
+++ b/src/plugins/qt4projectmanager/profileeditor.cpp
@@ -40,7 +40,6 @@
#include "proeditormodel.h"
#include "procommandmanager.h"
-#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
@@ -62,13 +61,10 @@ using namespace ProjectExplorer;
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
: BaseTextEditorEditable(editor)
{
- Core::ICore *core = Core::ICore::instance();
- m_context << core->uniqueIDManager()->
- uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
- m_context << core->uniqueIDManager()->
- uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
-// m_contexts << core->uniqueIDManager()->
-// uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_context << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
+ m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
+// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
}
TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface()
diff --git a/src/plugins/qt4projectmanager/profileeditorfactory.cpp b/src/plugins/qt4projectmanager/profileeditorfactory.cpp
index b3d32a025e4..21299bb2fea 100644
--- a/src/plugins/qt4projectmanager/profileeditorfactory.cpp
+++ b/src/plugins/qt4projectmanager/profileeditorfactory.cpp
@@ -37,7 +37,6 @@
#include "qt4projectmanagerconstants.h"
#include "profileeditor.h"
-#include <coreplugin/icore.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/texteditoractionhandler.h>
@@ -74,8 +73,7 @@ QString ProFileEditorFactory::kind() const
Core::IFile *ProFileEditorFactory::open(const QString &fileName)
{
- Core::ICore *core = Core::ICore::instance();
- Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp
index 8d44d81df20..4356b0b536e 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp
+++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp
@@ -89,8 +89,8 @@ Qt4Manager::Qt4Manager(Qt4ProjectManagerPlugin *plugin)
m_contextProject(0),
m_languageID(0)
{
- m_languageID = Core::ICore::instance()->uniqueIDManager()->
- uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
+ m_languageID = Core::UniqueIDManager::instance()->
+ uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
}
Qt4Manager::~Qt4Manager()
diff --git a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp
index 9e169648f12..1f776d8df08 100644
--- a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp
+++ b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp
@@ -37,7 +37,6 @@
#include "qtscripteditorconstants.h"
#include "qtscripteditorplugin.h"
-#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QFileInfo>
@@ -67,7 +66,7 @@ QString QtScriptEditorFactory::kind() const
Core::IFile *QtScriptEditorFactory::open(const QString &fileName)
{
- Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
if (!iface) {
qWarning() << "QtScriptEditorFactory::open: openEditor failed for " << fileName;
return 0;
diff --git a/src/plugins/quickopen/basefilefilter.cpp b/src/plugins/quickopen/basefilefilter.cpp
index 147cd5b07d1..8bd10cd4a6b 100644
--- a/src/plugins/quickopen/basefilefilter.cpp
+++ b/src/plugins/quickopen/basefilefilter.cpp
@@ -33,7 +33,6 @@
#include "basefilefilter.h"
-#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QtCore/QDir>
@@ -89,7 +88,7 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry)
void BaseFileFilter::accept(QuickOpen::FilterEntry selection) const
{
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
em->openEditor(selection.internalData.toString());
em->ensureEditorManagerVisible();
}
diff --git a/src/plugins/resourceeditor/resourceeditorfactory.cpp b/src/plugins/resourceeditor/resourceeditorfactory.cpp
index 658a572c394..dcdd691c9fc 100644
--- a/src/plugins/resourceeditor/resourceeditorfactory.cpp
+++ b/src/plugins/resourceeditor/resourceeditorfactory.cpp
@@ -36,7 +36,6 @@
#include "resourceeditorplugin.h"
#include "resourceeditorconstants.h"
-#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -53,7 +52,7 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
m_kind(QLatin1String(C_RESOURCEEDITOR)),
m_plugin(plugin)
{
- m_context += Core::ICore::instance()->uniqueIDManager()
+ m_context += Core::UniqueIDManager::instance()
->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR));
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
iconProvider->registerIconForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
@@ -67,7 +66,7 @@ QString ResourceEditorFactory::kind() const
Core::IFile *ResourceEditorFactory::open(const QString &fileName)
{
- Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
if (!iface) {
qWarning() << "ResourceEditorFactory::open: openEditor failed for " << fileName;
return 0;
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp
index 7e5a7dcd1f8..117ccedfbd7 100644
--- a/src/plugins/resourceeditor/resourceeditorplugin.cpp
+++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp
@@ -129,7 +129,7 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor,
ResourceEditorW * ResourceEditorPlugin::currentEditor() const
{
ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>(
- Core::ICore::instance()->editorManager()->currentEditor());
+ Core::EditorManager::instance()->currentEditor());
QTC_ASSERT(focusEditor, return 0);
return focusEditor;
}
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index 4d10297d9b9..7f6ea476eb2 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -134,7 +134,7 @@ static inline QString debugCodec(const QTextCodec *c)
Core::IEditor* locateEditor(const char *property, const QString &entry)
{
- foreach (Core::IEditor *ed, Core::ICore::instance()->editorManager()->openedEditors())
+ foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors())
if (ed->property(property).toString() == entry)
return ed;
return 0;
@@ -407,7 +407,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
// Actions of the submit editor
QList<int> svncommitcontext;
- svncommitcontext << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
+ svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
@@ -513,7 +513,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname)
// Show in the same editor if diff has been executed before
if (Core::IEditor *editor = locateEditor("originalFileName", files.front())) {
editor->createNew(response.stdOut);
- Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
+ Core::EditorManager::instance()->setCurrentEditor(editor);
return;
}
}
@@ -525,7 +525,7 @@ void SubversionPlugin::svnDiff(const QStringList &files, QString diffname)
SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QString &fileName)
{
- Core::IEditor *editor = Core::ICore::instance()->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
+ Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, /**/);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
@@ -776,7 +776,7 @@ void SubversionPlugin::filelog(const QString &file)
if (Core::IEditor *editor = locateEditor("logFileName", file)) {
editor->createNew(response.stdOut);
- Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
+ Core::EditorManager::instance()->setCurrentEditor(editor);
} else {
const QString title = tr("svn log %1").arg(QFileInfo(file).fileName());
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, file, codec);
@@ -819,7 +819,7 @@ void SubversionPlugin::annotate(const QString &file)
if (Core::IEditor *editor = locateEditor("annotateFileName", file)) {
editor->createNew(response.stdOut);
- Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
+ Core::EditorManager::instance()->setCurrentEditor(editor);
} else {
const QString title = tr("svn annotate %1").arg(QFileInfo(file).fileName());
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, file, codec);
@@ -873,7 +873,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
const QString id = diffArg + source;
if (Core::IEditor *editor = locateEditor("describeChange", id)) {
editor->createNew(response.stdOut);
- Core::ICore::instance()->editorManager()->setCurrentEditor(editor);
+ Core::EditorManager::instance()->setCurrentEditor(editor);
} else {
const QString title = tr("svn describe %1#%2").arg(QFileInfo(source).fileName(), changeNr);
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::DiffOutput, source, codec);
@@ -883,8 +883,8 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr)
void SubversionPlugin::submitCurrentLog()
{
- Core::ICore::instance()->editorManager()->closeEditors(QList<Core::IEditor*>()
- << Core::ICore::instance()->editorManager()->currentEditor());
+ Core::EditorManager::instance()->closeEditors(QList<Core::IEditor*>()
+ << Core::EditorManager::instance()->currentEditor());
}
QString SubversionPlugin::currentFileName() const
@@ -990,8 +990,8 @@ Core::IEditor * SubversionPlugin::showOutputInEditor(const QString& title, const
if (Subversion::Constants::debug)
qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
QString s = title;
- Core::IEditor *ediface = Core::ICore::instance()->editorManager()->newFile(kind, &s, output.toLocal8Bit());
- SubversionEditor *e = qobject_cast<SubversionEditor*>(ediface->widget());
+ Core::IEditor *editor = Core::EditorManager::instance()->newFile(kind, &s, output.toLocal8Bit());
+ SubversionEditor *e = qobject_cast<SubversionEditor*>(editor->widget());
if (!e)
return 0;
s.replace(QLatin1Char(' '), QLatin1Char('_'));
diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp
index e574140d3d8..36295979d1d 100644
--- a/src/plugins/texteditor/basefilefind.cpp
+++ b/src/plugins/texteditor/basefilefind.cpp
@@ -33,6 +33,7 @@
#include "basefilefind.h"
+#include <coreplugin/icore.h>
#include <coreplugin/stylehelper.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -40,7 +41,7 @@
#include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
-#include <QtDebug>
+#include <QtCore/QDebug>
#include <QtCore/QDirIterator>
#include <QtGui/QPushButton>
#include <QtGui/QFileDialog>
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index cae7df6bd7d..0e058ff752e 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -43,7 +43,6 @@
#include "codecselector.h"
#ifndef TEXTEDITOR_STANDALONE
-#include <coreplugin/icore.h>
#include <coreplugin/manhattanstyle.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -132,7 +131,7 @@ ITextEditor *BaseTextEditor::openEditorAt(const QString &fileName,
int column,
const QString &editorKind)
{
- Core::EditorManager *editorManager = Core::ICore::instance()->editorManager();
+ Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory(true);
Core::IEditor *editor = editorManager->openEditor(fileName, editorKind, true);
TextEditor::ITextEditor *texteditor = qobject_cast<TextEditor::ITextEditor *>(editor);
diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp
index c5db6932565..b6ec76b7ddc 100644
--- a/src/plugins/texteditor/basetextmark.cpp
+++ b/src/plugins/texteditor/basetextmark.cpp
@@ -35,7 +35,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
-#include <coreplugin/icore.h>
#include <QtCore/QTimer>
@@ -57,7 +56,7 @@ BaseTextMark::BaseTextMark(const QString &filename, int line)
void BaseTextMark::init()
{
m_init = true;
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
foreach (Core::IEditor *editor, em->openedEditors())
@@ -117,7 +116,7 @@ void BaseTextMark::updateMarker()
void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
{
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
if (!m_init) {
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
m_init = true;
diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp
index 4a76df10766..f4fbe12aa8c 100644
--- a/src/plugins/texteditor/plaintexteditor.cpp
+++ b/src/plugins/texteditor/plaintexteditor.cpp
@@ -36,24 +36,21 @@
#include "texteditorplugin.h"
#include <coreplugin/coreconstants.h>
-#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
using namespace TextEditor;
using namespace TextEditor::Internal;
PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
- :BaseTextEditorEditable(editor)
+ : BaseTextEditorEditable(editor)
{
- Core::ICore *core = Core::ICore::instance();
- m_context << core->uniqueIDManager()->
- uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR);
- m_context << core->uniqueIDManager()->
- uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR);
+ m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
-PlainTextEditor::PlainTextEditor(QWidget *parent) :
- BaseTextEditor(parent)
+PlainTextEditor::PlainTextEditor(QWidget *parent)
+ : BaseTextEditor(parent)
{
setRevisionsVisible(true);
setMarksVisible(true);
diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp
index 7c63855ec7a..8fc40ac703f 100644
--- a/src/plugins/texteditor/plaintexteditorfactory.cpp
+++ b/src/plugins/texteditor/plaintexteditorfactory.cpp
@@ -37,7 +37,6 @@
#include "texteditorplugin.h"
#include "texteditoractionhandler.h"
-#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -67,8 +66,7 @@ QString PlainTextEditorFactory::kind() const
Core::IFile *PlainTextEditorFactory::open(const QString &fileName)
{
- Core::ICore *core = Core::ICore::instance();
- Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp
index 511e1d919e7..5ff46ef1353 100644
--- a/src/plugins/texteditor/texteditoractionhandler.cpp
+++ b/src/plugins/texteditor/texteditoractionhandler.cpp
@@ -89,7 +89,7 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context,
m_moveLineUpAction = 0;
m_moveLineDownAction = 0;
- m_contextId << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(context);
+ m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context);
connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)),
this, SLOT(updateCurrentEditor(Core::IContext *)));
diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp
index 23b96a53217..1e6a47e47d4 100644
--- a/src/plugins/texteditor/texteditorplugin.cpp
+++ b/src/plugins/texteditor/texteditorplugin.cpp
@@ -43,6 +43,7 @@
#include "plaintexteditor.h"
#include "storagesettings.h"
+#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
@@ -166,7 +167,7 @@ void TextEditorPlugin::initializeEditor(TextEditor::PlainTextEditor *editor)
void TextEditorPlugin::invokeCompletion()
{
- Core::IEditor *iface = Core::ICore::instance()->editorManager()->currentEditor();
+ Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
if (editor)
editor->triggerCompletions();
diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp
index edfadc7032a..d7f85a9449d 100644
--- a/src/plugins/vcsbase/basevcseditorfactory.cpp
+++ b/src/plugins/vcsbase/basevcseditorfactory.cpp
@@ -35,7 +35,6 @@
#include "vcsbaseplugin.h"
#include "vcsbaseeditor.h"
-#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
@@ -83,7 +82,7 @@ QString BaseVCSEditorFactory::kind() const
Core::IFile *BaseVCSEditorFactory::open(const QString &fileName)
{
- Core::IEditor *iface = Core::ICore::instance()->editorManager()->openEditor(fileName, kind());
+ Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
return iface ? iface->file() : 0;
}
diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp
index f4610ed6685..616f27794a3 100644
--- a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp
+++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp
@@ -34,7 +34,6 @@
#include "basevcssubmiteditorfactory.h"
#include "vcsbasesubmiteditor.h"
-#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
namespace VCSBase {
@@ -82,8 +81,7 @@ QStringList BaseVCSSubmitEditorFactory::mimeTypes() const
Core::IFile *BaseVCSSubmitEditorFactory::open(const QString &fileName)
{
- Core::ICore *core = Core::ICore::instance();
- if (Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind()))
+ if (Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind()))
return iface->file();
return 0;
}
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp
index 7cf2f2a9a4e..5a4e02dd81e 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.cpp
+++ b/src/plugins/vcsbase/vcsbaseeditor.cpp
@@ -38,7 +38,6 @@
#include "vcsbaseconstants.h"
#include <coreplugin/editormanager/editormanager.h>
-#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/editorconfiguration.h>
@@ -85,10 +84,9 @@ VCSBaseEditorEditable::VCSBaseEditorEditable(VCSBaseEditor *editor,
const VCSBaseEditorParameters *type)
: BaseTextEditorEditable(editor), m_kind(type->kind)
{
- Core::ICore *core = Core::ICore::instance();
- m_context << core->uniqueIDManager()->uniqueIdentifier(QLatin1String(type->context))
- << core->uniqueIDManager()->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
-
+ Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
+ m_context << uidm->uniqueIdentifier(QLatin1String(type->context))
+ << uidm->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
}
QList<int> VCSBaseEditorEditable::context() const
@@ -363,7 +361,7 @@ void VCSBaseEditor::jumpToChangeFromDiff(QTextCursor cursor)
if (!exists)
return;
- Core::EditorManager *em = Core::ICore::instance()->editorManager();
+ Core::EditorManager *em = Core::EditorManager::instance();
Core::IEditor *ed = em->openEditor(fileName);
em->ensureEditorManagerVisible();
if (TextEditor::ITextEditor *editor = qobject_cast<TextEditor::ITextEditor *>(ed))
@@ -409,8 +407,7 @@ static QTextCodec *findFileCodec(const QString &source)
{
typedef QList<Core::IEditor *> EditorList;
- const EditorList editors =
- Core::ICore::instance()->editorManager()->editorsForFileName(source);
+ const EditorList editors = Core::EditorManager::instance()->editorsForFileName(source);
if (!editors.empty()) {
const EditorList::const_iterator ecend = editors.constEnd();
for (EditorList::const_iterator it = editors.constBegin(); it != ecend; ++it)
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 64192d1b6b4..16636aaedb2 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -35,7 +35,6 @@
#include "submiteditorfile.h"
#include <coreplugin/ifile.h>
-#include <coreplugin/icore.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <extensionsystem/pluginmanager.h>
@@ -84,7 +83,7 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor
m_parameters(parameters),
m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q))
{
- m_contexts << Core::ICore::instance()->uniqueIDManager()->uniqueIdentifier(m_parameters->context);
+ m_contexts << Core::UniqueIDManager::instance()->uniqueIdentifier(m_parameters->context);
}
VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters,