summaryrefslogtreecommitdiffstats
path: root/src/kchmsourcefactory.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
commit25794f504692e5a36c490438814e9dfda8aaa2dd (patch)
tree8061e6d27b5bc9042afdff177872779c4e8c9015 /src/kchmsourcefactory.cpp
parent35ff2a942f63b5201c04f41c3097e61cdd7817e9 (diff)
downloadkchmviewer-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 'src/kchmsourcefactory.cpp')
-rw-r--r--src/kchmsourcefactory.cpp32
1 files changed, 16 insertions, 16 deletions
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 <qcstring.h>
-#include <qimage.h>
-#include <qdir.h>
+#include <tqcstring.h>
+#include <tqimage.h>
+#include <tqdir.h>
#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 );
}