aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cvs/cvsplugin.cpp
diff options
context:
space:
mode:
authordt <[email protected]>2010-09-14 15:15:57 +0200
committerdt <[email protected]>2010-09-14 15:23:11 +0200
commit08ccda586254de7ff4c66ccdb98d9843847080be (patch)
treef5a2f84c816c92f5beeb71712bc4abacc0f93520 /src/plugins/cvs/cvsplugin.cpp
parentf068e1159615ee2e1140008359e998ed95c778fd (diff)
EditorManager: Change openEditor/activateEditor to not do mode switching
Also introduce a indirection, modes have now types, edit and debug have the same type, and editors do have a prefered type of modes instead of a prefered mode. That fixes the bug that if the prefered qml editing mode was set to design, then in switching between qml editors would - in Edit Mode: stay in edit mode - in Debug Mode: switch to debug mode
Diffstat (limited to 'src/plugins/cvs/cvsplugin.cpp')
-rw-r--r--src/plugins/cvs/cvsplugin.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp
index e20b3339efe..c904002cd8e 100644
--- a/src/plugins/cvs/cvsplugin.cpp
+++ b/src/plugins/cvs/cvsplugin.cpp
@@ -557,7 +557,7 @@ void CVSPlugin::cvsDiff(const QString &workingDir, const QStringList &files)
// Show in the same editor if diff has been executed before
if (Core::IEditor *editor = locateEditor("originalFileName", id)) {
editor->createNew(output);
- Core::EditorManager::instance()->activateEditor(editor);
+ Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch);
setDiffBaseDirectory(editor, workingDir);
return;
}
@@ -571,7 +571,8 @@ void CVSPlugin::cvsDiff(const QString &workingDir, const QStringList &files)
CVSSubmitEditor *CVSPlugin::openCVSSubmitEditor(const QString &fileName)
{
- Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::CVSCOMMITEDITOR_ID));
+ Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::CVSCOMMITEDITOR_ID),
+ Core::EditorManager::ModeSwitch);
CVSSubmitEditor *submitEditor = qobject_cast<CVSSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, /**/);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
@@ -819,7 +820,7 @@ void CVSPlugin::filelog(const QString &workingDir,
// the common usage pattern of continuously changing and diffing a file
if (Core::IEditor *editor = locateEditor("logFileName", id)) {
editor->createNew(response.stdOut);
- Core::EditorManager::instance()->activateEditor(editor);
+ Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch);
} else {
const QString title = QString::fromLatin1("cvs log %1").arg(id);
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, source, codec);
@@ -961,7 +962,7 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file,
if (Core::IEditor *editor = locateEditor("annotateFileName", id)) {
editor->createNew(response.stdOut);
VCSBase::VCSBaseEditor::gotoLineOfEditor(editor, lineNumber);
- Core::EditorManager::instance()->activateEditor(editor);
+ Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch);
} else {
const QString title = QString::fromLatin1("cvs annotate %1").arg(id);
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, source, codec);
@@ -1156,7 +1157,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
const QString commitId = entries.front().revisions.front().commitId;
if (Core::IEditor *editor = locateEditor("describeChange", commitId)) {
editor->createNew(output);
- Core::EditorManager::instance()->activateEditor(editor);
+ Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch);
setDiffBaseDirectory(editor, repositoryPath);
} else {
const QString title = QString::fromLatin1("cvs describe %1").arg(commitId);
@@ -1241,7 +1242,7 @@ Core::IEditor * CVSPlugin::showOutputInEditor(const QString& title, const QStrin
if (codec)
e->setCodec(codec);
Core::IEditor *ie = e->editableInterface();
- Core::EditorManager::instance()->activateEditor(ie);
+ Core::EditorManager::instance()->activateEditor(ie, Core::EditorManager::ModeSwitch);
return ie;
}