summaryrefslogtreecommitdiff
path: root/src/plugins/locator
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-05-31 12:52:53 +0200
committerEike Ziller <eike.ziller@digia.com>2013-06-05 09:43:14 +0200
commit7c8db79817ed436176f6055b5c6f8ccf6df16c4c (patch)
tree28c65055a97c872468055db6e96fb51f70e83f1d /src/plugins/locator
parentf99ce422b475c000e1bbdadf13da232dd54d9cca (diff)
downloadqt-creator-7c8db79817ed436176f6055b5c6f8ccf6df16c4c.tar.gz
Switch less often to edit mode
This change * Removes IMode::type, ModeManager::activateModeType, and IEditor::preferredModeType, and adds IEditor::isDesignModePreferred instead * Adapts the mode switching code in EditorManager to handle multiple windows, for example switching to edit mode should only happen if the editor/view is in the main window. Otherwise the editor window should be raised and focused * Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor * Reverts the EditorManager::ModeSwitch logic to switch mode or make the current editor visible by default, introducing DoNotMakeVisible flag instead * Fixes a few instances where EditorManager::ModeSwitch should have been used One non-trivial problem left: If you open a .ui file and switch to an external editor window, edit mode is activated, because the current editor no longer is a .ui file, which means that the design mode gets deactivated. Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41 Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/locator')
-rw-r--r--src/plugins/locator/basefilefilter.cpp2
-rw-r--r--src/plugins/locator/filesystemfilter.cpp2
-rw-r--r--src/plugins/locator/opendocumentsfilter.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/locator/basefilefilter.cpp b/src/plugins/locator/basefilefilter.cpp
index 14166a5bdf..8cd2a96e40 100644
--- a/src/plugins/locator/basefilefilter.cpp
+++ b/src/plugins/locator/basefilefilter.cpp
@@ -100,7 +100,7 @@ QList<FilterEntry> BaseFileFilter::matchesFor(QFutureInterface<Locator::FilterEn
void BaseFileFilter::accept(Locator::FilterEntry selection) const
{
EditorManager::openEditor(selection.internalData.toString(), Id(),
- EditorManager::ModeSwitch | EditorManager::CanContainLineNumber);
+ EditorManager::CanContainLineNumber);
}
void BaseFileFilter::generateFileNames()
diff --git a/src/plugins/locator/filesystemfilter.cpp b/src/plugins/locator/filesystemfilter.cpp
index 212d494b3d..4e7af5c91b 100644
--- a/src/plugins/locator/filesystemfilter.cpp
+++ b/src/plugins/locator/filesystemfilter.cpp
@@ -115,7 +115,7 @@ void FileSystemFilter::accept(FilterEntry selection) const
return;
}
EditorManager::openEditor(selection.internalData.toString(), Id(),
- EditorManager::ModeSwitch | EditorManager::CanContainLineNumber);
+ EditorManager::CanContainLineNumber);
}
bool FileSystemFilter::openConfigDialog(QWidget *parent, bool &needsRefresh)
diff --git a/src/plugins/locator/opendocumentsfilter.cpp b/src/plugins/locator/opendocumentsfilter.cpp
index f208a65ecf..c626b2de94 100644
--- a/src/plugins/locator/opendocumentsfilter.cpp
+++ b/src/plugins/locator/opendocumentsfilter.cpp
@@ -106,5 +106,5 @@ void OpenDocumentsFilter::refresh(QFutureInterface<void> &future)
void OpenDocumentsFilter::accept(FilterEntry selection) const
{
EditorManager::openEditor(selection.internalData.toString(), Id(),
- EditorManager::ModeSwitch | EditorManager::CanContainLineNumber);
+ EditorManager::CanContainLineNumber);
}