diff options
Diffstat (limited to 'kdoctools')
-rw-r--r-- | kdoctools/kio_help.cpp | 88 | ||||
-rw-r--r-- | kdoctools/kio_help.h | 16 | ||||
-rw-r--r-- | kdoctools/main.cpp | 2 | ||||
-rw-r--r-- | kdoctools/main_ghelp.cpp | 2 | ||||
-rw-r--r-- | kdoctools/meinproc.cpp | 76 | ||||
-rw-r--r-- | kdoctools/xslt.cpp | 98 | ||||
-rw-r--r-- | kdoctools/xslt.h | 22 |
7 files changed, 152 insertions, 152 deletions
diff --git a/kdoctools/kio_help.cpp b/kdoctools/kio_help.cpp index fc4548090..615b01b7e 100644 --- a/kdoctools/kio_help.cpp +++ b/kdoctools/kio_help.cpp @@ -16,12 +16,12 @@ # include <stdlib.h> #endif -#include <qvaluelist.h> -#include <qfileinfo.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> -#include <qtextcodec.h> +#include <tqvaluelist.h> +#include <tqfileinfo.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqtextcodec.h> #include <kdebug.h> #include <kurl.h> @@ -37,20 +37,20 @@ using namespace KIO; -QString HelpProtocol::langLookup(const QString& fname) +TQString HelpProtocol::langLookup(const TQString& fname) { - QStringList search; + TQStringList search; // assemble the local search paths - const QStringList localDoc = KGlobal::dirs()->resourceDirs("html"); + const TQStringList localDoc = KGlobal::dirs()->resourceDirs("html"); - QStringList langs = KGlobal::locale()->languageList(); + TQStringList langs = KGlobal::locale()->languageList(); langs.append( "en" ); langs.remove( "C" ); // this is kind of compat hack as we install our docs in en/ but the // default language is en_US - for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it) + for (TQStringList::Iterator it = langs.begin(); it != langs.end(); ++it) if ( *it == "en_US" ) *it = "en"; @@ -58,24 +58,24 @@ QString HelpProtocol::langLookup(const QString& fname) int ldCount = localDoc.count(); for (int id=0; id < ldCount; id++) { - 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(TQString("%1%2/%3").arg(localDoc[id], *lang, fname)); } // try to locate the file - QStringList::Iterator it; + TQStringList::Iterator it; for (it = search.begin(); it != search.end(); ++it) { kdDebug( 7119 ) << "Looking for help in: " << *it << endl; - QFileInfo info(*it); + TQFileInfo info(*it); if (info.exists() && info.isFile() && info.isReadable()) return *it; if ( ( *it ).right( 5 ) == ".html" ) { - QString file = (*it).left((*it).findRev('/')) + "/index.docbook"; + TQString file = (*it).left((*it).findRev('/')) + "/index.docbook"; kdDebug( 7119 ) << "Looking for help in: " << file << endl; info.setFile(file); if (info.exists() && info.isFile() && info.isReadable()) @@ -84,16 +84,16 @@ QString HelpProtocol::langLookup(const QString& fname) } - return QString::null; + return TQString::null; } -QString HelpProtocol::lookupFile(const QString &fname, - const QString &query, bool &redirect) +TQString HelpProtocol::lookupFile(const TQString &fname, + const TQString &query, bool &redirect) { redirect = false; - QString path, result; + TQString path, result; path = fname; @@ -114,7 +114,7 @@ QString HelpProtocol::lookupFile(const QString &fname, { unicodeError( i18n("There is no documentation available for %1." ).arg(path) ); finished(); - return QString::null; + return TQString::null; } } else kdDebug( 7119 ) << "result " << result << endl; @@ -123,16 +123,16 @@ QString HelpProtocol::lookupFile(const QString &fname, } -void HelpProtocol::unicodeError( const QString &t ) +void HelpProtocol::unicodeError( const TQString &t ) { - data(fromUnicode( QString( + data(fromUnicode( TQString( "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=%1\"></head>\n" - "%2</html>" ).arg( QTextCodec::codecForLocale()->name() ).arg( t ) ) ); + "%2</html>" ).arg( TQTextCodec::codecForLocale()->name() ).arg( t ) ) ); } HelpProtocol *slave = 0; -HelpProtocol::HelpProtocol( bool ghelp, const QCString &pool, const QCString &app ) +HelpProtocol::HelpProtocol( bool ghelp, const TQCString &pool, const TQCString &app ) : SlaveBase( ghelp ? "ghelp" : "help", pool, app ), mGhelp( ghelp ) { slave = this; @@ -144,7 +144,7 @@ void HelpProtocol::get( const KURL& url ) << " query=" << url.query() << endl; bool redirect; - QString doc; + TQString doc; doc = url.path(); if ( !mGhelp ) { @@ -181,7 +181,7 @@ void HelpProtocol::get( const KURL& url ) kdDebug( 7119 ) << "target " << target.url() << endl; - QString file = target.path(); + TQString file = target.path(); if ( mGhelp ) { if ( file.right( 4 ) != ".xml" ) { @@ -189,11 +189,11 @@ void HelpProtocol::get( const KURL& url ) return; } } else { - QString docbook_file = file.left(file.findRev('/')) + "/index.docbook"; + TQString docbook_file = file.left(file.findRev('/')) + "/index.docbook"; if (!KStandardDirs::exists(file)) { file = docbook_file; } else { - QFileInfo fi(file); + TQFileInfo fi(file); if (fi.isDir()) { file = file + "/index.docbook"; } else { @@ -209,7 +209,7 @@ void HelpProtocol::get( const KURL& url ) infoMessage(i18n("Preparing document")); if ( mGhelp ) { - QString xsl = "customization/kde-nochunk.xsl"; + TQString xsl = "customization/kde-nochunk.xsl"; mParsed = transform(file, locate("dtd", xsl)); kdDebug( 7119 ) << "parsed " << mParsed.length() << endl; @@ -238,7 +238,7 @@ void HelpProtocol::get( const KURL& url ) mParsed = transform(file, locate("dtd", "customization/kde-chunk.xsl")); if ( !mParsed.isEmpty() ) { infoMessage( i18n( "Saving to cache" ) ); - QString cache = file.left( file.length() - 7 ); + TQString cache = file.left( file.length() - 7 ); saveToCache( mParsed, locateLocal( "cache", "kio_help" + cache + "cache.bz2" ) ); @@ -250,7 +250,7 @@ void HelpProtocol::get( const KURL& url ) if (mParsed.isEmpty()) { unicodeError( i18n( "The requested help file could not be parsed:<br>%1" ).arg( file ) ); } else { - QString query = url.query(), anchor; + TQString query = url.query(), anchor; // if we have a query, look if it contains an anchor if (!query.isEmpty()) @@ -259,7 +259,7 @@ void HelpProtocol::get( const KURL& url ) KURL redirURL(url); - redirURL.setQuery(QString::null); + redirURL.setQuery(TQString::null); redirURL.setHTMLRef(anchor); redirection(redirURL); finished(); @@ -274,20 +274,20 @@ void HelpProtocol::get( const KURL& url ) { int index = 0; while ( true ) { - index = mParsed.find( QRegExp( "<a name=" ), index); + index = mParsed.find( TQRegExp( "<a name=" ), index); if ( index == -1 ) { kdDebug( 7119 ) << "no anchor\n"; break; // use whatever is the target, most likely index.html } if ( mParsed.mid( index, 11 + anchor.length() ).lower() == - QString( "<a name=\"%1\">" ).arg( anchor ) ) + TQString( "<a name=\"%1\">" ).arg( anchor ) ) { index = mParsed.findRev( "<FILENAME filename=", index ) + strlen( "<FILENAME filename=\"" ); - QString filename=mParsed.mid( index, 2000 ); + TQString filename=mParsed.mid( index, 2000 ); filename = filename.left( filename.find( '\"' ) ); - QString path = target.path(); + TQString path = target.path(); path = path.left( path.findRev( '/' ) + 1) + filename; kdDebug( 7119 ) << "anchor found in " << path <<endl; target.setPath( path ); @@ -307,9 +307,9 @@ void HelpProtocol::emitFile( const KURL& url ) { infoMessage(i18n("Looking up section")); - QString filename = url.path().mid(url.path().findRev('/') + 1); + TQString filename = url.path().mid(url.path().findRev('/') + 1); - int index = mParsed.find(QString("<FILENAME filename=\"%1\"").arg(filename)); + int index = mParsed.find(TQString("<FILENAME filename=\"%1\"").arg(filename)); if (index == -1) { if ( filename == "index.html" ) { data( fromUnicode( mParsed ) ); @@ -320,11 +320,11 @@ void HelpProtocol::emitFile( const KURL& url ) return; } - QString filedata = splitOut(mParsed, index); + TQString filedata = splitOut(mParsed, index); replaceCharsetHeader( filedata ); data( fromUnicode( filedata ) ); - data( QByteArray() ); + data( TQByteArray() ); } void HelpProtocol::mimetype( const KURL &) @@ -341,7 +341,7 @@ void HelpProtocol::get_file( const KURL& url ) { kdDebug( 7119 ) << "get_file " << url.url() << endl; - QCString _path( QFile::encodeName(url.path())); + TQCString _path( TQFile::encodeName(url.path())); struct stat buff; if ( ::stat( _path.data(), &buff ) == -1 ) { if ( errno == EACCES ) @@ -370,7 +370,7 @@ void HelpProtocol::get_file( const KURL& url ) int processed_size = 0; char buffer[ MAX_IPC_SIZE ]; - QByteArray array; + TQByteArray array; while( 1 ) { @@ -394,7 +394,7 @@ void HelpProtocol::get_file( const KURL& url ) processedSize( processed_size ); } - data( QByteArray() ); + data( TQByteArray() ); close( fd ); diff --git a/kdoctools/kio_help.h b/kdoctools/kio_help.h index f0f34eea0..13c198af1 100644 --- a/kdoctools/kio_help.h +++ b/kdoctools/kio_help.h @@ -10,9 +10,9 @@ #include <unistd.h> -#include <qintdict.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqintdict.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <kio/global.h> @@ -22,7 +22,7 @@ class HelpProtocol : public KIO::SlaveBase { public: - HelpProtocol( bool ghelp, const QCString &pool, const QCString &app); + HelpProtocol( bool ghelp, const TQCString &pool, const TQCString &app); virtual ~HelpProtocol() { } virtual void get( const KURL& url ); @@ -31,15 +31,15 @@ public: private: - QString langLookup(const QString& fname); + TQString langLookup(const TQString& fname); void emitFile( const KURL &url ); void get_file( const KURL& url ); - QString lookupFile(const QString &fname, const QString &query, + TQString lookupFile(const TQString &fname, const TQString &query, bool &redirect); - void unicodeError( const QString &t ); + void unicodeError( const TQString &t ); - QString mParsed; + TQString mParsed; bool mGhelp; }; diff --git a/kdoctools/main.cpp b/kdoctools/main.cpp index 4a08c14d1..8e096d6cf 100644 --- a/kdoctools/main.cpp +++ b/kdoctools/main.cpp @@ -11,7 +11,7 @@ #include <libxslt/xsltInternals.h> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> -#include <qstring.h> +#include <tqstring.h> #include <kstandarddirs.h> #include <kinstance.h> #include <kdebug.h> diff --git a/kdoctools/main_ghelp.cpp b/kdoctools/main_ghelp.cpp index 2170c738b..281b31f17 100644 --- a/kdoctools/main_ghelp.cpp +++ b/kdoctools/main_ghelp.cpp @@ -11,7 +11,7 @@ #include <libxslt/xsltInternals.h> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> -#include <qstring.h> +#include <tqstring.h> #include <kstandarddirs.h> #include <kinstance.h> #include <kdebug.h> diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp index c48706451..dd2e194e6 100644 --- a/kdoctools/meinproc.cpp +++ b/kdoctools/meinproc.cpp @@ -12,30 +12,30 @@ #include <libxslt/xsltInternals.h> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> -#include <qstring.h> +#include <tqstring.h> #include <kstandarddirs.h> #include <kinstance.h> #include <xslt.h> -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> #include <kcmdlineargs.h> #include <klocale.h> #include <kaboutdata.h> #include <stdlib.h> #include <kdebug.h> -#include <qtextcodec.h> -#include <qfileinfo.h> +#include <tqtextcodec.h> +#include <tqfileinfo.h> #include <kprocess.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> extern int xmlLoadExtDtdDefaultValue; class MyPair { public: - QString word; + TQString word; int base;}; -typedef QValueList<MyPair> PairList; +typedef TQValueList<MyPair> PairList; void parseEntry(PairList &list, xmlNodePtr cur, int base) { @@ -51,9 +51,9 @@ void parseEntry(PairList &list, xmlNodePtr cur, int base) while (cur != NULL) { if ( cur->type == XML_TEXT_NODE ) { - QString words = QString::fromUtf8( ( char* )cur->content ); - QStringList wlist = QStringList::split( ' ', words.simplifyWhiteSpace() ); - for ( QStringList::ConstIterator it = wlist.begin(); + TQString words = TQString::fromUtf8( ( char* )cur->content ); + TQStringList wlist = TQStringList::split( ' ', words.simplifyWhiteSpace() ); + for ( TQStringList::ConstIterator it = wlist.begin(); it != wlist.end(); ++it ) { MyPair m; @@ -110,15 +110,15 @@ int main(int argc, char **argv) { } // Need to set SRCDIR before calling fillInstance - QString srcdir; + TQString srcdir; if ( args->isSet( "srcdir" ) ) - srcdir = QDir( QFile::decodeName( args->getOption( "srcdir" ) ) ).absPath(); + srcdir = TQDir( TQFile::decodeName( args->getOption( "srcdir" ) ) ).absPath(); fillInstance(ins,srcdir); LIBXML_TEST_VERSION - QString checkFilename = QFile::decodeName(args->arg( 0 )); - QFileInfo checkFile(checkFilename); + TQString checkFilename = TQFile::decodeName(args->arg( 0 )); + TQFileInfo checkFile(checkFilename); if (!checkFile.exists()) { kdError() << "File '" << checkFilename << "' does not exist." << endl; @@ -141,7 +141,7 @@ int main(int argc, char **argv) { #else char pwd_buffer[PATH_MAX]; #endif - QFileInfo file( QFile::decodeName(args->arg( 0 )) ); + TQFileInfo file( TQFile::decodeName(args->arg( 0 )) ); #if !defined(PATH_MAX) && defined(__GLIBC__) if ( !(pwd_buffer = getcwd( NULL, 0 ) ) ) #else @@ -152,28 +152,28 @@ int main(int argc, char **argv) { return 2; } - QString catalogs; + TQString catalogs; catalogs += locate( "dtd", "customization/catalog" ); catalogs += " "; catalogs += locate( "dtd", "docbook/xml-dtd-4.1.2/docbook.cat" ); - setenv( "SGML_CATALOG_FILES", QFile::encodeName( catalogs ).data(), 1); - QString exe; + setenv( "SGML_CATALOG_FILES", TQFile::encodeName( catalogs ).data(), 1); + TQString exe; #if defined( XMLLINT ) exe = XMLLINT; #endif - if ( (::access( QFile::encodeName( exe ), X_OK )!=0) ) { + if ( (::access( TQFile::encodeName( exe ), X_OK )!=0) ) { exe = KStandardDirs::findExe( "xmllint" ); if (exe.isEmpty()) exe = locate( "exe", "xmllint" ); } - if ( ::access( QFile::encodeName( exe ), X_OK )==0 ) { - chdir( QFile::encodeName( file.dirPath( true ) ) ); - QString cmd = exe; + if ( ::access( TQFile::encodeName( exe ), X_OK )==0 ) { + chdir( TQFile::encodeName( file.dirPath( true ) ) ); + TQString cmd = exe; cmd += " --catalogs --valid --noout "; cmd += KProcess::quote(file.fileName()); cmd += " 2>&1"; - FILE *xmllint = popen( QFile::encodeName( cmd ), "r"); + FILE *xmllint = popen( TQFile::encodeName( cmd ), "r"); char buf[ 512 ]; bool noout = true; unsigned int n; @@ -201,17 +201,17 @@ int main(int argc, char **argv) { xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; - QValueVector<const char *> params; + TQValueVector<const char *> params; if (args->isSet( "output" ) ) { params.append( qstrdup( "outputFile" ) ); - params.append( qstrdup( QFile::decodeName( args->getOption( "output" ) ).latin1() ) ); + params.append( qstrdup( TQFile::decodeName( args->getOption( "output" ) ).latin1() ) ); } { const QCStringList paramList = args->getOptionList( "param" ); QCStringList::ConstIterator it = paramList.begin(); QCStringList::ConstIterator end = paramList.end(); for ( ; it != end; ++it ) { - const QCString tuple = *it; + const TQCString tuple = *it; const int ch = tuple.find( '=' ); if ( ch == -1 ) { kdError() << "Key-Value tuple '" << tuple << "' lacks a '='!" << endl; @@ -224,7 +224,7 @@ int main(int argc, char **argv) { params.append( NULL ); bool index = args->isSet( "htdig" ); - QString tss = args->getOption( "stylesheet" ); + TQString tss = args->getOption( "stylesheet" ); if ( tss.isEmpty() ) tss = "customization/kde-chunk.xsl"; if ( index ) @@ -238,7 +238,7 @@ int main(int argc, char **argv) { if (style_sheet != NULL) { - xmlDocPtr doc = xmlParseFile( QFile::encodeName( args->arg( 0 ) ) ); + xmlDocPtr doc = xmlParseFile( TQFile::encodeName( args->arg( 0 ) ) ); xmlDocPtr res = xsltApplyStylesheet(style_sheet, doc, ¶ms[0]); @@ -268,13 +268,13 @@ int main(int argc, char **argv) { } } else { - QString output = transform(args->arg( 0 ) , tss, params); + TQString output = transform(args->arg( 0 ) , tss, params); if (output.isEmpty()) { fprintf(stderr, "unable to parse %s\n", args->arg( 0 )); return(1); } - QString cache = args->getOption( "cache" ); + TQString cache = args->getOption( "cache" ); if ( !cache.isEmpty() ) { if ( !saveToCache( output, cache ) ) { kdError() << i18n( "Could not write to cache file %1." ).arg( cache ) << endl; @@ -284,19 +284,19 @@ int main(int argc, char **argv) { if (output.find( "<FILENAME " ) == -1 || args->isSet( "stdout" ) || args->isSet("output") ) { - QFile file; + TQFile file; if (args->isSet( "stdout" ) ) { file.open( IO_WriteOnly, stdout ); } else { if (args->isSet( "output" ) ) - file.setName( QFile::decodeName(args->getOption( "output" ))); + file.setName( TQFile::decodeName(args->getOption( "output" ))); else file.setName( "index.html" ); file.open(IO_WriteOnly); } replaceCharsetHeader( output ); - QCString data = output.local8Bit(); + TQCString data = output.local8Bit(); file.writeBlock(data.data(), data.length()); file.close(); } else { @@ -307,15 +307,15 @@ int main(int argc, char **argv) { break; int filename_index = index + strlen("<FILENAME filename=\""); - QString filename = output.mid(filename_index, + TQString filename = output.mid(filename_index, output.find("\"", filename_index) - filename_index); - QString filedata = splitOut(output, index); - QFile file(filename); + TQString filedata = splitOut(output, index); + TQFile file(filename); file.open(IO_WriteOnly); replaceCharsetHeader( filedata ); - QCString data = fromUnicode( filedata ); + TQCString data = fromUnicode( filedata ); file.writeBlock(data.data(), data.length()); file.close(); diff --git a/kdoctools/xslt.cpp b/kdoctools/xslt.cpp index fc1fd4546..216773e7d 100644 --- a/kdoctools/xslt.cpp +++ b/kdoctools/xslt.cpp @@ -7,8 +7,8 @@ #include <libxml/catalog.h> #include <kdebug.h> #include <kstandarddirs.h> -#include <qdir.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqregexp.h> #include <xslt.h> #include <kinstance.h> #include "kio_help.h" @@ -16,7 +16,7 @@ #include <assert.h> #include <kfilterbase.h> #include <kfilterdev.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <stdlib.h> #include <config.h> #include <stdarg.h> @@ -25,7 +25,7 @@ #include <gzip/kgzipfilter.h> #include <bzip2/kbzip2filter.h> #include <klibloader.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> #if !defined( SIMPLE_XSLT ) extern HelpProtocol *slave; @@ -36,21 +36,21 @@ extern HelpProtocol *slave; int writeToQString(void * context, const char * buffer, int len) { - QString *t = (QString*)context; - *t += QString::fromUtf8(buffer, len); + TQString *t = (TQString*)context; + *t += TQString::fromUtf8(buffer, len); return len; } int closeQString(void * context) { - QString *t = (QString*)context; + TQString *t = (TQString*)context; *t += '\n'; return 0; } -QString transform( const QString &pat, const QString& tss, - const QValueVector<const char *> ¶ms ) +TQString transform( const TQString &pat, const TQString& tss, + const TQValueVector<const char *> ¶ms ) { - QString parsed; + TQString parsed; INFO(i18n("Parsing stylesheet")); @@ -76,7 +76,7 @@ QString transform( const QString &pat, const QString& tss, return parsed; INFO(i18n("Applying stylesheet")); - QValueVector<const char *> p = params; + TQValueVector<const char *> p = params; p.append( NULL ); xmlDocPtr res = xsltApplyStylesheet(style_sheet, doc, const_cast<const char **>(&p[0])); xmlFreeDoc(doc); @@ -113,9 +113,9 @@ xmlParserInputPtr meinExternalEntityLoader(const char *URL, const char *ID, if (!qstrcmp(ID, "-//OASIS//DTD XML DocBook V4.1.2//EN")) URL = "docbook/xml-dtd-4.1.2/docbookx.dtd"; - QString file; - if (KStandardDirs::exists( QDir::currentDirPath() + "/" + URL ) ) - file = QDir::currentDirPath() + "/" + URL; + TQString file; + if (KStandardDirs::exists( TQDir::currentDirPath() + "/" + URL ) ) + file = TQDir::currentDirPath() + "/" + URL; else file = locate("dtd", URL); @@ -130,14 +130,14 @@ xmlParserInputPtr meinExternalEntityLoader(const char *URL, const char *ID, } */ -QString splitOut(const QString &parsed, int index) +TQString splitOut(const TQString &parsed, int index) { int start_index = index + 1; while (parsed.at(start_index - 1) != '>') start_index++; int inside = 0; - QString filedata; + TQString filedata; while (true) { int endindex = parsed.find("</FILENAME>", index); @@ -175,12 +175,12 @@ QString splitOut(const QString &parsed, int index) filedata = filedata.left(index) + filedata.mid(endindex); } - // filedata.replace(QRegExp(">"), "\n>"); + // filedata.replace(TQRegExp(">"), "\n>"); return filedata; } -void fillInstance(KInstance &ins, const QString &srcdir) { - QString catalogs; +void fillInstance(KInstance &ins, const TQString &srcdir) { + TQString catalogs; if ( srcdir.isEmpty() ) { catalogs += ins.dirs()->findResource("data", "ksgmltools2/customization/catalog"); @@ -197,9 +197,9 @@ void fillInstance(KInstance &ins, const QString &srcdir) { extern "C" void *init_kbzip2filter(); -static QIODevice *getBZip2device(const QString &fileName ) +static TQIODevice *getBZip2device(const TQString &fileName ) { - QFile * f = new QFile( fileName ); + TQFile * f = new TQFile( fileName ); KLibFactory * factory = static_cast<KLibFactory*>(init_kbzip2filter()); KFilterBase * base = static_cast<KFilterBase*>( factory->create(0, "bzip2" ) ); @@ -211,9 +211,9 @@ static QIODevice *getBZip2device(const QString &fileName ) return 0; } -bool saveToCache( const QString &contents, const QString &filename ) +bool saveToCache( const TQString &contents, const TQString &filename ) { - QIODevice *fd = ::getBZip2device(filename); + TQIODevice *fd = ::getBZip2device(filename); if ( !fd ) return false; @@ -229,8 +229,8 @@ bool saveToCache( const QString &contents, const QString &filename ) return true; } -static bool readCache( const QString &filename, - const QString &cache, QString &output) +static bool readCache( const TQString &filename, + const TQString &cache, TQString &output) { kdDebug( 7119 ) << "verifyCache " << filename << " " << cache << endl; if ( !compareTimeStamps( filename, cache ) ) @@ -239,14 +239,14 @@ static bool readCache( const QString &filename, return false; kdDebug( 7119 ) << "create filter" << endl; - QIODevice *fd = ::getBZip2device(cache); + TQIODevice *fd = ::getBZip2device(cache); if ( !fd ) return false; if (!fd->open(IO_ReadOnly)) { delete fd; - QFile::remove(cache); + TQFile::remove(cache); return false; } @@ -254,7 +254,7 @@ static bool readCache( const QString &filename, char buffer[32000]; int n; - QCString text; + TQCString text; // Also end loop in case of error, when -1 is returned while ( ( n = fd->readBlock(buffer, 31900) ) > 0) { @@ -264,7 +264,7 @@ static bool readCache( const QString &filename, kdDebug( 7119 ) << "read " << text.length() << endl; fd->close(); - output = QString::fromUtf8( text ); + output = TQString::fromUtf8( text ); delete fd; if (n == -1) @@ -275,14 +275,14 @@ static bool readCache( const QString &filename, return true; } -QString lookForCache( const QString &filename ) +TQString lookForCache( const TQString &filename ) { kdDebug() << "lookForCache " << filename << endl; assert( filename.endsWith( ".docbook" ) ); assert( filename.at( 0 ) == '/' ); - QString cache = filename.left( filename.length() - 7 ); - QString output; + TQString cache = filename.left( filename.length() - 7 ); + TQString output; if ( readCache( filename, cache + "cache.bz2", output) ) return output; if ( readCache( filename, @@ -291,35 +291,35 @@ QString lookForCache( const QString &filename ) "cache.bz2" ), output ) ) return output; - return QString::null; + return TQString::null; } -bool compareTimeStamps( const QString &older, const QString &newer ) +bool compareTimeStamps( const TQString &older, const TQString &newer ) { - QFileInfo _older( older ); - QFileInfo _newer( newer ); + TQFileInfo _older( older ); + TQFileInfo _newer( newer ); assert( _older.exists() ); if ( !_newer.exists() ) return false; return ( _newer.lastModified() > _older.lastModified() ); } -QCString fromUnicode( const QString &data ) +TQCString fromUnicode( const TQString &data ) { - QTextCodec *locale = QTextCodec::codecForLocale(); - QCString result; + TQTextCodec *locale = TQTextCodec::codecForLocale(); + TQCString result; char buffer[30000]; uint buffer_len = 0; uint len = 0; uint offset = 0; const int part_len = 5000; - QString part; + TQString part; while ( offset < data.length() ) { part = data.mid( offset, part_len ); - QCString test = locale->fromUnicode( part ); + TQCString test = locale->fromUnicode( part ); if ( locale->toUnicode( test ) == part ) { result += test; offset += part_len; @@ -328,14 +328,14 @@ QCString fromUnicode( const QString &data ) len = part.length(); buffer_len = 0; for ( uint i = 0; i < len; i++ ) { - QCString test = locale->fromUnicode( part.mid( i, 1 ) ); + TQCString test = locale->fromUnicode( part.mid( i, 1 ) ); if ( locale->toUnicode( test ) == part.mid( i, 1 ) ) { if (buffer_len + test.length() + 1 > sizeof(buffer)) break; strcpy( buffer + buffer_len, test.data() ); buffer_len += test.length(); } else { - QString res; + TQString res; res.sprintf( "&#%d;", part.at( i ).unicode() ); test = locale->fromUnicode( res ); if (buffer_len + test.length() + 1 > sizeof(buffer)) @@ -344,16 +344,16 @@ QCString fromUnicode( const QString &data ) buffer_len += test.length(); } } - result += QCString( buffer, buffer_len + 1); + result += TQCString( buffer, buffer_len + 1); offset += part_len; } return result; } -void replaceCharsetHeader( QString &output ) +void replaceCharsetHeader( TQString &output ) { - QString name = QTextCodec::codecForLocale()->name(); - name.replace( QString( "ISO " ), "iso-" ); - output.replace( QString( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" ), - QString( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%1\">" ).arg( name ) ); + TQString name = TQTextCodec::codecForLocale()->name(); + name.replace( TQString( "ISO " ), "iso-" ); + output.replace( TQString( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" ), + TQString( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%1\">" ).arg( name ) ); } diff --git a/kdoctools/xslt.h b/kdoctools/xslt.h index 777c77573..975bd3c88 100644 --- a/kdoctools/xslt.h +++ b/kdoctools/xslt.h @@ -2,23 +2,23 @@ #define _MEIN_XSLT_H_ #include <libxml/parser.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> -QString transform(const QString &file, const QString& stylesheet, - const QValueVector<const char *> ¶ms = QValueVector<const char *>()); -QString splitOut(const QString &parsed, int index); -void fillInstance(KInstance &ins, const QString &srcdir = QString::null ); -bool saveToCache( const QString &contents, const QString &filename ); -QString lookForCache( const QString &filename ); -QCString fromUnicode( const QString &data ); -void replaceCharsetHeader( QString &output ); +TQString transform(const TQString &file, const TQString& stylesheet, + const TQValueVector<const char *> ¶ms = TQValueVector<const char *>()); +TQString splitOut(const TQString &parsed, int index); +void fillInstance(KInstance &ins, const TQString &srcdir = TQString::null ); +bool saveToCache( const TQString &contents, const TQString &filename ); +TQString lookForCache( const TQString &filename ); +TQCString fromUnicode( const TQString &data ); +void replaceCharsetHeader( TQString &output ); extern bool warnings_exist; -extern QString *SRCDIR; +extern TQString *SRCDIR; /** * Compares two files and returns true if @param newer exists and is newer than * @param older **/ -bool compareTimeStamps( const QString &older, const QString &newer ); +bool compareTimeStamps( const TQString &older, const TQString &newer ); #endif |