Bug 50484 - Help not displayed for application when helpcenter already open.
Summary: Help not displayed for application when helpcenter already open.
Status: RESOLVED FIXED
Alias: None
Product: khelpcenter
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Cornelius Schumacher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-09 20:11 UTC by Alan Borgolotto
Modified: 2003-05-01 11:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Borgolotto 2002-11-09 20:11:23 UTC
Version:            (using KDE KDE 3.0.9)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) 
OS:          Linux

Steps to reproduce:

1.  Open HelpCenter.
2.  Access help from any application (HelpCenter will gain focus but it won't change to the help topic for the application -- perhaps it would be much better to open a new instance of HelpCenter).
Comment 1 Lauri Watts 2003-02-18 02:19:55 UTC
Oops, it's not even getting focus anymore (this could well be focus policy setting dependent) 
Comment 2 Frerich Raabe 2003-05-01 11:21:15 UTC
Subject: kdebase/khelpcenter

CVS commit by raabe: 

- Show the proper help page for an application even if khelpcenter is already
  running.
CCMAIL:50484-done@bugs.kde.org


  M +8 -8      application.cpp   1.11
  M +7 -7      mainwindow.cpp   1.34
  M +3 -0      navigatorappitem.cpp   1.12


--- kdebase/khelpcenter/application.cpp  #1.10:1.11
@@ -27,11 +27,5 @@ using namespace KHC;
 Application::Application() : KUniqueApplication()
 {
-        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-
-        KURL url;
-        if ( args->count() )
-                url = args->url( 0 );
-
-        MainWindow *mainWindow = new MainWindow( url );
+        MainWindow *mainWindow = new MainWindow;
         setMainWidget( mainWindow );
         mainWindow->show();
@@ -41,4 +34,11 @@ Application::Application() : KUniqueAppl
 int Application::newInstance()
 {
+        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+        KURL url;
+        if ( args->count() )
+                url = args->url( 0 );
+        static_cast<MainWindow *>( mainWidget() )->slotOpenURL( url.url() );
+
         if ( isRestored() ) {
                 RESTORE( MainWindow );

--- kdebase/khelpcenter/mainwindow.cpp  #1.33:1.34
@@ -128,10 +128,5 @@ MainWindow::MainWindow(const KURL &url)
     History::self().installMenuBarHook( this );
 
-    if ( url.isEmpty() ) {
-      slotShowHome();
-    } else {
-      openURL( url );
-      mNavigator->selectItem( url );
-    }
+    slotOpenURL( url.url() );
 
     statusBarMessage(i18n("Ready"));
@@ -261,5 +256,10 @@ void MainWindow::statusBarMessage(const 
 void MainWindow::slotOpenURL(const QString &url)
 {
+    if ( url.isEmpty() ) {
+      slotShowHome();
+    } else {
     openURL( KURL( url ) );
+      mNavigator->selectItem( url );
+    }
 }
 

--- kdebase/khelpcenter/navigatorappitem.cpp  #1.11:1.12
@@ -73,4 +73,7 @@ void NavigatorAppItem::setOpen(bool open
 void NavigatorAppItem::populate( bool recursive )
 {
+     if ( mPopulated )
+         return;
+
      KServiceGroup::Ptr root = KServiceGroup::group(mRelpath);
      if (!root) {