summaryrefslogtreecommitdiffstats
path: root/opensuse/tdelibs/bundle-locale-help.diff
blob: 8305fad3aba2978fff407ade1a1ea8283e83f410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Index: kdecore/kstandarddirs.cpp
===================================================================
--- kdecore/kstandarddirs.cpp.orig
+++ kdecore/kstandarddirs.cpp
@@ -94,8 +94,8 @@ KStandardDirsSingleton* KStandardDirsSin
     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 @@ static int tokenize( QStringList& tokens
 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 @@ QString KStandardDirs::kde_default(const
 	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"))
Index: kdecore/kcatalogue.cpp
===================================================================
--- kdecore/kcatalogue.cpp.orig
+++ kdecore/kcatalogue.cpp
@@ -66,7 +66,11 @@ KCatalogue::KCatalogue(const QString & n
     .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 );
     
 }
 
Index: kdecore/klocale.cpp
===================================================================
--- kdecore/klocale.cpp.orig
+++ kdecore/klocale.cpp
@@ -402,7 +402,11 @@ QString KLocale::catalogueFileName(const
     .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 @@ bool KLocale::isApplicationTranslatedInt
   // 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();
 }
Index: kdoctools/kio_help.cpp
===================================================================
--- kdoctools/kio_help.cpp.orig
+++ kdoctools/kio_help.cpp
@@ -42,7 +42,7 @@ QString HelpProtocol::langLookup(const Q
     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;
@@ -60,10 +60,14 @@ QString HelpProtocol::langLookup(const Q
     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" );