Commit 1c25f9cd authored by hjk's avatar hjk

EditorManager: Avoid some duplicated code

Change-Id: Ia7c1b1b5eea0ba75010ff667ba05273c62c18491
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent fd2c2df8
......@@ -820,25 +820,19 @@ void EditorManager::addNativeDirActions(QMenu *contextMenu, DocumentModel::Entry
static void setFocusToEditorViewAndUnmaximizePanes(EditorView *view)
{
QWidget *w = 0;
if (view->currentEditor()) {
w = view->currentEditor()->widget()->focusWidget();
if (!w)
w = view->currentEditor()->widget();
} else {
w = view->focusWidget();
if (!w)
w = view;
}
IEditor *editor = view->currentEditor();
QWidget *target = editor ? editor->widget() : view;
QWidget *focus = target->focusWidget();
QWidget *w = focus ? focus : target;
w->setFocus();
ICore::raiseWindow(w);
if (OutputPanePlaceHolder::getCurrent()
&& OutputPanePlaceHolder::getCurrent()->window() == view->window()) {
OutputPanePlaceHolder *holder = OutputPanePlaceHolder::getCurrent();
if (holder && holder->window() == view->window()) {
// unmaximize output pane if necessary
if (OutputPanePlaceHolder::getCurrent()
&& OutputPanePlaceHolder::getCurrent()->isVisible()
&& OutputPanePlaceHolder::getCurrent()->isMaximized())
OutputPanePlaceHolder::getCurrent()->unmaximize();
if (holder->isVisible() && holder->isMaximized())
holder->unmaximize();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment