Ubuntu Pastebin

Paste from me at Thu, 2 Apr 2015 15:54:58 +0000

Download as text
 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
diff --git a/src/ioslaves/help/kio_help.cpp b/src/ioslaves/help/kio_help.cpp
index 5abd4c8..cef0b5b 100644
--- a/src/ioslaves/help/kio_help.cpp
+++ b/src/ioslaves/help/kio_help.cpp
@@ -46,10 +46,17 @@ using namespace KIO;
 
 QString HelpProtocol::langLookup(const QString &fname)
 {
-    QStringList search;
+    QString path;
+    path = langLookupInternal(fname, QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML", QStandardPaths::LocateDirectory));
+    if (path.isEmpty()) {
+        path = langLookupInternal(fname, QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/kde/HTML", QStandardPaths::LocateDirectory));
+    }
+    return path;
+}
 
-    // assemble the local search paths
-    const QStringList localDoc = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML", QStandardPaths::LocateDirectory);
+QString HelpProtocol::langLookupInternal(const QString &fname, const QStringList localDoc)
+{
+    QStringList search;
 
     QStringList langs = QLocale().uiLanguages();
     langs.append("en");
@@ -265,8 +272,9 @@ void HelpProtocol::get(const QUrl &url)
                 // Accessing user data under a different path is possible
                 // when using usb sticks - this may affect unix/mac systems also
                 const QString installPath = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML", QStandardPaths::LocateDirectory).last();
+                const QString installPath2 = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/kde/HTML", QStandardPaths::LocateDirectory).last();
 
-                QString cache = '/' + fi.absolutePath().remove(installPath, Qt::CaseInsensitive).replace('/', '_') + '_' + fi.baseName() + '.';
+                QString cache = '/' + fi.absolutePath().remove(installPath, Qt::CaseInsensitive).remove(installPath2, Qt::CaseInsensitive).replace('/', '_') + '_' + fi.baseName() + '.';
 #else
                 QString cache = file.left(file.length() - 7);
 #endif
Download as text