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 ...@@ -820,25 +820,19 @@ void EditorManager::addNativeDirActions(QMenu *contextMenu, DocumentModel::Entry
static void setFocusToEditorViewAndUnmaximizePanes(EditorView *view) static void setFocusToEditorViewAndUnmaximizePanes(EditorView *view)
{ {
QWidget *w = 0; IEditor *editor = view->currentEditor();
if (view->currentEditor()) { QWidget *target = editor ? editor->widget() : view;
w = view->currentEditor()->widget()->focusWidget(); QWidget *focus = target->focusWidget();
if (!w) QWidget *w = focus ? focus : target;
w = view->currentEditor()->widget();
} else {
w = view->focusWidget();
if (!w)
w = view;
}
w->setFocus(); w->setFocus();
ICore::raiseWindow(w); 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 // unmaximize output pane if necessary
if (OutputPanePlaceHolder::getCurrent() if (holder->isVisible() && holder->isMaximized())
&& OutputPanePlaceHolder::getCurrent()->isVisible() holder->unmaximize();
&& OutputPanePlaceHolder::getCurrent()->isMaximized())
OutputPanePlaceHolder::getCurrent()->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