From 11cc292da6a316fb4f3cee09bc5a15e45fda6b2e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 5 Mar 2014 17:27:48 +0100 Subject: [PATCH] EditorManager: Add NoFlags as 0-option Add NoFlags as 0 option to OpenEditorFlags. Change-Id: I33fca771b6c51442febff8a4bb3c06c844147758 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/editormanager/editormanager.h | 12 +++++++----- .../cppeditor/cppvirtualfunctionproposalitem.cpp | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 1a5a62d58a2..3c5ab171e8a 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -98,6 +98,7 @@ public: static EditorToolBar *createToolBar(QWidget *parent = 0); enum OpenEditorFlag { + NoFlags = 0, DoNotChangeCurrentEditor = 1, IgnoreNavigationHistory = 2, DoNotMakeVisible = 4, @@ -108,9 +109,9 @@ public: static QString splitLineNumber(QString *fileName); static IEditor *openEditor(const QString &fileName, const Id &editorId = Id(), - OpenEditorFlags flags = 0, bool *newEditor = 0); + OpenEditorFlags flags = NoFlags, bool *newEditor = 0); static IEditor *openEditorAt(const QString &fileName, int line, int column = 0, - const Id &editorId = Id(), OpenEditorFlags flags = 0, + const Id &editorId = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0); static IEditor *openEditorWithContents(const Id &editorId, QString *titlePattern = 0, const QByteArray &contents = QByteArray()); @@ -259,11 +260,12 @@ private: static IEditor *placeEditor(Internal::EditorView *view, IEditor *editor); static IEditor *duplicateEditor(IEditor *editor); - static IEditor *activateEditor(Internal::EditorView *view, IEditor *editor, OpenEditorFlags flags = 0); - static void activateEditorForEntry(Internal::EditorView *view, DocumentModel::Entry *entry, OpenEditorFlags flags = 0); + static IEditor *activateEditor(Internal::EditorView *view, IEditor *editor, OpenEditorFlags flags = NoFlags); + static void activateEditorForEntry(Internal::EditorView *view, DocumentModel::Entry *entry, + OpenEditorFlags flags = NoFlags); static void activateView(Internal::EditorView *view); static IEditor *openEditor(Internal::EditorView *view, const QString &fileName, - const Id &id = Id(), OpenEditorFlags flags = 0, bool *newEditor = 0); + const Id &id = Id(), OpenEditorFlags flags = NoFlags, bool *newEditor = 0); static int visibleDocumentsCount(); static void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false); diff --git a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp index a7710484e6d..fe9f72ac92d 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp +++ b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.cpp @@ -44,7 +44,7 @@ void VirtualFunctionProposalItem::apply(TextEditor::BaseTextEditor *, int) const if (!m_link.hasValidTarget()) return; - Core::EditorManager::OpenEditorFlags flags; + Core::EditorManager::OpenEditorFlags flags = Core::EditorManager::NoFlags; if (m_openInSplit) flags |= Core::EditorManager::OpenInOtherSplit; Core::EditorManager::openEditorAt(m_link.targetFileName,