Index: runtime/khelpcenter/toc.cpp
===================================================================
--- runtime/khelpcenter/toc.cpp	(revision 748314)
+++ runtime/khelpcenter/toc.cpp	(working copy)
@@ -23,7 +23,7 @@
 #include "docentry.h"
 
 #include <kiconloader.h>
-#include <k3process.h>
+#include <kprocess.h>
 #include <kstandarddirs.h>
 #include <kdebug.h>
 
@@ -134,26 +134,29 @@
 
 void TOC::buildCache()
 {
-	K3Process *meinproc = new K3Process;
-	connect( meinproc, SIGNAL( processExited( K3Process * ) ),
-	         this, SLOT( meinprocExited( K3Process * ) ) );
+	m_meinproc = new KProcess;
+	connect( m_meinproc, SIGNAL( finished( int, QProcess::ExitStatus) ),
+	         this, SLOT( meinprocExited( int, QProcess::ExitStatus) ) );
 
-	*meinproc << KStandardDirs::locate( "exe", "meinproc4" );
-	*meinproc << "--stylesheet" << KStandardDirs::locate( "data", "khelpcenter/table-of-contents.xslt" );
-	*meinproc << "--output" << m_cacheFile;
-	*meinproc << m_sourceFile;
+	*m_meinproc << KStandardDirs::locate("exe", "meinproc4");
+	*m_meinproc << "--stylesheet" << KStandardDirs::locate( "data", "khelpcenter/table-of-contents.xslt" );
+	*m_meinproc << "--output" << m_cacheFile;
+	*m_meinproc << m_sourceFile;
 
-	meinproc->start( K3Process::NotifyOnExit );
+	m_meinproc->start();
+	m_meinproc->waitForStarted();
 }
 
-void TOC::meinprocExited( K3Process *meinproc )
+void TOC::meinprocExited( int exitCode, QProcess::ExitStatus exitStatus)
 {
-	if ( !meinproc->normalExit() || meinproc->exitStatus() != 0 ) {
-		delete meinproc;
+	if ( exitStatus == QProcess::CrashExit || exitCode != 0 ) {
+		qDebug() << "running" << m_meinproc->program() << "failed with exitCode" << exitCode;
+		qDebug() << "stderr output:" << m_meinProc->readAllStandardError(); 
+		delete m_meinproc;
 		return;
 	}
 
-	delete meinproc;
+	delete m_meinproc;
 
 	QFile f( m_cacheFile );
 	if ( !f.open( QIODevice::ReadWrite ) )
Index: runtime/khelpcenter/toc.h
===================================================================
--- runtime/khelpcenter/toc.h	(revision 748314)
+++ runtime/khelpcenter/toc.h	(working copy)
@@ -26,7 +26,7 @@
 #include <Qt3Support/Q3CheckListItem>
 #include <QObject>
 
-class K3Process;
+#include <KProcess>
 
 namespace KHC {
 
@@ -47,7 +47,7 @@
 
 	private Q_SLOTS:
 		void slotItemSelected( Q3ListViewItem *item );
-		void meinprocExited( K3Process *meinproc );
+		void meinprocExited( int exitCode, QProcess::ExitStatus exitStatus);
 
 	private:
 		enum CacheStatus { NeedRebuild, CacheOk };
@@ -64,6 +64,7 @@
 		QString m_sourceFile;
 
 		NavigatorItem *m_parentItem;
+		KProcess *m_meinproc;
 };
 
 }
