From 25794f504692e5a36c490438814e9dfda8aaa2dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 29 May 2011 19:00:37 +0000 Subject: 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 --- lib/kio-msits/msits.cpp | 38 +++++++++++++++++++------------------- lib/kio-msits/msits.h | 12 ++++++------ 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'lib/kio-msits') 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 #include -#include -#include -#include +#include +#include +#include #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 *) context)->push_back (QString::fromLocal8Bit (ui->path)); + ((TQValueVector *) 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 listing; + TQValueVector 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 #include -#include -#include +#include +#include #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; -- cgit v1.2.3