File bundle-locale-help.diff of Package kdelibs3

--- kdecore/kstandarddirs.cpp	2007/09/03 11:34:54	1.81
+++ kdecore/kstandarddirs.cpp	2007/09/03 12:54:38
@@ -94,8 +94,8 @@
     return s_self;
 }
 
-static const char* const types[] = {"html", "icon", "apps", "sound",
-			      "data", "locale", "services", "mime",
+static const char* const types[] = {"html", "html-bundle", "icon", "apps", "sound",
+			      "data", "locale", "locale-bundle", "services", "mime",
 			      "servicetypes", "config", "exe",
 			      "wallpaper", "lib", "pixmap", "templates",
 			      "module", "qtplugins",
@@ -1023,6 +1023,8 @@
 QString KStandardDirs::kde_default(const char *type) {
     if (!strcmp(type, "data"))
 	return "share/apps/";
+    if (!strcmp(type, "html-bundle"))
+	return "share/doc-bundle/HTML/";
     if (!strcmp(type, "html"))
 	return "share/doc/HTML/";
     if (!strcmp(type, "icon"))
@@ -1035,6 +1037,8 @@
 	return "share/applnk/";
     if (!strcmp(type, "sound"))
 	return "share/sounds/";
+    if (!strcmp(type, "locale-bundle"))
+	return "share/locale-bundle/";
     if (!strcmp(type, "locale"))
 	return "share/locale/";
     if (!strcmp(type, "services"))
--- kdecore/kcatalogue.cpp	2007/09/03 11:52:36	1.1
+++ kdecore/kcatalogue.cpp	2007/09/03 12:08:06
@@ -66,7 +66,11 @@
     .arg( d->language )
     .arg( d->name );
 
-  setFileName( locate( "locale", path ) );
+  QString fileName = locate( "locale", path );
+  if (fileName.isEmpty())
+    fileName = locate( "locale-bundle", path );
+
+  setFileName( fileName );
     
 }
 
--- kdecore/klocale.cpp	2007/09/03 11:32:16	1.21
+++ kdecore/klocale.cpp	2007/09/03 12:09:48
@@ -402,7 +402,11 @@
     .arg( language )
     .arg( catalog.name() );
 
-  return locate( "locale", path );
+  QString fileName = locate( "locale", path );
+  if (fileName.isEmpty())
+    fileName = locate( "locale-bundle", path );
+
+  return fileName;
 }
 
 bool KLocale::setLanguage(const QString & language)
@@ -501,6 +505,9 @@
   // kdDebug() << "isApplicationTranslatedInto: filename " << sFileName << endl;
 
   QString sAbsFileName = locate( "locale", sFileName );
+  if (sAbsFileName.isEmpty())
+    sAbsFileName = locate( "locale-bundle", sFileName );
+
   // kdDebug() << "isApplicationTranslatedInto: absname " << sAbsFileName << endl;
   return ! sAbsFileName.isEmpty();
 }
--- kdoctools/kio_help.cpp	2007/09/03 11:32:40	1.33
+++ kdoctools/kio_help.cpp	2007/09/03 13:01:34
@@ -42,7 +42,7 @@
     QStringList search;
 
     // assemble the local search paths
-    const QStringList localDoc = KGlobal::dirs()->resourceDirs("html");
+    const QStringList localDoc = KGlobal::dirs()->resourceDirs("html") + KGlobal::dirs()->resourceDirs("html-bundle");
 
     kdDebug( 7119 ) << "Looking up help for: " << fname << endl;
     QString _fname = fname;
@@ -59,10 +59,14 @@
     QStringList langs = KGlobal::locale()->languageList();
     QStringList::ConstIterator lang;
     for (lang = langs.begin(); lang != langs.end(); ++lang)
-        if ((*lang).left(2) == "en")
+        if ((*lang).left(2) == "en") {
 	    search.append(QString("/usr/share/gnome/help/%1/C%2").arg(path).arg(_fname));
-        else
+	    search.append(QString("/usr/share/gnome/help-bundle/%1/C%2").arg(path).arg(_fname));
+        }
+        else {
 	    search.append(QString("/usr/share/gnome/help/%1/%2%3").arg(path).arg(*lang).arg(_fname));
+	    search.append(QString("/usr/share/gnome/help-bundle/%1/%2%3").arg(path).arg(*lang).arg(_fname));
+        }
 
     langs.append( "en" );
     langs.remove( "C" );
openSUSE Build Service is sponsored by