diff options
author | Robert Xu <[email protected]> | 2012-03-31 14:28:06 -0400 |
---|---|---|
committer | Robert Xu <[email protected]> | 2012-03-31 14:28:06 -0400 |
commit | 59dd46ef985a719579132efa6a9aa49bfeeae112 (patch) | |
tree | 93d8c721ff263e67aaf59e364496862872ded8fb /opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff | |
parent | c141f0bc29b6e2eeda5ca08a043d26546a1427f9 (diff) | |
download | tde-packaging-59dd46ef985a719579132efa6a9aa49bfeeae112.tar.gz tde-packaging-59dd46ef985a719579132efa6a9aa49bfeeae112.zip |
better late than never, hm...
Diffstat (limited to 'opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff')
-rw-r--r-- | opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff b/opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff index 0e2922e41..5db880383 100644 --- a/opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff +++ b/opensuse/core/tdelibs/fix-gnome-help-support_legacy.diff @@ -2,12 +2,12 @@ +++ kdoctools/kio_help.cpp @@ -44,7 +44,27 @@ // assemble the local search paths - const QStringList localDoc = KGlobal::dirs()->resourceDirs("html"); + const TQStringList localDoc = KGlobal::dirs()->resourceDirs("html") + KGlobal::dirs()->resourceDirs("html-bundle"); + kdDebug( 7119 ) << "Looking up help for: " << fname << endl; -+ QString _fname = fname; ++ TQString _fname = fname; + -+ QString path; ++ TQString path; + int slash = _fname.findRev ('/'); + if (slash == -1 || slash == 0) { + path = _fname; @@ -17,23 +17,23 @@ + _fname = _fname.right (_fname.length() - slash); + } + - QStringList langs = KGlobal::locale()->languageList(); -+ QStringList::ConstIterator lang; + TQStringList langs = KGlobal::locale()->languageList(); ++ TQStringList::ConstIterator lang; + for (lang = langs.begin(); lang != langs.end(); ++lang) + if ((*lang).left(2) == "en") -+ search.append(QString("/opt/gnome/share/gnome/help/%1/C%2").arg(path).arg(_fname)); ++ search.append(TQString("/opt/gnome/share/gnome/help/%1/C%2").arg(path).arg(_fname)); + else -+ search.append(QString("/opt/gnome/share/gnome/help/%1/%2%3").arg(path).arg(*lang).arg(_fname)); ++ search.append(TQString("/opt/gnome/share/gnome/help/%1/%2%3").arg(path).arg(*lang).arg(_fname)); + langs.append( "en" ); langs.remove( "C" ); @@ -60,7 +80,7 @@ { - QStringList::ConstIterator lang; + TQStringList::ConstIterator lang; for (lang = langs.begin(); lang != langs.end(); ++lang) -- search.append(QString("%1%2/%3").arg(localDoc[id], *lang, fname)); -+ search.append(QString("%1%2/%3").arg(localDoc[id], *lang, path + _fname)); +- search.append(TQString("%1%2/%3").arg(localDoc[id], *lang, fname)); ++ search.append(TQString("%1%2/%3").arg(localDoc[id], *lang, path + _fname)); } // try to locate the file @@ -44,7 +44,7 @@ + + if ( ( *it ).right( 5 ) == ".html" ) + { -+ QString file = (*it).left((*it).findRev('/')) + "/" + path + ".xml"; ++ TQString file = (*it).left((*it).findRev('/')) + "/" + path + ".xml"; + kdDebug( 7119 ) << "Looking for help in: " << file << endl; + info.setFile(file); + if (info.exists() && info.isFile() && info.isReadable()) @@ -65,16 +65,16 @@ @@ -190,12 +219,26 @@ } } else { - QString docbook_file = file.left(file.findRev('/')) + "/index.docbook"; + TQString docbook_file = file.left(file.findRev('/')) + "/index.docbook"; + int last_slash = file.findRev('/'); + if (last_slash != -1 && last_slash != 0) { + int slash2 = file.findRev('/', last_slash -1); + if (slash2 != -1 && slash2 != 0) { + int slash3 = file.findRev('/', slash2 - 1); + if (slash3 != -1) { -+ QString xml_file = file.left(file.findRev('/')) + "/" + file.mid(slash3 + 1, slash2 - (slash3 + 1)) + ".xml"; ++ TQString xml_file = file.left(file.findRev('/')) + "/" + file.mid(slash3 + 1, slash2 - (slash3 + 1)) + ".xml"; + kdDebug( 7119 ) << "xml_file " << xml_file << endl; -+ QFileInfo fi(xml_file); ++ TQFileInfo fi(xml_file); + if (fi.exists()) + docbook_file = xml_file; + } @@ -83,7 +83,7 @@ if (!KStandardDirs::exists(file)) { file = docbook_file; } else { - QFileInfo fi(file); + TQFileInfo fi(file); if (fi.isDir()) { - file = file + "/index.docbook"; + file = docbook_file; @@ -94,8 +94,8 @@ mParsed = transform(file, locate("dtd", "customization/kde-chunk.xsl")); if ( !mParsed.isEmpty() ) { infoMessage( i18n( "Saving to cache" ) ); -- QString cache = file.left( file.length() - 7 ); -+ QString cache; +- TQString cache = file.left( file.length() - 7 ); ++ TQString cache; + if (file.endsWith(".xml")) + cache = file.left( file.length() - strlen ("xml") ); + else @@ -105,22 +105,22 @@ "cache.bz2" ) ); --- kdoctools/xslt.cpp +++ kdoctools/xslt.cpp -@@ -274,10 +274,16 @@ - QString lookForCache( const QString &filename ) +@@ -278,10 +278,16 @@ + TQString lookForCache( const TQString &filename ) { kdDebug() << "lookForCache " << filename << endl; - assert( filename.endsWith( ".docbook" ) ); + assert( filename.endsWith( ".docbook" ) || filename.endsWith( ".xml" ) ); - assert( filename.at( 0 ) == '/' ); + assert( filename.tqat( 0 ) == '/' ); -- QString cache = filename.left( filename.length() - 7 ); -+ QString cache; +- TQString cache = filename.left( filename.length() - 7 ); ++ TQString cache; + + if (filename.endsWith( ".xml" )) + cache = filename.left( filename.length() - strlen ("xml") ); + else + cache = filename.left( filename.length() - strlen ("docbook") ); + - QString output; + TQString output; if ( readCache( filename, cache + "cache.bz2", output) ) return output; |