diff options
author | hjk <[email protected]> | 2008-12-10 16:53:39 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2008-12-10 16:53:39 +0100 |
commit | 6ae2cc0b5b7a8744c8dac498975136c8699673e9 (patch) | |
tree | 00d7291f75b2e6f3b88d478b8f002d5d255a28e0 /src | |
parent | 154121279e1befa507c4077f813af5f9aa11a253 (diff) | |
parent | e9d90710099376d585b73a872be62889b0fd24da (diff) |
Merge branch '0.9.1-beta' of [email protected]:creator/mainline into 0.9.1-beta
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/projectexplorer/projectwindow.cpp | 10 | ||||
-rw-r--r-- | src/plugins/projectexplorer/session.cpp | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index c725c915c9e..e6732387424 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -45,6 +45,7 @@ #include <coreplugin/icore.h> #include <QtCore/QDebug> +#include <QtGui/QApplication> #include <QtGui/QBoxLayout> #include <QtGui/QComboBox> #include <QtGui/QTabWidget> @@ -190,7 +191,14 @@ void ProjectWindow::updateTreeWidget() // That one runs fully thorough and deletes all widgets, even that one that we are currently removing // from m_panelsTabWidget. // To prevent that, we simply prevent the focus switching.... - m_treeWidget->setFocus(); + QWidget *focusWidget = qApp->focusWidget(); + while (focusWidget) { + if (focusWidget == this) { + m_treeWidget->setFocus(); + break; + } + focusWidget = focusWidget->parentWidget(); + } m_treeWidget->clear(); foreach(Project *project, m_session->projects()) { diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index a9bded02c61..89716ce3f68 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -628,8 +628,10 @@ bool SessionManager::loadImpl(const QString &fileName) if (success) { // restore the active mode const QString &modeIdentifier = value(QLatin1String("ActiveMode")).toString(); - if (!modeIdentifier.isEmpty()) + if (!modeIdentifier.isEmpty()) { m_core->modeManager()->activateMode(modeIdentifier); + m_core->modeManager()->setFocusToCurrentMode(); + } } if (debug) |