diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 0e25ca8d5cd327da6be62df4ac27b411dc74a78c..c62d54dc05de40cb70d54b6883b197794e4de84e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1189,7 +1189,7 @@ void EditorManager::ensureEditorManagerVisible() m_d->m_core->modeManager()->activateMode(Constants::MODE_EDIT); } -IEditor *EditorManager::newFile(const QString &editorKind, +IEditor *EditorManager::openEditorWithContents(const QString &editorKind, QString *titlePattern, const QString &contents) { diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 9243d7e5e6b947590f6267ab339ecbd4d07f48db..ccc54f75f1dfbb3952e8ce37a1bc22a8b2d0fd28 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -113,6 +113,9 @@ public: IEditor *openEditor(const QString &fileName, const QString &editorKind = QString(), OpenEditorFlags flags = 0); + IEditor *openEditorWithContents(const QString &editorKind, + QString *titlePattern = 0, + const QString &contents = QString()); bool openExternalEditor(const QString &fileName, const QString &editorKind); @@ -120,9 +123,6 @@ public: QString getOpenWithEditorKind(const QString &fileName, bool *isExternalEditor = 0) const; void ensureEditorManagerVisible(); - IEditor *newFile(const QString &editorKind, - QString *titlePattern = 0, - const QString &contents = QString()); bool hasEditor(const QString &fileName) const; QList<IEditor *> editorsForFileName(const QString &filename) const; QList<IEditor *> editorsForFile(IFile *file) const; diff --git a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp index 1a4803ca71d6bc84adf4302ac951d22f63c59383..bb2142792f0a1aa908f297f50c73cf98b461fcfa 100644 --- a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp +++ b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp @@ -273,7 +273,7 @@ Core::IEditor *EditorManagerPrototype::openEditor(const QString &fileName, const Core::IEditor *EditorManagerPrototype::newFile(const QString &editorKind, QString titlePattern, const QString &contents) { - return callee()->newFile(editorKind, &titlePattern, contents); + return callee()->openEditorWithContents(editorKind, &titlePattern, contents); } int EditorManagerPrototype::makeEditorWritable(Core::IEditor *editor) diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 36054f796a7b8ff03521142ec6c1f6ac741bb345..1135b7bbfdf6368c8246a06526e90af0f75f980c 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -263,7 +263,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription, ICore::instance()->messageManager()->printToOutputPane(content, true); } else { EditorManager* manager = EditorManager::instance(); - IEditor* editor = manager->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, content); + IEditor* editor = manager->openEditorWithContents(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, content); manager->activateEditor(editor); } } diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index d46efdacef4a33c42f708d8e5f00c7cd87b4d1cb..d347768a28005e785849caef682fcc47d05956df 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -1134,7 +1134,7 @@ Core::IEditor * CVSPlugin::showOutputInEditor(const QString& title, const QStrin if (CVS::Constants::debug) qDebug() << "CVSPlugin::showOutputInEditor" << title << kind << "source=" << source << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; - Core::IEditor *editor = Core::EditorManager::instance()->newFile(kind, &s, output.toLocal8Bit()); + Core::IEditor *editor = Core::EditorManager::instance()->openEditorWithContents(kind, &s, output.toLocal8Bit()); CVSEditor *e = qobject_cast<CVSEditor*>(editor->widget()); if (!e) return 0; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 4c75d60cd87ff288c88367618ae6e0b0fed9bc35..a703b0a54a648c5dce21e09101cc4fdd3aa33162 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -173,7 +173,7 @@ VCSBase::VCSBaseEditor QTC_ASSERT(rc, return 0); } else { // Create new, set wait message, set up with source and codec - outputEditor = m_core->editorManager()->newFile(kind, &title, m_msgWait); + outputEditor = m_core->editorManager()->openEditorWithContents(kind, &title, m_msgWait); outputEditor->file()->setProperty(registerDynamicProperty, dynamicPropertyValue); rc = VCSBase::VCSBaseEditor::getVcsBaseEditor(outputEditor); QTC_ASSERT(rc, return 0); diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index c3a0553ea0bfe0e7cd4804c932102dc692d7a6a9..25469cd1858abe90f9c2dcc65fe83661f3a1d5aa 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -884,7 +884,7 @@ 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 *editor = Core::EditorManager::instance()->newFile(kind, &s, output); + Core::IEditor *editor = Core::EditorManager::instance()->openEditorWithContents(kind, &s, output); PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget()); if (!e) return 0; diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index de74574614a5079befa999cc98630c8008b90d2d..f1aa7344831d75822f1059c3df406322c0f84844 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -979,7 +979,7 @@ 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 *editor = Core::EditorManager::instance()->newFile(kind, &s, output); + Core::IEditor *editor = Core::EditorManager::instance()->openEditorWithContents(kind, &s, output); SubversionEditor *e = qobject_cast<SubversionEditor*>(editor->widget()); if (!e) return 0;