Fix for finding and indexing KDE documentation [PATCH]

Norman Jordan njordan at shaw.ca
Wed Jul 3 07:11:04 UTC 2002


On Debian systems, the KDE documentation can be installed from a
package. KDevelop has some problems with this setup. When "kdevelop
--setup" is run, kdevelop will detect the KDE documentation on page 6,
but on page 9, it will say that the KDE documentation wasn't found
when you click "Start indexing". Also, on Debian systems, "htsearch"
is installed in "/usr/lib/cgi-bin".

This patch fixes both of the above problems. This patch is for the
"KDE_2_2_BRANCH" branch.
-- 
Norman Jordan <njordan at shaw.ca>
-------------- next part --------------
--- kdevelop-2.1.2/kdevelop/ckdevelop.cpp	Tue Jul  2 21:38:49 2002
+++ kdevelop-2.1.2.old/kdevelop/ckdevelop.cpp	Tue Jul  2 21:05:38 2002
@@ -2654,9 +2654,15 @@
 
 void CKDevelop::slotHelpSearchText(QString text){
   int pos;
+  QString htsearch_path = "";
 
   useGlimpse = CToolClass::searchInstProgram("glimpse");
   useHtDig = CToolClass::searchInstProgram("htsearch");
+  if(!useHtDig) {
+    useHtDig = CToolClass::searchInstProgram("/usr/lib/cgi-bin/htsearch");
+    if(useHtDig)
+      htsearch_path = "/usr/lib/cgi-bin/";
+  }
 
   if (!useGlimpse && !useHtDig)
   {
@@ -2721,7 +2726,7 @@
   }
   if (useHtDig && engine=="htdig" )
   {
-    search_process << "htsearch -c " +
+    search_process << htsearch_path + "htsearch -c " +
                         locate("appdata", "tools/htdig.conf") +
                         " \"format=&matchesperpage=30&words=" +
                         encodeURL(text) +"\" | sed -e '/file:\\/\\/localhost/s//file:\\/\\//g' > " +
--- kdevelop-2.1.2/kdevelop/setup/ckdevinstall.cpp	Tue Jul  2 21:38:50 2002
+++ kdevelop-2.1.2.old/kdevelop/setup/ckdevinstall.cpp	Tue Jul  2 21:05:38 2002
@@ -62,6 +62,8 @@
   m_config->setGroup("Doc_Location");
   QString qtDocuPath = m_config->readEntry("doc_qt", QT_DOCDIR);
   QString kdeDocuPath = m_config->readEntry("doc_kde", KDELIBS_DOCDIR);
+  if(!QFile::exists(kdeDocuPath + "/kdeui/KDialog.html"))
+    kdeDocuPath = KDELIBS_DOCDIR;
   m_pInstallState = new CKDevInstallState( qtDocuPath, kdeDocuPath);
 
   setCaption(i18n("KDevelop Setup"));
--- kdevelop-2.1.2/kdevelop/setup/wizardcreatekdedocpage.cpp	Tue Jul  2 21:38:50 2002
+++ kdevelop-2.1.2.old/kdevelop/setup/wizardcreatekdedocpage.cpp	Tue Jul  2 21:05:38 2002
@@ -65,7 +65,9 @@
 //    kde_dir->mkdir(".kde/share/apps/kdevelop",false);
 //    kde_dir->mkdir(".kde/share/apps/kdevelop/KDE-Documentation",false);
 
-    m_pInstallState->kde = docDir;
+    if(!QFile::exists(m_pInstallState->kde + "/kdeui/KDialog.html")) {
+      m_pInstallState->kde = docDir;
+    }
     pDlg = new CUpdateKDEDocDlg(m_pInstallState->shell_process, docDir, m_pInstallState->qt, wdg, false, "test");
     vl->addWidget(pDlg);
     QObject::connect(pDlg, SIGNAL(newDocIsCreatedNow(const QString&)), SLOT(slotSetKDEDocPath(const QString&)) );
--- kdevelop-2.1.2/kdevelop/setup/wizardtoolscheckpage.cpp	Tue Jul  2 21:38:50 2002
+++ kdevelop-2.1.2.old/kdevelop/setup/wizardtoolscheckpage.cpp	Tue Jul  2 21:05:38 2002
@@ -68,6 +68,9 @@
   m_pInstallState->glimpseindex = CToolClass::searchInstProgram("glimpseindex");
   m_pInstallState->htdig        = CToolClass::searchInstProgram("htdig");
   m_pInstallState->htsearch     = CToolClass::searchInstProgram("htsearch");
+  // Support htsearch in /usr/lib/cgi-bin
+  if(!(m_pInstallState->htsearch))
+    m_pInstallState->htsearch   = CToolClass::searchInstProgram("/usr/lib/cgi-bin/htsearch");
 
   ToolAppList toolList;
 


More information about the KDevelop-devel mailing list