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/kio-msits | |
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/kio-msits')
-rwxr-xr-x | lib/kio-msits/msits.cpp | 38 | ||||
-rwxr-xr-x | lib/kio-msits/msits.h | 12 |
2 files changed, 25 insertions, 25 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; |