Index: glossary.cpp
===================================================================
--- glossary.cpp	(revision 749893)
+++ glossary.cpp	(working copy)
@@ -26,7 +26,7 @@
 #include <kiconloader.h>
 #include <klocale.h>
 #include <kxmlguiwindow.h>
-#include <k3process.h>
+#include <kprocess.h>
 #include <kstandarddirs.h>
 #include <kstatusbar.h>
 
@@ -73,6 +73,8 @@
         QString m_id;
 };
 
+bool Glossary::m_alreadyWarned = false;
+
 Glossary::Glossary( QWidget *parent ) : K3ListView( parent )
 {
     m_initialized = false;
@@ -147,24 +149,47 @@
 void Glossary::rebuildGlossaryCache()
 {
     KXmlGuiWindow *mainWindow = dynamic_cast<KXmlGuiWindow *>( kapp->activeWindow() );
-    Q_ASSERT( mainWindow );
-    mainWindow->statusBar()->showMessage( i18n( "Rebuilding cache..." ) );
+    if (mainWindow)
+        mainWindow->statusBar()->showMessage( i18n( "Rebuilding cache..." ) );
 
-    K3Process *meinproc = new K3Process;
-    connect( meinproc, SIGNAL( processExited( K3Process * ) ),
-             this, SLOT( meinprocExited( K3Process * ) ) );
-
+    KProcess *meinproc = new KProcess;
+    connect( meinproc, SIGNAL( finished(int,QProcess::ExitStatus) ),
+             this, SLOT( meinprocFinished(int,QProcess::ExitStatus) ) );
+    
     *meinproc << KStandardDirs::locate( "exe", QLatin1String( "meinproc4" ) );
     *meinproc << QLatin1String( "--output" ) << m_cacheFile;
     *meinproc << QLatin1String( "--stylesheet" )
               << KStandardDirs::locate( "data", QLatin1String( "khelpcenter/glossary.xslt" ) );
     *meinproc << m_sourceFile;
 
-    meinproc->start( K3Process::NotifyOnExit );
+    meinproc->start();
+    if (!meinproc->waitForStarted()) {
+        kDebug() << "could not start process" << meinproc->program();
+        if (mainWindow && !m_alreadyWarned) {
+            ; // add warning message box with don't display again option 
+              // http://api.kde.org/4.0-api/kdelibs-apidocs/kdeui/html/classKDialog.html
+            m_alreadyWarned = true;
+        }
+        delete meinproc;
+    }
 }
 
-void Glossary::meinprocExited( K3Process *meinproc )
+void Glossary::meinprocFinished( int exitCode, QProcess::ExitStatus exitStatus )
 {
+    KProcess *meinproc = static_cast<KProcess *>(sender());
+    KXmlGuiWindow *mainWindow = dynamic_cast<KXmlGuiWindow *>( kapp->activeWindow() );
+
+    if (exitStatus != QProcess::NormalExit || exitCode != 0) {
+        kDebug() << "running" << meinproc->program() << "failed with exitCode" << exitCode;
+        kDebug() << "stderr output:" << meinproc->readAllStandardError(); 
+        if (mainWindow && !m_alreadyWarned) {
+            ; // add warning message box with don't display again option 
+              // http://api.kde.org/4.0-api/kdelibs-apidocs/kdeui/html/classKDialog.html
+            m_alreadyWarned = true;
+        }
+        delete meinproc;
+        return; 
+    }        
     delete meinproc;
 
     if ( !QFile::exists( m_cacheFile ) )
@@ -176,9 +201,8 @@
 
     m_status = CacheOk;
 
-    KXmlGuiWindow *mainWindow = dynamic_cast<KXmlGuiWindow *>( kapp->activeWindow() );
-    Q_ASSERT( mainWindow );
-    mainWindow->statusBar()->showMessage( i18n( "Rebuilding cache... done." ), 2000 );
+    if (mainWindow)
+        mainWindow->statusBar()->showMessage( i18n( "Rebuilding cache... done." ), 2000 );
 
     buildGlossaryTree();
 }
Index: glossary.h
===================================================================
--- glossary.h	(revision 749894)
+++ glossary.h	(working copy)
@@ -26,9 +26,8 @@
 #include <QList>
 #include <ksharedconfig.h>
 #include <QHash>
+#include <KProcess>
 
-class K3Process;
-
 class EntryItem;
 
 namespace KHC {
@@ -115,7 +114,7 @@
         void entrySelected( const GlossaryEntry &entry );
         
     private Q_SLOTS:
-        void meinprocExited( K3Process *meinproc );
+        void meinprocFinished(int exitCode, QProcess::ExitStatus exitStatus);
         void treeItemSelected( Q3ListViewItem *item );
 
         protected:
@@ -139,6 +138,7 @@
         QHash<QString, GlossaryEntry*> m_glossEntries;
         QHash<QString, EntryItem*> m_idDict;
         bool m_initialized;
+        static bool m_alreadyWarned;
 };
 
 }
