[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdoctools
From: Ralf Habacker <Ralf.Habacker () freenet ! de>
Date: 2008-02-27 10:21:35
Message-ID: 1204107695.314531.25816.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 779898 by habacker:
- fixed creating and caching of html page on win32
M +19 -0 kio_help.cpp
M +9 -3 xslt.cpp
--- trunk/KDE/kdelibs/kdoctools/kio_help.cpp #779897:779898
@@ -258,9 +258,28 @@
if ( mParsed.isEmpty() ) {
mParsed = transform(file, KStandardDirs::locate("dtd", \
"customization/kde-chunk.xsl")); +#ifdef Q_WS_WIN
+ /*
+ there are several help:/.. entries in the transformed html page
+ refering to the language related doc installation path
+ (based for example on .../html/en)
+ Because the prefered way to transform this isn't known yet,
+ a manual replace workaround is used.
+ */
+ QFileInfo f1(file);
+ QFileInfo f2(f1.absolutePath());
+ QString f3 = f2.absolutePath();
+ mParsed = mParsed.replace("help:", f3);
+#endif
if ( !mParsed.isEmpty() ) {
infoMessage( i18n( "Saving to cache" ) );
+#ifdef Q_WS_WIN
+ QFileInfo fi(file);
+ // don't create subdirectories, remove ':' in path
+ QString cache = '/' + \
fi.absolutePath().replace(':','_').replace('/','_') + '_' + fi.baseName() + '.'; \
+#else QString cache = file.left( file.length() - 7 );
+#endif
saveToCache( mParsed, KStandardDirs::locateLocal( "cache",
"kio_help" + cache \
+
"cache.bz2" ) );
--- trunk/KDE/kdelibs/kdoctools/xslt.cpp #779897:779898
@@ -184,7 +184,10 @@
catalogs += QUrl::fromLocalFile( ins.dirs()->findResource("data", \
"ksgmltools2/customization/catalog.xml") ).toEncoded(); catalogs += ' ';
catalogs += QUrl::fromLocalFile( ins.dirs()->findResource("data", \
"ksgmltools2/docbook/xml-dtd-4.2/catalog.xml") ).toEncoded();
- ins.dirs()->addResourceType("dtd", "data", "ksgmltools2/");
+#ifdef Q_WS_WIN
+ catalogs += ' ';
+ catalogs += ins.dirs()->addResourceType("dtd", "data", "ksgmltools2/");
+#endif
} else {
catalogs += QUrl::fromLocalFile( srcdir +"/customization/catalog.xml" \
).toEncoded(); catalogs += ' ';
@@ -270,14 +273,17 @@
kDebug() << "lookForCache " << filename;
assert( filename.endsWith( ".docbook" ) );
#ifndef Q_WS_WIN
- // this check fails always on win32 : if it is for testing absolute path, \
QFileInfo::isAbsolute() should be used
- // anyway - why should a relative path not be valid
assert( filename.at( 0 ) == '/' );
#endif
QString cache = filename.left( filename.length() - 7 );
QString output;
if ( readCache( filename, cache + "cache.bz2", output) )
return output;
+#ifdef Q_WS_WIN
+ QFileInfo fi(filename);
+ // don't create subdirectories, remove ':' in path
+ cache = '/' + fi.absolutePath().replace(':','_').replace('/','_') + '_' + \
fi.baseName() + '.'; +#endif
if ( readCache( filename,
KStandardDirs::locateLocal( "cache",
"kio_help" + cache +
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic