File khelpcenter-fallback-to-kde4-docs.patch of Package khelpcenter5.openSUSE_Leap_42.1_Update
diff --git a/toc.cpp b/toc.cpp
index e293ae8..42653d1 100644
--- a/toc.cpp
+++ b/toc.cpp
@@ -84,7 +84,9 @@ void TOC::build( const QString &file )
{
QFileInfo fileInfo( file );
QString fileName = fileInfo.absoluteFilePath();
- const QStringList resourceDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML");
+ QStringList resourceDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/HTML");
+ QStringList fallbackresourceDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "doc/kde/HTML");
+ resourceDirs.append(fallbackresourceDirs);
QStringList::ConstIterator it = resourceDirs.begin();
QStringList::ConstIterator end = resourceDirs.end();
for ( ; it != end; ++it ) {
diff --git a/view.cpp b/view.cpp
index c419bb0..853129b 100644
--- a/view.cpp
+++ b/view.cpp
@@ -105,6 +105,19 @@ QString View::langLookup( const QString &fname )
}
}
+ // assemble the local KDE4 search paths
+ const QStringList localkde4Doc = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+
+ // look up the different languages
+ for (int id=localkde4Doc.count()-1; id >= 0; --id)
+ {
+ QDir kde4d(QStringLiteral("%1/doc/KDE/HTML/").arg(localkde4Doc[id]));
+
+ foreach(const QString& entry, kde4d.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
+ search.append(kde4d.absoluteFilePath(entry+'/'+fname));
+ }
+ }
+
// try to locate the file
QStringList::Iterator it;
for (it = search.begin(); it != search.end(); ++it)