From 0ec23fefd1b937249a589c2fdd90f1fd53cf66bf Mon Sep 17 00:00:00 2001
From: kh1 <qt-info@nokia.com>
Date: Wed, 10 Mar 2010 18:39:46 +0100
Subject: [PATCH] Fix split mode after last change for welcome page examples.

We need to append "?view=split"to force the split mode check. Make the
check more readable in viewerForContextMode.
---
 src/plugins/help/helpplugin.cpp                 | 17 ++++++-----------
 .../gettingstartedwelcomepagewidget.cpp         |  2 +-
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 762ae385bae..55dea14b928 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -829,10 +829,12 @@ HelpViewer* HelpPlugin::viewerForContextMode()
             // side by side if possible
             if (IEditor *editor = EditorManager::instance()->currentEditor()) {
                 if (!placeHolder || !placeHolder->isVisible()) {
-                    if (!editor->widget() && editor->widget()->isVisible()
-                        && editor->widget()->width() < 800) {
+                    if (!editor->widget())
+                        break;
+                    if (!editor->widget()->isVisible())
+                        break;
+                    if (editor->widget()->width() < 800)
                         break;
-                    }
                 }
             }
         }   // fall through
@@ -850,8 +852,7 @@ HelpViewer* HelpPlugin::viewerForContextMode()
         RightPaneWidget::instance()->setShown(true);
         viewer = m_helpViewerForSideBar;
     } else {
-        if (!viewer)
-            activateHelpMode();
+        activateHelpMode();
     }
     return viewer;
 }
@@ -1003,12 +1004,6 @@ void HelpPlugin::handleHelpRequest(const QString &address)
     if (m_helpEngine->findFile(address).isValid()) {
         const QUrl url(address);
         if (url.queryItemValue(QLatin1String("view")) == QLatin1String("split")) {
-            using namespace Core::Constants;
-
-            Core::ModeManager *modeManager = Core::ICore::instance()->modeManager();
-            if (modeManager->currentMode() == modeManager->mode(MODE_WELCOME))
-                modeManager->activateMode(MODE_EDIT);
-
             if (HelpViewer* viewer = viewerForContextMode())
                 viewer->setSource(url);
         } else {
diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
index 98233b6ca81..1770203398b 100644
--- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
+++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
@@ -272,7 +272,7 @@ void GettingStartedWelcomePageWidget::slotOpenContextHelpPage(const QString& url
     Help::HelpManager *helpManager
         = ExtensionSystem::PluginManager::instance()->getObject<Help::HelpManager>();
     Q_ASSERT(helpManager);
-    helpManager->handleHelpRequest(url);
+    helpManager->handleHelpRequest(url % QLatin1String("?view=split"));
 }
 
 void GettingStartedWelcomePageWidget::slotNextTip()
-- 
GitLab