From 9eccbbee5c575e4d5a952321859af773ad32720a Mon Sep 17 00:00:00 2001 From: con Date: Wed, 9 Mar 2011 11:16:55 +0100 Subject: [PATCH] F1+F1 behavior was broken if there was no context help found. If on F1 no documentation was found, the focus was not set to the side bar, making it impossible to press F1 again to get into help mode. The fix also makes sure that the "blank" page is not set to the help mode in this case, to avoid a big white empty area. --- src/plugins/help/helpplugin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 520ae722553..2b7baca982a 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -655,13 +655,17 @@ void HelpPlugin::activateHelpMode() void HelpPlugin::switchToHelpMode() { - switchToHelpMode(m_helpViewerForSideBar->source()); + QUrl source = m_helpViewerForSideBar->source(); + if (source == QUrl(Help::Constants::AboutBlank)) + source = QUrl(); + switchToHelpMode(source); } void HelpPlugin::switchToHelpMode(const QUrl &source) { activateHelpMode(); - m_centralWidget->setSource(source); + if (!source.isEmpty()) + m_centralWidget->setSource(source); m_centralWidget->setFocus(); } @@ -877,6 +881,7 @@ void HelpPlugin::activateContext() viewer->setHtml(tr("No Documentation" "
%1
No documentation " "available.
").arg(m_idFromContext)); + viewer->setFocus(); // we still want the F1+F1 shortcut behavior } else { int version = 0; const QRegExp exp("(\\d+)");