diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 19:00:37 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 19:00:37 +0000 |
commit | 25794f504692e5a36c490438814e9dfda8aaa2dd (patch) | |
tree | 8061e6d27b5bc9042afdff177872779c4e8c9015 /lib | |
parent | 35ff2a942f63b5201c04f41c3097e61cdd7817e9 (diff) | |
download | kchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.tar.gz kchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.zip |
TQt4 port kchmviewer
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kchmviewer@1234150 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/kio-msits/msits.cpp | 38 | ||||
-rwxr-xr-x | lib/kio-msits/msits.h | 12 | ||||
-rw-r--r-- | lib/libchmfile/bitfiddle.h | 24 | ||||
-rw-r--r-- | lib/libchmfile/libchmfile.cpp | 22 | ||||
-rw-r--r-- | lib/libchmfile/libchmfile.h | 56 | ||||
-rw-r--r-- | lib/libchmfile/libchmfile_search.cpp | 42 | ||||
-rw-r--r-- | lib/libchmfile/libchmfileimpl.cpp | 252 | ||||
-rw-r--r-- | lib/libchmfile/libchmfileimpl.h | 74 | ||||
-rw-r--r-- | lib/libchmfile/libchmtextencoding.h | 2 | ||||
-rw-r--r-- | lib/libchmfile/libchmtocimage.cpp | 2 | ||||
-rw-r--r-- | lib/libchmfile/libchmtocimage.h | 4 | ||||
-rw-r--r-- | lib/libchmfile/libchmurlfactory.h | 34 | ||||
-rw-r--r-- | lib/libchmfile/qt34.cpp | 104 | ||||
-rw-r--r-- | lib/libchmfile/qt34.h | 68 |
14 files changed, 367 insertions, 367 deletions
diff --git a/lib/kio-msits/msits.cpp b/lib/kio-msits/msits.cpp index cf7cf27..bea4d79 100755 --- a/lib/kio-msits/msits.cpp +++ b/lib/kio-msits/msits.cpp @@ -29,9 +29,9 @@ #include <kurl.h> #include <kmimemagic.h> -#include <qfile.h> -#include <qbitarray.h> -#include <qvaluevector.h> +#include <tqfile.h> +#include <tqbitarray.h> +#include <tqvaluevector.h> #include "msits.h" #include "libchmurlfactory.h" @@ -60,7 +60,7 @@ extern "C" } } -ProtocolMSITS::ProtocolMSITS (const QCString &pool_socket, const QCString &app_socket) +ProtocolMSITS::ProtocolMSITS (const TQCString &pool_socket, const TQCString &app_socket) : SlaveBase ("kio_msits", pool_socket, app_socket) { m_chmFile = 0; @@ -76,7 +76,7 @@ ProtocolMSITS::~ProtocolMSITS() } // A simple stat() wrapper -static bool isDirectory ( const QString & filename ) +static bool isDirectory ( const TQString & filename ) { return filename[filename.length() - 1] == '/'; } @@ -84,9 +84,9 @@ static bool isDirectory ( const QString & filename ) void ProtocolMSITS::get( const KURL& url ) { - QString htmdata, fileName; + TQString htmdata, fileName; chmUnitInfo ui; - QByteArray buf; + TQByteArray buf; kdDebug() << "kio_msits::get() " << url.path() << endl; @@ -137,11 +137,11 @@ void ProtocolMSITS::get( const KURL& url ) } -bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath ) +bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, TQString& abspath ) { kdDebug() << "ProtocolMSITS::parseLoadAndLookup (const KURL&) " << url.path() << endl; - int pos = url.path().find ("::"); + int pos = url.path().tqfind ("::"); if ( pos == -1 ) { @@ -149,7 +149,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath ) return false; } - QString filename = url.path().left (pos); + TQString filename = url.path().left (pos); abspath = url.path().mid (pos + 2); // skip :: // Some buggy apps add ms-its:/ to the path as well @@ -173,7 +173,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath ) // First try to open a temporary file chmFile * tmpchm; - if ( (tmpchm = chm_open ( QFile::encodeName (filename))) == 0 ) + if ( (tmpchm = chm_open ( TQFile::encodeName (filename))) == 0 ) { error( KIO::ERR_COULD_NOT_READ, url.prettyURL() ); return false; @@ -193,7 +193,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath ) /* * Shamelessly stolen from a KDE KIO tutorial */ -static void app_entry(UDSEntry& e, unsigned int uds, const QString& str) +static void app_entry(UDSEntry& e, unsigned int uds, const TQString& str) { UDSAtom a; a.m_uds = uds; @@ -212,7 +212,7 @@ static void app_entry(UDSEntry& e, unsigned int uds, const QString& str) // internal function // fills a directory item with its name and size -static void app_dir(UDSEntry& e, const QString & name) +static void app_dir(UDSEntry& e, const TQString & name) { e.clear(); app_entry(e, KIO::UDS_NAME, name); @@ -222,7 +222,7 @@ static void app_dir(UDSEntry& e, const QString & name) // internal function // fills a file item with its name and size -static void app_file(UDSEntry& e, const QString & name, size_t size) +static void app_file(UDSEntry& e, const TQString & name, size_t size) { e.clear(); app_entry(e, KIO::UDS_NAME, name); @@ -232,7 +232,7 @@ static void app_file(UDSEntry& e, const QString & name, size_t size) void ProtocolMSITS::stat (const KURL & url) { - QString fileName; + TQString fileName; chmUnitInfo ui; kdDebug() << "kio_msits::stat (const KURL& url) " << url.path() << endl; @@ -263,14 +263,14 @@ void ProtocolMSITS::stat (const KURL & url) // A local CHMLIB enumerator static int chmlib_enumerator (struct chmFile *, struct chmUnitInfo *ui, void *context) { - ((QValueVector<QString> *) context)->push_back (QString::fromLocal8Bit (ui->path)); + ((TQValueVector<TQString> *) context)->push_back (TQString::fromLocal8Bit (ui->path)); return CHM_ENUMERATOR_CONTINUE; } void ProtocolMSITS::listDir (const KURL & url) { - QString filepath; + TQString filepath; kdDebug() << "kio_msits::listDir (const KURL& url) " << url.path() << endl; @@ -287,7 +287,7 @@ void ProtocolMSITS::listDir (const KURL & url) kdDebug() << "kio_msits::listDir: enumerating directory " << filepath << endl; - QValueVector<QString> listing; + TQValueVector<TQString> listing; if ( chm_enumerate_dir ( m_chmFile, filepath.local8Bit(), @@ -305,7 +305,7 @@ void ProtocolMSITS::listDir (const KURL & url) for ( unsigned int i = 0; i < listing.size(); i++ ) { // Strip the direcroty name - QString ename = listing[i].mid (striplength); + TQString ename = listing[i].mid (striplength); if ( isDirectory ( ename ) ) app_dir(entry, ename); diff --git a/lib/kio-msits/msits.h b/lib/kio-msits/msits.h index 3de7719..abf1a3f 100755 --- a/lib/kio-msits/msits.h +++ b/lib/kio-msits/msits.h @@ -26,8 +26,8 @@ #include <kio/slavebase.h> #include <kurl.h> -#include <qstring.h> -#include <qcstring.h> +#include <tqstring.h> +#include <tqcstring.h> #include "config.h" #include "chm_lib.h" @@ -36,7 +36,7 @@ class ProtocolMSITS : public KIO::SlaveBase { public: - ProtocolMSITS ( const QCString&, const QCString& ); + ProtocolMSITS ( const TQCString&, const TQCString& ); virtual ~ProtocolMSITS(); virtual void get ( const KURL& ); @@ -48,10 +48,10 @@ private: // - parses the URL to get a file name and URL inside the file; // - loads a new CHM file, if needed; // - returns the parsed URL inside the file; - bool parseLoadAndLookup ( const KURL&, QString& abspath ); + bool parseLoadAndLookup ( const KURL&, TQString& abspath ); // Resolve an object inside a CHM file - inline bool ResolveObject (const QString& fileName, chmUnitInfo *ui) + inline bool ResolveObject (const TQString& fileName, chmUnitInfo *ui) { return m_chmFile != NULL && ::chm_resolve_object(m_chmFile, fileName.utf8(), ui) == CHM_RESOLVE_SUCCESS; } @@ -69,7 +69,7 @@ private: } // An opened file name, if presend - QString m_openedFile; + TQString m_openedFile; // a CHM structure file pointer (from chmlib) chmFile * m_chmFile; diff --git a/lib/libchmfile/bitfiddle.h b/lib/libchmfile/bitfiddle.h index cd97b8e..14a4bdc 100644 --- a/lib/libchmfile/bitfiddle.h +++ b/lib/libchmfile/bitfiddle.h @@ -84,7 +84,7 @@ inline u_int64_t sr_int(unsigned char* byte, int* bit, unsigned char s, unsigned char r, size_t& length) { u_int64_t ret; - unsigned char mask; + unsigned char tqmask; int n, n_bits, num_bits, base, count; length = 0; size_t fflen; @@ -105,37 +105,37 @@ inline u_int64_t sr_int(unsigned char* byte, int* bit, switch(num_bits){ case 0: - mask = 1; + tqmask = 1; break; case 1: - mask = 3; + tqmask = 3; break; case 2: - mask = 7; + tqmask = 7; break; case 3: - mask = 0xf; + tqmask = 0xf; break; case 4: - mask = 0x1f; + tqmask = 0x1f; break; case 5: - mask = 0x3f; + tqmask = 0x3f; break; case 6: - mask = 0x7f; + tqmask = 0x7f; break; case 7: - mask = 0xff; + tqmask = 0xff; break; default: - mask = 0xff; + tqmask = 0xff; break; } - mask <<= base; + tqmask <<= base; ret = (ret << (num_bits+1)) | - (u_int64_t)((*byte & mask) >> base); + (u_int64_t)((*byte & tqmask) >> base); if( n > *bit ){ ++byte; diff --git a/lib/libchmfile/libchmfile.cpp b/lib/libchmfile/libchmfile.cpp index 7d13aaa..e88e37c 100644 --- a/lib/libchmfile/libchmfile.cpp +++ b/lib/libchmfile/libchmfile.cpp @@ -33,7 +33,7 @@ LCHMFile::~ LCHMFile( ) delete m_impl; } -bool LCHMFile::loadFile( const QString & archiveName ) +bool LCHMFile::loadFile( const TQString & archiveName ) { return m_impl->loadFile( archiveName ); } @@ -43,14 +43,14 @@ void LCHMFile::closeAll( ) m_impl->closeAll(); } -QString LCHMFile::title( ) const +TQString LCHMFile::title( ) const { return m_impl->title(); } -QString LCHMFile::homeUrl( ) const +TQString LCHMFile::homeUrl( ) const { - QString url = m_impl->homeUrl(); + TQString url = m_impl->homeUrl(); return url.isNull() ? "/" : url; } @@ -79,27 +79,27 @@ bool LCHMFile::parseIndex( QT34VECTOR< LCHMParsedEntry > * indexes ) const return m_impl->parseFileAndFillArray( m_impl->m_indexFile, indexes, true ); } -bool LCHMFile::getFileContentAsString( QString * str, const QString & url ) +bool LCHMFile::getFileContentAsString( TQString * str, const TQString & url ) { return m_impl->getFileContentAsString( str, url ); } -bool LCHMFile::getFileContentAsBinary( QByteArray * data, const QString & url ) +bool LCHMFile::getFileContentAsBinary( TQByteArray * data, const TQString & url ) { return m_impl->getFileContentAsBinary( data, url ); } -bool LCHMFile::enumerateFiles( QStringList * files ) +bool LCHMFile::enumerateFiles( TQStringList * files ) { return m_impl->enumerateFiles( files ); } -QString LCHMFile::getTopicByUrl( const QString & url ) +TQString LCHMFile::getTopicByUrl( const TQString & url ) { return m_impl->getTopicByUrl( url ); } -const QPixmap * LCHMFile::getBookIconPixmap( unsigned int imagenum ) +const TQPixmap * LCHMFile::getBookIconPixmap( unsigned int imagenum ) { return m_impl->getBookIconPixmap( imagenum ); } @@ -114,12 +114,12 @@ bool LCHMFile::setCurrentEncoding( const LCHMTextEncoding * encoding ) return m_impl->setCurrentEncoding( encoding ); } -QString LCHMFile::normalizeUrl( const QString & url ) const +TQString LCHMFile::normalizeUrl( const TQString & url ) const { return m_impl->normalizeUrl( url ); } -bool LCHMFile::getFileSize(unsigned int * size, const QString & url) +bool LCHMFile::getFileSize(unsigned int * size, const TQString & url) { return m_impl->getFileSize( size, url ); } diff --git a/lib/libchmfile/libchmfile.h b/lib/libchmfile/libchmfile.h index ab129b5..f94de0b 100644 --- a/lib/libchmfile/libchmfile.h +++ b/lib/libchmfile/libchmfile.h @@ -22,22 +22,22 @@ #ifndef INCLUDE_LIBCHMFILE_H #define INCLUDE_LIBCHMFILE_H -#include <qstring.h> -#include <qcstring.h> -#include <qlistview.h> -#include <qlistbox.h> -#include <qmap.h> -#include <qvaluevector.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqlistview.h> +#include <tqlistbox.h> +#include <tqmap.h> +#include <tqvaluevector.h> +#include <tqtextcodec.h> #include "libchmtextencoding.h" -// Qt3/Qt4 compatibility: in Qt3 QVector stores pointers, not values - so QValueVector should be used. -// In Qt4 QVector stores values, so we can use QVector -#if defined (USE_QT_4) - #define QT34VECTOR QVector +// TQt3/TQt4 compatibility: in TQt3 TQVector stores pointers, not values - so TQValueVector should be used. +// In TQt4 TQVector stores values, so we can use TQVector +#if defined (USE_TQT_4) + #define QT34VECTOR TQVector #else - #define QT34VECTOR QValueVector + #define QT34VECTOR TQValueVector #endif @@ -56,10 +56,10 @@ namespace LCHMBookIcons typedef struct { //! Entry name - QString name; + TQString name; //! Entry URLs. The TOC entry should have only one URL; the index entry could have several. - QStringList urls; + TQStringList urls; //! Associated image number. Used for TOC only; indexes does not have the image. //! Use LCHMFile::getBookIconPixmap() to get associated pixmap icon @@ -91,7 +91,7 @@ class LCHMFile * this one are present locally (like MSDN). * \ingroup init */ - bool loadFile( const QString& archiveName ); + bool loadFile( const TQString& archiveName ); /*! * \brief Closes all the files, and frees the appropriate data. @@ -104,7 +104,7 @@ class LCHMFile * \return The name of the opened document, or an empty string if no .chm has been loaded. * \ingroup information */ - QString title() const; + TQString title() const; /*! * \brief Gets the URL of the default page in the chm archive. @@ -113,7 +113,7 @@ class LCHMFile * returns "/". * \ingroup information */ - QString homeUrl() const; + TQString homeUrl() const; /*! * \brief Checks whether the Table of Contents is present in this file. @@ -161,7 +161,7 @@ class LCHMFile bool parseIndex( QT34VECTOR< LCHMParsedEntry > * indexes ) const; /*! - * \brief Retrieves the content from url in current chm file to QString. + * \brief Retrieves the content from url in current chm file to TQString. * \param str A string where the retreived content should be stored. * \param url An URL in chm file to retreive content from. Must be absolute. * \return true if the content is successfully received; false otherwise. @@ -173,10 +173,10 @@ class LCHMFile * \sa setCurrentEncoding() currentEncoding() getFileContentAsBinary() * \ingroup dataretrieve */ - bool getFileContentAsString( QString * str, const QString& url ); + bool getFileContentAsString( TQString * str, const TQString& url ); /*! - * \brief Retrieves the content from url in current chm file to QByteArray. + * \brief Retrieves the content from url in current chm file to TQByteArray. * \param data A data array where the retreived content should be stored. * \param url An URL in chm file to retreive content from. Must be absolute. * \return true if the content is successfully received; false otherwise. @@ -187,7 +187,7 @@ class LCHMFile * \sa getFileContentAsString() * \ingroup dataretrieve */ - bool getFileContentAsBinary( QByteArray * data, const QString& url ); + bool getFileContentAsBinary( TQByteArray * data, const TQString& url ); /*! * \brief Retrieves the content size. @@ -197,7 +197,7 @@ class LCHMFile * * \ingroup dataretrieve */ - bool getFileSize( unsigned int * size, const QString& url ); + bool getFileSize( unsigned int * size, const TQString& url ); /*! * \brief Obtains the list of all the files in current chm file archive. @@ -206,16 +206,16 @@ class LCHMFile * * \ingroup dataretrieve */ - bool enumerateFiles( QStringList * files ); + bool enumerateFiles( TQStringList * files ); /*! * \brief Gets the Title of the HTML page referenced by url. * \param url An URL in chm file to get title from. Must be absolute. - * \return The title, or QString::null if the URL cannot be found or not a HTML page. + * \return The title, or TQString() if the URL cannot be found or not a HTML page. * * \ingroup dataretrieve */ - QString getTopicByUrl ( const QString& url ); + TQString getTopicByUrl ( const TQString& url ); /*! * \brief Gets the appropriate CHM pixmap icon. @@ -224,7 +224,7 @@ class LCHMFile * * \ingroup dataretrieve */ - const QPixmap * getBookIconPixmap( unsigned int imagenum ); + const TQPixmap * getBookIconPixmap( unsigned int imagenum ); /*! * \brief Normalizes the URL, converting relatives, adding "/" in front and removing .. @@ -233,7 +233,7 @@ class LCHMFile * * \ingroup dataretrieve */ - QString normalizeUrl( const QString& url ) const; + TQString normalizeUrl( const TQString& url ) const; /*! * \brief Gets the current CHM archive encoding (set or autodetected) @@ -270,7 +270,7 @@ class LCHMFile * If there is no prefix, the word considered as required. * \ingroup search */ - bool searchQuery ( const QString& query, QStringList * results, unsigned int limit = 100 ); + bool searchQuery ( const TQString& query, TQStringList * results, unsigned int limit = 100 ); //! Access to implementation LCHMFileImpl * impl() { return m_impl; } diff --git a/lib/libchmfile/libchmfile_search.cpp b/lib/libchmfile/libchmfile_search.cpp index 41acfb3..3820879 100644 --- a/lib/libchmfile/libchmfile_search.cpp +++ b/lib/libchmfile/libchmfile_search.cpp @@ -19,7 +19,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qregexp.h> +#include <tqregexp.h> #include "libchmfile.h" #include "libchmfileimpl.h" @@ -28,20 +28,20 @@ #define DEBUG_SEARCH(A) -static inline void validateWord ( QString & word, bool & query_valid ) +static inline void validateWord ( TQString & word, bool & query_valid ) { - QRegExp rxvalid ("[^\\d\\w_\\.]+"); + TQRegExp rxvalid ("[^\\d\\w_\\.]+"); - QString orig = word; + TQString orig = word; word.remove ( rxvalid ); if ( word != orig ) query_valid = false; } -static inline void validateWords ( QStringList & wordlist, bool & query_valid ) +static inline void validateWords ( TQStringList & wordlist, bool & query_valid ) { - QRegExp rxvalid ("[^\\d\\w_\\.]+"); + TQRegExp rxvalid ("[^\\d\\w_\\.]+"); for ( unsigned int i = 0; i < wordlist.size(); i++ ) validateWord ( wordlist[i], query_valid ); @@ -116,7 +116,7 @@ static inline void findNextWords ( QT34VECTOR<u_int64_t> & src, const QT34VECTOR } -inline bool searchPhrase( LCHMFileImpl * impl, const QStringList & phrase, LCHMSearchProgressResults & results ) +inline bool searchPhrase( LCHMFileImpl * impl, const TQStringList & phrase, LCHMSearchProgressResults & results ) { // Accumulate the phrase data here. LCHMSearchProgressResults phrasekeeper; @@ -173,11 +173,11 @@ inline bool searchPhrase( LCHMFileImpl * impl, const QStringList & phrase, LCHMS -bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults, unsigned int limit ) +bool LCHMFile::searchQuery( const TQString& inquery, TQStringList * searchresults, unsigned int limit ) { - QStringList words_must_exist, words_must_not_exist, words_highlight; - QT34VECTOR<QStringList> phrases_must_exist; - QString query = inquery; + TQStringList words_must_exist, words_must_not_exist, words_highlight; + QT34VECTOR<TQStringList> phrases_must_exist; + TQString query = inquery; bool query_valid = true; LCHMSearchProgressResults results; int pos; @@ -196,15 +196,15 @@ bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults, * If there is no prefix, the word considered as required. */ - QRegExp rxphrase( "\"(.*)\"" ); - QRegExp rxword( "([^\\s]+)" ); + TQRegExp rxphrase( "\"(.*)\"" ); + TQRegExp rxword( "([^\\s]+)" ); rxphrase.setMinimal( TRUE ); // First, get the phrase queries while ( (pos = rxphrase.search (query, 0)) != -1 ) { // A phrase query found. Locate its boundaries, and parse it. - QStringList plist = QStringList::split ( QRegExp ("\\s+"), rxphrase.cap ( 1 )); + TQStringList plist = TQStringList::split ( TQRegExp ("\\s+"), rxphrase.cap ( 1 )); validateWords ( plist, query_valid ); @@ -218,8 +218,8 @@ bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults, while ( (pos = rxword.search (query, 0)) != -1 ) { // A phrase query found. Locate its boundaries, and parse it. - QString word = rxword.cap ( 1 ); - QChar type = '+'; + TQString word = rxword.cap ( 1 ); + TQChar type = '+'; if ( word[0] == '-' || word[0] == '+' ) { @@ -237,17 +237,17 @@ bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults, query.remove (pos, rxword.matchedLength()); } -#if defined (DUMP_SEARCH_QUERY) +#if defined (DUMP_SEARCH_TQUERY) // Dump the search query - QString qdump; + TQString qdump; for ( i = 0; i < phrases_must_exist.size(); i++ ) - qdump += QString(" \"") + phrases_must_exist[i].join (" ") + QString ("\""); + qdump += TQString(" \"") + phrases_must_exist[i].join (" ") + TQString ("\""); for ( i = 0; i < words_must_not_exist.size(); i++ ) - qdump += QString (" -") + words_must_not_exist[i]; + qdump += TQString (" -") + words_must_not_exist[i]; for ( i = 0; i < words_must_exist.size(); i++ ) - qdump += QString (" +") + words_must_exist[i]; + qdump += TQString (" +") + words_must_exist[i]; qDebug ("Search query dump: %s", qdump.ascii()); #endif diff --git a/lib/libchmfile/libchmfileimpl.cpp b/lib/libchmfile/libchmfileimpl.cpp index 6f1e052..71907c5 100644 --- a/lib/libchmfile/libchmfileimpl.cpp +++ b/lib/libchmfile/libchmfileimpl.cpp @@ -22,9 +22,9 @@ #include <sys/types.h> -#include <qcursor.h> -#include <qfile.h> -#include <qapplication.h> +#include <tqcursor.h> +#include <tqfile.h> +#include <tqapplication.h> #include "config.h" #include "chm_lib.h" @@ -46,15 +46,15 @@ class KCHMShowWaitCursor { public: - KCHMShowWaitCursor () { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); } - ~KCHMShowWaitCursor () { QApplication::restoreOverrideCursor(); } + KCHMShowWaitCursor () { TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); } + ~KCHMShowWaitCursor () { TQApplication::restoreOverrideCursor(); } }; LCHMFileImpl::LCHMFileImpl( ) { m_chmFile = NULL; - m_home = m_filename = m_home = m_topicsFile = m_indexFile = m_font = QString::null; + m_home = m_filename = m_home = m_topicsFile = m_indexFile = m_font = TQString(); m_entityDecodeMap.clear(); m_textCodec = 0; m_textCodecForSpecialFiles = 0; @@ -69,9 +69,9 @@ LCHMFileImpl::~ LCHMFileImpl( ) } -bool LCHMFileImpl::loadFile( const QString & archiveName ) +bool LCHMFileImpl::loadFile( const TQString & archiveName ) { - QString filename; + TQString filename; // If the file has a file:// prefix, remove it if ( archiveName.startsWith( "file://" ) ) @@ -82,7 +82,7 @@ bool LCHMFileImpl::loadFile( const QString & archiveName ) if( m_chmFile ) closeAll(); - m_chmFile = chm_open( QFile::encodeName(filename) ); + m_chmFile = chm_open( TQFile::encodeName(filename) ); if ( m_chmFile == NULL ) return false; @@ -129,7 +129,7 @@ void LCHMFileImpl::closeAll( ) chm_close( m_chmFile ); m_chmFile = NULL; - m_home = m_filename = m_home = m_topicsFile = m_indexFile = m_font = QString::null; + m_home = m_filename = m_home = m_topicsFile = m_indexFile = m_font = TQString(); m_entityDecodeMap.clear(); m_textCodec = 0; m_textCodecForSpecialFiles = 0; @@ -138,7 +138,7 @@ void LCHMFileImpl::closeAll( ) } -QString LCHMFileImpl::decodeEntity( const QString & entity ) +TQString LCHMFileImpl::decodeEntity( const TQString & entity ) { // Set up m_entityDecodeMap characters according to current textCodec if ( m_entityDecodeMap.isEmpty() ) @@ -247,49 +247,49 @@ QString LCHMFileImpl::decodeEntity( const QString & entity ) m_entityDecodeMap["reg"] = encodeWithCurrentCodec ("\256"); // registered sign m_entityDecodeMap["nbsp"] = encodeWithCurrentCodec ("\240"); // non breaking space - m_entityDecodeMap["fnof"] = QChar((unsigned short) 402); + m_entityDecodeMap["fnof"] = TQChar((unsigned short) 402); - m_entityDecodeMap["Delta"] = QChar((unsigned short) 916); - m_entityDecodeMap["Pi"] = QChar((unsigned short) 928); - m_entityDecodeMap["Sigma"] = QChar((unsigned short) 931); + m_entityDecodeMap["Delta"] = TQChar((unsigned short) 916); + m_entityDecodeMap["Pi"] = TQChar((unsigned short) 928); + m_entityDecodeMap["Sigma"] = TQChar((unsigned short) 931); - m_entityDecodeMap["beta"] = QChar((unsigned short) 946); - m_entityDecodeMap["gamma"] = QChar((unsigned short) 947); - m_entityDecodeMap["delta"] = QChar((unsigned short) 948); - m_entityDecodeMap["eta"] = QChar((unsigned short) 951); - m_entityDecodeMap["theta"] = QChar((unsigned short) 952); - m_entityDecodeMap["lambda"] = QChar((unsigned short) 955); - m_entityDecodeMap["mu"] = QChar((unsigned short) 956); - m_entityDecodeMap["nu"] = QChar((unsigned short) 957); - m_entityDecodeMap["pi"] = QChar((unsigned short) 960); - m_entityDecodeMap["rho"] = QChar((unsigned short) 961); + m_entityDecodeMap["beta"] = TQChar((unsigned short) 946); + m_entityDecodeMap["gamma"] = TQChar((unsigned short) 947); + m_entityDecodeMap["delta"] = TQChar((unsigned short) 948); + m_entityDecodeMap["eta"] = TQChar((unsigned short) 951); + m_entityDecodeMap["theta"] = TQChar((unsigned short) 952); + m_entityDecodeMap["lambda"] = TQChar((unsigned short) 955); + m_entityDecodeMap["mu"] = TQChar((unsigned short) 956); + m_entityDecodeMap["nu"] = TQChar((unsigned short) 957); + m_entityDecodeMap["pi"] = TQChar((unsigned short) 960); + m_entityDecodeMap["rho"] = TQChar((unsigned short) 961); - m_entityDecodeMap["lsquo"] = QChar((unsigned short) 8216); - m_entityDecodeMap["rsquo"] = QChar((unsigned short) 8217); - m_entityDecodeMap["rdquo"] = QChar((unsigned short) 8221); - m_entityDecodeMap["bdquo"] = QChar((unsigned short) 8222); - m_entityDecodeMap["trade"] = QChar((unsigned short) 8482); - m_entityDecodeMap["ldquo"] = QChar((unsigned short) 8220); - m_entityDecodeMap["ndash"] = QChar((unsigned short) 8211); - m_entityDecodeMap["mdash"] = QChar((unsigned short) 8212); - m_entityDecodeMap["bull"] = QChar((unsigned short) 8226); - m_entityDecodeMap["hellip"] = QChar((unsigned short) 8230); - m_entityDecodeMap["emsp"] = QChar((unsigned short) 8195); - m_entityDecodeMap["rarr"] = QChar((unsigned short) 8594); - m_entityDecodeMap["rArr"] = QChar((unsigned short) 8658); - m_entityDecodeMap["crarr"] = QChar((unsigned short) 8629); - m_entityDecodeMap["le"] = QChar((unsigned short) 8804); - m_entityDecodeMap["ge"] = QChar((unsigned short) 8805); - m_entityDecodeMap["lte"] = QChar((unsigned short) 8804); // wrong, but used somewhere - m_entityDecodeMap["gte"] = QChar((unsigned short) 8805); // wrong, but used somewhere - m_entityDecodeMap["dagger"] = QChar((unsigned short) 8224); - m_entityDecodeMap["Dagger"] = QChar((unsigned short) 8225); - m_entityDecodeMap["euro"] = QChar((unsigned short) 8364); - m_entityDecodeMap["asymp"] = QChar((unsigned short) 8776); - m_entityDecodeMap["isin"] = QChar((unsigned short) 8712); - m_entityDecodeMap["notin"] = QChar((unsigned short) 8713); - m_entityDecodeMap["prod"] = QChar((unsigned short) 8719); - m_entityDecodeMap["ne"] = QChar((unsigned short) 8800); + m_entityDecodeMap["lsquo"] = TQChar((unsigned short) 8216); + m_entityDecodeMap["rsquo"] = TQChar((unsigned short) 8217); + m_entityDecodeMap["rdquo"] = TQChar((unsigned short) 8221); + m_entityDecodeMap["bdquo"] = TQChar((unsigned short) 8222); + m_entityDecodeMap["trade"] = TQChar((unsigned short) 8482); + m_entityDecodeMap["ldquo"] = TQChar((unsigned short) 8220); + m_entityDecodeMap["ndash"] = TQChar((unsigned short) 8211); + m_entityDecodeMap["mdash"] = TQChar((unsigned short) 8212); + m_entityDecodeMap["bull"] = TQChar((unsigned short) 8226); + m_entityDecodeMap["hellip"] = TQChar((unsigned short) 8230); + m_entityDecodeMap["emsp"] = TQChar((unsigned short) 8195); + m_entityDecodeMap["rarr"] = TQChar((unsigned short) 8594); + m_entityDecodeMap["rArr"] = TQChar((unsigned short) 8658); + m_entityDecodeMap["crarr"] = TQChar((unsigned short) 8629); + m_entityDecodeMap["le"] = TQChar((unsigned short) 8804); + m_entityDecodeMap["ge"] = TQChar((unsigned short) 8805); + m_entityDecodeMap["lte"] = TQChar((unsigned short) 8804); // wrong, but used somewhere + m_entityDecodeMap["gte"] = TQChar((unsigned short) 8805); // wrong, but used somewhere + m_entityDecodeMap["dagger"] = TQChar((unsigned short) 8224); + m_entityDecodeMap["Dagger"] = TQChar((unsigned short) 8225); + m_entityDecodeMap["euro"] = TQChar((unsigned short) 8364); + m_entityDecodeMap["asymp"] = TQChar((unsigned short) 8776); + m_entityDecodeMap["isin"] = TQChar((unsigned short) 8712); + m_entityDecodeMap["notin"] = TQChar((unsigned short) 8713); + m_entityDecodeMap["prod"] = TQChar((unsigned short) 8719); + m_entityDecodeMap["ne"] = TQChar((unsigned short) 8800); m_entityDecodeMap["amp"] = "&"; // ampersand m_entityDecodeMap["gt"] = ">"; // greater than @@ -311,19 +311,19 @@ QString LCHMFileImpl::decodeEntity( const QString & entity ) if ( !valid ) { qWarning ( "LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", entity.ascii() ); - return QString::null; + return TQString(); } - return (QString) (QChar( ascode )); + return (TQString) (TQChar( ascode )); } else { - QMap<QString, QString>::const_iterator it = m_entityDecodeMap.find( entity ); + TQMap<TQString, TQString>::const_iterator it = m_entityDecodeMap.tqfind( entity ); if ( it == m_entityDecodeMap.end() ) { qWarning ("LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", entity.ascii()); - return QString::null; + return TQString(); } return *it; @@ -331,14 +331,14 @@ QString LCHMFileImpl::decodeEntity( const QString & entity ) } -inline int LCHMFileImpl::findStringInQuotes (const QString& tag, int offset, QString& value, bool firstquote, bool decodeentities) +inline int LCHMFileImpl::findStringInQuotes (const TQString& tag, int offset, TQString& value, bool firstquote, bool decodeentities) { - int qbegin = tag.find ('"', offset); + int qbegin = tag.tqfind ('"', offset); if ( qbegin == -1 ) qFatal ("LCHMFileImpl::findStringInQuotes: cannot find first quote in <param> tag: '%s'", tag.ascii()); - int qend = firstquote ? tag.find ('"', qbegin + 1) : tag.findRev ('"'); + int qend = firstquote ? tag.tqfind ('"', qbegin + 1) : tag.tqfindRev ('"'); if ( qend == -1 || qend <= qbegin ) qFatal ("LCHMFileImpl::findStringInQuotes: cannot find last quote in <param> tag: '%s'", tag.ascii()); @@ -346,7 +346,7 @@ inline int LCHMFileImpl::findStringInQuotes (const QString& tag, int offset, QSt // If we do not need to decode HTML entities, just return. if ( decodeentities ) { - QString htmlentity = QString::null; + TQString htmlentity = TQString(); bool fill_entity = false; value.reserve (qend - qbegin); // to avoid multiple memory allocations @@ -365,13 +365,13 @@ inline int LCHMFileImpl::findStringInQuotes (const QString& tag, int offset, QSt if ( tag[i] == ';' ) // HTML entity ends { // If entity is an ASCII code, just decode it - QString decode = decodeEntity( htmlentity ); + TQString decode = decodeEntity( htmlentity ); if ( decode.isNull() ) break; value.append ( decode ); - htmlentity = QString::null; + htmlentity = TQString(); fill_entity = false; } else @@ -386,7 +386,7 @@ inline int LCHMFileImpl::findStringInQuotes (const QString& tag, int offset, QSt } -bool LCHMFileImpl::searchWord (const QString& text, +bool LCHMFileImpl::searchWord (const TQString& text, bool wholeWords, bool titlesOnly, LCHMSearchProgressResults& results, @@ -397,7 +397,7 @@ bool LCHMFileImpl::searchWord (const QString& text, if ( text.isEmpty() || !m_searchAvailable ) return false; - QString searchword = (QString) convertSearchWord (text); + TQString searchword = (TQString) convertSearchWord (text); #define FTS_HEADER_LEN 0x32 unsigned char header[FTS_HEADER_LEN]; @@ -425,11 +425,11 @@ bool LCHMFileImpl::searchWord (const QString& text, u_int16_t tree_depth = UINT16ARRAY(cursor16); unsigned char word_len, pos; - QString word; + TQString word; u_int32_t i = sizeof(u_int16_t); u_int16_t free_space; - QMemArray<unsigned char> buffer(node_len); + TQMemArray<unsigned char> buffer(node_len); node_offset = GetLeafNodeOffset (searchword, node_offset, node_len, tree_depth); @@ -505,7 +505,7 @@ bool LCHMFileImpl::searchWord (const QString& text, loc_codes_r, results, phrase_search); } - else if ( QString::compare (searchword, word.mid(0, searchword.length())) < -1 ) + else if ( TQString::compare (searchword, word.mid(0, searchword.length())) < -1 ) break; } } @@ -516,7 +516,7 @@ bool LCHMFileImpl::searchWord (const QString& text, } -bool LCHMFileImpl::ResolveObject(const QString& fileName, chmUnitInfo *ui) const +bool LCHMFileImpl::ResolveObject(const TQString& fileName, chmUnitInfo *ui) const { return m_chmFile != NULL && ::chm_resolve_object(m_chmFile, fileName.ascii(), ui) == @@ -537,7 +537,7 @@ size_t LCHMFileImpl::RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer } -inline u_int32_t LCHMFileImpl::GetLeafNodeOffset(const QString& text, +inline u_int32_t LCHMFileImpl::GetLeafNodeOffset(const TQString& text, u_int32_t initialOffset, u_int32_t buffSize, u_int16_t treeDepth) @@ -546,8 +546,8 @@ inline u_int32_t LCHMFileImpl::GetLeafNodeOffset(const QString& text, unsigned char* cursor16, *cursor32; unsigned char word_len, pos; u_int32_t i = sizeof(u_int16_t); - QMemArray<unsigned char> buffer(buffSize); - QString word; + TQMemArray<unsigned char> buffer(buffSize); + TQString word; while(--treeDepth) { @@ -607,7 +607,7 @@ inline bool LCHMFileImpl::ProcessWLC (u_int64_t wlc_count, u_int64_t wlc_size, int wlc_bit = 7; u_int64_t index = 0, count; size_t length, off = 0; - QMemArray<unsigned char> buffer (wlc_size); + TQMemArray<unsigned char> buffer (wlc_size); unsigned char *cursor32; unsigned char entry[TOPICS_ENTRY_LEN]; @@ -682,7 +682,7 @@ bool LCHMFileImpl::getInfoFromWindows() u_int32_t entries = get_int32_le( (u_int32_t *)(buffer) ); u_int32_t entry_size = get_int32_le( (u_int32_t *)(buffer + 0x04) ); - QByteArray uptr(entries * entry_size); + TQByteArray uptr(entries * entry_size); unsigned char* raw = (unsigned char*) uptr.data(); if ( !RetrieveObject (&ui, raw, 8, entries * entry_size) ) @@ -706,7 +706,7 @@ bool LCHMFileImpl::getInfoFromWindows() size = RetrieveObject(&ui, buffer, factor * 4096, BUF_SIZE); if ( size && off_title ) - m_title = QString ((const char*) (buffer + off_title % 4096)); + m_title = TQString ((const char*) (buffer + off_title % 4096)); if ( factor != off_home / 4096) { @@ -715,7 +715,7 @@ bool LCHMFileImpl::getInfoFromWindows() } if ( size && off_home ) - m_home = QString("/") + QString( (const char*) buffer + off_home % 4096); + m_home = TQString("/") + TQString( (const char*) buffer + off_home % 4096); if ( factor != off_hhc / 4096) { @@ -724,7 +724,7 @@ bool LCHMFileImpl::getInfoFromWindows() } if ( size && off_hhc ) - m_topicsFile = QString("/") + QString ((const char*) buffer + off_hhc % 4096); + m_topicsFile = TQString("/") + TQString ((const char*) buffer + off_hhc % 4096); if ( factor != off_hhk / 4096) { @@ -733,7 +733,7 @@ bool LCHMFileImpl::getInfoFromWindows() } if ( size && off_hhk ) - m_indexFile = QString("/") + QString((const char*) buffer + off_hhk % 4096); + m_indexFile = TQString("/") + TQString((const char*) buffer + off_hhk % 4096); } } return true; @@ -775,7 +775,7 @@ bool LCHMFileImpl::getInfoFromSystem() cursor = buffer + index; if(m_topicsFile.isEmpty()) - m_topicsFile = QString("/") + QString((const char*) buffer + index + 2); + m_topicsFile = TQString("/") + TQString((const char*) buffer + index + 2); break; @@ -784,7 +784,7 @@ bool LCHMFileImpl::getInfoFromSystem() cursor = buffer + index; if(m_indexFile.isEmpty()) - m_indexFile = QString("/") + QString ((const char*)buffer + index + 2); + m_indexFile = TQString("/") + TQString ((const char*)buffer + index + 2); break; case 2: @@ -792,13 +792,13 @@ bool LCHMFileImpl::getInfoFromSystem() cursor = buffer + index; if(m_home.isEmpty() || m_home == "/") - m_home = QString("/") + QString ((const char*) buffer + index + 2); + m_home = TQString("/") + TQString ((const char*) buffer + index + 2); break; case 3: index += 2; cursor = buffer + index; - m_title = QString((const char*) (buffer + index + 2)); + m_title = TQString((const char*) (buffer + index + 2)); break; case 4: @@ -815,8 +815,8 @@ bool LCHMFileImpl::getInfoFromSystem() cursor = buffer + index; if(m_topicsFile.isEmpty()) { - QString topicAttempt = "/", tmp; - topicAttempt += QString ((const char*) buffer +index +2); + TQString topicAttempt = "/", tmp; + topicAttempt += TQString ((const char*) buffer +index +2); tmp = topicAttempt + ".hhc"; @@ -834,7 +834,7 @@ bool LCHMFileImpl::getInfoFromSystem() index += 2; cursor = buffer + index; - m_font = QString ((const char*) buffer + index + 2); + m_font = TQString ((const char*) buffer + index + 2); break; default: @@ -850,7 +850,7 @@ bool LCHMFileImpl::getInfoFromSystem() } -QCString LCHMFileImpl::convertSearchWord( const QString & src ) +TQCString LCHMFileImpl::convertSearchWord( const TQString & src ) { static const char * searchwordtable[128] = { @@ -865,9 +865,9 @@ QCString LCHMFileImpl::convertSearchWord( const QString & src ) }; if ( !m_textCodec ) - return (QCString) src.lower(); + return (TQCString) src.lower(); - QCString dest = m_textCodec->fromUnicode (src); + TQCString dest = m_textCodec->fromUnicode (src); for ( unsigned int i = 0; i < dest.size(); i++ ) { @@ -875,7 +875,7 @@ QCString LCHMFileImpl::convertSearchWord( const QString & src ) { int index = dest[i] & 0x7F; if ( searchwordtable[index] ) - dest.replace (i, 1, searchwordtable[index]); + dest.tqreplace (i, 1, searchwordtable[index]); else dest.remove (i, 1); } @@ -887,15 +887,15 @@ QCString LCHMFileImpl::convertSearchWord( const QString & src ) void LCHMFileImpl::getSearchResults( const LCHMSearchProgressResults& tempres, - QStringList * results, + TQStringList * results, unsigned int limit_results ) { unsigned char combuf [COMMON_BUF_LEN]; - QMap<u_int32_t, u_int32_t> urlsmap; // used to prevent duplicated urls + TQMap<u_int32_t, u_int32_t> urlsmap; // used to prevent duplicated urls for ( unsigned int i = 0; i < tempres.size(); i++ ) { - if ( urlsmap.find (tempres[i].urloff) != urlsmap.end() ) + if ( urlsmap.tqfind (tempres[i].urloff) != urlsmap.end() ) continue; urlsmap[tempres[i].urloff] = 1; @@ -912,10 +912,10 @@ void LCHMFileImpl::getSearchResults( const LCHMSearchProgressResults& tempres, } -QString LCHMFileImpl::normalizeUrl( const QString & path ) const +TQString LCHMFileImpl::normalizeUrl( const TQString & path ) const { - int pos = path.find ('#'); - QString fixedpath = pos == -1 ? path : path.left (pos); + int pos = path.tqfind ('#'); + TQString fixedpath = pos == -1 ? path : path.left (pos); return LCHMUrlFactory::makeURLabsoluteIfNeeded( fixedpath ); } @@ -925,9 +925,9 @@ QString LCHMFileImpl::normalizeUrl( const QString & path ) const * FIXME: <OBJECT type="text/sitemap"><param name="Merge" value="hhaxref.chm::/HHOCX_c.hhc"></OBJECT> * (from htmlhelp.chm) */ -bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex ) +bool LCHMFileImpl::parseFileAndFillArray( const TQString & file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex ) { - QString src; + TQString src; const int MAX_NEST_DEPTH = 256; if ( !getFileContentAsString( &src, file ) || src.isEmpty() ) @@ -937,11 +937,11 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM /* // Save the index for debugging purposes - QFile outfile( "parsed.htm" ); + TQFile outfile( "parsed.htm" ); if ( outfile.open( IO_WriteOnly ) ) { - QTextStream textstream( &outfile ); + TQTextStream textstream( &outfile ); textstream << src; outfile.close(); } @@ -957,7 +957,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM // Split the HHC file by HTML tags int stringlen = src.length(); - while ( pos < stringlen && (pos = src.find ('<', pos)) != -1 ) + while ( pos < stringlen && (pos = src.tqfind ('<', pos)) != -1 ) { int i, word_end = 0; @@ -967,8 +967,8 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM if ( (src[i] == '"' || src[i] == '\'') ) { // find where quote ends, either by another quote, or by '>' symbol (some people don't know HTML) - int nextpos = src.find (src[i], i+1); - if ( nextpos == -1 && (nextpos = src.find ('>', i+1)) == -1 ) + int nextpos = src.tqfind (src[i], i+1); + if ( nextpos == -1 && (nextpos = src.tqfind ('>', i+1)) == -1 ) { qWarning ("LCHMFileImpl::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).ascii()); return false; @@ -982,7 +982,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM word_end = i; } - QString tagword, tag = src.mid (pos, i - pos); + TQString tagword, tag = src.mid (pos, i - pos); if ( word_end ) tagword = src.mid (pos, word_end - pos).lower(); @@ -992,7 +992,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM //qDebug ("tag: '%s', tagword: '%s'\n", tag.ascii(), tagword.ascii()); // <OBJECT type="text/sitemap"> - a topic entry - if ( tagword == "object" && tag.find ("text/sitemap", 0, false) != -1 ) + if ( tagword == "object" && tag.tqfind ("text/sitemap", 0, false) != -1 ) in_object = true; else if ( tagword == "/object" && in_object ) { @@ -1021,7 +1021,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM qDebug ("LCHMFileImpl::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty."); } - entry.name = QString::null; + entry.name = TQString(); entry.urls.clear(); entry.imageid = defaultimagenum; in_object = false; @@ -1030,17 +1030,17 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM { // <param name="Name" value="First Page"> int offset; // strlen("param ") - QString name_pattern = "name=", value_pattern = "value="; - QString pname, pvalue; + TQString name_pattern = "name=", value_pattern = "value="; + TQString pname, pvalue; - if ( (offset = tag.find (name_pattern, 0, FALSE)) == -1 ) + if ( (offset = tag.tqfind (name_pattern, 0, FALSE)) == -1 ) qFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no name=\n", tag.ascii()); // offset+5 skips 'name=' offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); pname = pname.lower(); - if ( (offset = tag.find (value_pattern, offset, FALSE)) == -1 ) + if ( (offset = tag.tqfind (value_pattern, offset, FALSE)) == -1 ) qFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no value=\n", tag.ascii()); // offset+6 skips 'value=' @@ -1057,9 +1057,9 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM else if ( pname == "local" ) { // Check for URL duplication - QString url = LCHMUrlFactory::makeURLabsoluteIfNeeded( pvalue ); + TQString url = LCHMUrlFactory::makeURLabsoluteIfNeeded( pvalue ); - if ( entry.urls.find( url ) == entry.urls.end() ) + if ( entry.urls.tqfind( url ) == entry.urls.end() ) entry.urls.push_back( url ); } else if ( pname == "see also" && asIndex && entry.name != pvalue ) @@ -1097,7 +1097,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM } -bool LCHMFileImpl::getFileContentAsBinary( QByteArray * data, const QString & url ) const +bool LCHMFileImpl::getFileContentAsBinary( TQByteArray * data, const TQString & url ) const { chmUnitInfo ui; @@ -1113,9 +1113,9 @@ bool LCHMFileImpl::getFileContentAsBinary( QByteArray * data, const QString & ur } -bool LCHMFileImpl::getFileContentAsString( QString * str, const QString & url, bool internal_encoding ) +bool LCHMFileImpl::getFileContentAsString( TQString * str, const TQString & url, bool internal_encoding ) { - QByteArray buf; + TQByteArray buf; if ( getFileContentAsBinary( &buf, url ) ) { @@ -1126,7 +1126,7 @@ bool LCHMFileImpl::getFileContentAsString( QString * str, const QString & url, b buf.resize( length + 1 ); buf [length] = '\0'; - *str = internal_encoding ? (QString)((const char*) buf) : encodeWithCurrentCodec((const char*) buf); + *str = internal_encoding ? (TQString)((const char*) buf) : encodeWithCurrentCodec((const char*) buf); return true; } } @@ -1135,12 +1135,12 @@ bool LCHMFileImpl::getFileContentAsString( QString * str, const QString & url, b } -QString LCHMFileImpl::getTopicByUrl( const QString & url ) const +TQString LCHMFileImpl::getTopicByUrl( const TQString & url ) const { - QMap< QString, QString >::const_iterator it = m_url2topics.find( url ); + TQMap< TQString, TQString >::const_iterator it = m_url2topics.tqfind( url ); if ( it == m_url2topics.end() ) - return QString::null; + return TQString(); return it.data(); } @@ -1148,17 +1148,17 @@ QString LCHMFileImpl::getTopicByUrl( const QString & url ) const static int chm_enumerator_callback( struct chmFile*, struct chmUnitInfo *ui, void *context ) { - ((QStringList*) context)->push_back( ui->path ); + ((TQStringList*) context)->push_back( ui->path ); return CHM_ENUMERATOR_CONTINUE; } -bool LCHMFileImpl::enumerateFiles( QStringList * files ) +bool LCHMFileImpl::enumerateFiles( TQStringList * files ) { files->clear(); return chm_enumerate( m_chmFile, CHM_ENUMERATE_ALL, chm_enumerator_callback, files ); } -const QPixmap * LCHMFileImpl::getBookIconPixmap( unsigned int imagenum ) +const TQPixmap * LCHMFileImpl::getBookIconPixmap( unsigned int imagenum ) { return m_imagesKeeper.getImage( imagenum ); } @@ -1188,7 +1188,7 @@ bool LCHMFileImpl::guessTextEncoding( ) bool LCHMFileImpl::changeFileEncoding( const char *qtencoding ) { - // Encoding could be either simple Qt codepage, or set like CP1251/KOI8, which allows to + // Encoding could be either simple TQt codepage, or set like CP1251/KOI8, which allows to // set up encodings separately for text (first) and internal files (second) const char * p = strchr( qtencoding, '/' ); if ( p ) @@ -1197,7 +1197,7 @@ bool LCHMFileImpl::changeFileEncoding( const char *qtencoding ) strcpy( buf, qtencoding ); buf[p - qtencoding] = '\0'; - m_textCodec = QTextCodec::codecForName( buf ); + m_textCodec = TQTextCodec::codecForName( buf ); if ( !m_textCodec ) { @@ -1205,7 +1205,7 @@ bool LCHMFileImpl::changeFileEncoding( const char *qtencoding ) return false; } - m_textCodecForSpecialFiles = QTextCodec::codecForName( p + 1 ); + m_textCodecForSpecialFiles = TQTextCodec::codecForName( p + 1 ); if ( !m_textCodecForSpecialFiles ) { @@ -1215,7 +1215,7 @@ bool LCHMFileImpl::changeFileEncoding( const char *qtencoding ) } else { - m_textCodecForSpecialFiles = m_textCodec = QTextCodec::codecForName (qtencoding); + m_textCodecForSpecialFiles = m_textCodec = TQTextCodec::codecForName (qtencoding); if ( !m_textCodec ) { @@ -1235,7 +1235,7 @@ void LCHMFileImpl::fillTopicsUrlMap() return; // Read those tables - QByteArray topics( m_chmTOPICS.length ), urltbl( m_chmURLTBL.length ), urlstr( m_chmURLSTR.length ), strings( m_chmSTRINGS.length ); + TQByteArray topics( m_chmTOPICS.length ), urltbl( m_chmURLTBL.length ), urlstr( m_chmURLSTR.length ), strings( m_chmSTRINGS.length ); if ( !RetrieveObject( &m_chmTOPICS, (unsigned char*) topics.data(), 0, m_chmTOPICS.length ) || !RetrieveObject( &m_chmURLTBL, (unsigned char*) urltbl.data(), 0, m_chmURLTBL.length ) @@ -1249,7 +1249,7 @@ void LCHMFileImpl::fillTopicsUrlMap() u_int32_t off_url = get_int32_le( (u_int32_t *)(topics.data() + i + 8) ); off_url = get_int32_le( (u_int32_t *)( urltbl.data() + off_url + 8) ) + 8; - QString url = LCHMUrlFactory::makeURLabsoluteIfNeeded( (const char*) urlstr.data() + off_url ); + TQString url = LCHMUrlFactory::makeURLabsoluteIfNeeded( (const char*) urlstr.data() + off_url ); if ( off_title < strings.size() ) m_url2topics[url] = encodeWithCurrentCodec ( (const char*) strings.data() + off_title ); @@ -1259,7 +1259,7 @@ void LCHMFileImpl::fillTopicsUrlMap() } -bool LCHMFileImpl::getFileSize(unsigned int * size, const QString & url) +bool LCHMFileImpl::getFileSize(unsigned int * size, const TQString & url) { chmUnitInfo ui; diff --git a/lib/libchmfile/libchmfileimpl.h b/lib/libchmfile/libchmfileimpl.h index b609b16..c6558f7 100644 --- a/lib/libchmfile/libchmfileimpl.h +++ b/lib/libchmfile/libchmfileimpl.h @@ -34,7 +34,7 @@ class LCHMSearchProgressResult inline LCHMSearchProgressResult() {} inline LCHMSearchProgressResult( u_int32_t t, u_int32_t u ) : titleoff(t),urloff(u) {} - QValueVector<u_int64_t> offsets; + TQValueVector<u_int64_t> offsets; u_int32_t titleoff; u_int32_t urloff; }; @@ -51,25 +51,25 @@ class LCHMFileImpl ~LCHMFileImpl(); // Implementations for LCHMFile members - bool loadFile( const QString& archiveName ); + bool loadFile( const TQString& archiveName ); void closeAll(); - QString title() const { return encodeWithCurrentCodec( m_title ); } - QString homeUrl() const { return encodeWithCurrentCodec( m_home ); } + TQString title() const { return encodeWithCurrentCodec( m_title ); } + TQString homeUrl() const { return encodeWithCurrentCodec( m_home ); } - bool getFileContentAsString( QString * str, const QString& url, bool internal_encoding = false ); - bool getFileContentAsBinary( QByteArray * data, const QString& url ) const; - bool getFileSize( unsigned int * size, const QString& url ); + bool getFileContentAsString( TQString * str, const TQString& url, bool internal_encoding = false ); + bool getFileContentAsBinary( TQByteArray * data, const TQString& url ) const; + bool getFileSize( unsigned int * size, const TQString& url ); - bool enumerateFiles( QStringList * files ); - QString getTopicByUrl ( const QString& url ) const; + bool enumerateFiles( TQStringList * files ); + TQString getTopicByUrl ( const TQString& url ) const; - const QPixmap * getBookIconPixmap( unsigned int imagenum ); + const TQPixmap * getBookIconPixmap( unsigned int imagenum ); bool setCurrentEncoding( const LCHMTextEncoding * encoding ); //! Parse the HHC or HHS file, and fill the context (asIndex is false) or index (asIndex is true) array. - bool parseFileAndFillArray (const QString& file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex ); + bool parseFileAndFillArray (const TQString& file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex ); /*! * \brief Fast search using the $FIftiMain file in the .chm. @@ -82,7 +82,7 @@ class LCHMFileImpl * \param phrase_search Indicates that word offset information should be kept. * \return true if the search found something, false otherwise. */ - bool searchWord( const QString& word, + bool searchWord( const TQString& word, bool wholeWords, bool titlesOnly, LCHMSearchProgressResults& results, @@ -95,46 +95,46 @@ class LCHMFileImpl * The keys are the URLs and the values are the page titles. */ void getSearchResults( const LCHMSearchProgressResults& tempres, - QStringList * results, + TQStringList * results, unsigned int limit_results = 500 ); //! Looks up fileName in the archive. - bool ResolveObject( const QString& fileName, chmUnitInfo *ui ) const; + bool ResolveObject( const TQString& fileName, chmUnitInfo *ui ) const; //! Retrieves an uncompressed chunk of a file in the .chm. size_t RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) const; //! Encode the string with the currently selected text codec, if possible. Or return as-is, if not. - inline QString encodeWithCurrentCodec (const QString& str) const + inline TQString encodeWithCurrentCodec (const TQString& str) const { return (m_textCodec ? m_textCodec->toUnicode (str) : str); } //! Encode the string with the currently selected text codec, if possible. Or return as-is, if not. - inline QString encodeWithCurrentCodec (const char * str) const + inline TQString encodeWithCurrentCodec (const char * str) const { - return (m_textCodec ? m_textCodec->toUnicode (str) : (QString) str); + return (m_textCodec ? m_textCodec->toUnicode (str) : (TQString) str); } //! Encode the string from internal files with the currently selected text codec, if possible. //! Or return as-is, if not. - inline QString encodeInternalWithCurrentCodec (const QString& str) const + inline TQString encodeInternalWithCurrentCodec (const TQString& str) const { return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : str); } //! Encode the string from internal files with the currently selected text codec, if possible. //! Or return as-is, if not. - inline QString encodeInternalWithCurrentCodec (const char * str) const + inline TQString encodeInternalWithCurrentCodec (const char * str) const { - return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : (QString) str); + return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : (TQString) str); } //! Helper. Translates from Win32 encodings to generic wxWidgets ones. - const char * GetFontEncFromCharSet (const QString& font) const; + const char * GetFontEncFromCharSet (const TQString& font) const; //! Helper. Returns the $FIftiMain offset of leaf node or 0. - u_int32_t GetLeafNodeOffset(const QString& text, + u_int32_t GetLeafNodeOffset(const TQString& text, u_int32_t initalOffset, u_int32_t buffSize, u_int16_t treeDepth ); @@ -168,23 +168,23 @@ class LCHMFileImpl bool guessTextEncoding (); //! Change the current CHM encoding for internal files and texts. - //! Encoding could be either simple Qt codepage, or set like CP1251/KOI8, which allows to + //! Encoding could be either simple TQt codepage, or set like CP1251/KOI8, which allows to //! set up encodings separately for text (first) and internal files (second) bool changeFileEncoding( const char *qtencoding ); //! Convert the word, so it has an appropriate encoding - QCString convertSearchWord ( const QString &src ); + TQCString convertSearchWord ( const TQString &src ); /*! * Helper procedure in TOC parsing, decodes the string between the quotes (first or last) with decoding HTML * entities like í */ - int findStringInQuotes (const QString& tag, int offset, QString& value, bool firstquote, bool decodeentities ); + int findStringInQuotes (const TQString& tag, int offset, TQString& value, bool firstquote, bool decodeentities ); /*! * Decodes Unicode HTML entities according to current encoding. */ - QString decodeEntity (const QString& entity ); + TQString decodeEntity (const TQString& entity ); /*! * \brief Returns the list of all available text encodings. @@ -216,7 +216,7 @@ class LCHMFileImpl /*! * Normalizes path to search in internal arrays */ - QString normalizeUrl (const QString& path ) const; + TQString normalizeUrl (const TQString& path ) const; // Members @@ -225,36 +225,36 @@ class LCHMFileImpl chmFile * m_chmFile; //! Opened file name - QString m_filename; + TQString m_filename; //! Home url, got from CHM file - QString m_home; + TQString m_home; //! Context tree filename. Got from CHM file - QString m_topicsFile; + TQString m_topicsFile; //! Index filename. Got from CHM file - QString m_indexFile; + TQString m_indexFile; //! Chm Title. Got from CHM file - QString m_title; + TQString m_title; // Localization stuff //! LCID from CHM file, used in encoding detection short m_detectedLCID; //! font charset from CHM file, used in encoding detection - QString m_font; + TQString m_font; //! Chosen text codec - QTextCodec * m_textCodec; - QTextCodec * m_textCodecForSpecialFiles; + TQTextCodec * m_textCodec; + TQTextCodec * m_textCodecForSpecialFiles; //! Current encoding const LCHMTextEncoding * m_currentEncoding; //! Map to decode HTML entitles like ´ based on current encoding - QMap<QString, QString> m_entityDecodeMap; + TQMap<TQString, TQString> m_entityDecodeMap; //! TRUE if /#TOPICS, /#STRINGS, /#URLTBL and /#URLSTR are resolved, and the members below are valid bool m_lookupTablesValid; @@ -282,5 +282,5 @@ class LCHMFileImpl LCHMTocImageKeeper m_imagesKeeper; //! Map url->topic - QMap< QString, QString > m_url2topics; + TQMap< TQString, TQString > m_url2topics; }; diff --git a/lib/libchmfile/libchmtextencoding.h b/lib/libchmfile/libchmtextencoding.h index ff34736..b62b3d0 100644 --- a/lib/libchmfile/libchmtextencoding.h +++ b/lib/libchmfile/libchmtextencoding.h @@ -33,7 +33,7 @@ typedef struct LCHMTextEncoding int winlcid; //! Windows LCID for this language int wincodepage; //! Windows codepage for this language. int wincharset; //! Windows charset. - const char * qtcodec; //! Qt text codec to use + const char * qtcodec; //! TQt text codec to use }; diff --git a/lib/libchmfile/libchmtocimage.cpp b/lib/libchmfile/libchmtocimage.cpp index c272b10..89fe45e 100644 --- a/lib/libchmfile/libchmtocimage.cpp +++ b/lib/libchmfile/libchmtocimage.cpp @@ -2103,7 +2103,7 @@ LCHMTocImageKeeper::LCHMTocImageKeeper( ) } } -const QPixmap * LCHMTocImageKeeper::getImage( int id ) +const TQPixmap * LCHMTocImageKeeper::getImage( int id ) { if ( id < 0 || id > LCHMBookIcons::MAX_BUILTIN_ICONS ) qFatal("LCHMTocImageKeeper::getImage: requested image id (%d) is out of range (%d)", id, LCHMBookIcons::MAX_BUILTIN_ICONS ); diff --git a/lib/libchmfile/libchmtocimage.h b/lib/libchmfile/libchmtocimage.h index 73f84da..784b81b 100644 --- a/lib/libchmfile/libchmtocimage.h +++ b/lib/libchmfile/libchmtocimage.h @@ -25,8 +25,8 @@ class LCHMTocImageKeeper { public: LCHMTocImageKeeper(); - const QPixmap * getImage( int id ); + const TQPixmap * getImage( int id ); private: - QPixmap m_images[LCHMBookIcons::MAX_BUILTIN_ICONS]; + TQPixmap m_images[LCHMBookIcons::MAX_BUILTIN_ICONS]; }; diff --git a/lib/libchmfile/libchmurlfactory.h b/lib/libchmfile/libchmurlfactory.h index 29ac433..5481e8d 100644 --- a/lib/libchmfile/libchmurlfactory.h +++ b/lib/libchmfile/libchmurlfactory.h @@ -19,18 +19,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdir.h> -#include <qstring.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqstring.h> +#include <tqregexp.h> namespace LCHMUrlFactory { -static inline bool isRemoteURL( const QString & url, QString & protocol ) +static inline bool isRemoteURL( const TQString & url, TQString & protocol ) { // Check whether the URL is external - QRegExp uriregex ( "^(\\w+):\\/\\/" ); - QRegExp mailtoregex ( "^(mailto):" ); + TQRegExp uriregex ( "^(\\w+):\\/\\/" ); + TQRegExp mailtoregex ( "^(mailto):" ); // mailto: can also have different format, so handle it if ( url.startsWith( "mailto:" ) ) @@ -40,7 +40,7 @@ static inline bool isRemoteURL( const QString & url, QString & protocol ) } else if ( uriregex.search ( url ) != -1 ) { - QString proto = uriregex.cap ( 1 ).lower(); + TQString proto = TQString(uriregex.cap( 1 )).lower(); // Filter the URLs which need to be opened by a browser if ( proto == "http" @@ -57,15 +57,15 @@ static inline bool isRemoteURL( const QString & url, QString & protocol ) } // Some JS urls start with javascript:// -static inline bool isJavascriptURL( const QString & url ) +static inline bool isJavascriptURL( const TQString & url ) { return url.startsWith ("javascript://"); } // Parse urls like "ms-its:file name.chm::/topic.htm" -static inline bool isNewChmURL( const QString & url, QString & chmfile, QString & page ) +static inline bool isNewChmURL( const TQString & url, TQString & chmfile, TQString & page ) { - QRegExp uriregex ( "^ms-its:(.*)::(.*)$" ); + TQRegExp uriregex ( "^ms-its:(.*)::(.*)$" ); if ( uriregex.search ( url ) != -1 ) { @@ -78,15 +78,15 @@ static inline bool isNewChmURL( const QString & url, QString & chmfile, QString return false; } -static inline QString makeURLabsoluteIfNeeded( const QString & url ) +static inline TQString makeURLabsoluteIfNeeded( const TQString & url ) { - QString p1, p2, newurl = url; + TQString p1, p2, newurl = url; if ( !isRemoteURL (url, p1) && !isJavascriptURL (url) && !isNewChmURL (url, p1, p2) ) { - newurl = QDir::cleanDirPath (url); + newurl = TQDir::cleanDirPath (url); // Normalize url, so it becomes absolute if ( newurl[0] != '/' ) @@ -100,20 +100,20 @@ static inline QString makeURLabsoluteIfNeeded( const QString & url ) // Returns a special string, which allows the kio-slave, or viewwindow-browser iteraction // to regognize our own internal urls, which is necessary to show image-only pages. -static inline QString getInternalUriExtension() +static inline TQString getInternalUriExtension() { return ".KCHMVIEWER_SPECIAL_HANDLER"; } -static inline bool handleFileType( const QString& link, QString& generated ) +static inline bool handleFileType( const TQString& link, TQString& generated ) { - QString intext = getInternalUriExtension(); + TQString intext = getInternalUriExtension(); if ( !link.endsWith( intext ) ) return false; - QString filelink = link.left( link.length() - strlen( intext ) ); + TQString filelink = link.left( link.length() - strlen( intext ) ); generated = "<html><body><img src=\"" + filelink + "\"></body></html>"; return true; } diff --git a/lib/libchmfile/qt34.cpp b/lib/libchmfile/qt34.cpp index fd7028a..e1194f9 100644 --- a/lib/libchmfile/qt34.cpp +++ b/lib/libchmfile/qt34.cpp @@ -19,9 +19,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qdir.h> +#include <tqdir.h> -#include "qt34.h" +#include "tqt34.h" LIBCHMCString::LIBCHMCString() { @@ -29,10 +29,10 @@ LIBCHMCString::LIBCHMCString() LIBCHMCString::LIBCHMCString(const char *string) { -#if defined (USE_QT_4) - cs = QByteArray(string); +#if defined (USE_TQT_4) + cs = TQByteArray(string); #else - cs = QCString(string); + cs = TQCString(string); #endif } @@ -45,16 +45,16 @@ const char *LIBCHMCString::toCString() const void LIBCHMCString::clear() { -#if defined (USE_QT_4) - cs = QByteArray(); +#if defined (USE_TQT_4) + cs = TQByteArray(); #else - cs = QCString(); + cs = TQCString(); #endif } -bool LIBCHMCString::operator==(const QString &string) const +bool LIBCHMCString::operator==(const TQString &string) const { - return QString(cs) == string; + return TQString(cs) == string; } uint LIBCHMCString::length() const @@ -77,9 +77,9 @@ char LIBCHMCString::at(uint i) const return cs.at(i); } -void LIBCHMCString::replace(uint index, uint len, const char *str) +void LIBCHMCString::tqreplace(uint index, uint len, const char *str) { - cs.replace(index, len, str); + cs.tqreplace(index, len, str); } void LIBCHMCString::remove(uint index, uint len) @@ -89,7 +89,7 @@ void LIBCHMCString::remove(uint index, uint len) LIBCHMCString LIBCHMCString::lower() { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return cs.toLower().data(); #else return cs.lower().data(); @@ -98,21 +98,21 @@ LIBCHMCString LIBCHMCString::lower() -LIBCHMRegExp::LIBCHMRegExp(const QString ®exp) +LIBCHMRegExp::LIBCHMRegExp(const TQString ®exp) { - re = QRegExp(regexp); + re = TQRegExp(regexp); } -int LIBCHMRegExp::search(const QString &str, int offset) +int LIBCHMRegExp::search(const TQString &str, int offset) { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return re.indexIn(str, offset); #else return re.search(str, offset); #endif } -QString LIBCHMRegExp::cap(int nth) +TQString LIBCHMRegExp::cap(int nth) { return re.cap(nth); } @@ -134,19 +134,19 @@ LIBCHMString::LIBCHMString() { } -LIBCHMString::LIBCHMString(const QString &string) +LIBCHMString::LIBCHMString(const TQString &string) { s = string; } LIBCHMString::LIBCHMString(const char *string) { - s = QString(string); + s = TQString(string); } -QString LIBCHMString::lower() const +TQString LIBCHMString::lower() const { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return s.toLower(); #else return s.lower(); @@ -155,58 +155,58 @@ QString LIBCHMString::lower() const const char *LIBCHMString::ascii() const { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return s.toAscii(); #else return s.ascii(); #endif } -int LIBCHMString::find(char c, int index) const +int LIBCHMString::tqfind(char c, int index) const { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return s.indexOf(c, index); #else - return s.find(c, index); + return s.tqfind(c, index); #endif } -int LIBCHMString::find(const QChar &c, int index) const +int LIBCHMString::tqfind(const TQChar &c, int index) const { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return s.indexOf(c, index); #else - return s.find(c, index); + return s.tqfind(c, index); #endif } -int LIBCHMString::find(const QString &string, int index, bool cs) const +int LIBCHMString::tqfind(const TQString &string, int index, bool cs) const { -#if defined (USE_QT_4) - Qt::CaseSensitivity cse; - if (cs) cse = Qt::CaseSensitive; - else cse = Qt::CaseInsensitive; +#if defined (USE_TQT_4) + TQt::CaseSensitivity cse; + if (cs) cse = TQt::CaseSensitive; + else cse = TQt::CaseInsensitive; return s.indexOf(string, index, cse); #else - return s.find(string, index, cs); + return s.tqfind(string, index, cs); #endif } -int LIBCHMString::findRev(char c) const +int LIBCHMString::tqfindRev(char c) const { -#if defined (USE_QT_4) +#if defined (USE_TQT_4) return s.lastIndexOf(c); #else - return s.findRev(c); + return s.tqfindRev(c); #endif } -QChar LIBCHMString::at(uint i) const +TQChar LIBCHMString::at(uint i) const { return s.at(i); } -QString LIBCHMString::left(uint len) const +TQString LIBCHMString::left(uint len) const { return s.left(len); } @@ -221,39 +221,39 @@ bool LIBCHMString::isEmpty() const return s.isEmpty(); } -QString LIBCHMString::toString() const +TQString LIBCHMString::toString() const { return s; } -bool LIBCHMString::operator==(const QString &string) const +bool LIBCHMString::operator==(const TQString &string) const { return s == string; } -QString LIBCHMDir::cleanDirPath(const QString &dir) +TQString LIBCHMDir::cleanDirPath(const TQString &dir) { -#if defined (USE_QT_4) - return QDir::cleanPath(dir); +#if defined (USE_TQT_4) + return TQDir::cleanPath(dir); #else - return QDir::cleanDirPath(dir); + return TQDir::cleanDirPath(dir); #endif } -bool LIBCHMStringList::contains(const QStringList &list, const QString &string) +bool LIBCHMStringList::tqcontains(const TQStringList &list, const TQString &string) { - return list.contains(string); + return list.tqcontains(string); } -QStringList LIBCHMStringList::split(const QRegExp ®exp, const QString &string) +TQStringList LIBCHMStringList::split(const TQRegExp ®exp, const TQString &string) { -#if defined (USE_QT_4) - return string.split(regexp, QString::SkipEmptyParts); +#if defined (USE_TQT_4) + return string.split(regexp, TQString::SkipEmptyParts); #else - return QStringList::split(regexp, string); + return TQStringList::split(regexp, string); #endif } diff --git a/lib/libchmfile/qt34.h b/lib/libchmfile/qt34.h index 0835b0a..6181c8b 100644 --- a/lib/libchmfile/qt34.h +++ b/lib/libchmfile/qt34.h @@ -22,22 +22,22 @@ #ifndef INCLUDE_QT34_H #define INCLUDE_QT34_H -#include <qregexp.h> -#include <qstring.h> +#include <tqregexp.h> +#include <tqstring.h> -// Qt3/Qt4 compatibility: in Qt3 QVector stores pointers, not values - so QValueVector should be used. -// In Qt4 QVector stores values, so we can use QVector -#if defined (USE_QT_4) - #define LIBCHMVector QVector +// TQt3/TQt4 compatibility: in TQt3 TQVector stores pointers, not values - so TQValueVector should be used. +// In TQt4 TQVector stores values, so we can use TQVector +#if defined (USE_TQT_4) + #define LIBCHMVector TQVector #else -#include <qvaluevector.h> - #define LIBCHMVector QValueVector +#include <tqvaluevector.h> + #define LIBCHMVector TQValueVector #endif -#if defined (USE_QT_4) - #define LIBCHMMemArray QVector +#if defined (USE_TQT_4) + #define LIBCHMMemArray TQVector #else - #define LIBCHMMemArray QMemArray + #define LIBCHMMemArray TQMemArray #endif class LIBCHMCString @@ -50,74 +50,74 @@ class LIBCHMCString void clear(); - bool operator==(const QString &string) const; + bool operator==(const TQString &string) const; uint length() const; bool isEmpty() const; void prepend(char c); char at(uint i) const; - void replace(uint index, uint len, const char *str); + void tqreplace(uint index, uint len, const char *str); void remove(uint index, uint len); LIBCHMCString lower(); private: -#if defined (USE_QT_4) - QByteArray cs; +#if defined (USE_TQT_4) + TQByteArray cs; #else - QCString cs; + TQCString cs; #endif }; class LIBCHMRegExp { public: - LIBCHMRegExp(const QString ®exp); + LIBCHMRegExp(const TQString ®exp); - int search(const QString &str, int offset = 0); - QString cap(int nth); + int search(const TQString &str, int offset = 0); + TQString cap(int nth); void setMinimal(bool minimal); int matchedLength() const; private: - QRegExp re; + TQRegExp re; }; class LIBCHMString { public: LIBCHMString(); - LIBCHMString(const QString &string); + LIBCHMString(const TQString &string); LIBCHMString(const char *string); - QString lower() const; + TQString lower() const; const char *ascii() const; - int find(char c, int index = -1) const; - int find(const QChar &c, int index) const; - int find(const QString &string, int index, bool cs) const; - int findRev(char c) const; - QChar at(uint i) const; - QString left(uint len) const; + int tqfind(char c, int index = -1) const; + int tqfind(const TQChar &c, int index) const; + int tqfind(const TQString &string, int index, bool cs) const; + int tqfindRev(char c) const; + TQChar at(uint i) const; + TQString left(uint len) const; LIBCHMString mid(uint index, uint len = 0xffffffff) const; bool isEmpty() const; - QString toString() const; + TQString toString() const; - bool operator==(const QString &string) const; + bool operator==(const TQString &string) const; private: - QString s; + TQString s; }; class LIBCHMDir { public: - static QString cleanDirPath(const QString &dir); + static TQString cleanDirPath(const TQString &dir); }; class LIBCHMStringList { public: - static bool contains(const QStringList &list, const QString &string); - static QStringList split(const QRegExp ®exp, const QString &string); + static bool tqcontains(const TQStringList &list, const TQString &string); + static TQStringList split(const TQRegExp ®exp, const TQString &string); }; #endif |