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 --- src/kchmsourcefactory.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/kchmsourcefactory.cpp') diff --git a/src/kchmsourcefactory.cpp b/src/kchmsourcefactory.cpp index 8b4232c..896a447 100644 --- a/src/kchmsourcefactory.cpp +++ b/src/kchmsourcefactory.cpp @@ -19,9 +19,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "libchmfile.h" #include "libchmurlfactory.h" @@ -33,15 +33,15 @@ KCHMSourceFactory::KCHMSourceFactory (KCHMViewWindow * viewwindow) - : QMimeSourceFactory() + : TQMimeSourceFactory() { m_viewWindow = viewwindow; } -const QMimeSource * KCHMSourceFactory::data( const QString & abs_name ) const +const TQMimeSource * KCHMSourceFactory::data( const TQString & abs_name ) const { - QString data, file, path = abs_name; + TQString data, file, path = abs_name; // Retreive the data from chm file LCHMFile * chm = ::mainWindow->chmFile(); @@ -49,7 +49,7 @@ const QMimeSource * KCHMSourceFactory::data( const QString & abs_name ) const if ( !chm ) return 0; - int pos = path.find ('#'); + int pos = path.tqfind ('#'); if ( pos != -1 ) path = path.left (pos); @@ -58,37 +58,37 @@ const QMimeSource * KCHMSourceFactory::data( const QString & abs_name ) const // to generate the HTML page, and set it. if ( LCHMUrlFactory::handleFileType( path, data ) ) { - ((QMimeSourceFactory*)this)->setText (path, data); + ((TQMimeSourceFactory*)this)->setText (path, data); } else if ( path.endsWith (".htm") || path.endsWith (".html") ) { if ( chm->getFileContentAsString( &data, path ) ) - ((QMimeSourceFactory*)this)->setText (path, data); + ((TQMimeSourceFactory*)this)->setText (path, data); } else { // treat as image - QImage img; - QByteArray buf; + TQImage img; + TQByteArray buf; - QString fpath = KCHMViewWindow_QTextBrowser::decodeUrl( path ); + TQString fpath = KCHMViewWindow_QTextBrowser::decodeUrl( path ); if ( chm->getFileContentAsBinary( &buf, fpath ) ) { if ( img.loadFromData ( (const uchar *) buf.data(), buf.size() ) ) - ((QMimeSourceFactory*)this)->setImage (path, img); + ((TQMimeSourceFactory*)this)->setImage (path, img); } else { - ((QMimeSourceFactory*)this)->setImage( path, img ); + ((TQMimeSourceFactory*)this)->setImage( path, img ); qWarning( "Could not resolve file %s\n", path.ascii() ); } } - return QMimeSourceFactory::data (path); + return TQMimeSourceFactory::data (path); } -QString KCHMSourceFactory::makeAbsolute ( const QString & abs_or_rel_name, const QString & ) const +TQString KCHMSourceFactory::makeAbsolute ( const TQString & abs_or_rel_name, const TQString & ) const { return m_viewWindow->makeURLabsolute ( abs_or_rel_name, false ); } -- cgit v1.2.3