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
v3.5.13-sru
tpearson 14 years ago
parent 35ff2a942f
commit 25794f5046

@ -29,9 +29,9 @@
#include <kurl.h> #include <kurl.h>
#include <kmimemagic.h> #include <kmimemagic.h>
#include <qfile.h> #include <tqfile.h>
#include <qbitarray.h> #include <tqbitarray.h>
#include <qvaluevector.h> #include <tqvaluevector.h>
#include "msits.h" #include "msits.h"
#include "libchmurlfactory.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) : SlaveBase ("kio_msits", pool_socket, app_socket)
{ {
m_chmFile = 0; m_chmFile = 0;
@ -76,7 +76,7 @@ ProtocolMSITS::~ProtocolMSITS()
} }
// A simple stat() wrapper // A simple stat() wrapper
static bool isDirectory ( const QString & filename ) static bool isDirectory ( const TQString & filename )
{ {
return filename[filename.length() - 1] == '/'; return filename[filename.length() - 1] == '/';
} }
@ -84,9 +84,9 @@ static bool isDirectory ( const QString & filename )
void ProtocolMSITS::get( const KURL& url ) void ProtocolMSITS::get( const KURL& url )
{ {
QString htmdata, fileName; TQString htmdata, fileName;
chmUnitInfo ui; chmUnitInfo ui;
QByteArray buf; TQByteArray buf;
kdDebug() << "kio_msits::get() " << url.path() << endl; 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; kdDebug() << "ProtocolMSITS::parseLoadAndLookup (const KURL&) " << url.path() << endl;
int pos = url.path().find ("::"); int pos = url.path().tqfind ("::");
if ( pos == -1 ) if ( pos == -1 )
{ {
@ -149,7 +149,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath )
return false; return false;
} }
QString filename = url.path().left (pos); TQString filename = url.path().left (pos);
abspath = url.path().mid (pos + 2); // skip :: abspath = url.path().mid (pos + 2); // skip ::
// Some buggy apps add ms-its:/ to the path as well // 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 // First try to open a temporary file
chmFile * tmpchm; 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() ); error( KIO::ERR_COULD_NOT_READ, url.prettyURL() );
return false; return false;
@ -193,7 +193,7 @@ bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath )
/* /*
* Shamelessly stolen from a KDE KIO tutorial * 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; UDSAtom a;
a.m_uds = uds; a.m_uds = uds;
@ -212,7 +212,7 @@ static void app_entry(UDSEntry& e, unsigned int uds, const QString& str)
// internal function // internal function
// fills a directory item with its name and size // 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(); e.clear();
app_entry(e, KIO::UDS_NAME, name); app_entry(e, KIO::UDS_NAME, name);
@ -222,7 +222,7 @@ static void app_dir(UDSEntry& e, const QString & name)
// internal function // internal function
// fills a file item with its name and size // 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(); e.clear();
app_entry(e, KIO::UDS_NAME, name); 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) void ProtocolMSITS::stat (const KURL & url)
{ {
QString fileName; TQString fileName;
chmUnitInfo ui; chmUnitInfo ui;
kdDebug() << "kio_msits::stat (const KURL& url) " << url.path() << endl; kdDebug() << "kio_msits::stat (const KURL& url) " << url.path() << endl;
@ -263,14 +263,14 @@ void ProtocolMSITS::stat (const KURL & url)
// A local CHMLIB enumerator // A local CHMLIB enumerator
static int chmlib_enumerator (struct chmFile *, struct chmUnitInfo *ui, void *context) 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; return CHM_ENUMERATOR_CONTINUE;
} }
void ProtocolMSITS::listDir (const KURL & url) void ProtocolMSITS::listDir (const KURL & url)
{ {
QString filepath; TQString filepath;
kdDebug() << "kio_msits::listDir (const KURL& url) " << url.path() << endl; 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; kdDebug() << "kio_msits::listDir: enumerating directory " << filepath << endl;
QValueVector<QString> listing; TQValueVector<TQString> listing;
if ( chm_enumerate_dir ( m_chmFile, if ( chm_enumerate_dir ( m_chmFile,
filepath.local8Bit(), filepath.local8Bit(),
@ -305,7 +305,7 @@ void ProtocolMSITS::listDir (const KURL & url)
for ( unsigned int i = 0; i < listing.size(); i++ ) for ( unsigned int i = 0; i < listing.size(); i++ )
{ {
// Strip the direcroty name // Strip the direcroty name
QString ename = listing[i].mid (striplength); TQString ename = listing[i].mid (striplength);
if ( isDirectory ( ename ) ) if ( isDirectory ( ename ) )
app_dir(entry, ename); app_dir(entry, ename);

@ -26,8 +26,8 @@
#include <kio/slavebase.h> #include <kio/slavebase.h>
#include <kurl.h> #include <kurl.h>
#include <qstring.h> #include <tqstring.h>
#include <qcstring.h> #include <tqcstring.h>
#include "config.h" #include "config.h"
#include "chm_lib.h" #include "chm_lib.h"
@ -36,7 +36,7 @@
class ProtocolMSITS : public KIO::SlaveBase class ProtocolMSITS : public KIO::SlaveBase
{ {
public: public:
ProtocolMSITS ( const QCString&, const QCString& ); ProtocolMSITS ( const TQCString&, const TQCString& );
virtual ~ProtocolMSITS(); virtual ~ProtocolMSITS();
virtual void get ( const KURL& ); virtual void get ( const KURL& );
@ -48,10 +48,10 @@ private:
// - parses the URL to get a file name and URL inside the file; // - parses the URL to get a file name and URL inside the file;
// - loads a new CHM file, if needed; // - loads a new CHM file, if needed;
// - returns the parsed URL inside the file; // - 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 // 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; 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 // An opened file name, if presend
QString m_openedFile; TQString m_openedFile;
// a CHM structure file pointer (from chmlib) // a CHM structure file pointer (from chmlib)
chmFile * m_chmFile; chmFile * m_chmFile;

@ -84,7 +84,7 @@ inline u_int64_t sr_int(unsigned char* byte, int* bit,
unsigned char s, unsigned char r, size_t& length) unsigned char s, unsigned char r, size_t& length)
{ {
u_int64_t ret; u_int64_t ret;
unsigned char mask; unsigned char tqmask;
int n, n_bits, num_bits, base, count; int n, n_bits, num_bits, base, count;
length = 0; length = 0;
size_t fflen; size_t fflen;
@ -105,37 +105,37 @@ inline u_int64_t sr_int(unsigned char* byte, int* bit,
switch(num_bits){ switch(num_bits){
case 0: case 0:
mask = 1; tqmask = 1;
break; break;
case 1: case 1:
mask = 3; tqmask = 3;
break; break;
case 2: case 2:
mask = 7; tqmask = 7;
break; break;
case 3: case 3:
mask = 0xf; tqmask = 0xf;
break; break;
case 4: case 4:
mask = 0x1f; tqmask = 0x1f;
break; break;
case 5: case 5:
mask = 0x3f; tqmask = 0x3f;
break; break;
case 6: case 6:
mask = 0x7f; tqmask = 0x7f;
break; break;
case 7: case 7:
mask = 0xff; tqmask = 0xff;
break; break;
default: default:
mask = 0xff; tqmask = 0xff;
break; break;
} }
mask <<= base; tqmask <<= base;
ret = (ret << (num_bits+1)) | ret = (ret << (num_bits+1)) |
(u_int64_t)((*byte & mask) >> base); (u_int64_t)((*byte & tqmask) >> base);
if( n > *bit ){ if( n > *bit ){
++byte; ++byte;

@ -33,7 +33,7 @@ LCHMFile::~ LCHMFile( )
delete m_impl; delete m_impl;
} }
bool LCHMFile::loadFile( const QString & archiveName ) bool LCHMFile::loadFile( const TQString & archiveName )
{ {
return m_impl->loadFile( archiveName ); return m_impl->loadFile( archiveName );
} }
@ -43,14 +43,14 @@ void LCHMFile::closeAll( )
m_impl->closeAll(); m_impl->closeAll();
} }
QString LCHMFile::title( ) const TQString LCHMFile::title( ) const
{ {
return m_impl->title(); 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; 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 ); 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 ); 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 ); return m_impl->getFileContentAsBinary( data, url );
} }
bool LCHMFile::enumerateFiles( QStringList * files ) bool LCHMFile::enumerateFiles( TQStringList * files )
{ {
return m_impl->enumerateFiles( files ); return m_impl->enumerateFiles( files );
} }
QString LCHMFile::getTopicByUrl( const QString & url ) TQString LCHMFile::getTopicByUrl( const TQString & url )
{ {
return m_impl->getTopicByUrl( 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 ); return m_impl->getBookIconPixmap( imagenum );
} }
@ -114,12 +114,12 @@ bool LCHMFile::setCurrentEncoding( const LCHMTextEncoding * encoding )
return m_impl->setCurrentEncoding( 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 ); 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 ); return m_impl->getFileSize( size, url );
} }

@ -22,22 +22,22 @@
#ifndef INCLUDE_LIBCHMFILE_H #ifndef INCLUDE_LIBCHMFILE_H
#define INCLUDE_LIBCHMFILE_H #define INCLUDE_LIBCHMFILE_H
#include <qstring.h> #include <tqstring.h>
#include <qcstring.h> #include <tqcstring.h>
#include <qlistview.h> #include <tqlistview.h>
#include <qlistbox.h> #include <tqlistbox.h>
#include <qmap.h> #include <tqmap.h>
#include <qvaluevector.h> #include <tqvaluevector.h>
#include <qtextcodec.h> #include <tqtextcodec.h>
#include "libchmtextencoding.h" #include "libchmtextencoding.h"
// Qt3/Qt4 compatibility: in Qt3 QVector stores pointers, not values - so QValueVector should be used. // TQt3/TQt4 compatibility: in TQt3 TQVector stores pointers, not values - so TQValueVector should be used.
// In Qt4 QVector stores values, so we can use QVector // In TQt4 TQVector stores values, so we can use TQVector
#if defined (USE_QT_4) #if defined (USE_TQT_4)
#define QT34VECTOR QVector #define QT34VECTOR TQVector
#else #else
#define QT34VECTOR QValueVector #define QT34VECTOR TQValueVector
#endif #endif
@ -56,10 +56,10 @@ namespace LCHMBookIcons
typedef struct typedef struct
{ {
//! Entry name //! Entry name
QString name; TQString name;
//! Entry URLs. The TOC entry should have only one URL; the index entry could have several. //! 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. //! Associated image number. Used for TOC only; indexes does not have the image.
//! Use LCHMFile::getBookIconPixmap() to get associated pixmap icon //! Use LCHMFile::getBookIconPixmap() to get associated pixmap icon
@ -91,7 +91,7 @@ class LCHMFile
* this one are present locally (like MSDN). * this one are present locally (like MSDN).
* \ingroup init * \ingroup init
*/ */
bool loadFile( const QString& archiveName ); bool loadFile( const TQString& archiveName );
/*! /*!
* \brief Closes all the files, and frees the appropriate data. * \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. * \return The name of the opened document, or an empty string if no .chm has been loaded.
* \ingroup information * \ingroup information
*/ */
QString title() const; TQString title() const;
/*! /*!
* \brief Gets the URL of the default page in the chm archive. * \brief Gets the URL of the default page in the chm archive.
@ -113,7 +113,7 @@ class LCHMFile
* returns "/". * returns "/".
* \ingroup information * \ingroup information
*/ */
QString homeUrl() const; TQString homeUrl() const;
/*! /*!
* \brief Checks whether the Table of Contents is present in this file. * \brief Checks whether the Table of Contents is present in this file.
@ -161,7 +161,7 @@ class LCHMFile
bool parseIndex( QT34VECTOR< LCHMParsedEntry > * indexes ) const; 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 str A string where the retreived content should be stored.
* \param url An URL in chm file to retreive content from. Must be absolute. * \param url An URL in chm file to retreive content from. Must be absolute.
* \return true if the content is successfully received; false otherwise. * \return true if the content is successfully received; false otherwise.
@ -173,10 +173,10 @@ class LCHMFile
* \sa setCurrentEncoding() currentEncoding() getFileContentAsBinary() * \sa setCurrentEncoding() currentEncoding() getFileContentAsBinary()
* \ingroup dataretrieve * \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 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. * \param url An URL in chm file to retreive content from. Must be absolute.
* \return true if the content is successfully received; false otherwise. * \return true if the content is successfully received; false otherwise.
@ -187,7 +187,7 @@ class LCHMFile
* \sa getFileContentAsString() * \sa getFileContentAsString()
* \ingroup dataretrieve * \ingroup dataretrieve
*/ */
bool getFileContentAsBinary( QByteArray * data, const QString& url ); bool getFileContentAsBinary( TQByteArray * data, const TQString& url );
/*! /*!
* \brief Retrieves the content size. * \brief Retrieves the content size.
@ -197,7 +197,7 @@ class LCHMFile
* *
* \ingroup dataretrieve * \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. * \brief Obtains the list of all the files in current chm file archive.
@ -206,16 +206,16 @@ class LCHMFile
* *
* \ingroup dataretrieve * \ingroup dataretrieve
*/ */
bool enumerateFiles( QStringList * files ); bool enumerateFiles( TQStringList * files );
/*! /*!
* \brief Gets the Title of the HTML page referenced by url. * \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. * \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 * \ingroup dataretrieve
*/ */
QString getTopicByUrl ( const QString& url ); TQString getTopicByUrl ( const TQString& url );
/*! /*!
* \brief Gets the appropriate CHM pixmap icon. * \brief Gets the appropriate CHM pixmap icon.
@ -224,7 +224,7 @@ class LCHMFile
* *
* \ingroup dataretrieve * \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 .. * \brief Normalizes the URL, converting relatives, adding "/" in front and removing ..
@ -233,7 +233,7 @@ class LCHMFile
* *
* \ingroup dataretrieve * \ingroup dataretrieve
*/ */
QString normalizeUrl( const QString& url ) const; TQString normalizeUrl( const TQString& url ) const;
/*! /*!
* \brief Gets the current CHM archive encoding (set or autodetected) * \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. * If there is no prefix, the word considered as required.
* \ingroup search * \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 //! Access to implementation
LCHMFileImpl * impl() { return m_impl; } LCHMFileImpl * impl() { return m_impl; }

@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qregexp.h> #include <tqregexp.h>
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmfileimpl.h" #include "libchmfileimpl.h"
@ -28,20 +28,20 @@
#define DEBUG_SEARCH(A) #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 ); word.remove ( rxvalid );
if ( word != orig ) if ( word != orig )
query_valid = false; 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++ ) for ( unsigned int i = 0; i < wordlist.size(); i++ )
validateWord ( wordlist[i], query_valid ); 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. // Accumulate the phrase data here.
LCHMSearchProgressResults phrasekeeper; 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; TQStringList words_must_exist, words_must_not_exist, words_highlight;
QT34VECTOR<QStringList> phrases_must_exist; QT34VECTOR<TQStringList> phrases_must_exist;
QString query = inquery; TQString query = inquery;
bool query_valid = true; bool query_valid = true;
LCHMSearchProgressResults results; LCHMSearchProgressResults results;
int pos; int pos;
@ -196,15 +196,15 @@ bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults,
* If there is no prefix, the word considered as required. * If there is no prefix, the word considered as required.
*/ */
QRegExp rxphrase( "\"(.*)\"" ); TQRegExp rxphrase( "\"(.*)\"" );
QRegExp rxword( "([^\\s]+)" ); TQRegExp rxword( "([^\\s]+)" );
rxphrase.setMinimal( TRUE ); rxphrase.setMinimal( TRUE );
// First, get the phrase queries // First, get the phrase queries
while ( (pos = rxphrase.search (query, 0)) != -1 ) while ( (pos = rxphrase.search (query, 0)) != -1 )
{ {
// A phrase query found. Locate its boundaries, and parse it. // 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 ); validateWords ( plist, query_valid );
@ -218,8 +218,8 @@ bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults,
while ( (pos = rxword.search (query, 0)) != -1 ) while ( (pos = rxword.search (query, 0)) != -1 )
{ {
// A phrase query found. Locate its boundaries, and parse it. // A phrase query found. Locate its boundaries, and parse it.
QString word = rxword.cap ( 1 ); TQString word = rxword.cap ( 1 );
QChar type = '+'; TQChar type = '+';
if ( word[0] == '-' || word[0] == '+' ) if ( word[0] == '-' || word[0] == '+' )
{ {
@ -237,17 +237,17 @@ bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults,
query.remove (pos, rxword.matchedLength()); query.remove (pos, rxword.matchedLength());
} }
#if defined (DUMP_SEARCH_QUERY) #if defined (DUMP_SEARCH_TQUERY)
// Dump the search query // Dump the search query
QString qdump; TQString qdump;
for ( i = 0; i < phrases_must_exist.size(); i++ ) 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++ ) 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++ ) 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()); qDebug ("Search query dump: %s", qdump.ascii());
#endif #endif

@ -22,9 +22,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <qcursor.h> #include <tqcursor.h>
#include <qfile.h> #include <tqfile.h>
#include <qapplication.h> #include <tqapplication.h>
#include "config.h" #include "config.h"
#include "chm_lib.h" #include "chm_lib.h"
@ -46,15 +46,15 @@
class KCHMShowWaitCursor class KCHMShowWaitCursor
{ {
public: public:
KCHMShowWaitCursor () { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); } KCHMShowWaitCursor () { TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); }
~KCHMShowWaitCursor () { QApplication::restoreOverrideCursor(); } ~KCHMShowWaitCursor () { TQApplication::restoreOverrideCursor(); }
}; };
LCHMFileImpl::LCHMFileImpl( ) LCHMFileImpl::LCHMFileImpl( )
{ {
m_chmFile = NULL; 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_entityDecodeMap.clear();
m_textCodec = 0; m_textCodec = 0;
m_textCodecForSpecialFiles = 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 the file has a file:// prefix, remove it
if ( archiveName.startsWith( "file://" ) ) if ( archiveName.startsWith( "file://" ) )
@ -82,7 +82,7 @@ bool LCHMFileImpl::loadFile( const QString & archiveName )
if( m_chmFile ) if( m_chmFile )
closeAll(); closeAll();
m_chmFile = chm_open( QFile::encodeName(filename) ); m_chmFile = chm_open( TQFile::encodeName(filename) );
if ( m_chmFile == NULL ) if ( m_chmFile == NULL )
return false; return false;
@ -129,7 +129,7 @@ void LCHMFileImpl::closeAll( )
chm_close( m_chmFile ); chm_close( m_chmFile );
m_chmFile = NULL; 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_entityDecodeMap.clear();
m_textCodec = 0; m_textCodec = 0;
m_textCodecForSpecialFiles = 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 // Set up m_entityDecodeMap characters according to current textCodec
if ( m_entityDecodeMap.isEmpty() ) if ( m_entityDecodeMap.isEmpty() )
@ -247,49 +247,49 @@ QString LCHMFileImpl::decodeEntity( const QString & entity )
m_entityDecodeMap["reg"] = encodeWithCurrentCodec ("\256"); // registered sign m_entityDecodeMap["reg"] = encodeWithCurrentCodec ("\256"); // registered sign
m_entityDecodeMap["nbsp"] = encodeWithCurrentCodec ("\240"); // non breaking space 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["Delta"] = TQChar((unsigned short) 916);
m_entityDecodeMap["Pi"] = QChar((unsigned short) 928); m_entityDecodeMap["Pi"] = TQChar((unsigned short) 928);
m_entityDecodeMap["Sigma"] = QChar((unsigned short) 931); m_entityDecodeMap["Sigma"] = TQChar((unsigned short) 931);
m_entityDecodeMap["beta"] = QChar((unsigned short) 946); m_entityDecodeMap["beta"] = TQChar((unsigned short) 946);
m_entityDecodeMap["gamma"] = QChar((unsigned short) 947); m_entityDecodeMap["gamma"] = TQChar((unsigned short) 947);
m_entityDecodeMap["delta"] = QChar((unsigned short) 948); m_entityDecodeMap["delta"] = TQChar((unsigned short) 948);
m_entityDecodeMap["eta"] = QChar((unsigned short) 951); m_entityDecodeMap["eta"] = TQChar((unsigned short) 951);
m_entityDecodeMap["theta"] = QChar((unsigned short) 952); m_entityDecodeMap["theta"] = TQChar((unsigned short) 952);
m_entityDecodeMap["lambda"] = QChar((unsigned short) 955); m_entityDecodeMap["lambda"] = TQChar((unsigned short) 955);
m_entityDecodeMap["mu"] = QChar((unsigned short) 956); m_entityDecodeMap["mu"] = TQChar((unsigned short) 956);
m_entityDecodeMap["nu"] = QChar((unsigned short) 957); m_entityDecodeMap["nu"] = TQChar((unsigned short) 957);
m_entityDecodeMap["pi"] = QChar((unsigned short) 960); m_entityDecodeMap["pi"] = TQChar((unsigned short) 960);
m_entityDecodeMap["rho"] = QChar((unsigned short) 961); m_entityDecodeMap["rho"] = TQChar((unsigned short) 961);
m_entityDecodeMap["lsquo"] = QChar((unsigned short) 8216); m_entityDecodeMap["lsquo"] = TQChar((unsigned short) 8216);
m_entityDecodeMap["rsquo"] = QChar((unsigned short) 8217); m_entityDecodeMap["rsquo"] = TQChar((unsigned short) 8217);
m_entityDecodeMap["rdquo"] = QChar((unsigned short) 8221); m_entityDecodeMap["rdquo"] = TQChar((unsigned short) 8221);
m_entityDecodeMap["bdquo"] = QChar((unsigned short) 8222); m_entityDecodeMap["bdquo"] = TQChar((unsigned short) 8222);
m_entityDecodeMap["trade"] = QChar((unsigned short) 8482); m_entityDecodeMap["trade"] = TQChar((unsigned short) 8482);
m_entityDecodeMap["ldquo"] = QChar((unsigned short) 8220); m_entityDecodeMap["ldquo"] = TQChar((unsigned short) 8220);
m_entityDecodeMap["ndash"] = QChar((unsigned short) 8211); m_entityDecodeMap["ndash"] = TQChar((unsigned short) 8211);
m_entityDecodeMap["mdash"] = QChar((unsigned short) 8212); m_entityDecodeMap["mdash"] = TQChar((unsigned short) 8212);
m_entityDecodeMap["bull"] = QChar((unsigned short) 8226); m_entityDecodeMap["bull"] = TQChar((unsigned short) 8226);
m_entityDecodeMap["hellip"] = QChar((unsigned short) 8230); m_entityDecodeMap["hellip"] = TQChar((unsigned short) 8230);
m_entityDecodeMap["emsp"] = QChar((unsigned short) 8195); m_entityDecodeMap["emsp"] = TQChar((unsigned short) 8195);
m_entityDecodeMap["rarr"] = QChar((unsigned short) 8594); m_entityDecodeMap["rarr"] = TQChar((unsigned short) 8594);
m_entityDecodeMap["rArr"] = QChar((unsigned short) 8658); m_entityDecodeMap["rArr"] = TQChar((unsigned short) 8658);
m_entityDecodeMap["crarr"] = QChar((unsigned short) 8629); m_entityDecodeMap["crarr"] = TQChar((unsigned short) 8629);
m_entityDecodeMap["le"] = QChar((unsigned short) 8804); m_entityDecodeMap["le"] = TQChar((unsigned short) 8804);
m_entityDecodeMap["ge"] = QChar((unsigned short) 8805); m_entityDecodeMap["ge"] = TQChar((unsigned short) 8805);
m_entityDecodeMap["lte"] = QChar((unsigned short) 8804); // wrong, but used somewhere m_entityDecodeMap["lte"] = TQChar((unsigned short) 8804); // wrong, but used somewhere
m_entityDecodeMap["gte"] = QChar((unsigned short) 8805); // wrong, but used somewhere m_entityDecodeMap["gte"] = TQChar((unsigned short) 8805); // wrong, but used somewhere
m_entityDecodeMap["dagger"] = QChar((unsigned short) 8224); m_entityDecodeMap["dagger"] = TQChar((unsigned short) 8224);
m_entityDecodeMap["Dagger"] = QChar((unsigned short) 8225); m_entityDecodeMap["Dagger"] = TQChar((unsigned short) 8225);
m_entityDecodeMap["euro"] = QChar((unsigned short) 8364); m_entityDecodeMap["euro"] = TQChar((unsigned short) 8364);
m_entityDecodeMap["asymp"] = QChar((unsigned short) 8776); m_entityDecodeMap["asymp"] = TQChar((unsigned short) 8776);
m_entityDecodeMap["isin"] = QChar((unsigned short) 8712); m_entityDecodeMap["isin"] = TQChar((unsigned short) 8712);
m_entityDecodeMap["notin"] = QChar((unsigned short) 8713); m_entityDecodeMap["notin"] = TQChar((unsigned short) 8713);
m_entityDecodeMap["prod"] = QChar((unsigned short) 8719); m_entityDecodeMap["prod"] = TQChar((unsigned short) 8719);
m_entityDecodeMap["ne"] = QChar((unsigned short) 8800); m_entityDecodeMap["ne"] = TQChar((unsigned short) 8800);
m_entityDecodeMap["amp"] = "&"; // ampersand m_entityDecodeMap["amp"] = "&"; // ampersand
m_entityDecodeMap["gt"] = ">"; // greater than m_entityDecodeMap["gt"] = ">"; // greater than
@ -311,19 +311,19 @@ QString LCHMFileImpl::decodeEntity( const QString & entity )
if ( !valid ) if ( !valid )
{ {
qWarning ( "LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", entity.ascii() ); 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 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() ) if ( it == m_entityDecodeMap.end() )
{ {
qWarning ("LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", entity.ascii()); qWarning ("LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", entity.ascii());
return QString::null; return TQString();
} }
return *it; 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 ) if ( qbegin == -1 )
qFatal ("LCHMFileImpl::findStringInQuotes: cannot find first quote in <param> tag: '%s'", tag.ascii()); 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 ) if ( qend == -1 || qend <= qbegin )
qFatal ("LCHMFileImpl::findStringInQuotes: cannot find last quote in <param> tag: '%s'", tag.ascii()); 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 we do not need to decode HTML entities, just return.
if ( decodeentities ) if ( decodeentities )
{ {
QString htmlentity = QString::null; TQString htmlentity = TQString();
bool fill_entity = false; bool fill_entity = false;
value.reserve (qend - qbegin); // to avoid multiple memory allocations 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 ( tag[i] == ';' ) // HTML entity ends
{ {
// If entity is an ASCII code, just decode it // If entity is an ASCII code, just decode it
QString decode = decodeEntity( htmlentity ); TQString decode = decodeEntity( htmlentity );
if ( decode.isNull() ) if ( decode.isNull() )
break; break;
value.append ( decode ); value.append ( decode );
htmlentity = QString::null; htmlentity = TQString();
fill_entity = false; fill_entity = false;
} }
else 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 wholeWords,
bool titlesOnly, bool titlesOnly,
LCHMSearchProgressResults& results, LCHMSearchProgressResults& results,
@ -397,7 +397,7 @@ bool LCHMFileImpl::searchWord (const QString& text,
if ( text.isEmpty() || !m_searchAvailable ) if ( text.isEmpty() || !m_searchAvailable )
return false; return false;
QString searchword = (QString) convertSearchWord (text); TQString searchword = (TQString) convertSearchWord (text);
#define FTS_HEADER_LEN 0x32 #define FTS_HEADER_LEN 0x32
unsigned char header[FTS_HEADER_LEN]; unsigned char header[FTS_HEADER_LEN];
@ -425,11 +425,11 @@ bool LCHMFileImpl::searchWord (const QString& text,
u_int16_t tree_depth = UINT16ARRAY(cursor16); u_int16_t tree_depth = UINT16ARRAY(cursor16);
unsigned char word_len, pos; unsigned char word_len, pos;
QString word; TQString word;
u_int32_t i = sizeof(u_int16_t); u_int32_t i = sizeof(u_int16_t);
u_int16_t free_space; 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); 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); 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; 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 return m_chmFile != NULL
&& ::chm_resolve_object(m_chmFile, fileName.ascii(), ui) == && ::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 initialOffset,
u_int32_t buffSize, u_int32_t buffSize,
u_int16_t treeDepth) u_int16_t treeDepth)
@ -546,8 +546,8 @@ inline u_int32_t LCHMFileImpl::GetLeafNodeOffset(const QString& text,
unsigned char* cursor16, *cursor32; unsigned char* cursor16, *cursor32;
unsigned char word_len, pos; unsigned char word_len, pos;
u_int32_t i = sizeof(u_int16_t); u_int32_t i = sizeof(u_int16_t);
QMemArray<unsigned char> buffer(buffSize); TQMemArray<unsigned char> buffer(buffSize);
QString word; TQString word;
while(--treeDepth) while(--treeDepth)
{ {
@ -607,7 +607,7 @@ inline bool LCHMFileImpl::ProcessWLC (u_int64_t wlc_count, u_int64_t wlc_size,
int wlc_bit = 7; int wlc_bit = 7;
u_int64_t index = 0, count; u_int64_t index = 0, count;
size_t length, off = 0; size_t length, off = 0;
QMemArray<unsigned char> buffer (wlc_size); TQMemArray<unsigned char> buffer (wlc_size);
unsigned char *cursor32; unsigned char *cursor32;
unsigned char entry[TOPICS_ENTRY_LEN]; 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 entries = get_int32_le( (u_int32_t *)(buffer) );
u_int32_t entry_size = get_int32_le( (u_int32_t *)(buffer + 0x04) ); 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(); unsigned char* raw = (unsigned char*) uptr.data();
if ( !RetrieveObject (&ui, raw, 8, entries * entry_size) ) if ( !RetrieveObject (&ui, raw, 8, entries * entry_size) )
@ -706,7 +706,7 @@ bool LCHMFileImpl::getInfoFromWindows()
size = RetrieveObject(&ui, buffer, factor * 4096, BUF_SIZE); size = RetrieveObject(&ui, buffer, factor * 4096, BUF_SIZE);
if ( size && off_title ) 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) if ( factor != off_home / 4096)
{ {
@ -715,7 +715,7 @@ bool LCHMFileImpl::getInfoFromWindows()
} }
if ( size && off_home ) 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) if ( factor != off_hhc / 4096)
{ {
@ -724,7 +724,7 @@ bool LCHMFileImpl::getInfoFromWindows()
} }
if ( size && off_hhc ) 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) if ( factor != off_hhk / 4096)
{ {
@ -733,7 +733,7 @@ bool LCHMFileImpl::getInfoFromWindows()
} }
if ( size && off_hhk ) 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; return true;
@ -775,7 +775,7 @@ bool LCHMFileImpl::getInfoFromSystem()
cursor = buffer + index; cursor = buffer + index;
if(m_topicsFile.isEmpty()) if(m_topicsFile.isEmpty())
m_topicsFile = QString("/") + QString((const char*) buffer + index + 2); m_topicsFile = TQString("/") + TQString((const char*) buffer + index + 2);
break; break;
@ -784,7 +784,7 @@ bool LCHMFileImpl::getInfoFromSystem()
cursor = buffer + index; cursor = buffer + index;
if(m_indexFile.isEmpty()) if(m_indexFile.isEmpty())
m_indexFile = QString("/") + QString ((const char*)buffer + index + 2); m_indexFile = TQString("/") + TQString ((const char*)buffer + index + 2);
break; break;
case 2: case 2:
@ -792,13 +792,13 @@ bool LCHMFileImpl::getInfoFromSystem()
cursor = buffer + index; cursor = buffer + index;
if(m_home.isEmpty() || m_home == "/") 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; break;
case 3: case 3:
index += 2; index += 2;
cursor = buffer + index; cursor = buffer + index;
m_title = QString((const char*) (buffer + index + 2)); m_title = TQString((const char*) (buffer + index + 2));
break; break;
case 4: case 4:
@ -815,8 +815,8 @@ bool LCHMFileImpl::getInfoFromSystem()
cursor = buffer + index; cursor = buffer + index;
if(m_topicsFile.isEmpty()) { if(m_topicsFile.isEmpty()) {
QString topicAttempt = "/", tmp; TQString topicAttempt = "/", tmp;
topicAttempt += QString ((const char*) buffer +index +2); topicAttempt += TQString ((const char*) buffer +index +2);
tmp = topicAttempt + ".hhc"; tmp = topicAttempt + ".hhc";
@ -834,7 +834,7 @@ bool LCHMFileImpl::getInfoFromSystem()
index += 2; index += 2;
cursor = buffer + index; cursor = buffer + index;
m_font = QString ((const char*) buffer + index + 2); m_font = TQString ((const char*) buffer + index + 2);
break; break;
default: 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] = static const char * searchwordtable[128] =
{ {
@ -865,9 +865,9 @@ QCString LCHMFileImpl::convertSearchWord( const QString & src )
}; };
if ( !m_textCodec ) 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++ ) for ( unsigned int i = 0; i < dest.size(); i++ )
{ {
@ -875,7 +875,7 @@ QCString LCHMFileImpl::convertSearchWord( const QString & src )
{ {
int index = dest[i] & 0x7F; int index = dest[i] & 0x7F;
if ( searchwordtable[index] ) if ( searchwordtable[index] )
dest.replace (i, 1, searchwordtable[index]); dest.tqreplace (i, 1, searchwordtable[index]);
else else
dest.remove (i, 1); dest.remove (i, 1);
} }
@ -887,15 +887,15 @@ QCString LCHMFileImpl::convertSearchWord( const QString & src )
void LCHMFileImpl::getSearchResults( const LCHMSearchProgressResults& tempres, void LCHMFileImpl::getSearchResults( const LCHMSearchProgressResults& tempres,
QStringList * results, TQStringList * results,
unsigned int limit_results ) unsigned int limit_results )
{ {
unsigned char combuf [COMMON_BUF_LEN]; 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++ ) 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; continue;
urlsmap[tempres[i].urloff] = 1; 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 ('#'); int pos = path.tqfind ('#');
QString fixedpath = pos == -1 ? path : path.left (pos); TQString fixedpath = pos == -1 ? path : path.left (pos);
return LCHMUrlFactory::makeURLabsoluteIfNeeded( fixedpath ); 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> * FIXME: <OBJECT type="text/sitemap"><param name="Merge" value="hhaxref.chm::/HHOCX_c.hhc"></OBJECT>
* (from htmlhelp.chm) * (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; const int MAX_NEST_DEPTH = 256;
if ( !getFileContentAsString( &src, file ) || src.isEmpty() ) if ( !getFileContentAsString( &src, file ) || src.isEmpty() )
@ -937,11 +937,11 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM
/* /*
// Save the index for debugging purposes // Save the index for debugging purposes
QFile outfile( "parsed.htm" ); TQFile outfile( "parsed.htm" );
if ( outfile.open( IO_WriteOnly ) ) if ( outfile.open( IO_WriteOnly ) )
{ {
QTextStream textstream( &outfile ); TQTextStream textstream( &outfile );
textstream << src; textstream << src;
outfile.close(); outfile.close();
} }
@ -957,7 +957,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM
// Split the HHC file by HTML tags // Split the HHC file by HTML tags
int stringlen = src.length(); 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; int i, word_end = 0;
@ -967,8 +967,8 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM
if ( (src[i] == '"' || src[i] == '\'') ) if ( (src[i] == '"' || src[i] == '\'') )
{ {
// find where quote ends, either by another quote, or by '>' symbol (some people don't know HTML) // 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); int nextpos = src.tqfind (src[i], i+1);
if ( nextpos == -1 && (nextpos = src.find ('>', i+1)) == -1 ) if ( nextpos == -1 && (nextpos = src.tqfind ('>', i+1)) == -1 )
{ {
qWarning ("LCHMFileImpl::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).ascii()); qWarning ("LCHMFileImpl::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).ascii());
return false; return false;
@ -982,7 +982,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM
word_end = i; word_end = i;
} }
QString tagword, tag = src.mid (pos, i - pos); TQString tagword, tag = src.mid (pos, i - pos);
if ( word_end ) if ( word_end )
tagword = src.mid (pos, word_end - pos).lower(); 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()); //qDebug ("tag: '%s', tagword: '%s'\n", tag.ascii(), tagword.ascii());
// <OBJECT type="text/sitemap"> - a topic entry // <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; in_object = true;
else if ( tagword == "/object" && in_object ) 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."); 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.urls.clear();
entry.imageid = defaultimagenum; entry.imageid = defaultimagenum;
in_object = false; in_object = false;
@ -1030,17 +1030,17 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM
{ {
// <param name="Name" value="First Page"> // <param name="Name" value="First Page">
int offset; // strlen("param ") int offset; // strlen("param ")
QString name_pattern = "name=", value_pattern = "value="; TQString name_pattern = "name=", value_pattern = "value=";
QString pname, pvalue; 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()); qFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no name=\n", tag.ascii());
// offset+5 skips 'name=' // offset+5 skips 'name='
offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE);
pname = pname.lower(); 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()); qFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no value=\n", tag.ascii());
// offset+6 skips 'value=' // offset+6 skips 'value='
@ -1057,9 +1057,9 @@ bool LCHMFileImpl::parseFileAndFillArray( const QString & file, QT34VECTOR< LCHM
else if ( pname == "local" ) else if ( pname == "local" )
{ {
// Check for URL duplication // 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 ); entry.urls.push_back( url );
} }
else if ( pname == "see also" && asIndex && entry.name != pvalue ) 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; 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 ) ) if ( getFileContentAsBinary( &buf, url ) )
{ {
@ -1126,7 +1126,7 @@ bool LCHMFileImpl::getFileContentAsString( QString * str, const QString & url, b
buf.resize( length + 1 ); buf.resize( length + 1 );
buf [length] = '\0'; 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; 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() ) if ( it == m_url2topics.end() )
return QString::null; return TQString();
return it.data(); 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 ) 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; return CHM_ENUMERATOR_CONTINUE;
} }
bool LCHMFileImpl::enumerateFiles( QStringList * files ) bool LCHMFileImpl::enumerateFiles( TQStringList * files )
{ {
files->clear(); files->clear();
return chm_enumerate( m_chmFile, CHM_ENUMERATE_ALL, chm_enumerator_callback, files ); 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 ); return m_imagesKeeper.getImage( imagenum );
} }
@ -1188,7 +1188,7 @@ bool LCHMFileImpl::guessTextEncoding( )
bool LCHMFileImpl::changeFileEncoding( const char *qtencoding ) 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) // set up encodings separately for text (first) and internal files (second)
const char * p = strchr( qtencoding, '/' ); const char * p = strchr( qtencoding, '/' );
if ( p ) if ( p )
@ -1197,7 +1197,7 @@ bool LCHMFileImpl::changeFileEncoding( const char *qtencoding )
strcpy( buf, qtencoding ); strcpy( buf, qtencoding );
buf[p - qtencoding] = '\0'; buf[p - qtencoding] = '\0';
m_textCodec = QTextCodec::codecForName( buf ); m_textCodec = TQTextCodec::codecForName( buf );
if ( !m_textCodec ) if ( !m_textCodec )
{ {
@ -1205,7 +1205,7 @@ bool LCHMFileImpl::changeFileEncoding( const char *qtencoding )
return false; return false;
} }
m_textCodecForSpecialFiles = QTextCodec::codecForName( p + 1 ); m_textCodecForSpecialFiles = TQTextCodec::codecForName( p + 1 );
if ( !m_textCodecForSpecialFiles ) if ( !m_textCodecForSpecialFiles )
{ {
@ -1215,7 +1215,7 @@ bool LCHMFileImpl::changeFileEncoding( const char *qtencoding )
} }
else else
{ {
m_textCodecForSpecialFiles = m_textCodec = QTextCodec::codecForName (qtencoding); m_textCodecForSpecialFiles = m_textCodec = TQTextCodec::codecForName (qtencoding);
if ( !m_textCodec ) if ( !m_textCodec )
{ {
@ -1235,7 +1235,7 @@ void LCHMFileImpl::fillTopicsUrlMap()
return; return;
// Read those tables // 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 ) if ( !RetrieveObject( &m_chmTOPICS, (unsigned char*) topics.data(), 0, m_chmTOPICS.length )
|| !RetrieveObject( &m_chmURLTBL, (unsigned char*) urltbl.data(), 0, m_chmURLTBL.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) ); 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; 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() ) if ( off_title < strings.size() )
m_url2topics[url] = encodeWithCurrentCodec ( (const char*) strings.data() + off_title ); 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; chmUnitInfo ui;

@ -34,7 +34,7 @@ class LCHMSearchProgressResult
inline LCHMSearchProgressResult() {} inline LCHMSearchProgressResult() {}
inline LCHMSearchProgressResult( u_int32_t t, u_int32_t u ) : titleoff(t),urloff(u) {} 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 titleoff;
u_int32_t urloff; u_int32_t urloff;
}; };
@ -51,25 +51,25 @@ class LCHMFileImpl
~LCHMFileImpl(); ~LCHMFileImpl();
// Implementations for LCHMFile members // Implementations for LCHMFile members
bool loadFile( const QString& archiveName ); bool loadFile( const TQString& archiveName );
void closeAll(); void closeAll();
QString title() const { return encodeWithCurrentCodec( m_title ); } TQString title() const { return encodeWithCurrentCodec( m_title ); }
QString homeUrl() const { return encodeWithCurrentCodec( m_home ); } TQString homeUrl() const { return encodeWithCurrentCodec( m_home ); }
bool getFileContentAsString( QString * str, const QString& url, bool internal_encoding = false ); bool getFileContentAsString( TQString * str, const TQString& url, bool internal_encoding = false );
bool getFileContentAsBinary( QByteArray * data, const QString& url ) const; bool getFileContentAsBinary( TQByteArray * data, const TQString& url ) const;
bool getFileSize( unsigned int * size, const QString& url ); bool getFileSize( unsigned int * size, const TQString& url );
bool enumerateFiles( QStringList * files ); bool enumerateFiles( TQStringList * files );
QString getTopicByUrl ( const QString& url ) const; TQString getTopicByUrl ( const TQString& url ) const;
const QPixmap * getBookIconPixmap( unsigned int imagenum ); const TQPixmap * getBookIconPixmap( unsigned int imagenum );
bool setCurrentEncoding( const LCHMTextEncoding * encoding ); bool setCurrentEncoding( const LCHMTextEncoding * encoding );
//! Parse the HHC or HHS file, and fill the context (asIndex is false) or index (asIndex is true) array. //! 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. * \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. * \param phrase_search Indicates that word offset information should be kept.
* \return true if the search found something, false otherwise. * \return true if the search found something, false otherwise.
*/ */
bool searchWord( const QString& word, bool searchWord( const TQString& word,
bool wholeWords, bool wholeWords,
bool titlesOnly, bool titlesOnly,
LCHMSearchProgressResults& results, LCHMSearchProgressResults& results,
@ -95,46 +95,46 @@ class LCHMFileImpl
* The keys are the URLs and the values are the page titles. * The keys are the URLs and the values are the page titles.
*/ */
void getSearchResults( const LCHMSearchProgressResults& tempres, void getSearchResults( const LCHMSearchProgressResults& tempres,
QStringList * results, TQStringList * results,
unsigned int limit_results = 500 ); unsigned int limit_results = 500 );
//! Looks up fileName in the archive. //! 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. //! Retrieves an uncompressed chunk of a file in the .chm.
size_t RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) const; 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. //! 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); 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. //! 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. //! Encode the string from internal files with the currently selected text codec, if possible.
//! Or return as-is, if not. //! 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); return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : str);
} }
//! Encode the string from internal files with the currently selected text codec, if possible. //! Encode the string from internal files with the currently selected text codec, if possible.
//! Or return as-is, if not. //! 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. //! 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. //! 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 initalOffset,
u_int32_t buffSize, u_int32_t buffSize,
u_int16_t treeDepth ); u_int16_t treeDepth );
@ -168,23 +168,23 @@ class LCHMFileImpl
bool guessTextEncoding (); bool guessTextEncoding ();
//! Change the current CHM encoding for internal files and texts. //! 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) //! set up encodings separately for text (first) and internal files (second)
bool changeFileEncoding( const char *qtencoding ); bool changeFileEncoding( const char *qtencoding );
//! Convert the word, so it has an appropriate encoding //! 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 * Helper procedure in TOC parsing, decodes the string between the quotes (first or last) with decoding HTML
* entities like &iacute; * entities like &iacute;
*/ */
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. * 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. * \brief Returns the list of all available text encodings.
@ -216,7 +216,7 @@ class LCHMFileImpl
/*! /*!
* Normalizes path to search in internal arrays * Normalizes path to search in internal arrays
*/ */
QString normalizeUrl (const QString& path ) const; TQString normalizeUrl (const TQString& path ) const;
// Members // Members
@ -225,36 +225,36 @@ class LCHMFileImpl
chmFile * m_chmFile; chmFile * m_chmFile;
//! Opened file name //! Opened file name
QString m_filename; TQString m_filename;
//! Home url, got from CHM file //! Home url, got from CHM file
QString m_home; TQString m_home;
//! Context tree filename. Got from CHM file //! Context tree filename. Got from CHM file
QString m_topicsFile; TQString m_topicsFile;
//! Index filename. Got from CHM file //! Index filename. Got from CHM file
QString m_indexFile; TQString m_indexFile;
//! Chm Title. Got from CHM file //! Chm Title. Got from CHM file
QString m_title; TQString m_title;
// Localization stuff // Localization stuff
//! LCID from CHM file, used in encoding detection //! LCID from CHM file, used in encoding detection
short m_detectedLCID; short m_detectedLCID;
//! font charset from CHM file, used in encoding detection //! font charset from CHM file, used in encoding detection
QString m_font; TQString m_font;
//! Chosen text codec //! Chosen text codec
QTextCodec * m_textCodec; TQTextCodec * m_textCodec;
QTextCodec * m_textCodecForSpecialFiles; TQTextCodec * m_textCodecForSpecialFiles;
//! Current encoding //! Current encoding
const LCHMTextEncoding * m_currentEncoding; const LCHMTextEncoding * m_currentEncoding;
//! Map to decode HTML entitles like &acute; based on current encoding //! Map to decode HTML entitles like &acute; 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 //! TRUE if /#TOPICS, /#STRINGS, /#URLTBL and /#URLSTR are resolved, and the members below are valid
bool m_lookupTablesValid; bool m_lookupTablesValid;
@ -282,5 +282,5 @@ class LCHMFileImpl
LCHMTocImageKeeper m_imagesKeeper; LCHMTocImageKeeper m_imagesKeeper;
//! Map url->topic //! Map url->topic
QMap< QString, QString > m_url2topics; TQMap< TQString, TQString > m_url2topics;
}; };

@ -33,7 +33,7 @@ typedef struct LCHMTextEncoding
int winlcid; //! Windows LCID for this language int winlcid; //! Windows LCID for this language
int wincodepage; //! Windows codepage for this language. int wincodepage; //! Windows codepage for this language.
int wincharset; //! Windows charset. int wincharset; //! Windows charset.
const char * qtcodec; //! Qt text codec to use const char * qtcodec; //! TQt text codec to use
}; };

@ -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 ) 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 ); qFatal("LCHMTocImageKeeper::getImage: requested image id (%d) is out of range (%d)", id, LCHMBookIcons::MAX_BUILTIN_ICONS );

@ -25,8 +25,8 @@ class LCHMTocImageKeeper
{ {
public: public:
LCHMTocImageKeeper(); LCHMTocImageKeeper();
const QPixmap * getImage( int id ); const TQPixmap * getImage( int id );
private: private:
QPixmap m_images[LCHMBookIcons::MAX_BUILTIN_ICONS]; TQPixmap m_images[LCHMBookIcons::MAX_BUILTIN_ICONS];
}; };

@ -19,18 +19,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qdir.h> #include <tqdir.h>
#include <qstring.h> #include <tqstring.h>
#include <qregexp.h> #include <tqregexp.h>
namespace LCHMUrlFactory 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 // Check whether the URL is external
QRegExp uriregex ( "^(\\w+):\\/\\/" ); TQRegExp uriregex ( "^(\\w+):\\/\\/" );
QRegExp mailtoregex ( "^(mailto):" ); TQRegExp mailtoregex ( "^(mailto):" );
// mailto: can also have different format, so handle it // mailto: can also have different format, so handle it
if ( url.startsWith( "mailto:" ) ) if ( url.startsWith( "mailto:" ) )
@ -40,7 +40,7 @@ static inline bool isRemoteURL( const QString & url, QString & protocol )
} }
else if ( uriregex.search ( url ) != -1 ) 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 // Filter the URLs which need to be opened by a browser
if ( proto == "http" if ( proto == "http"
@ -57,15 +57,15 @@ static inline bool isRemoteURL( const QString & url, QString & protocol )
} }
// Some JS urls start with javascript:// // Some JS urls start with javascript://
static inline bool isJavascriptURL( const QString & url ) static inline bool isJavascriptURL( const TQString & url )
{ {
return url.startsWith ("javascript://"); return url.startsWith ("javascript://");
} }
// Parse urls like "ms-its:file name.chm::/topic.htm" // 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 ) if ( uriregex.search ( url ) != -1 )
{ {
@ -78,15 +78,15 @@ static inline bool isNewChmURL( const QString & url, QString & chmfile, QString
return false; 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) if ( !isRemoteURL (url, p1)
&& !isJavascriptURL (url) && !isJavascriptURL (url)
&& !isNewChmURL (url, p1, p2) ) && !isNewChmURL (url, p1, p2) )
{ {
newurl = QDir::cleanDirPath (url); newurl = TQDir::cleanDirPath (url);
// Normalize url, so it becomes absolute // Normalize url, so it becomes absolute
if ( newurl[0] != '/' ) 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 // 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. // 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"; 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 ) ) if ( !link.endsWith( intext ) )
return false; 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>"; generated = "<html><body><img src=\"" + filelink + "\"></body></html>";
return true; return true;
} }

@ -19,9 +19,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qdir.h> #include <tqdir.h>
#include "qt34.h" #include "tqt34.h"
LIBCHMCString::LIBCHMCString() LIBCHMCString::LIBCHMCString()
{ {
@ -29,10 +29,10 @@ LIBCHMCString::LIBCHMCString()
LIBCHMCString::LIBCHMCString(const char *string) LIBCHMCString::LIBCHMCString(const char *string)
{ {
#if defined (USE_QT_4) #if defined (USE_TQT_4)
cs = QByteArray(string); cs = TQByteArray(string);
#else #else
cs = QCString(string); cs = TQCString(string);
#endif #endif
} }
@ -45,16 +45,16 @@ const char *LIBCHMCString::toCString() const
void LIBCHMCString::clear() void LIBCHMCString::clear()
{ {
#if defined (USE_QT_4) #if defined (USE_TQT_4)
cs = QByteArray(); cs = TQByteArray();
#else #else
cs = QCString(); cs = TQCString();
#endif #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 uint LIBCHMCString::length() const
@ -77,9 +77,9 @@ char LIBCHMCString::at(uint i) const
return cs.at(i); 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) void LIBCHMCString::remove(uint index, uint len)
@ -89,7 +89,7 @@ void LIBCHMCString::remove(uint index, uint len)
LIBCHMCString LIBCHMCString::lower() LIBCHMCString LIBCHMCString::lower()
{ {
#if defined (USE_QT_4) #if defined (USE_TQT_4)
return cs.toLower().data(); return cs.toLower().data();
#else #else
return cs.lower().data(); return cs.lower().data();
@ -98,21 +98,21 @@ LIBCHMCString LIBCHMCString::lower()
LIBCHMRegExp::LIBCHMRegExp(const QString &regexp) LIBCHMRegExp::LIBCHMRegExp(const TQString &regexp)
{ {
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); return re.indexIn(str, offset);
#else #else
return re.search(str, offset); return re.search(str, offset);
#endif #endif
} }
QString LIBCHMRegExp::cap(int nth) TQString LIBCHMRegExp::cap(int nth)
{ {
return re.cap(nth); return re.cap(nth);
} }
@ -134,19 +134,19 @@ LIBCHMString::LIBCHMString()
{ {
} }
LIBCHMString::LIBCHMString(const QString &string) LIBCHMString::LIBCHMString(const TQString &string)
{ {
s = string; s = string;
} }
LIBCHMString::LIBCHMString(const char *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(); return s.toLower();
#else #else
return s.lower(); return s.lower();
@ -155,58 +155,58 @@ QString LIBCHMString::lower() const
const char *LIBCHMString::ascii() const const char *LIBCHMString::ascii() const
{ {
#if defined (USE_QT_4) #if defined (USE_TQT_4)
return s.toAscii(); return s.toAscii();
#else #else
return s.ascii(); return s.ascii();
#endif #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); return s.indexOf(c, index);
#else #else
return s.find(c, index); return s.tqfind(c, index);
#endif #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); return s.indexOf(c, index);
#else #else
return s.find(c, index); return s.tqfind(c, index);
#endif #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) #if defined (USE_TQT_4)
Qt::CaseSensitivity cse; TQt::CaseSensitivity cse;
if (cs) cse = Qt::CaseSensitive; if (cs) cse = TQt::CaseSensitive;
else cse = Qt::CaseInsensitive; else cse = TQt::CaseInsensitive;
return s.indexOf(string, index, cse); return s.indexOf(string, index, cse);
#else #else
return s.find(string, index, cs); return s.tqfind(string, index, cs);
#endif #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); return s.lastIndexOf(c);
#else #else
return s.findRev(c); return s.tqfindRev(c);
#endif #endif
} }
QChar LIBCHMString::at(uint i) const TQChar LIBCHMString::at(uint i) const
{ {
return s.at(i); return s.at(i);
} }
QString LIBCHMString::left(uint len) const TQString LIBCHMString::left(uint len) const
{ {
return s.left(len); return s.left(len);
} }
@ -221,39 +221,39 @@ bool LIBCHMString::isEmpty() const
return s.isEmpty(); return s.isEmpty();
} }
QString LIBCHMString::toString() const TQString LIBCHMString::toString() const
{ {
return s; return s;
} }
bool LIBCHMString::operator==(const QString &string) const bool LIBCHMString::operator==(const TQString &string) const
{ {
return s == string; return s == string;
} }
QString LIBCHMDir::cleanDirPath(const QString &dir) TQString LIBCHMDir::cleanDirPath(const TQString &dir)
{ {
#if defined (USE_QT_4) #if defined (USE_TQT_4)
return QDir::cleanPath(dir); return TQDir::cleanPath(dir);
#else #else
return QDir::cleanDirPath(dir); return TQDir::cleanDirPath(dir);
#endif #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 &regexp, const QString &string) TQStringList LIBCHMStringList::split(const TQRegExp &regexp, const TQString &string)
{ {
#if defined (USE_QT_4) #if defined (USE_TQT_4)
return string.split(regexp, QString::SkipEmptyParts); return string.split(regexp, TQString::SkipEmptyParts);
#else #else
return QStringList::split(regexp, string); return TQStringList::split(regexp, string);
#endif #endif
} }

@ -22,22 +22,22 @@
#ifndef INCLUDE_QT34_H #ifndef INCLUDE_QT34_H
#define INCLUDE_QT34_H #define INCLUDE_QT34_H
#include <qregexp.h> #include <tqregexp.h>
#include <qstring.h> #include <tqstring.h>
// Qt3/Qt4 compatibility: in Qt3 QVector stores pointers, not values - so QValueVector should be used. // TQt3/TQt4 compatibility: in TQt3 TQVector stores pointers, not values - so TQValueVector should be used.
// In Qt4 QVector stores values, so we can use QVector // In TQt4 TQVector stores values, so we can use TQVector
#if defined (USE_QT_4) #if defined (USE_TQT_4)
#define LIBCHMVector QVector #define LIBCHMVector TQVector
#else #else
#include <qvaluevector.h> #include <tqvaluevector.h>
#define LIBCHMVector QValueVector #define LIBCHMVector TQValueVector
#endif #endif
#if defined (USE_QT_4) #if defined (USE_TQT_4)
#define LIBCHMMemArray QVector #define LIBCHMMemArray TQVector
#else #else
#define LIBCHMMemArray QMemArray #define LIBCHMMemArray TQMemArray
#endif #endif
class LIBCHMCString class LIBCHMCString
@ -50,74 +50,74 @@ class LIBCHMCString
void clear(); void clear();
bool operator==(const QString &string) const; bool operator==(const TQString &string) const;
uint length() const; uint length() const;
bool isEmpty() const; bool isEmpty() const;
void prepend(char c); void prepend(char c);
char at(uint i) const; 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); void remove(uint index, uint len);
LIBCHMCString lower(); LIBCHMCString lower();
private: private:
#if defined (USE_QT_4) #if defined (USE_TQT_4)
QByteArray cs; TQByteArray cs;
#else #else
QCString cs; TQCString cs;
#endif #endif
}; };
class LIBCHMRegExp class LIBCHMRegExp
{ {
public: public:
LIBCHMRegExp(const QString &regexp); LIBCHMRegExp(const TQString &regexp);
int search(const QString &str, int offset = 0); int search(const TQString &str, int offset = 0);
QString cap(int nth); TQString cap(int nth);
void setMinimal(bool minimal); void setMinimal(bool minimal);
int matchedLength() const; int matchedLength() const;
private: private:
QRegExp re; TQRegExp re;
}; };
class LIBCHMString class LIBCHMString
{ {
public: public:
LIBCHMString(); LIBCHMString();
LIBCHMString(const QString &string); LIBCHMString(const TQString &string);
LIBCHMString(const char *string); LIBCHMString(const char *string);
QString lower() const; TQString lower() const;
const char *ascii() const; const char *ascii() const;
int find(char c, int index = -1) const; int tqfind(char c, int index = -1) const;
int find(const QChar &c, int index) const; int tqfind(const TQChar &c, int index) const;
int find(const QString &string, int index, bool cs) const; int tqfind(const TQString &string, int index, bool cs) const;
int findRev(char c) const; int tqfindRev(char c) const;
QChar at(uint i) const; TQChar at(uint i) const;
QString left(uint len) const; TQString left(uint len) const;
LIBCHMString mid(uint index, uint len = 0xffffffff) const; LIBCHMString mid(uint index, uint len = 0xffffffff) const;
bool isEmpty() const; bool isEmpty() const;
QString toString() const; TQString toString() const;
bool operator==(const QString &string) const; bool operator==(const TQString &string) const;
private: private:
QString s; TQString s;
}; };
class LIBCHMDir class LIBCHMDir
{ {
public: public:
static QString cleanDirPath(const QString &dir); static TQString cleanDirPath(const TQString &dir);
}; };
class LIBCHMStringList class LIBCHMStringList
{ {
public: public:
static bool contains(const QStringList &list, const QString &string); static bool tqcontains(const TQStringList &list, const TQString &string);
static QStringList split(const QRegExp &regexp, const QString &string); static TQStringList split(const TQRegExp &regexp, const TQString &string);
}; };
#endif #endif

@ -22,14 +22,14 @@
#ifndef FORWARD_DECLARATIONS_H #ifndef FORWARD_DECLARATIONS_H
#define FORWARD_DECLARATIONS_H #define FORWARD_DECLARATIONS_H
class QComboBox; class TQComboBox;
class QListView; class TQListView;
class QListBox; class TQListBox;
class QListViewItem; class TQListViewItem;
class QListViewItemIterator; class TQListViewItemIterator;
class QLineEdit; class TQLineEdit;
class QTabWidget; class TQTabWidget;
class QToolButton; class TQToolButton;
class KCHMMainWindow; class KCHMMainWindow;
class KCHMViewWindow; class KCHMViewWindow;

@ -973,7 +973,7 @@ static const KCHMIconStorage::png_memory_image_t png_image_toolbakicons[] =
const QPixmap * KCHMIconStorage::getApplicationIcon( ) const TQPixmap * KCHMIconStorage::getApplicationIcon( )
{ {
static const char png_image_cr64_app_kchmviewer[] = static const char png_image_cr64_app_kchmviewer[] =
{ {
@ -1197,7 +1197,7 @@ const QPixmap * KCHMIconStorage::getApplicationIcon( )
if ( !m_iconApplication ) if ( !m_iconApplication )
{ {
m_iconApplication = new QPixmap (); m_iconApplication = new TQPixmap ();
if ( !m_iconApplication->loadFromData ((const uchar*)png_image_cr64_app_kchmviewer, sizeof(png_image_cr64_app_kchmviewer) - 1, "PNG") ) if ( !m_iconApplication->loadFromData ((const uchar*)png_image_cr64_app_kchmviewer, sizeof(png_image_cr64_app_kchmviewer) - 1, "PNG") )
qFatal ("Could not load application icon"); qFatal ("Could not load application icon");
} }
@ -1206,7 +1206,7 @@ const QPixmap * KCHMIconStorage::getApplicationIcon( )
} }
const QPixmap * KCHMIconStorage::getCloseWindowIcon( ) const TQPixmap * KCHMIconStorage::getCloseWindowIcon( )
{ {
static const char png_image_cancel[] = static const char png_image_cancel[] =
{ {
@ -1253,7 +1253,7 @@ const QPixmap * KCHMIconStorage::getCloseWindowIcon( )
if ( !m_iconCloseWindow ) if ( !m_iconCloseWindow )
{ {
m_iconCloseWindow = new QPixmap (); m_iconCloseWindow = new TQPixmap ();
if ( !m_iconCloseWindow->loadFromData ((const uchar*)png_image_cancel, sizeof(png_image_cancel) - 1, "PNG") ) if ( !m_iconCloseWindow->loadFromData ((const uchar*)png_image_cancel, sizeof(png_image_cancel) - 1, "PNG") )
qFatal ("Could not load cancel icon"); qFatal ("Could not load cancel icon");
@ -1274,19 +1274,19 @@ KCHMIconStorage::KCHMIconStorage( )
KCHMIconStorage gIconStorage; KCHMIconStorage gIconStorage;
const QPixmap * KCHMIconStorage::getToolbarPixmap( pixmap_index_t pix ) const TQPixmap * KCHMIconStorage::getToolbarPixmap( pixmap_index_t pix )
{ {
return returnOrLoadImage ( (unsigned int) pix, png_image_toolbakicons + (pix - KCHMIconStorage::back)); return returnOrLoadImage ( (unsigned int) pix, png_image_toolbakicons + (pix - KCHMIconStorage::back));
} }
const QPixmap * KCHMIconStorage::returnOrLoadImage( unsigned int id, const png_memory_image_t * image ) const TQPixmap * KCHMIconStorage::returnOrLoadImage( unsigned int id, const png_memory_image_t * image )
{ {
QMap<unsigned int, QPixmap*>::iterator it = m_iconMap.find (id); TQMap<unsigned int, TQPixmap*>::iterator it = m_iconMap.tqfind (id);
if ( it == m_iconMap.end() ) if ( it == m_iconMap.end() )
{ {
m_iconMap[id] = new QPixmap (); m_iconMap[id] = new TQPixmap ();
if ( !m_iconMap[id]->loadFromData ((const uchar*)image->data, image->size, "PNG") ) if ( !m_iconMap[id]->loadFromData ((const uchar*)image->data, image->size, "PNG") )
qFatal ("Could not load image %d", id); qFatal ("Could not load image %d", id);
} }

@ -22,8 +22,8 @@
#ifndef ICON_STORAGE_H #ifndef ICON_STORAGE_H
#define ICON_STORAGE_H #define ICON_STORAGE_H
#include <qmap.h> #include <tqmap.h>
#include <qpixmap.h> #include <tqpixmap.h>
class KCHMIconStorage class KCHMIconStorage
@ -54,16 +54,16 @@ class KCHMIconStorage
}; };
KCHMIconStorage(); KCHMIconStorage();
const QPixmap * getToolbarPixmap (pixmap_index_t pix); const TQPixmap * getToolbarPixmap (pixmap_index_t pix);
const QPixmap * getApplicationIcon(); const TQPixmap * getApplicationIcon();
const QPixmap * getCloseWindowIcon(); const TQPixmap * getCloseWindowIcon();
private: private:
const QPixmap * returnOrLoadImage (unsigned int id, const png_memory_image_t * image); const TQPixmap * returnOrLoadImage (unsigned int id, const png_memory_image_t * image);
QMap<unsigned int, QPixmap*> m_iconMap; TQMap<unsigned int, TQPixmap*> m_iconMap;
QPixmap * m_iconApplication; TQPixmap * m_iconApplication;
QPixmap * m_iconCloseWindow; TQPixmap * m_iconCloseWindow;
}; };
extern KCHMIconStorage gIconStorage; extern KCHMIconStorage gIconStorage;

@ -27,52 +27,52 @@
#include "kchmbookmarkwindow.moc" #include "kchmbookmarkwindow.moc"
KCHMBookmarkWindow::KCHMBookmarkWindow(QWidget *parent, const char *name) KCHMBookmarkWindow::KCHMBookmarkWindow(TQWidget *tqparent, const char *name)
: QWidget(parent, name) : TQWidget(tqparent, name)
{ {
QVBoxLayout * layout = new QVBoxLayout (this); TQVBoxLayout * tqlayout = new TQVBoxLayout (this);
layout->setMargin (5); tqlayout->setMargin (5);
m_bookmarkList = new KQListView (this); m_bookmarkList = new KQListView (this);
m_bookmarkList->addColumn( "bookmark" ); // no need to i18n - the column is hidden m_bookmarkList->addColumn( "bookmark" ); // no need to i18n - the column is hidden
m_bookmarkList->header()->hide(); m_bookmarkList->header()->hide();
layout->addWidget (m_bookmarkList); tqlayout->addWidget (m_bookmarkList);
new KCHMListItemTooltip( m_bookmarkList ); new KCHMListItemTooltip( m_bookmarkList );
QHBoxLayout * hlayout = new QHBoxLayout (layout); TQHBoxLayout * htqlayout = new TQHBoxLayout (tqlayout);
QPushButton * add = new QPushButton ( i18n( "&Add" ), this); TQPushButton * add = new TQPushButton ( i18n( "&Add" ), this);
QPushButton * edit = new QPushButton ( i18n( "&Edit" ), this); TQPushButton * edit = new TQPushButton ( i18n( "&Edit" ), this);
QPushButton * del = new QPushButton ( i18n( "&Del" ), this); TQPushButton * del = new TQPushButton ( i18n( "&Del" ), this);
hlayout->addWidget (add); htqlayout->addWidget (add);
hlayout->addWidget (edit); htqlayout->addWidget (edit);
hlayout->addWidget (del); htqlayout->addWidget (del);
connect( m_bookmarkList, connect( m_bookmarkList,
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int) ),
this, this,
SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) ); TQT_SLOT( onDoubleClicked ( TQListViewItem *, const TQPoint &, int) ) );
connect( add, connect( add,
SIGNAL( clicked () ), TQT_SIGNAL( clicked () ),
this, this,
SLOT( onAddBookmarkPressed( ) ) ); TQT_SLOT( onAddBookmarkPressed( ) ) );
connect( del, connect( del,
SIGNAL( clicked () ), TQT_SIGNAL( clicked () ),
this, this,
SLOT( onDelBookmarkPressed( ) ) ); TQT_SLOT( onDelBookmarkPressed( ) ) );
connect( edit, connect( edit,
SIGNAL( clicked () ), TQT_SIGNAL( clicked () ),
this, this,
SLOT( onEditBookmarkPressed( ) ) ); TQT_SLOT( onEditBookmarkPressed( ) ) );
connect( m_bookmarkList, connect( m_bookmarkList,
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ),
this, this,
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) ); TQT_SLOT( slotContextMenuRequested ( TQListViewItem *, const TQPoint &, int ) ) );
m_menuBookmarks = 0; m_menuBookmarks = 0;
m_contextMenu = 0; m_contextMenu = 0;
@ -82,12 +82,12 @@ KCHMBookmarkWindow::KCHMBookmarkWindow(QWidget *parent, const char *name)
void KCHMBookmarkWindow::onAddBookmarkPressed( ) void KCHMBookmarkWindow::onAddBookmarkPressed( )
{ {
bool ok; bool ok;
QString url = ::mainWindow->currentBrowser()->getOpenedPage(); TQString url = ::mainWindow->currentBrowser()->getOpenedPage();
QString title = ::mainWindow->chmFile()->getTopicByUrl(url); TQString title = ::mainWindow->chmFile()->getTopicByUrl(url);
QString name = QInputDialog::getText( TQString name = TQInputDialog::getText(
i18n( "%1 - add a bookmark") . arg(APP_NAME), i18n( "%1 - add a bookmark") . arg(APP_NAME),
i18n( "Enter the name for this bookmark:" ), i18n( "Enter the name for this bookmark:" ),
QLineEdit::Normal, TQLineEdit::Normal,
title, title,
&ok, &ok,
this); this);
@ -126,10 +126,10 @@ void KCHMBookmarkWindow::onEditBookmarkPressed( )
if ( item ) if ( item )
{ {
bool ok; bool ok;
QString name = QInputDialog::getText( TQString name = TQInputDialog::getText(
i18n( "%1 - edit the bookmark name") . arg(APP_NAME), i18n( "%1 - edit the bookmark name") . arg(APP_NAME),
i18n( "Enter the name for this bookmark:" ), i18n( "Enter the name for this bookmark:" ),
QLineEdit::Normal, TQLineEdit::Normal,
item->name, item->name,
&ok, &ok,
this); this);
@ -144,7 +144,7 @@ void KCHMBookmarkWindow::onEditBookmarkPressed( )
} }
void KCHMBookmarkWindow::onDoubleClicked( QListViewItem * item, const QPoint &, int ) void KCHMBookmarkWindow::onDoubleClicked( TQListViewItem * item, const TQPoint &, int )
{ {
if ( !item ) if ( !item )
return; return;
@ -171,7 +171,7 @@ void KCHMBookmarkWindow::restoreSettings( const KCHMSettings::bookmark_saved_set
void KCHMBookmarkWindow::saveSettings( KCHMSettings::bookmark_saved_settings_t & settings ) void KCHMBookmarkWindow::saveSettings( KCHMSettings::bookmark_saved_settings_t & settings )
{ {
QListViewItemIterator it (m_bookmarkList); TQListViewItemIterator it (m_bookmarkList);
settings.clear(); settings.clear();
@ -182,9 +182,9 @@ void KCHMBookmarkWindow::saveSettings( KCHMSettings::bookmark_saved_settings_t &
} }
} }
void KCHMBookmarkWindow::invalidate( ) void KCHMBookmarkWindow::tqinvalidate( )
{ {
QListViewItemIterator it( m_bookmarkList ); TQListViewItemIterator it( m_bookmarkList );
for ( ; it.current(); it++ ) for ( ; it.current(); it++ )
m_menuBookmarks->removeItem( ((KCHMBookmarkTreeViewItem *) it.current())->menuid ); m_menuBookmarks->removeItem( ((KCHMBookmarkTreeViewItem *) it.current())->menuid );
@ -192,21 +192,21 @@ void KCHMBookmarkWindow::invalidate( )
m_bookmarkList->clear(); m_bookmarkList->clear();
} }
void KCHMBookmarkWindow::createMenu( KCHMMainWindow * parent ) void KCHMBookmarkWindow::createMenu( KCHMMainWindow * tqparent )
{ {
// Create the main Bookmark menu // Create the main Bookmark menu
m_menuBookmarks = new KQPopupMenu( parent ); m_menuBookmarks = new KTQPopupMenu( tqparent );
parent->menuBar()->insertItem( i18n( "&Bookmarks"), m_menuBookmarks ); tqparent->menuBar()->insertItem( i18n( "&Bookmarks"), m_menuBookmarks );
m_menuBookmarks->insertItem( i18n( "&Add bookmark"), this, SLOT(onAddBookmarkPressed()), CTRL+Key_B ); m_menuBookmarks->insertItem( i18n( "&Add bookmark"), this, TQT_SLOT(onAddBookmarkPressed()), CTRL+Key_B );
m_menuBookmarks->insertSeparator(); m_menuBookmarks->insertSeparator();
connect( m_menuBookmarks, SIGNAL( activated(int) ), this, SLOT ( onBookmarkSelected(int) )); connect( m_menuBookmarks, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( onBookmarkSelected(int) ));
} }
void KCHMBookmarkWindow::onBookmarkSelected( int bookmark ) void KCHMBookmarkWindow::onBookmarkSelected( int bookmark )
{ {
QListViewItemIterator it( m_bookmarkList ); TQListViewItemIterator it( m_bookmarkList );
for ( ; it.current(); it++ ) for ( ; it.current(); it++ )
{ {
@ -223,7 +223,7 @@ void KCHMBookmarkWindow::onBookmarkSelected( int bookmark )
} }
} }
void KCHMBookmarkWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int ) void KCHMBookmarkWindow::slotContextMenuRequested( TQListViewItem * item, const TQPoint & point, int )
{ {
if ( !m_contextMenu ) if ( !m_contextMenu )
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this ); m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );

@ -29,35 +29,36 @@
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
class KCHMBookmarkWindow : public QWidget class KCHMBookmarkWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMBookmarkWindow(QWidget *parent = 0, const char *name = 0); KCHMBookmarkWindow(TQWidget *tqparent = 0, const char *name = 0);
virtual ~KCHMBookmarkWindow() {}; virtual ~KCHMBookmarkWindow() {};
void createMenu( KCHMMainWindow * parent ); void createMenu( KCHMMainWindow * tqparent );
void restoreSettings (const KCHMSettings::bookmark_saved_settings_t& settings); void restoreSettings (const KCHMSettings::bookmark_saved_settings_t& settings);
void saveSettings (KCHMSettings::bookmark_saved_settings_t& settings); void saveSettings (KCHMSettings::bookmark_saved_settings_t& settings);
void invalidate(); void tqinvalidate();
public slots: public slots:
void onAddBookmarkPressed (); void onAddBookmarkPressed ();
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column ); void slotContextMenuRequested ( TQListViewItem *item, const TQPoint &point, int column );
private slots: private slots:
void onBookmarkSelected( int ); void onBookmarkSelected( int );
void onDelBookmarkPressed( ); void onDelBookmarkPressed( );
void onEditBookmarkPressed( ); void onEditBookmarkPressed( );
void onDoubleClicked ( QListViewItem *, const QPoint &, int ); void onDoubleClicked ( TQListViewItem *, const TQPoint &, int );
private: private:
KQPopupMenu * m_menuBookmarks; KTQPopupMenu * m_menuBookmarks;
KQListView * m_bookmarkList; KQListView * m_bookmarkList;
QString m_bookmarkFileName; TQString m_bookmarkFileName;
bool m_listChanged; bool m_listChanged;
KQPopupMenu * m_contextMenu; KTQPopupMenu * m_contextMenu;
}; };
#endif #endif

@ -32,8 +32,8 @@ const char * APP_PATHINUSERDIR = ".kchmviewer";
KCHMConfig::KCHMConfig() KCHMConfig::KCHMConfig()
{ {
QDir dir; TQDir dir;
m_datapath = QDir::homeDirPath() + "/" + APP_PATHINUSERDIR; m_datapath = TQDir::homeDirPath() + "/" + APP_PATHINUSERDIR;
dir.setPath (m_datapath); dir.setPath (m_datapath);
@ -47,8 +47,8 @@ KCHMConfig::KCHMConfig()
m_HistoryStoreExtra = true; m_HistoryStoreExtra = true;
m_useSearchEngine = SEARCH_USE_MINE; m_useSearchEngine = SEARCH_USE_MINE;
m_QtBrowserPath = "viewurl-netscape.sh '%s'"; m_TQtBrowserPath = "viewurl-netscape.sh '%s'";
m_kdeUseQTextBrowser = false; m_kdeUseTQTextBrowser = false;
m_kdeEnableJS = false; m_kdeEnableJS = false;
m_kdeEnableJava = false; m_kdeEnableJava = false;
m_kdeEnablePlugins = true; m_kdeEnablePlugins = true;
@ -67,24 +67,24 @@ KCHMConfig::~KCHMConfig()
bool KCHMConfig::load() bool KCHMConfig::load()
{ {
QFile file (m_datapath + "/config"); TQFile file (m_datapath + "/config");
if ( !file.open (IO_ReadOnly) ) if ( !file.open (IO_ReadOnly) )
return false; // no error message - not actually a problem return false; // no error message - not actually a problem
QString line; TQString line;
char readbuf[4096]; char readbuf[4096];
bool getting_history = false; bool getting_history = false;
m_History.clear(); m_History.clear();
while ( file.readLine( readbuf, sizeof(readbuf) - 1 ) > 0 ) while ( file.readLine( readbuf, sizeof(readbuf) - 1 ) > 0 )
{ {
line = QString::fromUtf8( readbuf ).stripWhiteSpace(); line = TQString::fromUtf8( readbuf ).stripWhiteSpace();
// skip empty lines and comments // skip empty lines and comments
if ( line.isEmpty() || line[0] == '#' ) if ( line.isEmpty() || line[0] == '#' )
continue; continue;
QRegExp rxsection ("^\\[(\\w+)\\]$"), rxkeypair ("^(\\w+)\\s*=\\s*(.*)$"); TQRegExp rxsection ("^\\[(\\w+)\\]$"), rxkeypair ("^(\\w+)\\s*=\\s*(.*)$");
if ( rxsection.search ( line ) != -1 ) if ( rxsection.search ( line ) != -1 )
{ {
@ -93,13 +93,13 @@ bool KCHMConfig::load()
else if ( rxsection.cap (1) == "history" ) else if ( rxsection.cap (1) == "history" )
getting_history = true; getting_history = true;
else else
qWarning ("Unknown configuration section: %s", rxsection.cap (1).ascii()); qWarning ("Unknown configuration section: %s", TQString(rxsection.cap(1)).ascii());
continue; continue;
} }
else if ( !getting_history && rxkeypair.search ( line ) != -1 ) else if ( !getting_history && rxkeypair.search ( line ) != -1 )
{ {
QString key (rxkeypair.cap (1)), value (rxkeypair.cap(2)); TQString key (rxkeypair.cap (1)), value (rxkeypair.cap(2));
if ( key == "LoadLatestFileOnStartup" ) if ( key == "LoadLatestFileOnStartup" )
m_LoadLatestFileOnStartup = value.toInt() ? true : false; m_LoadLatestFileOnStartup = value.toInt() ? true : false;
@ -111,10 +111,10 @@ bool KCHMConfig::load()
m_HistorySize = value.toInt(); m_HistorySize = value.toInt();
else if ( key == "HistoryStoreExtra" ) else if ( key == "HistoryStoreExtra" )
m_HistoryStoreExtra = value.toInt() ? true : false; m_HistoryStoreExtra = value.toInt() ? true : false;
else if ( key == "QtBrowserPath" ) else if ( key == "TQtBrowserPath" )
m_QtBrowserPath = value; m_TQtBrowserPath = value;
else if ( key == "kdeUseQTextBrowser" ) else if ( key == "kdeUseTQTextBrowser" )
m_kdeUseQTextBrowser = value.toInt() ? true : false; m_kdeUseTQTextBrowser = value.toInt() ? true : false;
else if ( key == "kdeEnableJS" ) else if ( key == "kdeEnableJS" )
m_kdeEnableJS = value.toInt() ? true : false; m_kdeEnableJS = value.toInt() ? true : false;
else if ( key == "kdeEnableJava" ) else if ( key == "kdeEnableJava" )
@ -148,15 +148,15 @@ bool KCHMConfig::load()
bool KCHMConfig::save( ) bool KCHMConfig::save( )
{ {
QFile file (m_datapath + "/config"); TQFile file (m_datapath + "/config");
if ( !file.open (IO_WriteOnly) ) if ( !file.open (IO_WriteOnly) )
{ {
qWarning ("Could not write settings into file %s: %s", file.name().ascii(), file.errorString().ascii()); qWarning ("Could not write settings into file %s: %s", TQString(file.name()).ascii(), TQString(file.errorString()).ascii());
return false; return false;
} }
QTextStream stream( &file ); TQTextStream stream( &file );
stream.setEncoding( QTextStream::UnicodeUTF8 ); stream.setEncoding( TQTextStream::UnicodeUTF8 );
stream << "[settings]\n"; stream << "[settings]\n";
stream << "LoadLatestFileOnStartup=" << m_LoadLatestFileOnStartup << "\n"; stream << "LoadLatestFileOnStartup=" << m_LoadLatestFileOnStartup << "\n";
@ -165,8 +165,8 @@ bool KCHMConfig::save( )
stream << "HistorySize=" << m_HistorySize << "\n"; stream << "HistorySize=" << m_HistorySize << "\n";
stream << "HistoryStoreExtra=" << m_HistoryStoreExtra << "\n"; stream << "HistoryStoreExtra=" << m_HistoryStoreExtra << "\n";
stream << "QtBrowserPath=" << m_QtBrowserPath << "\n"; stream << "TQtBrowserPath=" << m_TQtBrowserPath << "\n";
stream << "kdeUseQTextBrowser=" << m_kdeUseQTextBrowser << "\n"; stream << "kdeUseTQTextBrowser=" << m_kdeUseTQTextBrowser << "\n";
stream << "kdeEnableJS=" << m_kdeEnableJS << "\n"; stream << "kdeEnableJS=" << m_kdeEnableJS << "\n";
stream << "kdeEnableJava=" << m_kdeEnableJava << "\n"; stream << "kdeEnableJava=" << m_kdeEnableJava << "\n";
stream << "kdeEnablePlugins=" << m_kdeEnablePlugins << "\n"; stream << "kdeEnablePlugins=" << m_kdeEnablePlugins << "\n";
@ -187,9 +187,9 @@ bool KCHMConfig::save( )
return true; return true;
} }
void KCHMConfig::addFileToHistory( const QString & file ) void KCHMConfig::addFileToHistory( const TQString & file )
{ {
QStringList::Iterator itr = m_History.find( file ); TQStringList::Iterator itr = m_History.tqfind( file );
// check whether file already exists in history - more it forward // check whether file already exists in history - more it forward
if ( itr != m_History.end() ) if ( itr != m_History.end() )
@ -206,7 +206,7 @@ void KCHMConfig::addFileToHistory( const QString & file )
} }
// Remove a file from the front // Remove a file from the front
QString filetoremove = m_History[0]; TQString filetoremove = m_History[0];
m_History.erase( m_History.begin() ); m_History.erase( m_History.begin() );
m_History.push_back( file ); m_History.push_back( file );

@ -22,8 +22,8 @@
#ifndef KCHMCONFIG_H #ifndef KCHMCONFIG_H
#define KCHMCONFIG_H #define KCHMCONFIG_H
#include <qstring.h> #include <tqstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
extern const char * APP_PATHINUSERDIR; extern const char * APP_PATHINUSERDIR;
@ -53,11 +53,11 @@ public:
bool load(); bool load();
bool save(); bool save();
void addFileToHistory ( const QString& file ); void addFileToHistory ( const TQString& file );
public: public:
QString m_datapath; TQString m_datapath;
QString m_lastOpenedDir; TQString m_lastOpenedDir;
bool m_LoadLatestFileOnStartup; bool m_LoadLatestFileOnStartup;
choose_action_t m_onNewChmClick; choose_action_t m_onNewChmClick;
@ -66,17 +66,17 @@ public:
bool m_HistoryStoreExtra; bool m_HistoryStoreExtra;
use_search_engine m_useSearchEngine; use_search_engine m_useSearchEngine;
QString m_QtBrowserPath; TQString m_TQtBrowserPath;
bool m_kdeUseQTextBrowser; bool m_kdeUseTQTextBrowser;
bool m_kdeEnableJS; bool m_kdeEnableJS;
bool m_kdeEnableJava; bool m_kdeEnableJava;
bool m_kdeEnablePlugins; bool m_kdeEnablePlugins;
bool m_kdeEnableRefresh; bool m_kdeEnableRefresh;
bool m_advUseInternalEditor; bool m_advUseInternalEditor;
QString m_advExternalEditorPath; TQString m_advExternalEditorPath;
QStringList m_History; TQStringList m_History;
}; };
extern KCHMConfig appConfig; extern KCHMConfig appConfig;

@ -30,8 +30,8 @@
#include "kchmcontentswindow.moc" #include "kchmcontentswindow.moc"
KCHMContentsWindow::KCHMContentsWindow(QWidget *parent, const char *name) KCHMContentsWindow::KCHMContentsWindow(TQWidget *tqparent, const char *name)
: KQListView(parent, name) : KQListView(tqparent, name)
{ {
m_contextMenu = 0; m_contextMenu = 0;
@ -42,11 +42,11 @@ KCHMContentsWindow::KCHMContentsWindow(QWidget *parent, const char *name)
header()->hide(); header()->hide();
setShowToolTips( false ); setShowToolTips( false );
connect( this, SIGNAL( onItem ( QListViewItem * ) ), this, SLOT( slotOnItem( QListViewItem * ) ) ); connect( this, TQT_SIGNAL( onItem ( TQListViewItem * ) ), this, TQT_SLOT( slotOnItem( TQListViewItem * ) ) );
connect( this, connect( this,
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ),
this, this,
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) ); TQT_SLOT( slotContextMenuRequested ( TQListViewItem *, const TQPoint &, int ) ) );
new KCHMListItemTooltip( this ); new KCHMListItemTooltip( this );
@ -56,7 +56,7 @@ KCHMContentsWindow::~KCHMContentsWindow()
{ {
} }
void KCHMContentsWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int ) void KCHMContentsWindow::slotContextMenuRequested( TQListViewItem * item, const TQPoint & point, int )
{ {
if ( !m_contextMenu ) if ( !m_contextMenu )
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this ); m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
@ -71,7 +71,7 @@ void KCHMContentsWindow::slotContextMenuRequested( QListViewItem * item, const Q
void KCHMContentsWindow::refillTableOfContents( ) void KCHMContentsWindow::refillTableOfContents( )
{ {
QValueVector< LCHMParsedEntry > data; TQValueVector< LCHMParsedEntry > data;
if ( !::mainWindow->chmFile()->parseTableOfContents( &data ) if ( !::mainWindow->chmFile()->parseTableOfContents( &data )
|| data.size() == 0 ) || data.size() == 0 )
@ -83,10 +83,10 @@ void KCHMContentsWindow::refillTableOfContents( )
kchmFillListViewWithParsedData( this, data, &m_urlListMap ); kchmFillListViewWithParsedData( this, data, &m_urlListMap );
} }
KCHMIndTocItem * KCHMContentsWindow::getTreeItem( const QString & url ) KCHMIndTocItem * KCHMContentsWindow::getTreeItem( const TQString & url )
{ {
QString fixedstr = ::mainWindow->chmFile()->normalizeUrl( url ); TQString fixedstr = ::mainWindow->chmFile()->normalizeUrl( url );
QMap<QString, KCHMIndTocItem*>::const_iterator it = m_urlListMap.find( fixedstr ); TQMap<TQString, KCHMIndTocItem*>::const_iterator it = m_urlListMap.tqfind( fixedstr );
if ( it == m_urlListMap.end() ) if ( it == m_urlListMap.end() )
return 0; return 0;

@ -31,22 +31,23 @@
class KCHMContentsWindow : public KQListView class KCHMContentsWindow : public KQListView
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMContentsWindow( QWidget *parent = 0, const char *name = 0 ); KCHMContentsWindow( TQWidget *tqparent = 0, const char *name = 0 );
~KCHMContentsWindow(); ~KCHMContentsWindow();
QRect tip( const QPoint & p ); TQRect tip( const TQPoint & p );
void refillTableOfContents(); void refillTableOfContents();
KCHMIndTocItem * getTreeItem( const QString& url ); KCHMIndTocItem * getTreeItem( const TQString& url );
public slots: public slots:
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column ); void slotContextMenuRequested ( TQListViewItem *item, const TQPoint &point, int column );
private: private:
KQPopupMenu * m_contextMenu; KTQPopupMenu * m_contextMenu;
QMap<QString, KCHMIndTocItem*> m_urlListMap; TQMap<TQString, KCHMIndTocItem*> m_urlListMap;
}; };
#endif /* INCLUDE_KCHMCONTENTSWINDOW_H */ #endif /* INCLUDE_KCHMCONTENTSWINDOW_H */

@ -24,47 +24,47 @@
#include "kchmdialogchooseurlfromlist.h" #include "kchmdialogchooseurlfromlist.h"
#include "kchmtreeviewitem.h" #include "kchmtreeviewitem.h"
KCHMDialogChooseUrlFromList::KCHMDialogChooseUrlFromList(const QStringList& urls, const QStringList& titles, QWidget* parent) KCHMDialogChooseUrlFromList::KCHMDialogChooseUrlFromList(const TQStringList& urls, const TQStringList& titles, TQWidget* tqparent)
: QDialog(parent, 0, true) : TQDialog(tqparent, 0, true)
{ {
QVBoxLayout * layout = new QVBoxLayout (this); TQVBoxLayout * tqlayout = new TQVBoxLayout (this);
layout->setMargin (5); tqlayout->setMargin (5);
QListView * m_urlsList = new QListView (this); TQListView * m_urlsList = new TQListView (this);
m_urlsList->addColumn( i18n( "Topics" ) ); m_urlsList->addColumn( i18n( "Topics" ) );
for ( unsigned int i = 0; i < urls.size(); i++ ) for ( unsigned int i = 0; i < urls.size(); i++ )
new KCHMSingleTreeViewItem (m_urlsList, titles[i], urls[i]); new KCHMSingleTreeViewItem (m_urlsList, titles[i], urls[i]);
layout->addWidget ( new QLabel( i18n( "Please select one of the topics below:"), this) ); tqlayout->addWidget ( new TQLabel( i18n( "Please select one of the topics below:"), this) );
layout->addWidget ( m_urlsList ); tqlayout->addWidget ( m_urlsList );
QHBoxLayout * hlayout = new QHBoxLayout (layout); TQHBoxLayout * htqlayout = new TQHBoxLayout (tqlayout);
QPushButton * bok = new QPushButton( i18n( "&Ok" ), this); TQPushButton * bok = new TQPushButton( i18n( "&Ok" ), this);
QPushButton * bcancel = new QPushButton( i18n( "&Cancel" ), this); TQPushButton * bcancel = new TQPushButton( i18n( "&Cancel" ), this);
hlayout->addWidget (bok); htqlayout->addWidget (bok);
hlayout->addWidget (bcancel); htqlayout->addWidget (bcancel);
connect( m_urlsList, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), this, SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) ); connect( m_urlsList, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int) ), this, TQT_SLOT( onDoubleClicked ( TQListViewItem *, const TQPoint &, int) ) );
connect( m_urlsList, SIGNAL( currentChanged ( QListViewItem *) ), this, SLOT( onCurrentChanged ( QListViewItem *) ) ); connect( m_urlsList, TQT_SIGNAL( currentChanged ( TQListViewItem *) ), this, TQT_SLOT( onCurrentChanged ( TQListViewItem *) ) );
connect( bok, SIGNAL( clicked () ), this, SLOT( accept() ) ); connect( bok, TQT_SIGNAL( clicked () ), this, TQT_SLOT( accept() ) );
connect( bcancel, SIGNAL( clicked () ), this, SLOT( reject() ) ); connect( bcancel, TQT_SIGNAL( clicked () ), this, TQT_SLOT( reject() ) );
m_acceptedurl = QString::null; m_acceptedurl = TQString();
} }
void KCHMDialogChooseUrlFromList::onDoubleClicked( QListViewItem * , const QPoint &, int ) void KCHMDialogChooseUrlFromList::onDoubleClicked( TQListViewItem * , const TQPoint &, int )
{ {
accept(); accept();
} }
void KCHMDialogChooseUrlFromList::onCurrentChanged( QListViewItem * item ) void KCHMDialogChooseUrlFromList::onCurrentChanged( TQListViewItem * item )
{ {
if ( item ) if ( item )
m_acceptedurl = ((KCHMSingleTreeViewItem *) item)->getUrl(); m_acceptedurl = ((KCHMSingleTreeViewItem *) item)->getUrl();
else else
m_acceptedurl = QString::null; m_acceptedurl = TQString();
} }
#include "kchmdialogchooseurlfromlist.moc" #include "kchmdialogchooseurlfromlist.moc"

@ -22,26 +22,27 @@
#ifndef KCHMDIALOGCHOOSEURLFROMLIST_H #ifndef KCHMDIALOGCHOOSEURLFROMLIST_H
#define KCHMDIALOGCHOOSEURLFROMLIST_H #define KCHMDIALOGCHOOSEURLFROMLIST_H
#include <qdialog.h> #include <tqdialog.h>
#include <qlistview.h> #include <tqlistview.h>
/** /**
@author tim @author tim
*/ */
class KCHMDialogChooseUrlFromList : public QDialog class KCHMDialogChooseUrlFromList : public TQDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMDialogChooseUrlFromList (const QStringList& urls, const QStringList& titles, QWidget* parent); KCHMDialogChooseUrlFromList (const TQStringList& urls, const TQStringList& titles, TQWidget* tqparent);
QString getSelectedItemUrl() { return m_acceptedurl; } TQString getSelectedItemUrl() { return m_acceptedurl; }
private slots: private slots:
void onDoubleClicked( QListViewItem * item, const QPoint &, int ); void onDoubleClicked( TQListViewItem * item, const TQPoint &, int );
void onCurrentChanged ( QListViewItem * item); void onCurrentChanged ( TQListViewItem * item);
private: private:
QListView * m_urlsList; TQListView * m_urlsList;
QString m_acceptedurl; TQString m_acceptedurl;
}; };
#endif #endif

@ -19,8 +19,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qlayout.h> #include <tqlayout.h>
#include <qheader.h> #include <tqheader.h>
#include "libchmfile.h" #include "libchmfile.h"
@ -31,13 +31,13 @@
#include "kchmindexwindow.moc" #include "kchmindexwindow.moc"
KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f ) KCHMIndexWindow::KCHMIndexWindow ( TQWidget * tqparent, const char * name, WFlags f )
: QWidget (parent, name, f) : TQWidget (tqparent, name, f)
{ {
QVBoxLayout * layout = new QVBoxLayout (this); TQVBoxLayout * tqlayout = new TQVBoxLayout (this);
layout->setMargin (5); tqlayout->setMargin (5);
m_indexFinder = new QLineEdit (this); m_indexFinder = new TQLineEdit (this);
m_indexFinder->setFocus(); m_indexFinder->setFocus();
m_indexList = new KQListView (this); m_indexList = new KQListView (this);
@ -47,29 +47,29 @@ KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f
m_indexList->setShowToolTips(true); m_indexList->setShowToolTips(true);
//m_indexList->setSorting( 0, true ); //m_indexList->setSorting( 0, true );
layout->addWidget (m_indexFinder); tqlayout->addWidget (m_indexFinder);
layout->addSpacing (10); tqlayout->addSpacing (10);
layout->addWidget (m_indexList); tqlayout->addWidget (m_indexList);
connect( m_indexFinder, connect( m_indexFinder,
SIGNAL( textChanged (const QString &) ), TQT_SIGNAL( textChanged (const TQString &) ),
this, this,
SLOT( onTextChanged(const QString &) ) ); TQT_SLOT( onTextChanged(const TQString &) ) );
connect( m_indexFinder, connect( m_indexFinder,
SIGNAL( returnPressed() ), TQT_SIGNAL( returnPressed() ),
this, this,
SLOT( onReturnPressed() ) ); TQT_SLOT( onReturnPressed() ) );
connect( m_indexList, connect( m_indexList,
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int) ),
this, this,
SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) ); TQT_SLOT( onDoubleClicked ( TQListViewItem *, const TQPoint &, int) ) );
connect( m_indexList, connect( m_indexList,
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ),
this, this,
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) ); TQT_SLOT( slotContextMenuRequested ( TQListViewItem *, const TQPoint &, int ) ) );
m_indexListFilled = false; m_indexListFilled = false;
m_lastSelectedItem = 0; m_lastSelectedItem = 0;
@ -78,9 +78,9 @@ KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f
new KCHMListItemTooltip( m_indexList ); new KCHMListItemTooltip( m_indexList );
} }
void KCHMIndexWindow::onTextChanged ( const QString & newvalue) void KCHMIndexWindow::onTextChanged ( const TQString & newvalue)
{ {
m_lastSelectedItem = m_indexList->findItem (newvalue, 0, Qt::BeginsWith); m_lastSelectedItem = m_indexList->tqfindItem (newvalue, 0, TQt::BeginsWith);
if ( m_lastSelectedItem ) if ( m_lastSelectedItem )
{ {
@ -89,7 +89,7 @@ void KCHMIndexWindow::onTextChanged ( const QString & newvalue)
} }
} }
void KCHMIndexWindow::showEvent( QShowEvent * ) void KCHMIndexWindow::showEvent( TQShowEvent * )
{ {
if ( !::mainWindow->chmFile() || m_indexListFilled ) if ( !::mainWindow->chmFile() || m_indexListFilled )
return; return;
@ -104,27 +104,27 @@ void KCHMIndexWindow::onReturnPressed( )
} }
void KCHMIndexWindow::invalidate( ) void KCHMIndexWindow::tqinvalidate( )
{ {
m_indexList->clear(); m_indexList->clear();
m_indexListFilled = false; m_indexListFilled = false;
} }
void KCHMIndexWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int ) void KCHMIndexWindow::onDoubleClicked( TQListViewItem *item, const TQPoint &, int )
{ {
if ( !item ) if ( !item )
return; return;
KCHMIndTocItem * treeitem = (KCHMIndTocItem*) item; KCHMIndTocItem * treeitem = (KCHMIndTocItem*) item;
QString url = treeitem->getUrl(); TQString url = treeitem->getUrl();
if ( !url ) if ( !url )
return; return;
if ( url[0] == ':' ) // 'see also' link if ( url[0] == ':' ) // 'see also' link
{ {
m_lastSelectedItem = m_indexList->findItem (url.mid(1), 0); m_lastSelectedItem = m_indexList->tqfindItem (url.mid(1), 0);
if ( m_lastSelectedItem ) if ( m_lastSelectedItem )
{ {
m_indexList->ensureItemVisible (m_lastSelectedItem); m_indexList->ensureItemVisible (m_lastSelectedItem);
@ -135,7 +135,7 @@ void KCHMIndexWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int
::mainWindow->openPage( url, OPF_CONTENT_TREE | OPF_ADD2HISTORY ); ::mainWindow->openPage( url, OPF_CONTENT_TREE | OPF_ADD2HISTORY );
} }
void KCHMIndexWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int ) void KCHMIndexWindow::slotContextMenuRequested( TQListViewItem * item, const TQPoint & point, int )
{ {
if ( !m_contextMenu ) if ( !m_contextMenu )
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this ); m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
@ -151,7 +151,7 @@ void KCHMIndexWindow::slotContextMenuRequested( QListViewItem * item, const QPoi
void KCHMIndexWindow::refillIndex( ) void KCHMIndexWindow::refillIndex( )
{ {
QValueVector< LCHMParsedEntry > data; TQValueVector< LCHMParsedEntry > data;
if ( !::mainWindow->chmFile()->parseIndex( &data ) if ( !::mainWindow->chmFile()->parseIndex( &data )
|| data.size() == 0 ) || data.size() == 0 )
@ -163,7 +163,7 @@ void KCHMIndexWindow::refillIndex( )
kchmFillListViewWithParsedData( m_indexList, data, 0 ); kchmFillListViewWithParsedData( m_indexList, data, 0 );
} }
void KCHMIndexWindow::search( const QString & index ) void KCHMIndexWindow::search( const TQString & index )
{ {
if ( !::mainWindow->chmFile() ) if ( !::mainWindow->chmFile() )
return; return;

@ -23,39 +23,40 @@
#define KCHMINDEXWINDOW_H #define KCHMINDEXWINDOW_H
#include <qlineedit.h> #include <tqlineedit.h>
#include <qlistview.h> #include <tqlistview.h>
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
class KCHMIndexWindow : public QWidget class KCHMIndexWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMIndexWindow ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); KCHMIndexWindow ( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
void invalidate(); void tqinvalidate();
void search( const QString& index ); void search( const TQString& index );
public slots: public slots:
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column ); void slotContextMenuRequested ( TQListViewItem *item, const TQPoint &point, int column );
private slots: private slots:
void onTextChanged ( const QString & newvalue); void onTextChanged ( const TQString & newvalue);
void onReturnPressed (); void onReturnPressed ();
void onDoubleClicked ( QListViewItem *, const QPoint &, int); void onDoubleClicked ( TQListViewItem *, const TQPoint &, int);
private: private:
virtual void showEvent ( QShowEvent * ); virtual void showEvent ( TQShowEvent * );
void refillIndex(); void refillIndex();
QLineEdit * m_indexFinder; TQLineEdit * m_indexFinder;
KQListView * m_indexList; KQListView * m_indexList;
KQPopupMenu * m_contextMenu; KTQPopupMenu * m_contextMenu;
QListViewItem * m_lastSelectedItem; TQListViewItem * m_lastSelectedItem;
bool m_indexListFilled; bool m_indexListFilled;
}; };

@ -24,29 +24,29 @@
KCHMKeyEventFilter gKeyEventFilter; KCHMKeyEventFilter gKeyEventFilter;
KCHMKeyEventFilter::KCHMKeyEventFilter() KCHMKeyEventFilter::KCHMKeyEventFilter()
: QObject() : TQObject()
{ {
m_shiftPressed = false; m_shiftPressed = false;
m_ctrlPressed = false; m_ctrlPressed = false;
} }
bool KCHMKeyEventFilter::eventFilter( QObject *, QEvent *e ) bool KCHMKeyEventFilter::eventFilter( TQObject *, TQEvent *e )
{ {
// Handle KeyPress and KeyRelease events // Handle KeyPress and KeyRelease events
if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) if ( e->type() == TQEvent::KeyPress || e->type() == TQEvent::KeyRelease )
{ {
bool * ptr = 0; bool * ptr = 0;
QKeyEvent *k = (QKeyEvent *) e; TQKeyEvent *k = (TQKeyEvent *) e;
// We're interested only in Shift and Control // We're interested only in Shift and Control
if ( k->key() == Qt::Key_Shift ) if ( k->key() == TQt::Key_Shift )
ptr = &m_shiftPressed; ptr = &m_shiftPressed;
else if ( k->key() == Qt::Key_Control ) else if ( k->key() == TQt::Key_Control )
ptr = &m_ctrlPressed; ptr = &m_ctrlPressed;
// Set it // Set it
if ( ptr ) if ( ptr )
*ptr = e->type() == QEvent::KeyPress ? true : false; *ptr = e->type() == TQEvent::KeyPress ? true : false;
} }
return FALSE; // Standard event processing return FALSE; // Standard event processing

@ -22,14 +22,14 @@
#ifndef INCLUDE_KCHMKEYEVENTFILTER_H #ifndef INCLUDE_KCHMKEYEVENTFILTER_H
#define INCLUDE_KCHMKEYEVENTFILTER_H #define INCLUDE_KCHMKEYEVENTFILTER_H
#include <qobject.h> #include <tqobject.h>
/*!* /*!*
* This class must be installed as a global event handler. Its responsibility * This class must be installed as a global event handler. Its responsibility
* is to intercept keyboard events, and store the Shift and Ctrl keys state information. * is to intercept keyboard events, and store the Shift and Ctrl keys state information.
* Unfortunately it seems to be the only way to do it in Qt. * Unfortunately it seems to be the only way to do it in TQt.
*/ */
class KCHMKeyEventFilter : public QObject class KCHMKeyEventFilter : public TQObject
{ {
public: public:
KCHMKeyEventFilter(); KCHMKeyEventFilter();
@ -38,7 +38,7 @@ class KCHMKeyEventFilter : public QObject
bool isCtrlPressed() const { return m_ctrlPressed; } bool isCtrlPressed() const { return m_ctrlPressed; }
private: private:
bool eventFilter( QObject *, QEvent *e ); bool eventFilter( TQObject *, TQEvent *e );
bool m_shiftPressed; bool m_shiftPressed;
bool m_ctrlPressed; bool m_ctrlPressed;

@ -28,17 +28,17 @@
/** /**
@author tim @author tim
*/ */
class KCHMListItemTooltip : public QToolTip class KCHMListItemTooltip : public TQToolTip
{ {
public: public:
KCHMListItemTooltip( KQListView *parent ) KCHMListItemTooltip( KQListView *tqparent )
: QToolTip( parent->viewport() ) { m_pParent = parent; } : TQToolTip( tqparent->viewport() ) { m_pParent = tqparent; }
virtual ~KCHMListItemTooltip() {}; virtual ~KCHMListItemTooltip() {};
void maybeTip ( const QPoint & pos ) void maybeTip ( const TQPoint & pos )
{ {
QListViewItem *it = m_pParent->itemAt( pos ); TQListViewItem *it = m_pParent->itemAt( pos );
if ( !it ) if ( !it )
return; return;
@ -47,13 +47,13 @@ class KCHMListItemTooltip : public QToolTip
int section = m_pParent->header()->sectionAt (pos.x ()); int section = m_pParent->header()->sectionAt (pos.x ());
// Get the rect of the whole item (the row for the tip) // Get the rect of the whole item (the row for the tip)
QRect itemRect = m_pParent->itemRect( it ); TQRect tqitemRect = m_pParent->tqitemRect( it );
// Get the rect of the whole section (the column for the tip) // Get the rect of the whole section (the column for the tip)
QRect headerRect = m_pParent->header ()->sectionRect (section); TQRect headerRect = m_pParent->header ()->sectionRect (section);
// "Intersect" row and column to get exact rect for the tip // "Intersect" row and column to get exact rect for the tip
QRect destRect( headerRect.left (), itemRect.top(), headerRect.width(), itemRect.height() ); TQRect destRect( headerRect.left (), tqitemRect.top(), headerRect.width(), tqitemRect.height() );
int item_width = it->width( m_pParent->fontMetrics(), m_pParent, 0 ) int item_width = it->width( m_pParent->fontMetrics(), m_pParent, 0 )
+ it->depth() * m_pParent->treeStepSize(); + it->depth() * m_pParent->treeStepSize();

@ -28,8 +28,8 @@
#include "kde-qt.h" #include "kde-qt.h"
#include <qaccel.h> #include <tqaccel.h>
#include <qevent.h> #include <tqevent.h>
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmfileimpl.h" #include "libchmfileimpl.h"
@ -82,9 +82,9 @@ KCHMMainWindow::KCHMMainWindow()
m_currentSettings = new KCHMSettings; m_currentSettings = new KCHMSettings;
// Create the initial layout - a splitter with tab window in left, and text browser in right // Create the initial tqlayout - a splitter with tab window in left, and text browser in right
m_windowSplitter = new QSplitter(this); m_windowSplitter = new TQSplitter(this);
m_tabWidget = new KQTabWidget( m_windowSplitter ); m_tabWidget = new KTQTabWidget( m_windowSplitter );
m_viewWindowMgr = new KCHMViewWindowMgr( m_windowSplitter ); m_viewWindowMgr = new KCHMViewWindowMgr( m_windowSplitter );
m_bookmarkWindow = new KCHMBookmarkWindow (m_tabWidget); m_bookmarkWindow = new KCHMBookmarkWindow (m_tabWidget);
@ -96,7 +96,7 @@ KCHMMainWindow::KCHMMainWindow()
setCentralWidget( m_windowSplitter ); setCentralWidget( m_windowSplitter );
QValueList<int> sizes; TQValueList<int> sizes;
sizes.push_back (SPLT_X_SIZE); sizes.push_back (SPLT_X_SIZE);
sizes.push_back (WND_X_SIZE - SPLT_X_SIZE); sizes.push_back (WND_X_SIZE - SPLT_X_SIZE);
m_windowSplitter->setSizes (sizes); m_windowSplitter->setSizes (sizes);
@ -108,13 +108,13 @@ KCHMMainWindow::KCHMMainWindow()
m_useShortAutotest = false; m_useShortAutotest = false;
#endif /* defined (ENABLE_AUTOTEST_SUPPORT) */ #endif /* defined (ENABLE_AUTOTEST_SUPPORT) */
QAccel * accel = new QAccel( this ); TQAccel * accel = new TQAccel( this );
accel->connectItem ( accel->insertItem ( Key_F11 ), this, SLOT ( slotToggleFullScreenMode() ) ); accel->connectItem ( accel->insertItem ( Key_F11 ), this, TQT_SLOT ( slotToggleFullScreenMode() ) );
accel->connectItem ( accel->insertItem ( CTRL + Key_1), this, SLOT ( slotActivateContentTab() ) ); accel->connectItem ( accel->insertItem ( CTRL + Key_1), this, TQT_SLOT ( slotActivateContentTab() ) );
accel->connectItem ( accel->insertItem ( CTRL + Key_2), this, SLOT ( slotActivateIndexTab() ) ); accel->connectItem ( accel->insertItem ( CTRL + Key_2), this, TQT_SLOT ( slotActivateIndexTab() ) );
accel->connectItem ( accel->insertItem ( CTRL + Key_3), this, SLOT ( slotActivateSearchTab() ) ); accel->connectItem ( accel->insertItem ( CTRL + Key_3), this, TQT_SLOT ( slotActivateSearchTab() ) );
accel->connectItem ( accel->insertItem ( CTRL + Key_4), this, SLOT ( slotActivateBookmarkTab() ) ); accel->connectItem ( accel->insertItem ( CTRL + Key_4), this, TQT_SLOT ( slotActivateBookmarkTab() ) );
accel->connectItem ( accel->insertItem ( Key_F3 ), m_searchToolbar, SLOT ( onBtnNextSearchResult() ) ); accel->connectItem ( accel->insertItem ( Key_F3 ), m_searchToolbar, TQT_SLOT ( onBtnNextSearchResult() ) );
statusBar()->show(); statusBar()->show();
setIcon( *gIconStorage.getApplicationIcon() ); setIcon( *gIconStorage.getApplicationIcon() );
@ -136,9 +136,9 @@ KCHMMainWindow::~KCHMMainWindow()
void KCHMMainWindow::slotOpenMenuItemActivated() void KCHMMainWindow::slotOpenMenuItemActivated()
{ {
#if defined (USE_KDE) #if defined (USE_KDE)
QString fn = KFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("*.chm|Compressed Help Manual (*.chm)"), this); TQString fn = KFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("*.chm|Compressed Help Manual (*.chm)"), this);
#else #else
QString fn = QFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("Compressed Help Manual (*.chm)"), this); TQString fn = TQFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("Compressed Help Manual (*.chm)"), this);
#endif #endif
if ( !fn.isEmpty() ) if ( !fn.isEmpty() )
@ -153,7 +153,7 @@ void KCHMMainWindow::slotOpenMenuItemActivated()
} }
bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page ) bool KCHMMainWindow::loadChmFile ( const TQString &fileName, bool call_open_page )
{ {
LCHMFile * new_chmfile = new LCHMFile(); LCHMFile * new_chmfile = new LCHMFile();
@ -172,12 +172,12 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
showInStatusBar( tr("Detected chm file charset: %1") . arg(m_chmFile->currentEncoding()->language) ); showInStatusBar( tr("Detected chm file charset: %1") . arg(m_chmFile->currentEncoding()->language) );
// Make the file name absolute; we'll need it later // Make the file name absolute; we'll need it later
QDir qd; TQDir qd;
qd.setPath (fileName); qd.setPath (fileName);
m_chmFilename = qd.absPath(); m_chmFilename = qd.absPath();
// Qt's 'dirname' does not work well // TQt's 'dirname' does not work well
QFileInfo qf ( m_chmFilename ); TQFileInfo qf ( m_chmFilename );
appConfig.m_lastOpenedDir = qf.dirPath(true); appConfig.m_lastOpenedDir = qf.dirPath(true);
// Order the tabulations // Order the tabulations
@ -202,9 +202,9 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
showOrHideIndexWindow( m_tabIndexPage ); showOrHideIndexWindow( m_tabIndexPage );
showOrHideSearchWindow( m_tabSearchPage ); showOrHideSearchWindow( m_tabSearchPage );
m_bookmarkWindow->invalidate(); m_bookmarkWindow->tqinvalidate();
m_navToolbar->updateIconStatus( false, false ); m_navToolbar->updateIcontqStatus( false, false );
m_viewWindowMgr->invalidate(); m_viewWindowMgr->tqinvalidate();
refreshCurrentBrowser(); refreshCurrentBrowser();
if ( m_currentSettings->loadSettings (fileName) ) if ( m_currentSettings->loadSettings (fileName) )
@ -232,7 +232,7 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
} }
// Restore the main window size // Restore the main window size
QValueList<int> sizes; TQValueList<int> sizes;
sizes.push_back( m_currentSettings->m_window_size_splitter ); sizes.push_back( m_currentSettings->m_window_size_splitter );
sizes.push_back( m_currentSettings->m_window_size_x - m_currentSettings->m_window_size_splitter ); sizes.push_back( m_currentSettings->m_window_size_x - m_currentSettings->m_window_size_splitter );
@ -255,17 +255,17 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
} }
else else
{ {
QMessageBox mbox( TQMessageBox mbox(
i18n("%1 - failed to load the chm file") . arg(APP_NAME), i18n("%1 - failed to load the chm file") . arg(APP_NAME),
i18n("Unable to load the chm file %1") . arg(fileName), i18n("Unable to load the chm file %1") . arg(fileName),
QMessageBox::Critical, TQMessageBox::Critical,
QMessageBox::Ok, TQMessageBox::Ok,
QMessageBox::NoButton, TQMessageBox::NoButton,
QMessageBox::NoButton); TQMessageBox::NoButton);
mbox.exec(); mbox.exec();
statusBar()->message( statusBar()->message(
i18n("Could not load file %1").arg(fileName), i18n("Could not load file %1").tqarg(fileName),
2000 ); 2000 );
delete new_chmfile; delete new_chmfile;
return false; return false;
@ -281,44 +281,44 @@ void KCHMMainWindow::slotPrintMenuItemActivated()
void KCHMMainWindow::slotAboutMenuItemActivated() void KCHMMainWindow::slotAboutMenuItemActivated()
{ {
QString caption = i18n( "About %1" ) . arg(APP_NAME); TQString caption = i18n( "About %1" ) . arg(APP_NAME);
QString text = m_aboutDlgMenuText; TQString text = m_aboutDlgMenuText;
// It is quite funny that the argument order differs // It is quite funny that the argument order differs
#if defined (USE_KDE) #if defined (USE_KDE)
KMessageBox::about( this, text, caption ); KMessageBox::about( this, text, caption );
#else #else
QMessageBox::about( this, caption, text ); TQMessageBox::about( this, caption, text );
#endif #endif
} }
void KCHMMainWindow::slotAboutQtMenuItemActivated() void KCHMMainWindow::slotAboutQtMenuItemActivated()
{ {
QMessageBox::aboutQt( this, APP_NAME); TQMessageBox::aboutTQt( this, APP_NAME);
} }
void KCHMMainWindow::refreshCurrentBrowser( ) void KCHMMainWindow::refreshCurrentBrowser( )
{ {
QString title = m_chmFile->title(); TQString title = m_chmFile->title();
if ( !title ) if ( !title )
title = APP_NAME; title = APP_NAME;
// KDE adds application name automatically, so we don't need it here // KDE adds application name automatically, so we don't need it here
#if !defined (USE_KDE) #if !defined (USE_KDE)
else else
title = (QString) APP_NAME + " - " + title; title = (TQString) APP_NAME + " - " + title;
#endif #endif
setCaption ( title ); setCaption ( title );
currentBrowser()->invalidate(); currentBrowser()->tqinvalidate();
if ( m_contentsWindow ) if ( m_contentsWindow )
m_contentsWindow->refillTableOfContents(); m_contentsWindow->refillTableOfContents();
} }
void KCHMMainWindow::slotOnTreeClicked( QListViewItem * item ) void KCHMMainWindow::slotOnTreeClicked( TQListViewItem * item )
{ {
bool unused; bool unused;
@ -330,7 +330,7 @@ void KCHMMainWindow::slotOnTreeClicked( QListViewItem * item )
} }
void KCHMMainWindow::slotLinkClicked ( const QString & link, bool& follow_link ) void KCHMMainWindow::slotLinkClicked ( const TQString & link, bool& follow_link )
{ {
if ( link.isEmpty() ) if ( link.isEmpty() )
return; return;
@ -351,9 +351,9 @@ void KCHMMainWindow::slotLinkClicked ( const QString & link, bool& follow_link )
} }
bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags ) bool KCHMMainWindow::openPage( const TQString & srcurl, unsigned int flags )
{ {
QString p1, p2, url = srcurl; TQString p1, p2, url = srcurl;
if ( url == "/" ) if ( url == "/" )
url = m_chmFile->homeUrl(); url = m_chmFile->homeUrl();
@ -366,11 +366,11 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
break; break;
case KCHMConfig::ACTION_ASK_USER: case KCHMConfig::ACTION_ASK_USER:
if ( QMessageBox::question(this, if ( TQMessageBox::question(this,
i18n("%1 - remote link clicked - %2") . arg(APP_NAME) . arg(p1), i18n("%1 - remote link clicked - %2") . arg(APP_NAME) . arg(p1),
i18n("A remote link %1 will start the external program to open it.\n\nDo you want to continue?").arg( url ), i18n("A remote link %1 will start the external program to open it.\n\nDo you want to continue?").tqarg( url ),
i18n("&Yes"), i18n("&No"), i18n("&Yes"), i18n("&No"),
QString::null, 0, 1 ) ) TQString(), 0, 1 ) )
return false; return false;
// no break! should continue to open. // no break! should continue to open.
@ -380,7 +380,7 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
#if defined (USE_KDE) #if defined (USE_KDE)
new KRun ( url ); new KRun ( url );
#else #else
run_process( appConfig.m_QtBrowserPath, url ); run_process( appConfig.m_TQtBrowserPath, url );
#endif #endif
} }
break; break;
@ -389,10 +389,10 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
return false; // do not change the current page. return false; // do not change the current page.
} }
// Filter the URLs which do not need to be opened at all by Qt version // Filter the URLs which do not need to be opened at all by TQt version
if ( LCHMUrlFactory::isJavascriptURL (url) ) if ( LCHMUrlFactory::isJavascriptURL (url) )
{ {
QMessageBox::information( this, TQMessageBox::information( this,
i18n( "%1 - JavsScript link clicked") . arg(APP_NAME), i18n( "%1 - JavsScript link clicked") . arg(APP_NAME),
i18n( "You have clicked a JavaScript link.\nTo prevent security-related issues JavaScript URLs are disabled in CHM files.") ); i18n( "You have clicked a JavaScript link.\nTo prevent security-related issues JavaScript URLs are disabled in CHM files.") );
@ -401,23 +401,23 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
if ( LCHMUrlFactory::isNewChmURL (url, p1, p2) && p1 != m_chmFilename ) if ( LCHMUrlFactory::isNewChmURL (url, p1, p2) && p1 != m_chmFilename )
{ {
if ( QMessageBox::question( this, if ( TQMessageBox::question( this,
i18n( "%1 - link to a new CHM file clicked"). arg(APP_NAME), i18n( "%1 - link to a new CHM file clicked"). arg(APP_NAME),
i18n( "You have clicked a link, which leads to a new CHM file %1.\nThe current file will be closed.\n\nDo you want to continue?").arg( p1 ), i18n( "You have clicked a link, which leads to a new CHM file %1.\nThe current file will be closed.\n\nDo you want to continue?").tqarg( p1 ),
i18n( "&Yes" ), i18n( "&No" ), i18n( "&Yes" ), i18n( "&No" ),
QString::null, 0, 1 ) ) TQString(), 0, 1 ) )
return false; return false;
// Because chm file always contain relative link, and current filename is not changed, // Because chm file always contain relative link, and current filename is not changed,
// we need to form a new path // we need to form a new path
QFileInfo qfi( m_chmFilename ); TQFileInfo qfi( m_chmFilename );
QString newfilename = qfi.dirPath(true) + "/" + p1; TQString newfilename = qfi.dirPath(true) + "/" + p1;
QStringList event_args; TQStringList event_args;
event_args.push_back( newfilename ); event_args.push_back( newfilename );
event_args.push_back( p2 ); // url event_args.push_back( p2 ); // url
qApp->postEvent( this, new KCHMUserEvent( "loadAndOpen", event_args ) ); tqApp->postEvent( this, new KCHMUserEvent( "loadAndOpen", event_args ) );
return false; return false;
} }
@ -427,7 +427,7 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
// Store current page and position to add it to history if we change it // Store current page and position to add it to history if we change it
int hist_scrollpos = currentBrowser()->getScrollbarPosition(); int hist_scrollpos = currentBrowser()->getScrollbarPosition();
QString hist_url = currentBrowser()->getOpenedPage(); TQString hist_url = currentBrowser()->getOpenedPage();
if ( vwnd->openUrl (url) ) if ( vwnd->openUrl (url) )
{ {
@ -443,7 +443,7 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
} }
void KCHMMainWindow::showEvent( QShowEvent * ) void KCHMMainWindow::showEvent( TQShowEvent * )
{ {
if ( !m_FirstTimeShow ) if ( !m_FirstTimeShow )
return; return;
@ -465,61 +465,61 @@ void KCHMMainWindow::showEvent( QShowEvent * )
void KCHMMainWindow::setupToolbarsAndMenu( ) void KCHMMainWindow::setupToolbarsAndMenu( )
{ {
// Create a 'file' toolbar // Create a 'file' toolbar
QToolBar * toolbar = new QToolBar(this); TQToolBar * toolbar = new TQToolBar(this);
toolbar->setLabel( i18n( "File Operations") ); toolbar->setLabel( i18n( "File Operations") );
QPixmap iconFileOpen (*gIconStorage.getToolbarPixmap(KCHMIconStorage::fileopen)); TQPixmap iconFileOpen (*gIconStorage.getToolbarPixmap(KCHMIconStorage::fileopen));
QToolButton * fileOpen = new QToolButton (iconFileOpen, TQToolButton * fileOpen = new TQToolButton (iconFileOpen,
i18n( "Open File" ), i18n( "Open File" ),
QString::null, TQString(),
this, this,
SLOT( slotOpenMenuItemActivated() ), TQT_SLOT( slotOpenMenuItemActivated() ),
toolbar); toolbar);
QString fileOpenText = i18n( "Click this button to open an existing chm file." ); TQString fileOpenText = i18n( "Click this button to open an existing chm file." );
QWhatsThis::add( fileOpen, fileOpenText ); TQWhatsThis::add( fileOpen, fileOpenText );
QPixmap iconFilePrint (*gIconStorage.getToolbarPixmap(KCHMIconStorage::print)); TQPixmap iconFilePrint (*gIconStorage.getToolbarPixmap(KCHMIconStorage::print));
QToolButton * filePrint = new QToolButton (iconFilePrint, TQToolButton * filePrint = new TQToolButton (iconFilePrint,
i18n( "Print File" ), i18n( "Print File" ),
QString::null, TQString(),
this, this,
SLOT( slotPrintMenuItemActivated() ), TQT_SLOT( slotPrintMenuItemActivated() ),
toolbar); toolbar);
QString filePrintText = i18n( "Click this button to print the current page"); TQString filePrintText = i18n( "Click this button to print the current page");
QWhatsThis::add( filePrint, filePrintText ); TQWhatsThis::add( filePrint, filePrintText );
// Setup the menu // Setup the menu
KQPopupMenu * file = new KQPopupMenu( this ); KTQPopupMenu * file = new KTQPopupMenu( this );
menuBar()->insertItem( i18n( "&File"), file ); menuBar()->insertItem( i18n( "&File"), file );
int id; int id;
id = file->insertItem ( iconFileOpen, i18n( "&Open..."), this, SLOT( slotOpenMenuItemActivated() ), CTRL+Key_O ); id = file->insertItem ( iconFileOpen, i18n( "&Open..."), this, TQT_SLOT( slotOpenMenuItemActivated() ), CTRL+Key_O );
file->setWhatsThis( id, fileOpenText ); file->TQMenuData::setWhatsThis( id, fileOpenText );
id = file->insertItem( iconFilePrint, i18n( "&Print..."), this, SLOT( slotPrintMenuItemActivated() ), CTRL+Key_P ); id = file->insertItem( iconFilePrint, i18n( "&Print..."), this, TQT_SLOT( slotPrintMenuItemActivated() ), CTRL+Key_P );
file->setWhatsThis( id, filePrintText ); file->TQMenuData::setWhatsThis( id, filePrintText );
file->insertSeparator(); file->insertSeparator();
id = file->insertItem ( i18n( "E&xtract CHM content..."), this, SLOT( slotExtractCHM() ) ); id = file->insertItem ( i18n( "E&xtract CHM content..."), this, TQT_SLOT( slotExtractCHM() ) );
file->setWhatsThis( id, i18n( "Click this button to extract the whole CHM file content into a specific directory") ); file->TQMenuData::setWhatsThis( id, i18n( "Click this button to extract the whole CHM file content into a specific directory") );
file->insertSeparator(); file->insertSeparator();
m_menuHistory = new KQPopupMenu( file ); m_menuHistory = new KTQPopupMenu( file );
connect ( m_menuHistory, SIGNAL( activated(int) ), this, SLOT ( slotHistoryMenuItemActivated(int) )); connect ( m_menuHistory, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( slotHistoryMenuItemActivated(int) ));
file->insertItem( i18n( "&Recent files"), m_menuHistory ); file->insertItem( i18n( "&Recent files"), m_menuHistory );
file->insertSeparator(); file->insertSeparator();
file->insertItem( i18n( "&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q ); file->insertItem( i18n( "&Quit"), tqApp, TQT_SLOT( closeAllWindows() ), CTRL+Key_Q );
KQPopupMenu * menu_edit = new KQPopupMenu( this ); KTQPopupMenu * menu_edit = new KTQPopupMenu( this );
menuBar()->insertItem( i18n( "&Edit"), menu_edit ); menuBar()->insertItem( i18n( "&Edit"), menu_edit );
menu_edit->insertItem ( i18n( "&Copy"), this, SLOT( slotBrowserCopy()), CTRL+Key_C ); menu_edit->insertItem ( i18n( "&Copy"), this, TQT_SLOT( slotBrowserCopy()), CTRL+Key_C );
menu_edit->insertItem ( i18n( "&Select all"), this, SLOT( slotBrowserSelectAll()), CTRL+Key_A ); menu_edit->insertItem ( i18n( "&Select all"), this, TQT_SLOT( slotBrowserSelectAll()), CTRL+Key_A );
menu_edit->insertSeparator(); menu_edit->insertSeparator();
@ -535,18 +535,18 @@ void KCHMMainWindow::setupToolbarsAndMenu( )
// m_viewWindowMgr creates 'Window' menu // m_viewWindowMgr creates 'Window' menu
m_viewWindowMgr->createMenu( this ); m_viewWindowMgr->createMenu( this );
KQPopupMenu * settings = new KQPopupMenu( this ); KTQPopupMenu * settings = new KTQPopupMenu( this );
menuBar()->insertItem( i18n( "&Settings"), settings ); menuBar()->insertItem( i18n( "&Settings"), settings );
settings->insertItem( i18n( "&Change settings..."), this, SLOT( slotChangeSettingsMenuItemActivated() )); settings->insertItem( i18n( "&Change settings..."), this, TQT_SLOT( slotChangeSettingsMenuItemActivated() ));
#if defined(USE_KDE) #if defined(USE_KDE)
QPopupMenu *help = helpMenu( m_aboutDlgMenuText ); TQPopupMenu *help = helpMenu( m_aboutDlgMenuText );
#else #else
KQPopupMenu * help = new KQPopupMenu( this ); KTQPopupMenu * help = new KTQPopupMenu( this );
help->insertItem( i18n( "&About"), this, SLOT( slotAboutMenuItemActivated() ), Key_F1 ); help->insertItem( i18n( "&About"), this, TQT_SLOT( slotAboutMenuItemActivated() ), Key_F1 );
help->insertItem( i18n( "About &Qt"), this, SLOT( slotAboutQtMenuItemActivated() )); help->insertItem( i18n( "About &TQt"), this, TQT_SLOT( slotAboutQtMenuItemActivated() ));
help->insertSeparator(); help->insertSeparator();
help->insertItem( i18n( "What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1 ); help->insertItem( i18n( "What's &This"), this, TQT_SLOT(whatsThis()), SHIFT+Key_F1 );
#endif #endif
menuBar()->insertItem( i18n( "&Help"), help ); menuBar()->insertItem( i18n( "&Help"), help );
@ -563,9 +563,9 @@ void KCHMMainWindow::setTextEncoding( const LCHMTextEncoding * encoding )
m_chmFile->setCurrentEncoding( encoding ); m_chmFile->setCurrentEncoding( encoding );
m_searchToolbar->setChosenEncodingInMenu( encoding ); m_searchToolbar->setChosenEncodingInMenu( encoding );
// Because updateView() will call view->invalidate(), which clears the view->getOpenedPage(), // Because updateView() will call view->tqinvalidate(), which clears the view->getOpenedPage(),
// we have to make a copy of it. // we have to make a copy of it.
QString url = currentBrowser()->getOpenedPage(); TQString url = currentBrowser()->getOpenedPage();
// Regenerate the content and index trees // Regenerate the content and index trees
refreshCurrentBrowser(); refreshCurrentBrowser();
@ -600,7 +600,7 @@ void KCHMMainWindow::closeChmFile( )
} }
void KCHMMainWindow::closeEvent ( QCloseEvent * e ) void KCHMMainWindow::closeEvent ( TQCloseEvent * e )
{ {
// Save the settings if we have something opened // Save the settings if we have something opened
if ( m_chmFile ) if ( m_chmFile )
@ -610,13 +610,13 @@ void KCHMMainWindow::closeEvent ( QCloseEvent * e )
m_chmFile = 0; m_chmFile = 0;
} }
QMainWindow::closeEvent ( e ); TQMainWindow::closeEvent ( e );
} }
bool KCHMMainWindow::parseCmdLineArgs( ) bool KCHMMainWindow::parseCmdLineArgs( )
{ {
QString filename = QString::null, search_query = QString::null; TQString filename = TQString(), search_query = TQString();
QString search_index = QString::null, search_bookmark = QString::null; TQString search_index = TQString(), search_bookmark = TQString();
bool do_autotest = false; bool do_autotest = false;
#if defined (USE_KDE) #if defined (USE_KDE)
@ -634,44 +634,44 @@ bool KCHMMainWindow::parseCmdLineArgs( )
if ( args->count() > 0 ) if ( args->count() > 0 )
filename = args->arg(0); filename = args->arg(0);
#else #else
// argv[0] in Qt is still a program name // argv[0] in TQt is still a program name
for ( int i = 1; i < qApp->argc(); i++ ) for ( int i = 1; i < tqApp->argc(); i++ )
{ {
if ( !strcmp (qApp->argv()[i], "--autotestmode") ) if ( !strcmp (tqApp->argv()[i], "--autotestmode") )
do_autotest = m_useShortAutotest = true; do_autotest = m_useShortAutotest = true;
else if ( !strcmp (qApp->argv()[i], "--shortautotestmode") ) else if ( !strcmp (tqApp->argv()[i], "--shortautotestmode") )
do_autotest = true; do_autotest = true;
else if ( !strcmp (qApp->argv()[i], "--search") ) else if ( !strcmp (tqApp->argv()[i], "--search") )
search_query = qApp->argv()[++i]; search_query = tqApp->argv()[++i];
else if ( !strcmp (qApp->argv()[i], "--sindex") ) else if ( !strcmp (tqApp->argv()[i], "--sindex") )
search_index = qApp->argv()[++i]; search_index = tqApp->argv()[++i];
else if ( !strcmp (qApp->argv()[i], "-h") || !strcmp (qApp->argv()[i], "--help") ) else if ( !strcmp (tqApp->argv()[i], "-h") || !strcmp (tqApp->argv()[i], "--help") )
{ {
fprintf (stderr, "Usage: %s [chmfile]\n", qApp->argv()[0]); fprintf (stderr, "Usage: %s [chmfile]\n", tqApp->argv()[0]);
exit (1); exit (1);
} }
else else
filename = qApp->argv()[i]; filename = tqApp->argv()[i];
} }
#endif #endif
if ( !filename.isEmpty() ) if ( !filename.isEmpty() )
{ {
if ( !loadChmFile( QString::fromLocal8Bit( filename )) ) if ( !loadChmFile( TQString::fromLocal8Bit( filename )) )
return true; // skip the latest checks, but do not exit from the program return true; // skip the latest checks, but do not exit from the program
if ( !search_index.isEmpty() ) if ( !search_index.isEmpty() )
{ {
QStringList event_args; TQStringList event_args;
event_args.push_back( search_index ); event_args.push_back( search_index );
qApp->postEvent( this, new KCHMUserEvent( "findInIndex", event_args ) ); tqApp->postEvent( this, new KCHMUserEvent( "findInIndex", event_args ) );
} }
if ( !search_query.isEmpty() ) if ( !search_query.isEmpty() )
{ {
QStringList event_args; TQStringList event_args;
event_args.push_back( search_query ); event_args.push_back( search_query );
qApp->postEvent( this, new KCHMUserEvent( "searchQuery", event_args ) ); tqApp->postEvent( this, new KCHMUserEvent( "searchQuery", event_args ) );
} }
if ( do_autotest ) if ( do_autotest )
@ -729,9 +729,9 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
dlg.m_groupKDEsettings->setEnabled ( false ); dlg.m_groupKDEsettings->setEnabled ( false );
#endif #endif
dlg.m_qtBrowserPath->setText ( appConfig.m_QtBrowserPath ); dlg.m_qtBrowserPath->setText ( appConfig.m_TQtBrowserPath );
dlg.m_radioUseQtextBrowser->setChecked ( appConfig.m_kdeUseQTextBrowser ); dlg.m_radioUseQtextBrowser->setChecked ( appConfig.m_kdeUseTQTextBrowser );
dlg.m_radioUseKHTMLPart->setChecked ( !appConfig.m_kdeUseQTextBrowser ); dlg.m_radioUseKHTMLPart->setChecked ( !appConfig.m_kdeUseTQTextBrowser );
dlg.m_enableJS->setChecked ( appConfig.m_kdeEnableJS ); dlg.m_enableJS->setChecked ( appConfig.m_kdeEnableJS );
dlg.m_enablePlugins->setChecked ( appConfig.m_kdeEnablePlugins ); dlg.m_enablePlugins->setChecked ( appConfig.m_kdeEnablePlugins );
@ -750,7 +750,7 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
dlg.m_labelUseSearchEngineInternal->setBuddy( dlg.m_useSearchEngineInternal ); dlg.m_labelUseSearchEngineInternal->setBuddy( dlg.m_useSearchEngineInternal );
dlg.m_labelUseSearchEngineNew->setBuddy( dlg.m_useSearchEngineNew ); dlg.m_labelUseSearchEngineNew->setBuddy( dlg.m_useSearchEngineNew );
if ( dlg.exec() == QDialog::Accepted ) if ( dlg.exec() == TQDialog::Accepted )
{ {
appConfig.m_LoadLatestFileOnStartup = dlg.m_radioOnBeginOpenLast->isChecked(); appConfig.m_LoadLatestFileOnStartup = dlg.m_radioOnBeginOpenLast->isChecked();
appConfig.m_HistorySize = dlg.m_historySize->value(); appConfig.m_HistorySize = dlg.m_historySize->value();
@ -770,7 +770,7 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
else else
appConfig.m_onNewChmClick = KCHMConfig::ACTION_DONT_OPEN; appConfig.m_onNewChmClick = KCHMConfig::ACTION_DONT_OPEN;
appConfig.m_QtBrowserPath = dlg.m_qtBrowserPath->text(); appConfig.m_TQtBrowserPath = dlg.m_qtBrowserPath->text();
// Check the changes // Check the changes
bool need_restart = false; bool need_restart = false;
@ -799,24 +799,24 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
appConfig.m_kdeEnableRefresh = dlg.m_enableRefresh->isChecked(); appConfig.m_kdeEnableRefresh = dlg.m_enableRefresh->isChecked();
} }
if ( appConfig.m_kdeUseQTextBrowser != dlg.m_radioUseQtextBrowser->isChecked() ) if ( appConfig.m_kdeUseTQTextBrowser != dlg.m_radioUseQtextBrowser->isChecked() )
{ {
need_restart = true; need_restart = true;
appConfig.m_kdeUseQTextBrowser = dlg.m_radioUseQtextBrowser->isChecked(); appConfig.m_kdeUseTQTextBrowser = dlg.m_radioUseQtextBrowser->isChecked();
} }
if ( dlg.m_useSearchEngineNew->isChecked() if ( dlg.m_useSearchEngineNew->isChecked()
&& appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_CHM ) && appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_CHM )
{ {
appConfig.m_useSearchEngine = KCHMConfig::SEARCH_USE_MINE; appConfig.m_useSearchEngine = KCHMConfig::SEARCH_USE_MINE;
m_searchWindow->invalidate(); m_searchWindow->tqinvalidate();
} }
if ( dlg.m_useSearchEngineInternal->isChecked() if ( dlg.m_useSearchEngineInternal->isChecked()
&& appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE ) && appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
{ {
appConfig.m_useSearchEngine = KCHMConfig::SEARCH_USE_CHM; appConfig.m_useSearchEngine = KCHMConfig::SEARCH_USE_CHM;
m_searchWindow->invalidate(); m_searchWindow->tqinvalidate();
} }
appConfig.m_advExternalEditorPath = dlg.m_advExternalProgramName->text(); appConfig.m_advExternalEditorPath = dlg.m_advExternalProgramName->text();
@ -826,7 +826,7 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
appConfig.save(); appConfig.save();
if ( need_restart ) if ( need_restart )
QMessageBox::information( TQMessageBox::information(
this, this,
APP_NAME, APP_NAME,
i18n( "Changing browser view options or search engine used\n" i18n( "Changing browser view options or search engine used\n"
@ -840,8 +840,8 @@ void KCHMMainWindow::setupSignals( )
#if defined(HAVE_SIGACTION) #if defined(HAVE_SIGACTION)
struct sigaction sa; struct sigaction sa;
memset ((char *)&sa, 0, sizeof(sa)); memset ((char *)&sa, 0, sizeof(sa));
sigemptyset (&sa.sa_mask); sigemptyset (&sa.sa_tqmask);
sigaddset (&sa.sa_mask, SIGCHLD); sigaddset (&sa.sa_tqmask, SIGCHLD);
#ifdef SA_RESTART #ifdef SA_RESTART
sa.sa_flags = SA_RESTART; sa.sa_flags = SA_RESTART;
@ -859,7 +859,7 @@ void KCHMMainWindow::slotHistoryMenuItemActivated( int item )
if ( item < 0 || item >= (signed) appConfig.m_History.size() ) if ( item < 0 || item >= (signed) appConfig.m_History.size() )
qFatal ("KCHMMainWindow::slotHistoryMenuItemActivated: bad history menu id %d", item); qFatal ("KCHMMainWindow::slotHistoryMenuItemActivated: bad history menu id %d", item);
QString filename = appConfig.m_History[item]; TQString filename = appConfig.m_History[item];
// remove it, so it will be added again at the history top, and will not shitf anything. // remove it, so it will be added again at the history top, and will not shitf anything.
// appConfig.m_History.remove ( appConfig.m_History.begin() + item); // appConfig.m_History.remove ( appConfig.m_History.begin() + item);
@ -916,14 +916,14 @@ void KCHMMainWindow::showOrHideContextWindow( int tabindex )
// Handle clicking on m_contentsWindow element // Handle clicking on m_contentsWindow element
connect( m_contentsWindow, connect( m_contentsWindow,
SIGNAL( clicked( QListViewItem* ) ), TQT_SIGNAL( clicked( TQListViewItem* ) ),
this, this,
SLOT( slotOnTreeClicked( QListViewItem* ) ) ); TQT_SLOT( slotOnTreeClicked( TQListViewItem* ) ) );
connect( m_contentsWindow, connect( m_contentsWindow,
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ),
this, this,
SLOT( slotOnTreeDoubleClicked ( QListViewItem *, const QPoint &, int ) ) ); TQT_SLOT( slotOnTreeDoubleClicked ( TQListViewItem *, const TQPoint &, int ) ) );
m_tabWidget->insertTab (m_contentsWindow, i18n( "Contents" ), tabindex); m_tabWidget->insertTab (m_contentsWindow, i18n( "Contents" ), tabindex);
} }
@ -932,7 +932,7 @@ void KCHMMainWindow::showOrHideContextWindow( int tabindex )
void KCHMMainWindow::showOrHideIndexWindow( int tabindex ) void KCHMMainWindow::showOrHideIndexWindow( int tabindex )
{ {
// Test whether to show/invalidate the index window // Test whether to show/tqinvalidate the index window
if ( tabindex == -1 ) if ( tabindex == -1 )
{ {
if ( m_indexWindow ) if ( m_indexWindow )
@ -950,7 +950,7 @@ void KCHMMainWindow::showOrHideIndexWindow( int tabindex )
m_tabWidget->insertTab (m_indexWindow, i18n( "Index" ), tabindex); m_tabWidget->insertTab (m_indexWindow, i18n( "Index" ), tabindex);
} }
else else
m_indexWindow->invalidate(); m_indexWindow->tqinvalidate();
} }
} }
@ -973,7 +973,7 @@ void KCHMMainWindow::showOrHideSearchWindow( int tabindex )
m_tabWidget->insertTab (m_searchWindow, i18n( "Search" ), tabindex); m_tabWidget->insertTab (m_searchWindow, i18n( "Search" ), tabindex);
} }
else else
m_searchWindow->invalidate(); m_searchWindow->tqinvalidate();
} }
} }
@ -1028,10 +1028,10 @@ void KCHMMainWindow::slotLocateInContentWindow( )
if ( treeitem ) if ( treeitem )
{ {
KCHMIndTocItem * itemparent = treeitem; KCHMIndTocItem * itemtqparent = treeitem;
while ( (itemparent = (KCHMIndTocItem*) itemparent->parent()) != 0 ) while ( (itemtqparent = (KCHMIndTocItem*) itemtqparent->tqparent()) != 0 )
itemparent->setOpen(true); itemtqparent->setOpen(true);
m_contentsWindow->setCurrentItem (treeitem); m_contentsWindow->setCurrentItem (treeitem);
m_contentsWindow->ensureItemVisible (treeitem); m_contentsWindow->ensureItemVisible (treeitem);
@ -1043,16 +1043,16 @@ void KCHMMainWindow::slotLocateInContentWindow( )
void KCHMMainWindow::slotExtractCHM( ) void KCHMMainWindow::slotExtractCHM( )
{ {
QStringList files; TQStringList files;
#if defined (USE_KDE) #if defined (USE_KDE)
QString outdir = KFileDialog::getExistingDirectory ( TQString outdir = KFileDialog::getExistingDirectory (
QString::null, TQString(),
this, this,
i18n("Choose a directory to store CHM content") ); i18n("Choose a directory to store CHM content") );
#else #else
QString outdir = QFileDialog::getExistingDirectory ( TQString outdir = TQFileDialog::getExistingDirectory (
QString::null, TQString(),
this, this,
0, 0,
i18n("Choose a directory to store CHM content"), i18n("Choose a directory to store CHM content"),
@ -1068,7 +1068,7 @@ void KCHMMainWindow::slotExtractCHM( )
if ( !m_chmFile || !m_chmFile->enumerateFiles( &files ) ) if ( !m_chmFile || !m_chmFile->enumerateFiles( &files ) )
return; return;
KQProgressModalDialog progress( i18n("Extracting CHM content"), i18n("Extracting files..."), i18n("Abort"), files.size(), this ); KTQProgressModalDialog progress( i18n("Extracting CHM content"), i18n("Extracting files..."), i18n("Abort"), files.size(), this );
for ( unsigned int i = 0; i < files.size(); i++ ) for ( unsigned int i = 0; i < files.size(); i++ )
{ {
@ -1076,25 +1076,25 @@ void KCHMMainWindow::slotExtractCHM( )
if ( (i % 3) == 0 ) if ( (i % 3) == 0 )
{ {
qApp->processEvents(); tqApp->processEvents();
if ( progress.wasCancelled() ) if ( progress.wasCancelled() )
break; break;
} }
// Extract the file // Extract the file
QByteArray buf; TQByteArray buf;
if ( m_chmFile->getFileContentAsBinary( &buf, files[i] ) ) if ( m_chmFile->getFileContentAsBinary( &buf, files[i] ) )
{ {
// Split filename to get the list of subdirectories // Split filename to get the list of subdirectories
QStringList dirs = QStringList::split( '/', files[i] ); TQStringList dirs = TQStringList::split( '/', files[i] );
// Walk through the list of subdirectories, and create them if needed // Walk through the list of subdirectories, and create them if needed
// dirlevel is used to detect extra .. and prevent overwriting files // dirlevel is used to detect extra .. and prevent overwriting files
// outside the directory (like creating the file images/../../../../../etc/passwd // outside the directory (like creating the file images/../../../../../etc/passwd
unsigned int i, dirlevel = 0; unsigned int i, dirlevel = 0;
QStringList dirlist; TQStringList dirlist;
for ( i = 0; i < dirs.size() - 1; i++ ) for ( i = 0; i < dirs.size() - 1; i++ )
{ {
@ -1111,7 +1111,7 @@ void KCHMMainWindow::slotExtractCHM( )
{ {
dirlist.push_back( dirs[i] ); dirlist.push_back( dirs[i] );
QDir dir ( outdir + dirlist.join( "/" ) ); TQDir dir ( outdir + dirlist.join( "/" ) );
if ( !dir.exists() ) if ( !dir.exists() )
{ {
if ( !dir.mkdir( dir.path() ) ) if ( !dir.mkdir( dir.path() ) )
@ -1120,8 +1120,8 @@ void KCHMMainWindow::slotExtractCHM( )
} }
} }
QString filename = outdir + dirlist.join( "/" ) + "/" + dirs[i]; TQString filename = outdir + dirlist.join( "/" ) + "/" + dirs[i];
QFile wf( filename ); TQFile wf( filename );
if ( !wf.open( IO_WriteOnly ) ) if ( !wf.open( IO_WriteOnly ) )
{ {
qWarning( "Could not write file %s\n", filename.ascii() ); qWarning( "Could not write file %s\n", filename.ascii() );
@ -1158,7 +1158,7 @@ void KCHMMainWindow::slotBrowserChanged( KCHMViewWindow * newbrowser )
locateInContentTree( newbrowser->getOpenedPage() ); locateInContentTree( newbrowser->getOpenedPage() );
} }
void KCHMMainWindow::locateInContentTree( const QString & url ) void KCHMMainWindow::locateInContentTree( const TQString & url )
{ {
if ( !m_contentsWindow ) if ( !m_contentsWindow )
return; return;
@ -1167,31 +1167,31 @@ void KCHMMainWindow::locateInContentTree( const QString & url )
if ( treeitem ) if ( treeitem )
{ {
KCHMIndTocItem * itemparent = treeitem; KCHMIndTocItem * itemtqparent = treeitem;
while ( (itemparent = (KCHMIndTocItem*) itemparent->parent()) != 0 ) while ( (itemtqparent = (KCHMIndTocItem*) itemtqparent->tqparent()) != 0 )
itemparent->setOpen(true); itemtqparent->setOpen(true);
m_contentsWindow->setCurrentItem (treeitem); m_contentsWindow->setCurrentItem (treeitem);
m_contentsWindow->ensureItemVisible (treeitem); m_contentsWindow->ensureItemVisible (treeitem);
} }
} }
void KCHMMainWindow::slotOnTreeDoubleClicked( QListViewItem * item, const QPoint &, int ) void KCHMMainWindow::slotOnTreeDoubleClicked( TQListViewItem * item, const TQPoint &, int )
{ {
// Open/close only existing item which have children // Open/close only existing item which have tqchildren
if ( !item || item->childCount() == 0 ) if ( !item || item->childCount() == 0 )
return; return;
item->setOpen( !item->isOpen() ); item->setOpen( !item->isOpen() );
item->repaint(); item->tqrepaint();
} }
bool KCHMMainWindow::event( QEvent * e ) bool KCHMMainWindow::event( TQEvent * e )
{ {
if ( e->type() == QEvent::User ) if ( e->type() == TQEvent::User )
return handleUserEvent( (KCHMUserEvent*) e ); return handleUserEvent( (KCHMUserEvent*) e );
return QWidget::event( e ); return TQWidget::event( e );
} }
bool KCHMMainWindow::handleUserEvent( const KCHMUserEvent * event ) bool KCHMMainWindow::handleUserEvent( const KCHMUserEvent * event )
@ -1201,8 +1201,8 @@ bool KCHMMainWindow::handleUserEvent( const KCHMUserEvent * event )
if ( event->m_args.size() != 1 && event->m_args.size() != 2 ) if ( event->m_args.size() != 1 && event->m_args.size() != 2 )
qFatal("handleUserEvent: event loadAndOpen must receive 1 or 2 args"); qFatal("handleUserEvent: event loadAndOpen must receive 1 or 2 args");
QString chmfile = event->m_args[0]; TQString chmfile = event->m_args[0];
QString openurl = event->m_args.size() > 1 ? event->m_args[1] : "/"; TQString openurl = event->m_args.size() > 1 ? event->m_args[1] : "/";
return loadChmFile( chmfile, false ) && openPage( openurl ); return loadChmFile( chmfile, false ) && openPage( openurl );
} }
@ -1254,13 +1254,13 @@ void KCHMMainWindow::runAutoTest()
case STATE_INITIAL: case STATE_INITIAL:
if ( m_contentsWindow && !m_useShortAutotest ) if ( m_contentsWindow && !m_useShortAutotest )
{ {
m_autotestlistiterator = QListViewItemIterator (m_contentsWindow); m_autotestlistiterator = TQListViewItemIterator (m_contentsWindow);
m_autoteststate = STATE_CONTENTS_OPENNEXTPAGE; m_autoteststate = STATE_CONTENTS_OPENNEXTPAGE;
} }
else else
m_autoteststate = STATE_OPEN_INDEX; m_autoteststate = STATE_OPEN_INDEX;
QTimer::singleShot (500, this, SLOT(runAutoTest()) ); TQTimer::singleShot (500, this, TQT_SLOT(runAutoTest()) );
break; // allow to finish the initialization sequence break; // allow to finish the initialization sequence
case STATE_CONTENTS_OPENNEXTPAGE: case STATE_CONTENTS_OPENNEXTPAGE:
@ -1272,7 +1272,7 @@ void KCHMMainWindow::runAutoTest()
else else
m_autoteststate = STATE_OPEN_INDEX; m_autoteststate = STATE_OPEN_INDEX;
QTimer::singleShot (50, this, SLOT(runAutoTest()) ); TQTimer::singleShot (50, this, TQT_SLOT(runAutoTest()) );
break; break;
case STATE_OPEN_INDEX: case STATE_OPEN_INDEX:
@ -1280,11 +1280,11 @@ void KCHMMainWindow::runAutoTest()
m_tabWidget->setCurrentPage (1); m_tabWidget->setCurrentPage (1);
m_autoteststate = STATE_SHUTDOWN; m_autoteststate = STATE_SHUTDOWN;
QTimer::singleShot (500, this, SLOT(runAutoTest()) ); TQTimer::singleShot (500, this, TQT_SLOT(runAutoTest()) );
break; break;
case STATE_SHUTDOWN: case STATE_SHUTDOWN:
qApp->quit(); tqApp->quit();
break; break;
default: default:

@ -44,29 +44,30 @@ static const unsigned int OPF_NEW_TAB = 1 << 2;
static const unsigned int OPF_BACKGROUND = 1 << 3; static const unsigned int OPF_BACKGROUND = 1 << 3;
//! Those events could be sent to main window to do useful things. See handleUserEvents() //! Those events could be sent to main window to do useful things. See handleUserEvents()
class KCHMUserEvent : public QEvent class KCHMUserEvent : public TQEvent
{ {
public: public:
KCHMUserEvent( const QString& action, const QStringList& args = QStringList()) KCHMUserEvent( const TQString& action, const TQStringList& args = TQStringList())
: QEvent( QEvent::User ), m_action(action), m_args(args) {}; : TQEvent( TQEvent::User ), m_action(action), m_args(args) {};
QString m_action; TQString m_action;
QStringList m_args; TQStringList m_args;
}; };
class KCHMMainWindow : public KQMainWindow class KCHMMainWindow : public KQMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMMainWindow(); KCHMMainWindow();
~KCHMMainWindow(); ~KCHMMainWindow();
bool openPage ( const QString &url, unsigned int flags = OPF_CONTENT_TREE ); bool openPage ( const TQString &url, unsigned int flags = OPF_CONTENT_TREE );
LCHMFile * chmFile() const { return m_chmFile; } LCHMFile * chmFile() const { return m_chmFile; }
const QString& getOpenedFileName () { return m_chmFilename; } const TQString& getOpenedFileName () { return m_chmFilename; }
KCHMViewWindow * currentBrowser() const; KCHMViewWindow * currentBrowser() const;
KCHMContentsWindow * contentsWindow() const { return m_contentsWindow; } KCHMContentsWindow * contentsWindow() const { return m_contentsWindow; }
@ -75,12 +76,12 @@ class KCHMMainWindow : public KQMainWindow
KCHMNavToolbar * navigationToolbar() const { return m_navToolbar; } KCHMNavToolbar * navigationToolbar() const { return m_navToolbar; }
KCHMSearchWindow * searchWindow() const { return m_searchWindow; } KCHMSearchWindow * searchWindow() const { return m_searchWindow; }
void showInStatusBar (const QString& text) { statusBar()->message( text, 2000 ); } void showInStatusBar (const TQString& text) { statusBar()->message( text, 2000 ); }
void setTextEncoding (const LCHMTextEncoding * enc); void setTextEncoding (const LCHMTextEncoding * enc);
public slots: public slots:
void slotOnTreeClicked( QListViewItem *item ); void slotOnTreeClicked( TQListViewItem *item );
void slotOnTreeDoubleClicked( QListViewItem *item, const QPoint &, int ); void slotOnTreeDoubleClicked( TQListViewItem *item, const TQPoint &, int );
void slotAddBookmark ( ); void slotAddBookmark ( );
void slotOpenPageInNewTab( ); void slotOpenPageInNewTab( );
@ -91,7 +92,7 @@ class KCHMMainWindow : public KQMainWindow
void slotBrowserChanged( KCHMViewWindow * newbrowser ); void slotBrowserChanged( KCHMViewWindow * newbrowser );
private slots: private slots:
void slotLinkClicked ( const QString & link, bool& follow_link ); void slotLinkClicked ( const TQString & link, bool& follow_link );
void slotOpenMenuItemActivated(); void slotOpenMenuItemActivated();
void slotPrintMenuItemActivated(); void slotPrintMenuItemActivated();
@ -119,12 +120,12 @@ class KCHMMainWindow : public KQMainWindow
private: private:
bool parseCmdLineArgs(); bool parseCmdLineArgs();
void showEvent( QShowEvent * ); void showEvent( TQShowEvent * );
void closeEvent ( QCloseEvent * e ); void closeEvent ( TQCloseEvent * e );
void setupSignals (); void setupSignals ();
void setupToolbarsAndMenu ( ); void setupToolbarsAndMenu ( );
bool loadChmFile ( const QString &fileName, bool call_open_page = true ); bool loadChmFile ( const TQString &fileName, bool call_open_page = true );
void closeChmFile(); void closeChmFile();
void refreshCurrentBrowser(); void refreshCurrentBrowser();
void updateHistoryMenu(); void updateHistoryMenu();
@ -134,13 +135,13 @@ class KCHMMainWindow : public KQMainWindow
void showOrHideSearchWindow( int tabindex ); void showOrHideSearchWindow( int tabindex );
// User events // User events
bool event ( QEvent * e ); bool event ( TQEvent * e );
bool handleUserEvent( const KCHMUserEvent * event ); bool handleUserEvent( const KCHMUserEvent * event );
void locateInContentTree( const QString& url ); void locateInContentTree( const TQString& url );
QString m_chmFilename; TQString m_chmFilename;
QString m_aboutDlgMenuText; // to show in KDE or Qt about dialogs TQString m_aboutDlgMenuText; // to show in KDE or TQt about dialogs
KCHMViewWindowMgr * m_viewWindowMgr; KCHMViewWindowMgr * m_viewWindowMgr;
KCHMIndexWindow * m_indexWindow; KCHMIndexWindow * m_indexWindow;
@ -148,8 +149,8 @@ class KCHMMainWindow : public KQMainWindow
KCHMBookmarkWindow * m_bookmarkWindow; KCHMBookmarkWindow * m_bookmarkWindow;
KCHMContentsWindow * m_contentsWindow; KCHMContentsWindow * m_contentsWindow;
KQTabWidget * m_tabWidget; KTQTabWidget * m_tabWidget;
QSplitter * m_windowSplitter; TQSplitter * m_windowSplitter;
KCHMSearchAndViewToolbar * m_searchToolbar; KCHMSearchAndViewToolbar * m_searchToolbar;
KCHMNavToolbar * m_navToolbar; KCHMNavToolbar * m_navToolbar;
@ -159,7 +160,7 @@ class KCHMMainWindow : public KQMainWindow
LCHMFile * m_chmFile; LCHMFile * m_chmFile;
bool m_FirstTimeShow; bool m_FirstTimeShow;
KQPopupMenu * m_menuHistory; KTQPopupMenu * m_menuHistory;
int m_tabContextPage; int m_tabContextPage;
int m_tabIndexPage; int m_tabIndexPage;
@ -178,7 +179,7 @@ class KCHMMainWindow : public KQMainWindow
bool m_useShortAutotest; bool m_useShortAutotest;
auto_test_state_t m_autoteststate; auto_test_state_t m_autoteststate;
QListViewItemIterator m_autotestlistiterator; TQListViewItemIterator m_autotestlistiterator;
private slots: private slots:
void runAutoTest(); void runAutoTest();

@ -26,38 +26,38 @@
#include "iconstorage.h" #include "iconstorage.h"
KCHMNavToolbar::KCHMNavToolbar( KCHMMainWindow *parent ) KCHMNavToolbar::KCHMNavToolbar( KCHMMainWindow *tqparent )
: QToolBar( parent ) : TQToolBar( tqparent )
{ {
// Initialize toolbar // Initialize toolbar
setLabel( i18n( "Navigation") ); setLabel( i18n( "Navigation") );
QPixmap iconBackward (*gIconStorage.getToolbarPixmap(KCHMIconStorage::back)); TQPixmap iconBackward (*gIconStorage.getToolbarPixmap(KCHMIconStorage::back));
m_toolbarIconBackward = new QToolButton (iconBackward, m_toolbarIconBackward = new TQToolButton (iconBackward,
i18n( "Move backward in history"), i18n( "Move backward in history"),
QString::null, TQString(),
parent, tqparent,
SLOT( slotNavigateBack() ), TQT_SLOT( slotNavigateBack() ),
this); this);
QWhatsThis::add( m_toolbarIconBackward, i18n( "Click this button to move backward in browser history") ); TQWhatsThis::add( m_toolbarIconBackward, i18n( "Click this button to move backward in browser history") );
QPixmap iconForward (*gIconStorage.getToolbarPixmap(KCHMIconStorage::forward)); TQPixmap iconForward (*gIconStorage.getToolbarPixmap(KCHMIconStorage::forward));
m_toolbarIconForward = new QToolButton (iconForward, m_toolbarIconForward = new TQToolButton (iconForward,
i18n( "Move forward in history"), i18n( "Move forward in history"),
QString::null, TQString(),
parent, tqparent,
SLOT( slotNavigateForward() ), TQT_SLOT( slotNavigateForward() ),
this); this);
QWhatsThis::add( m_toolbarIconForward, i18n( "Click this button to move forward in browser history") ); TQWhatsThis::add( m_toolbarIconForward, i18n( "Click this button to move forward in browser history") );
QPixmap iconHome = (*gIconStorage.getToolbarPixmap(KCHMIconStorage::gohome)); TQPixmap iconHome = (*gIconStorage.getToolbarPixmap(KCHMIconStorage::gohome));
QToolButton * hb = new QToolButton (iconHome, TQToolButton * hb = new TQToolButton (iconHome,
i18n( "Go to the home page"), i18n( "Go to the home page"),
QString::null, TQString(),
parent, tqparent,
SLOT( slotNavigateHome() ), TQT_SLOT( slotNavigateHome() ),
this); this);
QWhatsThis::add( hb, i18n( "Click this button to move to the home page") ); TQWhatsThis::add( hb, i18n( "Click this button to move to the home page") );
} }
@ -65,7 +65,7 @@ KCHMNavToolbar::~KCHMNavToolbar()
{ {
} }
void KCHMNavToolbar::updateIconStatus( bool enable_backward, bool enable_forward ) void KCHMNavToolbar::updateIcontqStatus( bool enable_backward, bool enable_forward )
{ {
m_toolbarIconBackward->setEnabled( enable_backward ); m_toolbarIconBackward->setEnabled( enable_backward );
m_toolbarIconForward->setEnabled ( enable_forward ); m_toolbarIconForward->setEnabled ( enable_forward );

@ -24,19 +24,20 @@
#include "forwarddeclarations.h" #include "forwarddeclarations.h"
class KCHMNavToolbar : public QToolBar class KCHMNavToolbar : public TQToolBar
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMNavToolbar( KCHMMainWindow *parent ); KCHMNavToolbar( KCHMMainWindow *tqparent );
~KCHMNavToolbar(); ~KCHMNavToolbar();
public slots: public slots:
void updateIconStatus( bool enable_backward, bool enable_forward ); void updateIcontqStatus( bool enable_backward, bool enable_forward );
private: private:
QToolButton * m_toolbarIconBackward; TQToolButton * m_toolbarIconBackward;
QToolButton * m_toolbarIconForward; TQToolButton * m_toolbarIconForward;
}; };
#endif /* INCLUDE_KCHMNAVHISTORY_H */ #endif /* INCLUDE_KCHMNAVHISTORY_H */

@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qapplication.h> #include <tqapplication.h>
#include "kchmmainwindow.h" #include "kchmmainwindow.h"
#include "kchmsearchengine.h" #include "kchmsearchengine.h"
@ -49,8 +49,8 @@ KCHMSearchEngine::~KCHMSearchEngine()
void KCHMSearchEngine::processEvents( ) void KCHMSearchEngine::processEvents( )
{ {
// Do it twice; some events generate other events // Do it twice; some events generate other events
qApp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput );
qApp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput ); tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput );
} }
@ -65,27 +65,27 @@ bool KCHMSearchEngine::loadOrGenerateIndex( )
if ( m_Index ) if ( m_Index )
return true; return true;
QString indexfiledict = ::mainWindow->currentSettings()->searchIndexDictFilename(); TQString indexfiledict = ::mainWindow->currentSettings()->searchIndexDictFilename();
QString indexfiledoc = ::mainWindow->currentSettings()->searchIndexDocFilename(); TQString indexfiledoc = ::mainWindow->currentSettings()->searchIndexDocFilename();
QStringList documents; TQStringList documents;
m_Index = new QtAs::Index( documents, appConfig.m_datapath ); m_Index = new QtAs::Index( documents, appConfig.m_datapath );
m_Index->setDictionaryFile( indexfiledict ); m_Index->setDictionaryFile( indexfiledict );
m_Index->setDocListFile( indexfiledoc ); m_Index->setDocListFile( indexfiledoc );
m_progressDlg = new QProgressDialog( 0 ); m_progressDlg = new TQProgressDialog( 0 );
connect( m_progressDlg, SIGNAL( canceled() ), this, SLOT( cancelButtonPressed() ) ); connect( m_progressDlg, TQT_SIGNAL( canceled() ), this, TQT_SLOT( cancelButtonPressed() ) );
connect( m_Index, SIGNAL( indexingProgress( int ) ), this, SLOT( setIndexingProgress( int ) ) ); connect( m_Index, TQT_SIGNAL( indexingProgress( int ) ), this, TQT_SLOT( setIndexingProgress( int ) ) );
KCHMShowWaitCursor waitcursor; KCHMShowWaitCursor waitcursor;
QFile f( indexfiledict ); TQFile f( indexfiledict );
if ( !f.exists() ) if ( !f.exists() )
{ {
::mainWindow->statusBar()->message( tr( "Generating search index..." ) ); ::mainWindow->statusBar()->message( tr( "Generating search index..." ) );
// Get the list of files in CHM archive // Get the list of files in CHM archive
QStringList alldocuments; TQStringList alldocuments;
m_progressDlg->setCaption( tr( "Generating search index..." ) ); m_progressDlg->setCaption( tr( "Generating search index..." ) );
m_progressDlg->setLabelText( tr( "Generating search index..." ) ); m_progressDlg->setLabelText( tr( "Generating search index..." ) );
@ -103,7 +103,7 @@ bool KCHMSearchEngine::loadOrGenerateIndex( )
// Process the list keeping only HTML documents there // Process the list keeping only HTML documents there
for ( unsigned int i = 0; i < alldocuments.size(); i++ ) for ( unsigned int i = 0; i < alldocuments.size(); i++ )
if ( alldocuments[i].endsWith( ".html", false ) || alldocuments[i].endsWith( ".htm", false ) ) if ( alldocuments[i].tqendsWith( ".html", false ) || alldocuments[i].tqendsWith( ".htm", false ) )
documents.push_back( LCHMUrlFactory::makeURLabsoluteIfNeeded( alldocuments[i] ) ); documents.push_back( LCHMUrlFactory::makeURLabsoluteIfNeeded( alldocuments[i] ) );
m_Index->setDocList( documents ); m_Index->setDocList( documents );
@ -161,7 +161,7 @@ class SearchDataKeeper
bool isInPhrase() const { return m_inPhrase; } bool isInPhrase() const { return m_inPhrase; }
void addTerm( const QString& term ) void addTerm( const TQString& term )
{ {
if ( !term.isEmpty() ) if ( !term.isEmpty() )
{ {
@ -173,36 +173,36 @@ class SearchDataKeeper
} }
// Should contain all the search terms present in query, includind those from phrases. One element - one term . // Should contain all the search terms present in query, includind those from phrases. One element - one term .
QStringList terms; TQStringList terms;
// Should contain phrases present in query without quotes. One element - one phrase. // Should contain phrases present in query without quotes. One element - one phrase.
QStringList phrases; TQStringList phrases;
// Should contain all the terms present in all the phrases (but not outside). // Should contain all the terms present in all the phrases (but not outside).
QStringList phrasewords; TQStringList phrasewords;
private: private:
bool m_inPhrase; bool m_inPhrase;
QStringList phrase_terms; TQStringList phrase_terms;
}; };
bool KCHMSearchEngine::searchQuery( const QString & query, QStringList * results, unsigned int limit ) bool KCHMSearchEngine::searchQuery( const TQString & query, TQStringList * results, unsigned int limit )
{ {
// Characters which split the words. We need to make them separate tokens // Characters which split the words. We need to make them separate tokens
QString splitChars = m_Index->getCharsSplit(); TQString splitChars = m_Index->getCharsSplit();
// Characters which are part of the word. We should keep them apart. // Characters which are part of the word. We should keep them apart.
QString partOfWordChars = m_Index->getCharsPartOfWord(); TQString partOfWordChars = m_Index->getCharsPartOfWord();
SearchDataKeeper keeper; SearchDataKeeper keeper;
// State machine variables // State machine variables
QString term; TQString term;
for ( unsigned int i = 0; i < query.length(); i++ ) for ( unsigned int i = 0; i < query.length(); i++ )
{ {
QChar ch = query[i].lower(); TQChar ch = query[i].lower();
// a quote either begins or ends the phrase // a quote either begins or ends the phrase
if ( ch == '"' ) if ( ch == '"' )
@ -218,14 +218,14 @@ bool KCHMSearchEngine::searchQuery( const QString & query, QStringList * results
} }
// If new char does not stop the word, add ot and continue // If new char does not stop the word, add ot and continue
if ( ch.isLetterOrNumber() || partOfWordChars.find( ch ) != -1 ) if ( ch.isLetterOrNumber() || partOfWordChars.tqfind( ch ) != -1 )
{ {
term.append( ch ); term.append( ch );
continue; continue;
} }
// If it is a split char, add this term and split char as separate term // If it is a split char, add this term and split char as separate term
if ( splitChars.find( ch ) != -1 ) if ( splitChars.tqfind( ch ) != -1 )
{ {
// Add existing term if present // Add existing term if present
keeper.addTerm( term ); keeper.addTerm( term );
@ -236,21 +236,21 @@ bool KCHMSearchEngine::searchQuery( const QString & query, QStringList * results
// Just add the word; it is most likely a space or terminated by tokenizer. // Just add the word; it is most likely a space or terminated by tokenizer.
keeper.addTerm( term ); keeper.addTerm( term );
term = QString::null; term = TQString();
} }
keeper.addTerm( term ); keeper.addTerm( term );
if ( keeper.isInPhrase() ) if ( keeper.isInPhrase() )
{ {
QMessageBox::warning( 0, i18n( "Search" ), i18n( "A closing quote character is missing." ) ); TQMessageBox::warning( 0, i18n( "Search" ), i18n( "A closing quote character is missing." ) );
return false; return false;
} }
KCHMShowWaitCursor waitcursor; KCHMShowWaitCursor waitcursor;
QStringList foundDocs = m_Index->query( keeper.terms, keeper.phrases, keeper.phrasewords ); TQStringList foundDocs = m_Index->query( keeper.terms, keeper.phrases, keeper.phrasewords );
for ( QStringList::iterator it = foundDocs.begin(); it != foundDocs.end() && limit > 0; ++it, limit-- ) for ( TQStringList::iterator it = foundDocs.begin(); it != foundDocs.end() && limit > 0; ++it, limit-- )
results->push_back( *it ); results->push_back( *it );
return true; return true;

@ -22,27 +22,28 @@
#ifndef KCHMSEARCHENGINE_H #ifndef KCHMSEARCHENGINE_H
#define KCHMSEARCHENGINE_H #define KCHMSEARCHENGINE_H
#include <qobject.h> #include <tqobject.h>
#include <qmap.h> #include <tqmap.h>
#include <qstring.h> #include <tqstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qprogressdialog.h> #include <tqprogressdialog.h>
#include "libchmfile.h" #include "libchmfile.h"
namespace QtAs { class Index; }; namespace QtAs { class Index; };
class KCHMSearchEngine : public QObject class KCHMSearchEngine : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMSearchEngine(); KCHMSearchEngine();
~KCHMSearchEngine(); ~KCHMSearchEngine();
bool loadOrGenerateIndex(); bool loadOrGenerateIndex();
bool searchQuery ( const QString& query, QStringList * results, unsigned int limit = 100 ); bool searchQuery ( const TQString& query, TQStringList * results, unsigned int limit = 100 );
private slots: private slots:
@ -53,8 +54,8 @@ class KCHMSearchEngine : public QObject
void processEvents(); void processEvents();
// Used during the index generation // Used during the index generation
QProgressDialog * m_progressDlg; TQProgressDialog * m_progressDlg;
QStringList m_keywordDocuments; TQStringList m_keywordDocuments;
QtAs::Index * m_Index; QtAs::Index * m_Index;
}; };

@ -21,11 +21,11 @@
***************************************************************************/ ***************************************************************************/
#include <qfile.h> #include <tqfile.h>
#include <qdir.h> #include <tqdir.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qdict.h> #include <tqdict.h>
#include <qapplication.h> #include <tqapplication.h>
#include <ctype.h> #include <ctype.h>
@ -45,7 +45,7 @@ static const char SPLIT_CHARACTERS[] = "!()*&^%#@[]{}':;,.?/|/?<>\\-+=~`";
static const char WORD_CHARACTERS[] = "$_"; static const char WORD_CHARACTERS[] = "$_";
int TermList::compareItems( QPtrCollection::Item i1, QPtrCollection::Item i2 ) int TermList::compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 )
{ {
if( ( (Term*)i1 )->frequency == ( (Term*)i2 )->frequency ) if( ( (Term*)i1 )->frequency == ( (Term*)i2 )->frequency )
return 0; return 0;
@ -54,35 +54,35 @@ int TermList::compareItems( QPtrCollection::Item i1, QPtrCollection::Item i2 )
return 1; return 1;
} }
QDataStream &operator>>( QDataStream &s, Document &l ) TQDataStream &operator>>( TQDataStream &s, Document &l )
{ {
s >> l.docNumber; s >> l.docNumber;
s >> l.frequency; s >> l.frequency;
return s; return s;
} }
QDataStream &operator<<( QDataStream &s, const Document &l ) TQDataStream &operator<<( TQDataStream &s, const Document &l )
{ {
s << (Q_INT16)l.docNumber; s << (TQ_INT16)l.docNumber;
s << (Q_INT16)l.frequency; s << (TQ_INT16)l.frequency;
return s; return s;
} }
Index::Index( const QString &dp, const QString & ) Index::Index( const TQString &dp, const TQString & )
: QObject( 0, 0 ), dict( 8999 ), docPath( dp ) : TQObject( 0, 0 ), dict( 8999 ), docPath( dp )
{ {
lastWindowClosed = false; lastWindowClosed = false;
connect( qApp, SIGNAL( lastWindowClosed() ), connect( tqApp, TQT_SIGNAL( lastWindowClosed() ),
this, SLOT( setLastWinClosed() ) ); this, TQT_SLOT( setLastWinClosed() ) );
} }
Index::Index( const QStringList &dl, const QString & ) Index::Index( const TQStringList &dl, const TQString & )
: QObject( 0, 0 ), dict( 20011 ) : TQObject( 0, 0 ), dict( 20011 )
{ {
docList = dl; docList = dl;
lastWindowClosed = false; lastWindowClosed = false;
connect( qApp, SIGNAL( lastWindowClosed() ), connect( tqApp, TQT_SIGNAL( lastWindowClosed() ),
this, SLOT( setLastWinClosed() ) ); this, TQT_SLOT( setLastWinClosed() ) );
} }
void Index::setLastWinClosed() void Index::setLastWinClosed()
@ -90,17 +90,17 @@ void Index::setLastWinClosed()
lastWindowClosed = true; lastWindowClosed = true;
} }
void Index::setDictionaryFile( const QString &f ) void Index::setDictionaryFile( const TQString &f )
{ {
dictFile = f; dictFile = f;
} }
void Index::setDocListFile( const QString &f ) void Index::setDocListFile( const TQString &f )
{ {
docListFile = f; docListFile = f;
} }
void Index::setDocList( const QStringList &lst ) void Index::setDocList( const TQStringList &lst )
{ {
docList = lst; docList = lst;
} }
@ -110,7 +110,7 @@ bool Index::makeIndex()
if ( docList.isEmpty() ) if ( docList.isEmpty() )
return false; return false;
QStringList::Iterator it = docList.begin(); TQStringList::Iterator it = docList.begin();
int steps = docList.count() / 100; int steps = docList.count() / 100;
if ( !steps ) if ( !steps )
@ -136,7 +136,7 @@ bool Index::makeIndex()
} }
void Index::insertInDict( const QString &str, int docNum ) void Index::insertInDict( const TQString &str, int docNum )
{ {
Entry *e = 0; Entry *e = 0;
if ( dict.count() ) if ( dict.count() )
@ -156,10 +156,10 @@ void Index::insertInDict( const QString &str, int docNum )
} }
bool Index::parseDocumentToStringlist( const QString & filename, QStringList & tokenlist ) bool Index::parseDocumentToStringlist( const TQString & filename, TQStringList & tokenlist )
{ {
QString parsedbuf, parseentity; TQString parsedbuf, parseentity;
QString text; TQString text;
if ( !::mainWindow->chmFile()->getFileContentAsString( &text, filename ) ) if ( !::mainWindow->chmFile()->getFileContentAsString( &text, filename ) )
{ {
@ -183,19 +183,19 @@ bool Index::parseDocumentToStringlist( const QString & filename, QStringList & t
{ {
STATE_OUTSIDE_TAGS, // outside HTML tags; parse text STATE_OUTSIDE_TAGS, // outside HTML tags; parse text
STATE_IN_HTML_TAG, // inside HTML tags; wait for end tag STATE_IN_HTML_TAG, // inside HTML tags; wait for end tag
STATE_IN_QUOTES, // inside HTML tags and inside quotes; wait for end quote (in var QuoteChar) STATE_IN_TQUOTES, // inside HTML tags and inside quotes; wait for end quote (in var QuoteChar)
STATE_IN_HTML_ENTITY, // inside HTML entity; parse the entity STATE_IN_HTML_ENTITY, // inside HTML entity; parse the entity
}; };
state_t state = STATE_OUTSIDE_TAGS; state_t state = STATE_OUTSIDE_TAGS;
QChar QuoteChar; // used in STATE_IN_QUOTES TQChar QuoteChar; // used in STATE_IN_TQUOTES
for ( unsigned int j = 0; j < text.length(); j++ ) for ( unsigned int j = 0; j < text.length(); j++ )
{ {
QChar ch = text[j]; TQChar ch = text[j];
if ( (j % 20000) == 0 ) if ( (j % 20000) == 0 )
qApp->processEvents( QEventLoop::ExcludeUserInput ); tqApp->tqprocessEvents( TQEventLoop::ExcludeUserInput );
if ( state == STATE_IN_HTML_TAG ) if ( state == STATE_IN_HTML_TAG )
{ {
@ -203,7 +203,7 @@ bool Index::parseDocumentToStringlist( const QString & filename, QStringList & t
// Ignore everything until we see '>' (end of HTML tag) or quote char (quote start) // Ignore everything until we see '>' (end of HTML tag) or quote char (quote start)
if ( ch == '"' || ch == '\'' ) if ( ch == '"' || ch == '\'' )
{ {
state = STATE_IN_QUOTES; state = STATE_IN_TQUOTES;
QuoteChar = ch; QuoteChar = ch;
} }
else if ( ch == '>' ) else if ( ch == '>' )
@ -211,7 +211,7 @@ bool Index::parseDocumentToStringlist( const QString & filename, QStringList & t
continue; continue;
} }
else if ( state == STATE_IN_QUOTES ) else if ( state == STATE_IN_TQUOTES )
{ {
// We are inside quoted text inside HTML tag. // We are inside quoted text inside HTML tag.
// Ignore everything until we see the quote character again // Ignore everything until we see the quote character again
@ -252,7 +252,7 @@ bool Index::parseDocumentToStringlist( const QString & filename, QStringList & t
// Don't we have a space? // Don't we have a space?
if ( parseentity.lower() != "nbsp" ) if ( parseentity.lower() != "nbsp" )
{ {
QString entity = ::mainWindow->chmFile()->impl()->decodeEntity( parseentity ); TQString entity = ::mainWindow->chmFile()->impl()->decodeEntity( parseentity );
if ( entity.isNull() ) if ( entity.isNull() )
{ {
@ -283,7 +283,7 @@ bool Index::parseDocumentToStringlist( const QString & filename, QStringList & t
if ( ch == '&' ) if ( ch == '&' )
{ {
state = STATE_IN_HTML_ENTITY; state = STATE_IN_HTML_ENTITY;
parseentity = QString::null; parseentity = TQString();
continue; continue;
} }
@ -293,20 +293,20 @@ bool Index::parseDocumentToStringlist( const QString & filename, QStringList & t
// Ok, we have a valid character outside HTML tags, and probably some in buffer already. // Ok, we have a valid character outside HTML tags, and probably some in buffer already.
// If it is char or letter, add it and continue // If it is char or letter, add it and continue
if ( ch.isLetterOrNumber() || m_charsword.find( ch ) != -1 ) if ( ch.isLetterOrNumber() || m_charsword.tqfind( ch ) != -1 )
{ {
parsedbuf.append( ch ); parsedbuf.append( ch );
continue; continue;
} }
// If it is a split char, add the word to the dictionary, and then add the char itself. // If it is a split char, add the word to the dictionary, and then add the char itself.
if ( m_charssplit.find( ch ) != -1 ) if ( m_charssplit.tqfind( ch ) != -1 )
{ {
if ( !parsedbuf.isEmpty() ) if ( !parsedbuf.isEmpty() )
tokenlist.push_back( parsedbuf.lower() ); tokenlist.push_back( parsedbuf.lower() );
tokenlist.push_back( ch.lower() ); tokenlist.push_back( ch.lower() );
parsedbuf = QString::null; parsedbuf = TQString();
continue; continue;
} }
@ -315,7 +315,7 @@ tokenize_buf:
if ( !parsedbuf.isEmpty() ) if ( !parsedbuf.isEmpty() )
{ {
tokenlist.push_back( parsedbuf.lower() ); tokenlist.push_back( parsedbuf.lower() );
parsedbuf = QString::null; parsedbuf = TQString();
} }
} }
@ -327,22 +327,22 @@ tokenize_buf:
} }
void Index::parseDocument( const QString &filename, int docNum ) void Index::parseDocument( const TQString &filename, int docNum )
{ {
QStringList terms; TQStringList terms;
if ( !parseDocumentToStringlist( filename, terms ) ) if ( !parseDocumentToStringlist( filename, terms ) )
return; return;
for ( QStringList::Iterator it = terms.begin(); it != terms.end(); ++it ) for ( TQStringList::Iterator it = terms.begin(); it != terms.end(); ++it )
insertInDict( *it, docNum ); insertInDict( *it, docNum );
} }
void Index::writeDict() void Index::writeDict()
{ {
QDictIterator<Entry> it( dict ); TQDictIterator<Entry> it( dict );
QFile f( dictFile ); TQFile f( dictFile );
if ( !f.open( IO_WriteOnly ) ) if ( !f.open( IO_WriteOnly ) )
{ {
@ -350,7 +350,7 @@ void Index::writeDict()
return; return;
} }
QDataStream s( &f ); TQDataStream s( &f );
s << (int) 1; // version s << (int) 1; // version
s << m_charssplit; s << m_charssplit;
s << m_charsword; s << m_charsword;
@ -368,27 +368,27 @@ void Index::writeDict()
void Index::writeDocumentList() void Index::writeDocumentList()
{ {
QFile f( docListFile ); TQFile f( docListFile );
if ( !f.open( IO_WriteOnly ) ) if ( !f.open( IO_WriteOnly ) )
{ {
qWarning( "Index::writeDocumentList: could not write dictionary file %s", docListFile.ascii() ); qWarning( "Index::writeDocumentList: could not write dictionary file %s", docListFile.ascii() );
return; return;
} }
QDataStream s( &f ); TQDataStream s( &f );
s << docList; s << docList;
} }
bool Index::readDict() bool Index::readDict()
{ {
QFile f( dictFile ); TQFile f( dictFile );
if ( !f.open( IO_ReadOnly ) ) if ( !f.open( IO_ReadOnly ) )
return false; return false;
dict.clear(); dict.clear();
QDataStream s( &f ); TQDataStream s( &f );
QString key; TQString key;
int version; int version;
QValueList<Document> docs; TQValueList<Document> docs;
s >> version; s >> version;
s >> m_charssplit; s >> m_charssplit;
@ -407,19 +407,19 @@ bool Index::readDict()
bool Index::readDocumentList() bool Index::readDocumentList()
{ {
QFile f( docListFile ); TQFile f( docListFile );
if ( !f.open( IO_ReadOnly ) ) if ( !f.open( IO_ReadOnly ) )
return false; return false;
QDataStream s( &f ); TQDataStream s( &f );
s >> docList; s >> docList;
return true; return true;
} }
QStringList Index::query( const QStringList &terms, const QStringList &termSeq, const QStringList &seqWords ) TQStringList Index::query( const TQStringList &terms, const TQStringList &termSeq, const TQStringList &seqWords )
{ {
TermList termList; TermList termList;
QStringList::ConstIterator it = terms.begin(); TQStringList::ConstIterator it = terms.begin();
for ( it = terms.begin(); it != terms.end(); ++it ) for ( it = terms.begin(); it != terms.end(); ++it )
{ {
Entry *e = 0; Entry *e = 0;
@ -431,7 +431,7 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq,
} }
else else
{ {
return QStringList(); return TQStringList();
} }
} }
@ -440,18 +440,18 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq,
Term *minTerm = termList.first(); Term *minTerm = termList.first();
if ( !termList.count() ) if ( !termList.count() )
return QStringList(); return TQStringList();
termList.removeFirst(); termList.removeFirst();
QValueList<Document> minDocs = minTerm->documents; TQValueList<Document> minDocs = minTerm->documents;
QValueList<Document>::iterator C; TQValueList<Document>::iterator C;
QValueList<Document>::ConstIterator It; TQValueList<Document>::ConstIterator It;
Term *t = termList.first(); Term *t = termList.first();
for ( ; t; t = termList.next() ) for ( ; t; t = termList.next() )
{ {
QValueList<Document> docs = t->documents; TQValueList<Document> docs = t->documents;
C = minDocs.begin(); C = minDocs.begin();
while ( C != minDocs.end() ) while ( C != minDocs.end() )
@ -475,7 +475,7 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq,
} }
} }
QStringList results; TQStringList results;
qHeapSort( minDocs ); qHeapSort( minDocs );
if ( termSeq.isEmpty() ) if ( termSeq.isEmpty() )
@ -486,7 +486,7 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq,
return results; return results;
} }
QString fileName; TQString fileName;
for ( C = minDocs.begin(); C != minDocs.end(); ++C ) for ( C = minDocs.begin(); C != minDocs.end(); ++C )
{ {
@ -500,9 +500,9 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq,
} }
bool Index::searchForPhrases( const QStringList &phrases, const QStringList &words, const QString &filename ) bool Index::searchForPhrases( const TQStringList &phrases, const TQStringList &words, const TQString &filename )
{ {
QStringList parsed_document; TQStringList parsed_document;
if ( !parseDocumentToStringlist( filename, parsed_document ) ) if ( !parseDocumentToStringlist( filename, parsed_document ) )
return false; return false;
@ -510,12 +510,12 @@ bool Index::searchForPhrases( const QStringList &phrases, const QStringList &wor
miniDict.clear(); miniDict.clear();
// Initialize the dictionary with the words in phrase(s) // Initialize the dictionary with the words in phrase(s)
for ( QStringList::ConstIterator cIt = words.begin(); cIt != words.end(); ++cIt ) for ( TQStringList::ConstIterator cIt = words.begin(); cIt != words.end(); ++cIt )
miniDict.insert( *cIt, new PosEntry( 0 ) ); miniDict.insert( *cIt, new PosEntry( 0 ) );
// Fill the dictionary with the words from the document // Fill the dictionary with the words from the document
unsigned int word_offset = 3; unsigned int word_offset = 3;
for ( QStringList::ConstIterator it = parsed_document.begin(); it != parsed_document.end(); it++, word_offset++ ) for ( TQStringList::ConstIterator it = parsed_document.begin(); it != parsed_document.end(); it++, word_offset++ )
{ {
PosEntry * entry = miniDict[ *it ]; PosEntry * entry = miniDict[ *it ];
@ -525,33 +525,33 @@ bool Index::searchForPhrases( const QStringList &phrases, const QStringList &wor
// Dump it // Dump it
/* /*
QDictIterator<PosEntry> it( miniDict ); TQDictIterator<PosEntry> it( miniDict );
for( ; it.current(); ++it ) for( ; it.current(); ++it )
{ {
QString text( it.currentKey() ); TQString text( it.currentKey() );
QValueList<uint> pos = miniDict[text]->positions; TQValueList<uint> pos = miniDict[text]->positions;
for ( unsigned int i = 1; i < pos.size(); i++ ) for ( unsigned int i = 1; i < pos.size(); i++ )
text += " " + QString::number( pos[i] ); text += " " + TQString::number( pos[i] );
qDebug( "%s", text.ascii()); qDebug( "%s", text.ascii());
} }
*/ */
QValueList<uint> first_word_positions; TQValueList<uint> first_word_positions;
for ( QStringList::ConstIterator phrase_it = phrases.begin(); phrase_it != phrases.end(); phrase_it++ ) for ( TQStringList::ConstIterator phrase_it = phrases.begin(); phrase_it != phrases.end(); phrase_it++ )
{ {
QStringList phrasewords = QStringList::split( ' ', *phrase_it ); TQStringList phrasewords = TQStringList::split( ' ', *phrase_it );
first_word_positions = miniDict[ phrasewords[0] ]->positions; first_word_positions = miniDict[ phrasewords[0] ]->positions;
for ( unsigned int j = 1; j < phrasewords.count(); ++j ) for ( unsigned int j = 1; j < phrasewords.count(); ++j )
{ {
QValueList<uint> next_word_it = miniDict[ phrasewords[j] ]->positions; TQValueList<uint> next_word_it = miniDict[ phrasewords[j] ]->positions;
QValueList<uint>::iterator dict_it = first_word_positions.begin(); TQValueList<uint>::iterator dict_it = first_word_positions.begin();
while ( dict_it != first_word_positions.end() ) while ( dict_it != first_word_positions.end() )
{ {
if ( next_word_it.find( *dict_it + 1 ) != next_word_it.end() ) if ( next_word_it.tqfind( *dict_it + 1 ) != next_word_it.end() )
{ {
(*dict_it)++; (*dict_it)++;
++dict_it; ++dict_it;

@ -20,13 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#ifndef QASSISTANTINDEX_H #ifndef TQASSISTANTINDEX_H
#define QASSISTANTINDEX_H #define TQASSISTANTINDEX_H
#include <qstringlist.h> #include <tqstringlist.h>
#include <qdict.h> #include <tqdict.h>
#include <qdatastream.h> #include <tqdatastream.h>
#include <qobject.h> #include <tqobject.h>
namespace QtAs namespace QtAs
{ {
@ -55,43 +55,44 @@ struct Document
return frequency < doc.frequency; return frequency < doc.frequency;
} }
Q_INT16 docNumber; TQ_INT16 docNumber;
Q_INT16 frequency; TQ_INT16 frequency;
}; };
QDataStream &operator>>( QDataStream &s, Document &l ); TQDataStream &operator>>( TQDataStream &s, Document &l );
QDataStream &operator<<( QDataStream &s, const Document &l ); TQDataStream &operator<<( TQDataStream &s, const Document &l );
class Index : public QObject class Index : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
struct Entry struct Entry
{ {
Entry( int d ) { documents.append( Document( d, 1 ) ); } Entry( int d ) { documents.append( Document( d, 1 ) ); }
Entry( QValueList<Document> l ) : documents( l ) {} Entry( TQValueList<Document> l ) : documents( l ) {}
QValueList<Document> documents; TQValueList<Document> documents;
}; };
struct PosEntry struct PosEntry
{ {
PosEntry( int p ) { positions.append( p ); } PosEntry( int p ) { positions.append( p ); }
QValueList<uint> positions; TQValueList<uint> positions;
}; };
Index( const QString &dp, const QString &hp ); Index( const TQString &dp, const TQString &hp );
Index( const QStringList &dl, const QString &hp ); Index( const TQStringList &dl, const TQString &hp );
void writeDict(); void writeDict();
bool readDict(); bool readDict();
bool makeIndex(); bool makeIndex();
QStringList query( const QStringList&, const QStringList&, const QStringList& ); TQStringList query( const TQStringList&, const TQStringList&, const TQStringList& );
void setDictionaryFile( const QString& ); void setDictionaryFile( const TQString& );
void setDocListFile( const QString& ); void setDocListFile( const TQString& );
void setDocList( const QStringList & ); void setDocList( const TQStringList & );
QString getCharsSplit() const { return m_charssplit; } TQString getCharsSplit() const { return m_charssplit; }
QString getCharsPartOfWord() const { return m_charsword; } TQString getCharsPartOfWord() const { return m_charsword; }
signals: signals:
void indexingProgress( int ); void indexingProgress( int );
@ -101,51 +102,51 @@ class Index : public QObject
private: private:
void setupDocumentList(); void setupDocumentList();
bool parseDocumentToStringlist( const QString& filename, QStringList& tokenlist ); bool parseDocumentToStringlist( const TQString& filename, TQStringList& tokenlist );
void parseDocument( const QString& filename, int docnum ); void parseDocument( const TQString& filename, int docnum );
void insertInDict( const QString&, int ); void insertInDict( const TQString&, int );
void writeDocumentList(); void writeDocumentList();
bool readDocumentList(); bool readDocumentList();
QStringList getWildcardTerms( const QString& ); TQStringList getWildcardTerms( const TQString& );
QStringList split( const QString& ); TQStringList split( const TQString& );
QValueList<Document> setupDummyTerm( const QStringList& ); TQValueList<Document> setupDummyTerm( const TQStringList& );
bool searchForPhrases( const QStringList &phrases, const QStringList &words, const QString &filename ); bool searchForPhrases( const TQStringList &phrases, const TQStringList &words, const TQString &filename );
QStringList docList; TQStringList docList;
QDict<Entry> dict; TQDict<Entry> dict;
QDict<PosEntry> miniDict; TQDict<PosEntry> miniDict;
QString docPath; TQString docPath;
QString dictFile; TQString dictFile;
QString docListFile; TQString docListFile;
bool lastWindowClosed; bool lastWindowClosed;
// Those characters are splitters (i.e. split the word), but added themselves into dictionary too. // Those characters are splitters (i.e. split the word), but added themselves into dictionary too.
// This makes the dictionary MUCH larger, but ensure that for the piece of "window->print" both // This makes the dictionary MUCH larger, but ensure that for the piece of "window->print" both
// search for "print" and "->print" will find it. // search for "print" and "->print" will find it.
QString m_charssplit; TQString m_charssplit;
// Those characters are parts of word - for example, '_' is here, and search for _debug will find only _debug. // Those characters are parts of word - for example, '_' is here, and search for _debug will find only _debug.
QString m_charsword; TQString m_charsword;
}; };
struct Term struct Term
{ {
Term( const QString &t, int f, QValueList<Document> l ) : term( t ), frequency( f ), documents( l ) {} Term( const TQString &t, int f, TQValueList<Document> l ) : term( t ), frequency( f ), documents( l ) {}
QString term; TQString term;
int frequency; int frequency;
QValueList<Document> documents; TQValueList<Document> documents;
}; };
class TermList : public QPtrList<Term> class TermList : public TQPtrList<Term>
{ {
public: public:
TermList() : QPtrList<Term>() {} TermList() : TQPtrList<Term>() {}
int compareItems( QPtrCollection::Item i1, QPtrCollection::Item i2 ); int compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 );
}; };
}; };
#endif /* QASSISTANTINDEX_H */ #endif /* TQASSISTANTINDEX_H */

@ -19,13 +19,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qtoolbutton.h> #include <tqtoolbutton.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <qaccel.h> #include <tqaccel.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qmenubar.h> #include <tqmenubar.h>
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmfileimpl.h" #include "libchmfileimpl.h"
@ -41,143 +41,143 @@
#include "kchmsearchtoolbar.moc" #include "kchmsearchtoolbar.moc"
static KQPopupMenu *menu_langlist, *menu_enclist; static KTQPopupMenu *menu_langlist, *menu_enclist;
KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * parent ) KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * tqparent )
: QToolBar (parent) : TQToolBar (tqparent)
{ {
// Toolbar label // Toolbar label
setLabel( i18n( "Find in page") ); setLabel( i18n( "Find in page") );
// Load the pixmaps // Load the pixmaps
QPixmap iconPrev (*gIconStorage.getToolbarPixmap(KCHMIconStorage::findprev)); TQPixmap iconPrev (*gIconStorage.getToolbarPixmap(KCHMIconStorage::findprev));
QPixmap iconNext (*gIconStorage.getToolbarPixmap(KCHMIconStorage::findnext)); TQPixmap iconNext (*gIconStorage.getToolbarPixmap(KCHMIconStorage::findnext));
QPixmap iconFontInc (*gIconStorage.getToolbarPixmap(KCHMIconStorage::view_increase)); TQPixmap iconFontInc (*gIconStorage.getToolbarPixmap(KCHMIconStorage::view_increase));
QPixmap iconFontDec (*gIconStorage.getToolbarPixmap(KCHMIconStorage::view_decrease)); TQPixmap iconFontDec (*gIconStorage.getToolbarPixmap(KCHMIconStorage::view_decrease));
QPixmap iconViewSource (*gIconStorage.getToolbarPixmap(KCHMIconStorage::viewsource)); TQPixmap iconViewSource (*gIconStorage.getToolbarPixmap(KCHMIconStorage::viewsource));
QPixmap iconAddBookmark (*gIconStorage.getToolbarPixmap(KCHMIconStorage::bookmark_add)); TQPixmap iconAddBookmark (*gIconStorage.getToolbarPixmap(KCHMIconStorage::bookmark_add));
QPixmap iconNextPage (*gIconStorage.getToolbarPixmap(KCHMIconStorage::next_page)); TQPixmap iconNextPage (*gIconStorage.getToolbarPixmap(KCHMIconStorage::next_page));
QPixmap iconPrevPage (*gIconStorage.getToolbarPixmap(KCHMIconStorage::prev_page)); TQPixmap iconPrevPage (*gIconStorage.getToolbarPixmap(KCHMIconStorage::prev_page));
QPixmap iconLocateInContent (*gIconStorage.getToolbarPixmap(KCHMIconStorage::locate_in_content)); TQPixmap iconLocateInContent (*gIconStorage.getToolbarPixmap(KCHMIconStorage::locate_in_content));
// Create the combobox to enter the find text // Create the combobox to enter the find text
m_findBox = new QComboBox (TRUE, this); m_findBox = new TQComboBox (TRUE, this);
m_findBox->setMinimumWidth (200); m_findBox->setMinimumWidth (200);
connect( m_findBox->lineEdit(), SIGNAL( returnPressed() ), this, SLOT( onReturnPressed() ) ); connect( m_findBox->lineEdit(), TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( onReturnPressed() ) );
QWhatsThis::add( m_findBox, i18n( "Enter here the text to search in the current page.") ); TQWhatsThis::add( m_findBox, i18n( "Enter here the text to search in the current page.") );
QAccel *acc = new QAccel( this ); TQAccel *acc = new TQAccel( this );
acc->connectItem( acc->insertItem(Key_F+CTRL), this, SLOT( onAccelFocusSearchField() ) ); acc->connectItem( acc->insertItem(Key_F+CTRL), this, TQT_SLOT( onAccelFocusSearchField() ) );
// Button 'prevous search result' // Button 'prevous search result'
m_buttonPrev = new QToolButton (iconPrev, m_buttonPrev = new TQToolButton (iconPrev,
i18n( "Previous search result"), i18n( "Previous search result"),
QString::null, TQString(),
this, this,
SLOT(onBtnPrevSearchResult()), TQT_SLOT(onBtnPrevSearchResult()),
this); this);
QWhatsThis::add( m_buttonPrev, i18n( "Click this button to find previous search result.") ); TQWhatsThis::add( m_buttonPrev, i18n( "Click this button to find previous search result.") );
// Button 'next search result' // Button 'next search result'
m_buttonNext = new QToolButton (iconNext, m_buttonNext = new TQToolButton (iconNext,
i18n( "Next search result"), i18n( "Next search result"),
QString::null, TQString(),
this, this,
SLOT(onBtnNextSearchResult()), TQT_SLOT(onBtnNextSearchResult()),
this); this);
QWhatsThis::add( m_buttonNext, i18n( "Click this button to find next search result.") ); TQWhatsThis::add( m_buttonNext, i18n( "Click this button to find next search result.") );
// Button 'locate in content' // Button 'locate in content'
m_buttonLocateInContent = new QToolButton( iconLocateInContent, m_buttonLocateInContent = new TQToolButton( iconLocateInContent,
i18n( "Locate this topic in content window"), i18n( "Locate this topic in content window"),
QString::null, TQString(),
this, this,
SLOT( onBtnLocateInContentWindow() ), TQT_SLOT( onBtnLocateInContentWindow() ),
this ); this );
QWhatsThis::add( m_buttonLocateInContent, i18n( "Click this button to find current topic in the content window, and open it.") ); TQWhatsThis::add( m_buttonLocateInContent, i18n( "Click this button to find current topic in the content window, and open it.") );
// Button 'increase font size' // Button 'increase font size'
m_buttonFontInc = new QToolButton (iconFontInc, m_buttonFontInc = new TQToolButton (iconFontInc,
i18n( "Increase font size"), i18n( "Increase font size"),
QString::null, TQString(),
this, this,
SLOT(onBtnFontInc()), TQT_SLOT(onBtnFontInc()),
this); this);
QWhatsThis::add( m_buttonFontInc, i18n( "Click this button to increase the font size.") ); TQWhatsThis::add( m_buttonFontInc, i18n( "Click this button to increase the font size.") );
// Button 'decrease font size' // Button 'decrease font size'
m_buttonFontDec = new QToolButton (iconFontDec, m_buttonFontDec = new TQToolButton (iconFontDec,
i18n( "Decrease font size"), i18n( "Decrease font size"),
QString::null, TQString(),
this, this,
SLOT(onBtnFontDec()), TQT_SLOT(onBtnFontDec()),
this); this);
QWhatsThis::add( m_buttonFontDec, i18n( "Click this button to decrease the font size.") ); TQWhatsThis::add( m_buttonFontDec, i18n( "Click this button to decrease the font size.") );
// Button 'view HTML source' // Button 'view HTML source'
m_buttonViewSource = new QToolButton (iconViewSource, m_buttonViewSource = new TQToolButton (iconViewSource,
i18n( "View HTML source"), i18n( "View HTML source"),
QString::null, TQString(),
this, this,
SLOT(onBtnViewSource()), TQT_SLOT(onBtnViewSource()),
this); this);
QWhatsThis::add( m_buttonViewSource, i18n( "Click this button to open a separate window with the page HTML source.") ); TQWhatsThis::add( m_buttonViewSource, i18n( "Click this button to open a separate window with the page HTML source.") );
// Button 'add a bookmark' // Button 'add a bookmark'
m_buttonAddBookmark = new QToolButton (iconAddBookmark, m_buttonAddBookmark = new TQToolButton (iconAddBookmark,
i18n( "Add to bookmarks"), i18n( "Add to bookmarks"),
QString::null, TQString(),
this, this,
SLOT(onBtnAddBookmark()), TQT_SLOT(onBtnAddBookmark()),
this); this);
QWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to add the current page to the bookmarks list.") ); TQWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to add the current page to the bookmarks list.") );
m_buttonPrevPageInTOC = new QToolButton( iconPrevPage, m_buttonPrevPageInTOC = new TQToolButton( iconPrevPage,
i18n( "Prev page in TOC"), i18n( "Prev page in TOC"),
QString::null, TQString(),
this, this,
SLOT(onBtnPrevPageInToc()), TQT_SLOT(onBtnPrevPageInToc()),
this); this);
QWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to go to previous page in Table Of Content.") ); TQWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to go to previous page in Table Of Content.") );
m_buttonNextPageInTOC = new QToolButton (iconNextPage, m_buttonNextPageInTOC = new TQToolButton (iconNextPage,
i18n( "Next page in TOC"), i18n( "Next page in TOC"),
QString::null, TQString(),
this, this,
SLOT(onBtnNextPageInToc()), TQT_SLOT(onBtnNextPageInToc()),
this); this);
QWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to go to next page in Table of Content.") ); TQWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to go to next page in Table of Content.") );
// Create the approptiate menu entries in 'View' main menu // Create the approptiate menu entries in 'View' main menu
m_MenuView = new KQPopupMenu( parent ); m_MenuView = new KTQPopupMenu( tqparent );
parent->menuBar()->insertItem( i18n( "&View"), m_MenuView ); tqparent->menuBar()->insertItem( i18n( "&View"), m_MenuView );
m_MenuView->insertItem( i18n( "&Increase font"), this, SLOT(onBtnFontInc()), CTRL+Key_Plus ); m_MenuView->insertItem( i18n( "&Increase font"), this, TQT_SLOT(onBtnFontInc()), CTRL+Key_Plus );
m_MenuView->insertItem( i18n( "&Decrease font"), this, SLOT(onBtnFontDec()), CTRL+Key_Minus ); m_MenuView->insertItem( i18n( "&Decrease font"), this, TQT_SLOT(onBtnFontDec()), CTRL+Key_Minus );
m_MenuView->insertItem( i18n( "&View HTML source"), this, SLOT(onBtnViewSource()), CTRL+Key_U ); m_MenuView->insertItem( i18n( "&View HTML source"), this, TQT_SLOT(onBtnViewSource()), CTRL+Key_U );
m_MenuView->insertSeparator(); m_MenuView->insertSeparator();
m_MenuView->insertItem( i18n( "&Bookmark this page"), this, SLOT(onBtnAddBookmark()), CTRL+Key_T ); m_MenuView->insertItem( i18n( "&Bookmark this page"), this, TQT_SLOT(onBtnAddBookmark()), CTRL+Key_T );
m_MenuView->insertSeparator(); m_MenuView->insertSeparator();
m_menuShowFullscreenMenuID = m_MenuView->insertItem( i18n( "&Full screen"), this, m_menuShowFullscreenMenuID = m_MenuView->insertItem( i18n( "&Full screen"), this,
SLOT(onBtnFullScreen()), Key_F11 ); TQT_SLOT(onBtnFullScreen()), Key_F11 );
m_menuShowContentWindowMenuID = m_MenuView->insertItem( i18n( "&Show contents window"), this, m_menuShowContentWindowMenuID = m_MenuView->insertItem( i18n( "&Show contents window"), this,
SLOT(onBtnToggleContentWindow()), Key_F9 ); TQT_SLOT(onBtnToggleContentWindow()), Key_F9 );
m_MenuView->insertItem( i18n( "&Locate in contents window"), this, m_MenuView->insertItem( i18n( "&Locate in contents window"), this,
SLOT(onBtnLocateInContentWindow()), CTRL+Key_L ); TQT_SLOT(onBtnLocateInContentWindow()), CTRL+Key_L );
m_MenuView->setItemChecked( m_menuShowFullscreenMenuID, false ); m_MenuView->setItemChecked( m_menuShowFullscreenMenuID, false );
m_MenuView->setItemChecked( m_menuShowContentWindowMenuID, true ); m_MenuView->setItemChecked( m_menuShowContentWindowMenuID, true );
m_MenuView->insertSeparator(); m_MenuView->insertSeparator();
// Create the language selection menu. // Create the language selection menu.
menu_langlist = new KQPopupMenu( parent ); menu_langlist = new KTQPopupMenu( tqparent );
KQPopupMenu * menu_sublang = 0; KTQPopupMenu * menu_sublang = 0;
// Because the encoding menu is very large, it is not reasonable to have a slot for every item. // Because the encoding menu is very large, it is not reasonable to have a slot for every item.
// It is simplier just to use a single slot for any menu item of this submenu. // It is simplier just to use a single slot for any menu item of this submenu.
connect (menu_langlist, SIGNAL( activated(int) ), this, SLOT ( onMenuActivated(int) )); connect (menu_langlist, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( onMenuActivated(int) ));
// Add the language entries // Add the language entries
const LCHMTextEncoding * enctable = LCHMFileImpl::getTextEncodingTable(); const LCHMTextEncoding * enctable = LCHMFileImpl::getTextEncodingTable();
@ -196,8 +196,8 @@ KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * parent )
// If the menu is already created, add to it // If the menu is already created, add to it
if ( !menu_sublang ) if ( !menu_sublang )
{ {
menu_sublang = new KQPopupMenu( menu_langlist ); menu_sublang = new KTQPopupMenu( menu_langlist );
connect (menu_sublang, SIGNAL( activated(int) ), this, SLOT ( onMenuActivated(int) )); connect (menu_sublang, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( onMenuActivated(int) ));
} }
menu_sublang->insertItem( item->sublanguage, idx ); menu_sublang->insertItem( item->sublanguage, idx );
@ -222,10 +222,10 @@ KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * parent )
m_checkedLanguageInMenu = -1; m_checkedLanguageInMenu = -1;
// Special menu for very smart people just to select codepage // Special menu for very smart people just to select codepage
QMap<QString,bool> addedCharsets; TQMap<TQString,bool> addedCharsets;
menu_enclist = new KQPopupMenu( parent ); menu_enclist = new KTQPopupMenu( tqparent );
connect (menu_enclist, SIGNAL( activated(int) ), this, SLOT ( onMenuActivated(int) )); connect (menu_enclist, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( onMenuActivated(int) ));
// Add the codepage entries // Add the codepage entries
for ( idx = 0; (enctable + idx)->language; idx++ ) for ( idx = 0; (enctable + idx)->language; idx++ )
@ -233,7 +233,7 @@ KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * parent )
const LCHMTextEncoding * item = enctable + idx; const LCHMTextEncoding * item = enctable + idx;
// This menu is only for charsets, so we won't add duplicate charset twice // This menu is only for charsets, so we won't add duplicate charset twice
if ( addedCharsets.find( item->qtcodec ) != addedCharsets.end() ) if ( addedCharsets.tqfind( item->qtcodec ) != addedCharsets.end() )
continue; continue;
addedCharsets[ item->qtcodec ] = true; addedCharsets[ item->qtcodec ] = true;
@ -242,7 +242,7 @@ KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * parent )
m_MenuView->insertItem( i18n( "&Set codepage"), menu_enclist ); m_MenuView->insertItem( i18n( "&Set codepage"), menu_enclist );
QWhatsThis::whatsThisButton( this ); TQWhatsThis::whatsThisButton( this );
} }
void KCHMSearchAndViewToolbar::setEnabled( bool enable ) void KCHMSearchAndViewToolbar::setEnabled( bool enable )
@ -277,7 +277,7 @@ void KCHMSearchAndViewToolbar::onBtnNextSearchResult( )
void KCHMSearchAndViewToolbar::search( bool search_forward ) void KCHMSearchAndViewToolbar::search( bool search_forward )
{ {
QString searchexpr = m_findBox->lineEdit()->text(); TQString searchexpr = m_findBox->lineEdit()->text();
if ( searchexpr.isEmpty() ) if ( searchexpr.isEmpty() )
return; return;
@ -297,23 +297,23 @@ void KCHMSearchAndViewToolbar::onBtnFontDec( )
void KCHMSearchAndViewToolbar::onBtnViewSource( ) void KCHMSearchAndViewToolbar::onBtnViewSource( )
{ {
QString text; TQString text;
if ( !::mainWindow->chmFile()->getFileContentAsString( &text, ::mainWindow->currentBrowser()->getOpenedPage() ) ) if ( !::mainWindow->chmFile()->getFileContentAsString( &text, ::mainWindow->currentBrowser()->getOpenedPage() ) )
return; return;
if ( appConfig.m_advUseInternalEditor ) if ( appConfig.m_advUseInternalEditor )
{ {
QTextEdit * editor = new QTextEdit ( 0 ); TQTextEdit * editor = new TQTextEdit ( 0 );
editor->setTextFormat ( Qt::PlainText ); editor->setTextFormat ( TQt::PlainText );
editor->setText (text); editor->setText (text);
editor->setCaption ( QString(APP_NAME) + " - view HTML source of " + ::mainWindow->currentBrowser()->getOpenedPage() ); editor->setCaption ( TQString(APP_NAME) + " - view HTML source of " + ::mainWindow->currentBrowser()->getOpenedPage() );
editor->resize (800, 600); editor->resize (800, 600);
editor->show(); editor->show();
} }
else else
{ {
QFile file; TQFile file;
m_tempFileKeeper.generateTempFile( file ); m_tempFileKeeper.generateTempFile( file );
file.writeBlock( text.utf8() ); file.writeBlock( text.utf8() );
@ -377,7 +377,7 @@ void KCHMSearchAndViewToolbar::onBtnNextPageInToc()
if ( !current ) if ( !current )
return; return;
QListViewItemIterator lit( current ); TQListViewItemIterator lit( current );
lit++; lit++;
if ( lit.current() ) if ( lit.current() )
@ -397,7 +397,7 @@ void KCHMSearchAndViewToolbar::onBtnPrevPageInToc()
if ( !current ) if ( !current )
return; return;
QListViewItemIterator lit( current ); TQListViewItemIterator lit( current );
lit--; lit--;
if ( lit.current() ) if ( lit.current() )

@ -31,11 +31,12 @@
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
class KCHMSearchAndViewToolbar : public QToolBar class KCHMSearchAndViewToolbar : public TQToolBar
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMSearchAndViewToolbar (KCHMMainWindow *parent); KCHMSearchAndViewToolbar (KCHMMainWindow *tqparent);
void setEnabled (bool enable); void setEnabled (bool enable);
void setChosenEncodingInMenu( const LCHMTextEncoding * encoding ); void setChosenEncodingInMenu( const LCHMTextEncoding * encoding );
@ -63,17 +64,17 @@ class KCHMSearchAndViewToolbar : public QToolBar
private: private:
void search (bool forward); void search (bool forward);
KQPopupMenu * m_MenuView; KTQPopupMenu * m_MenuView;
QComboBox * m_findBox; TQComboBox * m_findBox;
QToolButton * m_buttonPrev; TQToolButton * m_buttonPrev;
QToolButton * m_buttonNext; TQToolButton * m_buttonNext;
QToolButton * m_buttonFontInc; TQToolButton * m_buttonFontInc;
QToolButton * m_buttonFontDec; TQToolButton * m_buttonFontDec;
QToolButton * m_buttonViewSource; TQToolButton * m_buttonViewSource;
QToolButton * m_buttonAddBookmark; TQToolButton * m_buttonAddBookmark;
QToolButton * m_buttonNextPageInTOC; TQToolButton * m_buttonNextPageInTOC;
QToolButton * m_buttonPrevPageInTOC; TQToolButton * m_buttonPrevPageInTOC;
QToolButton * m_buttonLocateInContent; TQToolButton * m_buttonLocateInContent;
int m_checkedLanguageInMenu; int m_checkedLanguageInMenu;
int m_checkedEncodingInMenu; int m_checkedEncodingInMenu;
@ -81,7 +82,7 @@ class KCHMSearchAndViewToolbar : public QToolBar
int m_menuShowFullscreenMenuID; int m_menuShowFullscreenMenuID;
int m_menuShowContentWindowMenuID; int m_menuShowContentWindowMenuID;
KQTempFileKeeper m_tempFileKeeper; KTQTempFileKeeper m_tempFileKeeper;
}; };
#endif #endif

@ -31,36 +31,36 @@
#include "kchmsearchwindow.moc" #include "kchmsearchwindow.moc"
KCHMSearchWindow::KCHMSearchWindow( QWidget * parent, const char * name, WFlags f ) KCHMSearchWindow::KCHMSearchWindow( TQWidget * tqparent, const char * name, WFlags f )
: QWidget (parent, name, f) : TQWidget (tqparent, name, f)
{ {
QVBoxLayout * layout = new QVBoxLayout (this); TQVBoxLayout * tqlayout = new TQVBoxLayout (this);
layout->setMargin(6); tqlayout->setMargin(6);
layout->setSpacing(6); tqlayout->setSpacing(6);
// Labels <type words to search> and <help> // Labels <type words to search> and <help>
QHBoxLayout * labellayout = new QHBoxLayout(); TQHBoxLayout * labeltqlayout = new TQHBoxLayout();
labellayout->addWidget( new QLabel( i18n( "Type in word(s) to search for:"), this) ); labeltqlayout->addWidget( new TQLabel( i18n( "Type in word(s) to search for:"), this) );
labellayout->addStretch( 10 ); labeltqlayout->addStretch( 10 );
KCHMClickableLabel * helplink = new KCHMClickableLabel( i18n( "<a href=\"q\"><b>Help</b></a>"), this ); KCHMClickableLabel * helplink = new KCHMClickableLabel( i18n( "<a href=\"q\"><b>Help</b></a>"), this );
connect( helplink, SIGNAL( clicked() ), this, SLOT( onHelpClicked() ) ); connect( helplink, TQT_SIGNAL( clicked() ), this, TQT_SLOT( onHelpClicked() ) );
helplink->setCursor( QCursor( Qt::PointingHandCursor ) ); helplink->setCursor( TQCursor( TQt::PointingHandCursor ) );
labellayout->addWidget ( helplink ); labeltqlayout->addWidget ( helplink );
layout->addLayout( labellayout ); tqlayout->addLayout( labeltqlayout );
m_searchQuery = new QComboBox (TRUE, this); m_searchQuery = new TQComboBox (TRUE, this);
m_searchQuery->setFocus(); m_searchQuery->setFocus();
m_searchQuery->setMaxCount (10); m_searchQuery->setMaxCount (10);
m_searchQuery->setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); m_searchQuery->tqsetSizePolicy ( TQSizePolicy ( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) );
QPushButton * searchButton = new QPushButton ( i18n("Go"), this); TQPushButton * searchButton = new TQPushButton ( i18n("Go"), this);
searchButton->setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Fixed ) ); searchButton->tqsetSizePolicy ( TQSizePolicy ( TQSizePolicy::Minimum, TQSizePolicy::Fixed ) );
QHBoxLayout * hlayout = new QHBoxLayout ( layout ); TQHBoxLayout * htqlayout = new TQHBoxLayout ( tqlayout );
hlayout->addWidget ( m_searchQuery ); htqlayout->addWidget ( m_searchQuery );
hlayout->addWidget ( searchButton ); htqlayout->addWidget ( searchButton );
m_searchList = new KQListView (this); m_searchList = new KQListView (this);
m_searchList->addColumn( i18n( "Title" ) ); m_searchList->addColumn( i18n( "Title" ) );
@ -68,34 +68,34 @@ KCHMSearchWindow::KCHMSearchWindow( QWidget * parent, const char * name, WFlags
m_searchList->setShowToolTips(true); m_searchList->setShowToolTips(true);
connect( searchButton, connect( searchButton,
SIGNAL( clicked () ), TQT_SIGNAL( clicked () ),
this, this,
SLOT( onReturnPressed() ) ); TQT_SLOT( onReturnPressed() ) );
connect( m_searchQuery->lineEdit(), connect( m_searchQuery->lineEdit(),
SIGNAL( returnPressed() ), TQT_SIGNAL( returnPressed() ),
this, this,
SLOT( onReturnPressed() ) ); TQT_SLOT( onReturnPressed() ) );
connect( m_searchList, connect( m_searchList,
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int) ),
this, this,
SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) ); TQT_SLOT( onDoubleClicked ( TQListViewItem *, const TQPoint &, int) ) );
connect( m_searchList, connect( m_searchList,
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ),
this, this,
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) ); TQT_SLOT( slotContextMenuRequested ( TQListViewItem *, const TQPoint &, int ) ) );
//layout->addSpacing (10); //tqlayout->addSpacing (10);
layout->addWidget (m_searchList); tqlayout->addWidget (m_searchList);
new KCHMListItemTooltip( m_searchList ); new KCHMListItemTooltip( m_searchList );
m_contextMenu = 0; m_contextMenu = 0;
m_searchEngine = 0; m_searchEngine = 0;
} }
void KCHMSearchWindow::invalidate( ) void KCHMSearchWindow::tqinvalidate( )
{ {
m_searchList->clear(); m_searchList->clear();
m_searchQuery->clear(); m_searchQuery->clear();
@ -107,8 +107,8 @@ void KCHMSearchWindow::invalidate( )
void KCHMSearchWindow::onReturnPressed( ) void KCHMSearchWindow::onReturnPressed( )
{ {
QStringList results; TQStringList results;
QString text = m_searchQuery->lineEdit()->text(); TQString text = m_searchQuery->lineEdit()->text();
if ( text.isEmpty() ) if ( text.isEmpty() )
return; return;
@ -137,7 +137,7 @@ void KCHMSearchWindow::onReturnPressed( )
} }
void KCHMSearchWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int) void KCHMSearchWindow::onDoubleClicked( TQListViewItem *item, const TQPoint &, int)
{ {
if ( !item ) if ( !item )
return; return;
@ -165,19 +165,19 @@ void KCHMSearchWindow::onHelpClicked( )
{ {
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE ) if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
{ {
QMessageBox::information ( this, TQMessageBox::information ( this,
i18n( "How to use search"), i18n( "How to use search"),
i18n( "<html><p>The improved search engine allows you to search for a word, symbol or phrase, which is set of words and symbols included in quotes. Only the documents which include all the terms speficide in th search query are shown; no prefixes needed.<p>Unlike MS CHM internal search index, my improved search engine indexes everything, including special symbols. Therefore it is possible to search (and find!) for something like <i>$q = new ChmFile();</i>. This search also fully supports Unicode, which means that you can search in non-English documents.<p>If you want to search for a quote symbol, use quotation mark instead. The engine treats a quote and a quotation mark as the same symbol, which allows to use them in phrases.</html>") ); i18n( "<html><p>The improved search engine allows you to search for a word, symbol or phrase, which is set of words and symbols included in quotes. Only the documents which include all the terms speficide in th search query are shown; no prefixes needed.<p>Unlike MS CHM internal search index, my improved search engine indexes everything, including special symbols. Therefore it is possible to search (and tqfind!) for something like <i>$q = new ChmFile();</i>. This search also fully supports Unicode, which means that you can search in non-English documents.<p>If you want to search for a quote symbol, use quotation mark instead. The engine treats a quote and a quotation mark as the same symbol, which allows to use them in phrases.</html>") );
} }
else else
{ {
QMessageBox::information ( this, TQMessageBox::information ( this,
i18n( "How to use search"), i18n( "How to use search"),
i18n( "The search query can contain a few prefixes.\nA set of words inside the quote marks mean that you are searching for exact phrase.\nA word with minus sign means that it should be absent in the search result.\nA word with plus mark or without any mark means that it must be present in the search result.\n\nNote that only letters and digits are indexed.\nYou cannot search for non-character symbols other than underscope, and those symbols will be removed from the search query.\nFor example, search for 'C' will give the same result as searching for 'C++'.") ); i18n( "The search query can contain a few prefixes.\nA set of words inside the quote marks mean that you are searching for exact phrase.\nA word with minus sign means that it should be absent in the search result.\nA word with plus mark or without any mark means that it must be present in the search result.\n\nNote that only letters and digits are indexed.\nYou cannot search for non-character symbols other than underscope, and those symbols will be removed from the search query.\nFor example, search for 'C' will give the same result as searching for 'C++'.") );
} }
} }
void KCHMSearchWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int ) void KCHMSearchWindow::slotContextMenuRequested( TQListViewItem * item, const TQPoint & point, int )
{ {
if ( !m_contextMenu ) if ( !m_contextMenu )
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this ); m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
@ -206,14 +206,14 @@ bool KCHMSearchWindow::initSearchEngine( )
} }
void KCHMSearchWindow::execSearchQueryInGui( const QString & query ) void KCHMSearchWindow::execSearchQueryInGui( const TQString & query )
{ {
m_searchQuery->lineEdit()->setText( query ); m_searchQuery->lineEdit()->setText( query );
onReturnPressed(); onReturnPressed();
} }
bool KCHMSearchWindow::searchQuery( const QString & query, QStringList * results ) bool KCHMSearchWindow::searchQuery( const TQString & query, TQStringList * results )
{ {
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE ) if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
{ {
@ -222,7 +222,7 @@ bool KCHMSearchWindow::searchQuery( const QString & query, QStringList * results
} }
else if ( !::mainWindow->chmFile()->hasSearchTable() ) else if ( !::mainWindow->chmFile()->hasSearchTable() )
{ {
QMessageBox::information ( this, TQMessageBox::information ( this,
i18n( "Search is not available" ), i18n( "Search is not available" ),
i18n( "<p>The search feature is not avaiable for this chm file." i18n( "<p>The search feature is not avaiable for this chm file."
"<p>The old search engine depends on indexes present in chm files itself. Not every chm file has an index; it is set up" "<p>The old search engine depends on indexes present in chm files itself. Not every chm file has an index; it is set up"

@ -34,12 +34,13 @@
class KCHMSearchEngine; class KCHMSearchEngine;
class KCHMClickableLabel : public QLabel class KCHMClickableLabel : public TQLabel
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMClickableLabel( const QString& label, QWidget * parent ) KCHMClickableLabel( const TQString& label, TQWidget * tqparent )
: QLabel( label, parent ) {}; : TQLabel( label, tqparent ) {};
virtual ~KCHMClickableLabel() {}; virtual ~KCHMClickableLabel() {};
@ -47,37 +48,38 @@ class KCHMClickableLabel : public QLabel
void clicked(); void clicked();
protected: protected:
virtual void mousePressEvent ( QMouseEvent * ) { emit clicked(); } virtual void mousePressEvent ( TQMouseEvent * ) { emit clicked(); }
}; };
class KCHMSearchWindow : public QWidget class KCHMSearchWindow : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMSearchWindow ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); KCHMSearchWindow ( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
void invalidate(); void tqinvalidate();
void restoreSettings (const KCHMSettings::search_saved_settings_t& settings); void restoreSettings (const KCHMSettings::search_saved_settings_t& settings);
void saveSettings (KCHMSettings::search_saved_settings_t& settings); void saveSettings (KCHMSettings::search_saved_settings_t& settings);
void execSearchQueryInGui( const QString& query ); void execSearchQueryInGui( const TQString& query );
bool searchQuery( const QString& query, QStringList * results ); bool searchQuery( const TQString& query, TQStringList * results );
public slots: public slots:
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column ); void slotContextMenuRequested ( TQListViewItem *item, const TQPoint &point, int column );
private slots: private slots:
void onHelpClicked(); void onHelpClicked();
void onReturnPressed (); void onReturnPressed ();
void onDoubleClicked ( QListViewItem *, const QPoint &, int); void onDoubleClicked ( TQListViewItem *, const TQPoint &, int);
private: private:
bool initSearchEngine(); bool initSearchEngine();
private: private:
QComboBox * m_searchQuery; TQComboBox * m_searchQuery;
KQListView * m_searchList; KQListView * m_searchList;
KQPopupMenu * m_contextMenu; KTQPopupMenu * m_contextMenu;
KCHMSearchEngine* m_searchEngine; KCHMSearchEngine* m_searchEngine;
}; };

@ -19,15 +19,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qfile.h> #include <tqfile.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <qdatastream.h> #include <tqdatastream.h>
#include "kchmsettings.h" #include "kchmsettings.h"
#include "kchmconfig.h" #include "kchmconfig.h"
static Q_INT32 SETTINGS_MAGIC = 0xD8AB4E76; static TQ_INT32 SETTINGS_MAGIC = 0xD8AB4E76;
static Q_INT32 SETTINGS_VERSION = 4; static TQ_INT32 SETTINGS_VERSION = 4;
/* /*
* The order is important! * The order is important!
@ -54,8 +54,8 @@ enum marker_t
MARKER_END = 0x7FFF MARKER_END = 0x7FFF
}; };
// Helpers for serialization of SavedBookmark through QDataStream // Helpers for serialization of SavedBookmark through TQDataStream
static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::SavedBookmark& b ) static inline TQDataStream& operator<< ( TQDataStream& s, const KCHMSettings::SavedBookmark& b )
{ {
s << b.name; s << b.name;
s << b.url; s << b.url;
@ -63,7 +63,7 @@ static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::Save
return s; return s;
} }
static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedBookmark& b ) static inline TQDataStream& operator>> ( TQDataStream& s, KCHMSettings::SavedBookmark& b )
{ {
s >> b.name; s >> b.name;
s >> b.url; s >> b.url;
@ -71,8 +71,8 @@ static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedBookm
return s; return s;
} }
// Helpers for serialization of SavedViewWindow through QDataStream // Helpers for serialization of SavedViewWindow through TQDataStream
static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::SavedViewWindow& b ) static inline TQDataStream& operator<< ( TQDataStream& s, const KCHMSettings::SavedViewWindow& b )
{ {
// Store the version first. Later we can increase it when adding new members. // Store the version first. Later we can increase it when adding new members.
s << 1; s << 1;
@ -82,9 +82,9 @@ static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::Save
return s; return s;
} }
static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedViewWindow& b ) static inline TQDataStream& operator>> ( TQDataStream& s, KCHMSettings::SavedViewWindow& b )
{ {
Q_INT32 version; TQ_INT32 version;
s >> version; s >> version;
s >> b.url; s >> b.url;
@ -106,7 +106,7 @@ KCHMSettings::KCHMSettings( )
} }
bool KCHMSettings::loadSettings( const QString & filename ) bool KCHMSettings::loadSettings( const TQString & filename )
{ {
m_activetabsystem = 0; m_activetabsystem = 0;
m_activetabwindow = 0; m_activetabwindow = 0;
@ -116,11 +116,11 @@ bool KCHMSettings::loadSettings( const QString & filename )
m_bookmarks.clear(); m_bookmarks.clear();
m_viewwindows.clear(); m_viewwindows.clear();
QFileInfo finfo ( filename ); TQFileInfo finfo ( filename );
m_settingsFile = QString::null; m_settingsFile = TQString();
m_searchDictFile = QString::null; m_searchDictFile = TQString();
m_searchDocFile = QString::null; m_searchDocFile = TQString();
if ( !finfo.size() ) if ( !finfo.size() )
return false; return false;
@ -131,15 +131,15 @@ bool KCHMSettings::loadSettings( const QString & filename )
getFilenames( filename, &m_settingsFile, &m_searchDictFile, &m_searchDocFile ); getFilenames( filename, &m_settingsFile, &m_searchDictFile, &m_searchDocFile );
QFile file( m_settingsFile ); TQFile file( m_settingsFile );
if ( !file.open (IO_ReadOnly) ) if ( !file.open (IO_ReadOnly) )
return false; // it's ok, file may not exist return false; // it's ok, file may not exist
QDataStream stream (&file); TQDataStream stream (&file);
// Read and check header // Read and check header
Q_INT32 data; TQ_INT32 data;
bool complete_read = false; bool complete_read = false;
stream >> data; // magic stream >> data; // magic
@ -224,14 +224,14 @@ bool KCHMSettings::loadSettings( const QString & filename )
bool KCHMSettings::saveSettings( ) bool KCHMSettings::saveSettings( )
{ {
QFile file( m_settingsFile ); TQFile file( m_settingsFile );
if ( !file.open (IO_WriteOnly) ) if ( !file.open (IO_WriteOnly) )
{ {
qWarning ("Could not write settings into file %s: %s", file.name().ascii(), file.errorString().ascii()); qWarning ("Could not write settings into file %s: %s", TQString(file.name()).ascii(), TQString(file.errorString()).ascii());
return false; return false;
} }
QDataStream stream (&file); TQDataStream stream (&file);
// Save header // Save header
stream << SETTINGS_MAGIC; stream << SETTINGS_MAGIC;
@ -275,22 +275,22 @@ bool KCHMSettings::saveSettings( )
} }
void KCHMSettings::removeSettings( const QString & filename ) void KCHMSettings::removeSettings( const TQString & filename )
{ {
QString settingsfile, dictfile, doclistfile; TQString settingsfile, dictfile, doclistfile;
getFilenames( filename, &settingsfile, &dictfile, &doclistfile ); getFilenames( filename, &settingsfile, &dictfile, &doclistfile );
QFile::remove( settingsfile ); TQFile::remove( settingsfile );
QFile::remove( dictfile ); TQFile::remove( dictfile );
QFile::remove( doclistfile ); TQFile::remove( doclistfile );
} }
void KCHMSettings::getFilenames(const QString & helpfilename, QString * settingsfile, QString * dictfile, QString * doclistfile ) void KCHMSettings::getFilenames(const TQString & helpfilename, TQString * settingsfile, TQString * dictfile, TQString * doclistfile )
{ {
QFileInfo finfo ( helpfilename ); TQFileInfo finfo ( helpfilename );
QString prefix = appConfig.m_datapath + "/" + finfo.baseName(); TQString prefix = appConfig.m_datapath + "/" + finfo.baseName();
*settingsfile = prefix + ".kchmviewer"; *settingsfile = prefix + ".kchmviewer";
*dictfile = prefix + ".dict"; *dictfile = prefix + ".dict";

@ -22,15 +22,15 @@
#ifndef KCHMSETTINGS_H #ifndef KCHMSETTINGS_H
#define KCHMSETTINGS_H #define KCHMSETTINGS_H
#include <qstring.h> #include <tqstring.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
class SavedBookmark; class SavedBookmark;
class QFileInfo; class TQFileInfo;
class KCHMSettings class KCHMSettings
@ -38,21 +38,21 @@ class KCHMSettings
public: public:
KCHMSettings (); KCHMSettings ();
bool loadSettings (const QString& filename); bool loadSettings (const TQString& filename);
bool saveSettings ( ); bool saveSettings ( );
void removeSettings ( const QString& filename ); void removeSettings ( const TQString& filename );
QString searchIndexDictFilename() const { return m_searchDictFile; } TQString searchIndexDictFilename() const { return m_searchDictFile; }
QString searchIndexDocFilename() const { return m_searchDocFile; } TQString searchIndexDocFilename() const { return m_searchDocFile; }
class SavedBookmark class SavedBookmark
{ {
public: public:
SavedBookmark() { scroll_y = 0; } SavedBookmark() { scroll_y = 0; }
SavedBookmark (QString n, QString u, int y) : name(n), url(u), scroll_y(y) {}; SavedBookmark (TQString n, TQString u, int y) : name(n), url(u), scroll_y(y) {};
QString name; TQString name;
QString url; TQString url;
int scroll_y; int scroll_y;
}; };
@ -60,16 +60,16 @@ class KCHMSettings
{ {
public: public:
SavedViewWindow() { scroll_y = 0; zoom = 0; } SavedViewWindow() { scroll_y = 0; zoom = 0; }
SavedViewWindow (QString u, int y, int z) : url(u), scroll_y(y), zoom(z) {}; SavedViewWindow (TQString u, int y, int z) : url(u), scroll_y(y), zoom(z) {};
QString url; TQString url;
int scroll_y; int scroll_y;
int zoom; int zoom;
}; };
typedef QValueList<QString> search_saved_settings_t; typedef TQValueList<TQString> search_saved_settings_t;
typedef QValueList<SavedBookmark> bookmark_saved_settings_t; typedef TQValueList<SavedBookmark> bookmark_saved_settings_t;
typedef QValueList<SavedViewWindow> viewindow_saved_settings_t; typedef TQValueList<SavedViewWindow> viewindow_saved_settings_t;
int m_window_size_x; int m_window_size_x;
int m_window_size_y; int m_window_size_y;
@ -82,13 +82,13 @@ class KCHMSettings
viewindow_saved_settings_t m_viewwindows; viewindow_saved_settings_t m_viewwindows;
private: private:
void getFilenames(const QString & helpfilename, QString * settingsfile, QString * dictfile, QString * doclistfile ); void getFilenames(const TQString & helpfilename, TQString * settingsfile, TQString * dictfile, TQString * doclistfile );
unsigned int m_currentfilesize; unsigned int m_currentfilesize;
unsigned int m_currentfiledate; unsigned int m_currentfiledate;
QString m_settingsFile; TQString m_settingsFile;
QString m_searchDictFile; TQString m_searchDictFile;
QString m_searchDocFile; TQString m_searchDocFile;
}; };
#endif #endif

@ -9,279 +9,279 @@
#include "kchmsetupdialog.h" #include "kchmsetupdialog.h"
#include <qvariant.h> #include <tqvariant.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <qwidget.h> #include <tqwidget.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
/* /*
* Constructs a KCHMSetupDialog as a child of 'parent', with the * Constructs a KCHMSetupDialog as a child of 'tqparent', with the
* name 'name' and widget flags set to 'f'. * name 'name' and widget flags set to 'f'.
* *
* The dialog will by default be modeless, unless you set 'modal' to * The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog. * TRUE to construct a modal dialog.
*/ */
KCHMSetupDialog::KCHMSetupDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) KCHMSetupDialog::KCHMSetupDialog( TQWidget* tqparent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl ) : TQDialog( tqparent, name, modal, fl )
{ {
if ( !name ) if ( !name )
setName( "MyDialog1" ); setName( "MyDialog1" );
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) ); tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );
setSizeGripEnabled( FALSE ); setSizeGripEnabled( FALSE );
setModal( TRUE ); setModal( TRUE );
MyDialog1Layout = new QVBoxLayout( this, 11, 6, "MyDialog1Layout"); MyDialog1Layout = new TQVBoxLayout( this, 11, 6, "MyDialog1Layout");
MyDialog1Layout->setResizeMode( QLayout::Minimum ); MyDialog1Layout->setResizeMode( TQLayout::Minimum );
tabWidget = new QTabWidget( this, "tabWidget" ); tabWidget = new TQTabWidget( this, "tabWidget" );
Widget8 = new QWidget( tabWidget, "Widget8" ); Widget8 = new TQWidget( tabWidget, "Widget8" );
Widget8Layout = new QVBoxLayout( Widget8, 11, 6, "Widget8Layout"); Widget8Layout = new TQVBoxLayout( Widget8, 11, 6, "Widget8Layout");
layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); tqlayout4 = new TQHBoxLayout( 0, 0, 6, "tqlayout4");
buttonGroup1 = new QButtonGroup( Widget8, "buttonGroup1" ); buttonGroup1 = new TQButtonGroup( Widget8, "buttonGroup1" );
buttonGroup1->setColumnLayout(0, Qt::Vertical ); buttonGroup1->setColumnLayout(0, Qt::Vertical );
buttonGroup1->layout()->setSpacing( 6 ); buttonGroup1->tqlayout()->setSpacing( 6 );
buttonGroup1->layout()->setMargin( 11 ); buttonGroup1->tqlayout()->setMargin( 11 );
buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() ); buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->tqlayout() );
buttonGroup1Layout->setAlignment( Qt::AlignTop ); buttonGroup1Layout->tqsetAlignment( TQt::AlignTop );
m_radioOnBeginOpenDialog = new QRadioButton( buttonGroup1, "m_radioOnBeginOpenDialog" ); m_radioOnBeginOpenDialog = new TQRadioButton( buttonGroup1, "m_radioOnBeginOpenDialog" );
buttonGroup1Layout->addWidget( m_radioOnBeginOpenDialog ); buttonGroup1Layout->addWidget( m_radioOnBeginOpenDialog );
m_radioOnBeginOpenLast = new QRadioButton( buttonGroup1, "m_radioOnBeginOpenLast" ); m_radioOnBeginOpenLast = new TQRadioButton( buttonGroup1, "m_radioOnBeginOpenLast" );
buttonGroup1Layout->addWidget( m_radioOnBeginOpenLast ); buttonGroup1Layout->addWidget( m_radioOnBeginOpenLast );
layout4->addWidget( buttonGroup1 ); tqlayout4->addWidget( buttonGroup1 );
buttonGroup2 = new QButtonGroup( Widget8, "buttonGroup2" ); buttonGroup2 = new TQButtonGroup( Widget8, "buttonGroup2" );
buttonGroup2->setColumnLayout(0, Qt::Vertical ); buttonGroup2->setColumnLayout(0, Qt::Vertical );
buttonGroup2->layout()->setSpacing( 6 ); buttonGroup2->tqlayout()->setSpacing( 6 );
buttonGroup2->layout()->setMargin( 11 ); buttonGroup2->tqlayout()->setMargin( 11 );
buttonGroup2Layout = new QVBoxLayout( buttonGroup2->layout() ); buttonGroup2Layout = new TQVBoxLayout( buttonGroup2->tqlayout() );
buttonGroup2Layout->setAlignment( Qt::AlignTop ); buttonGroup2Layout->tqsetAlignment( TQt::AlignTop );
layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); tqlayout3 = new TQHBoxLayout( 0, 0, 6, "tqlayout3");
textLabel1 = new QLabel( buttonGroup2, "textLabel1" ); textLabel1 = new TQLabel( buttonGroup2, "textLabel1" );
layout3->addWidget( textLabel1 ); tqlayout3->addWidget( textLabel1 );
m_historySize = new QSpinBox( buttonGroup2, "m_historySize" ); m_historySize = new TQSpinBox( buttonGroup2, "m_historySize" );
m_historySize->setValue( 10 ); m_historySize->setValue( 10 );
layout3->addWidget( m_historySize ); tqlayout3->addWidget( m_historySize );
textLabel2 = new QLabel( buttonGroup2, "textLabel2" ); textLabel2 = new TQLabel( buttonGroup2, "textLabel2" );
layout3->addWidget( textLabel2 ); tqlayout3->addWidget( textLabel2 );
buttonGroup2Layout->addLayout( layout3 ); buttonGroup2Layout->addLayout( tqlayout3 );
m_rememberHistoryInfo = new QCheckBox( buttonGroup2, "m_rememberHistoryInfo" ); m_rememberHistoryInfo = new TQCheckBox( buttonGroup2, "m_rememberHistoryInfo" );
buttonGroup2Layout->addWidget( m_rememberHistoryInfo ); buttonGroup2Layout->addWidget( m_rememberHistoryInfo );
layout4->addWidget( buttonGroup2 ); tqlayout4->addWidget( buttonGroup2 );
Widget8Layout->addLayout( layout4 ); Widget8Layout->addLayout( tqlayout4 );
groupBox1 = new QGroupBox( Widget8, "groupBox1" ); groupBox1 = new TQGroupBox( Widget8, "groupBox1" );
groupBox1->setColumnLayout(0, Qt::Vertical ); groupBox1->setColumnLayout(0, Qt::Vertical );
groupBox1->layout()->setSpacing( 6 ); groupBox1->tqlayout()->setSpacing( 6 );
groupBox1->layout()->setMargin( 11 ); groupBox1->tqlayout()->setMargin( 11 );
groupBox1Layout = new QHBoxLayout( groupBox1->layout() ); groupBox1Layout = new TQHBoxLayout( groupBox1->tqlayout() );
groupBox1Layout->setAlignment( Qt::AlignTop ); groupBox1Layout->tqsetAlignment( TQt::AlignTop );
buttonGroup4 = new QButtonGroup( groupBox1, "buttonGroup4" ); buttonGroup4 = new TQButtonGroup( groupBox1, "buttonGroup4" );
buttonGroup4->setColumnLayout(0, Qt::Vertical ); buttonGroup4->setColumnLayout(0, Qt::Vertical );
buttonGroup4->layout()->setSpacing( 6 ); buttonGroup4->tqlayout()->setSpacing( 6 );
buttonGroup4->layout()->setMargin( 11 ); buttonGroup4->tqlayout()->setMargin( 11 );
buttonGroup4Layout = new QVBoxLayout( buttonGroup4->layout() ); buttonGroup4Layout = new TQVBoxLayout( buttonGroup4->tqlayout() );
buttonGroup4Layout->setAlignment( Qt::AlignTop ); buttonGroup4Layout->tqsetAlignment( TQt::AlignTop );
m_radioExtLinkOpenAlways = new QRadioButton( buttonGroup4, "m_radioExtLinkOpenAlways" ); m_radioExtLinkOpenAlways = new TQRadioButton( buttonGroup4, "m_radioExtLinkOpenAlways" );
buttonGroup4Layout->addWidget( m_radioExtLinkOpenAlways ); buttonGroup4Layout->addWidget( m_radioExtLinkOpenAlways );
m_radioExtLinkAsk = new QRadioButton( buttonGroup4, "m_radioExtLinkAsk" ); m_radioExtLinkAsk = new TQRadioButton( buttonGroup4, "m_radioExtLinkAsk" );
buttonGroup4Layout->addWidget( m_radioExtLinkAsk ); buttonGroup4Layout->addWidget( m_radioExtLinkAsk );
m_radioExtLinkOpenNever = new QRadioButton( buttonGroup4, "m_radioExtLinkOpenNever" ); m_radioExtLinkOpenNever = new TQRadioButton( buttonGroup4, "m_radioExtLinkOpenNever" );
buttonGroup4Layout->addWidget( m_radioExtLinkOpenNever ); buttonGroup4Layout->addWidget( m_radioExtLinkOpenNever );
groupBox1Layout->addWidget( buttonGroup4 ); groupBox1Layout->addWidget( buttonGroup4 );
buttonGroup5 = new QButtonGroup( groupBox1, "buttonGroup5" ); buttonGroup5 = new TQButtonGroup( groupBox1, "buttonGroup5" );
buttonGroup5->setColumnLayout(0, Qt::Vertical ); buttonGroup5->setColumnLayout(0, Qt::Vertical );
buttonGroup5->layout()->setSpacing( 6 ); buttonGroup5->tqlayout()->setSpacing( 6 );
buttonGroup5->layout()->setMargin( 11 ); buttonGroup5->tqlayout()->setMargin( 11 );
buttonGroup5Layout = new QVBoxLayout( buttonGroup5->layout() ); buttonGroup5Layout = new TQVBoxLayout( buttonGroup5->tqlayout() );
buttonGroup5Layout->setAlignment( Qt::AlignTop ); buttonGroup5Layout->tqsetAlignment( TQt::AlignTop );
m_radioNewChmOpenAlways = new QRadioButton( buttonGroup5, "m_radioNewChmOpenAlways" ); m_radioNewChmOpenAlways = new TQRadioButton( buttonGroup5, "m_radioNewChmOpenAlways" );
buttonGroup5Layout->addWidget( m_radioNewChmOpenAlways ); buttonGroup5Layout->addWidget( m_radioNewChmOpenAlways );
m_radioNewChmAsk = new QRadioButton( buttonGroup5, "m_radioNewChmAsk" ); m_radioNewChmAsk = new TQRadioButton( buttonGroup5, "m_radioNewChmAsk" );
buttonGroup5Layout->addWidget( m_radioNewChmAsk ); buttonGroup5Layout->addWidget( m_radioNewChmAsk );
m_radioNewChmOpenNever = new QRadioButton( buttonGroup5, "m_radioNewChmOpenNever" ); m_radioNewChmOpenNever = new TQRadioButton( buttonGroup5, "m_radioNewChmOpenNever" );
buttonGroup5Layout->addWidget( m_radioNewChmOpenNever ); buttonGroup5Layout->addWidget( m_radioNewChmOpenNever );
groupBox1Layout->addWidget( buttonGroup5 ); groupBox1Layout->addWidget( buttonGroup5 );
Widget8Layout->addWidget( groupBox1 ); Widget8Layout->addWidget( groupBox1 );
tabWidget->insertTab( Widget8, QString::fromLatin1("") ); tabWidget->insertTab( Widget8, TQString::tqfromLatin1("") );
Widget9 = new QWidget( tabWidget, "Widget9" ); Widget9 = new TQWidget( tabWidget, "Widget9" );
Widget9Layout = new QVBoxLayout( Widget9, 11, 6, "Widget9Layout"); Widget9Layout = new TQVBoxLayout( Widget9, 11, 6, "Widget9Layout");
m_groupQtsettings = new QGroupBox( Widget9, "m_groupQtsettings" ); m_groupQtsettings = new TQGroupBox( Widget9, "m_groupQtsettings" );
m_groupQtsettings->setColumnLayout(0, Qt::Vertical ); m_groupQtsettings->setColumnLayout(0, Qt::Vertical );
m_groupQtsettings->layout()->setSpacing( 6 ); m_groupQtsettings->tqlayout()->setSpacing( 6 );
m_groupQtsettings->layout()->setMargin( 11 ); m_groupQtsettings->tqlayout()->setMargin( 11 );
m_groupQtsettingsLayout = new QHBoxLayout( m_groupQtsettings->layout() ); m_groupQtsettingsLayout = new TQHBoxLayout( m_groupQtsettings->tqlayout() );
m_groupQtsettingsLayout->setAlignment( Qt::AlignTop ); m_groupQtsettingsLayout->tqsetAlignment( TQt::AlignTop );
textLabel1_2 = new QLabel( m_groupQtsettings, "textLabel1_2" ); textLabel1_2 = new TQLabel( m_groupQtsettings, "textLabel1_2" );
textLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) ); textLabel1_2->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );
textLabel1_2->setLineWidth( 1 ); textLabel1_2->setLineWidth( 1 );
textLabel1_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) ); textLabel1_2->tqsetAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
m_groupQtsettingsLayout->addWidget( textLabel1_2 ); m_groupQtsettingsLayout->addWidget( textLabel1_2 );
m_qtBrowserPath = new QLineEdit( m_groupQtsettings, "m_qtBrowserPath" ); m_qtBrowserPath = new TQLineEdit( m_groupQtsettings, "m_qtBrowserPath" );
m_qtBrowserPath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, m_qtBrowserPath->sizePolicy().hasHeightForWidth() ) ); m_qtBrowserPath->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, m_qtBrowserPath->sizePolicy().hasHeightForWidth() ) );
m_groupQtsettingsLayout->addWidget( m_qtBrowserPath ); m_groupQtsettingsLayout->addWidget( m_qtBrowserPath );
Widget9Layout->addWidget( m_groupQtsettings ); Widget9Layout->addWidget( m_groupQtsettings );
m_groupKDEsettings = new QGroupBox( Widget9, "m_groupKDEsettings" ); m_groupKDEsettings = new TQGroupBox( Widget9, "m_groupKDEsettings" );
m_groupKDEsettings->setColumnLayout(0, Qt::Vertical ); m_groupKDEsettings->setColumnLayout(0, Qt::Vertical );
m_groupKDEsettings->layout()->setSpacing( 6 ); m_groupKDEsettings->tqlayout()->setSpacing( 6 );
m_groupKDEsettings->layout()->setMargin( 11 ); m_groupKDEsettings->tqlayout()->setMargin( 11 );
m_groupKDEsettingsLayout = new QHBoxLayout( m_groupKDEsettings->layout() ); m_groupKDEsettingsLayout = new TQHBoxLayout( m_groupKDEsettings->tqlayout() );
m_groupKDEsettingsLayout->setAlignment( Qt::AlignTop ); m_groupKDEsettingsLayout->tqsetAlignment( TQt::AlignTop );
buttonGroup5_2 = new QButtonGroup( m_groupKDEsettings, "buttonGroup5_2" ); buttonGroup5_2 = new TQButtonGroup( m_groupKDEsettings, "buttonGroup5_2" );
buttonGroup5_2->setColumnLayout(0, Qt::Vertical ); buttonGroup5_2->setColumnLayout(0, Qt::Vertical );
buttonGroup5_2->layout()->setSpacing( 6 ); buttonGroup5_2->tqlayout()->setSpacing( 6 );
buttonGroup5_2->layout()->setMargin( 11 ); buttonGroup5_2->tqlayout()->setMargin( 11 );
buttonGroup5_2Layout = new QVBoxLayout( buttonGroup5_2->layout() ); buttonGroup5_2Layout = new TQVBoxLayout( buttonGroup5_2->tqlayout() );
buttonGroup5_2Layout->setAlignment( Qt::AlignTop ); buttonGroup5_2Layout->tqsetAlignment( TQt::AlignTop );
m_radioUseQtextBrowser = new QRadioButton( buttonGroup5_2, "m_radioUseQtextBrowser" ); m_radioUseQtextBrowser = new TQRadioButton( buttonGroup5_2, "m_radioUseQtextBrowser" );
buttonGroup5_2Layout->addWidget( m_radioUseQtextBrowser ); buttonGroup5_2Layout->addWidget( m_radioUseQtextBrowser );
m_radioUseKHTMLPart = new QRadioButton( buttonGroup5_2, "m_radioUseKHTMLPart" ); m_radioUseKHTMLPart = new TQRadioButton( buttonGroup5_2, "m_radioUseKHTMLPart" );
buttonGroup5_2Layout->addWidget( m_radioUseKHTMLPart ); buttonGroup5_2Layout->addWidget( m_radioUseKHTMLPart );
m_groupKDEsettingsLayout->addWidget( buttonGroup5_2 ); m_groupKDEsettingsLayout->addWidget( buttonGroup5_2 );
groupKhtmlSecurity = new QGroupBox( m_groupKDEsettings, "groupKhtmlSecurity" ); groupKhtmlSecurity = new TQGroupBox( m_groupKDEsettings, "groupKhtmlSecurity" );
groupKhtmlSecurity->setColumnLayout(0, Qt::Vertical ); groupKhtmlSecurity->setColumnLayout(0, Qt::Vertical );
groupKhtmlSecurity->layout()->setSpacing( 6 ); groupKhtmlSecurity->tqlayout()->setSpacing( 6 );
groupKhtmlSecurity->layout()->setMargin( 11 ); groupKhtmlSecurity->tqlayout()->setMargin( 11 );
groupKhtmlSecurityLayout = new QGridLayout( groupKhtmlSecurity->layout() ); groupKhtmlSecurityLayout = new TQGridLayout( groupKhtmlSecurity->tqlayout() );
groupKhtmlSecurityLayout->setAlignment( Qt::AlignTop ); groupKhtmlSecurityLayout->tqsetAlignment( TQt::AlignTop );
m_enableJS = new QCheckBox( groupKhtmlSecurity, "m_enableJS" ); m_enableJS = new TQCheckBox( groupKhtmlSecurity, "m_enableJS" );
groupKhtmlSecurityLayout->addWidget( m_enableJS, 0, 0 ); groupKhtmlSecurityLayout->addWidget( m_enableJS, 0, 0 );
m_enablePlugins = new QCheckBox( groupKhtmlSecurity, "m_enablePlugins" ); m_enablePlugins = new TQCheckBox( groupKhtmlSecurity, "m_enablePlugins" );
groupKhtmlSecurityLayout->addWidget( m_enablePlugins, 0, 1 ); groupKhtmlSecurityLayout->addWidget( m_enablePlugins, 0, 1 );
m_enableJava = new QCheckBox( groupKhtmlSecurity, "m_enableJava" ); m_enableJava = new TQCheckBox( groupKhtmlSecurity, "m_enableJava" );
groupKhtmlSecurityLayout->addWidget( m_enableJava, 1, 0 ); groupKhtmlSecurityLayout->addWidget( m_enableJava, 1, 0 );
m_enableRefresh = new QCheckBox( groupKhtmlSecurity, "m_enableRefresh" ); m_enableRefresh = new TQCheckBox( groupKhtmlSecurity, "m_enableRefresh" );
groupKhtmlSecurityLayout->addWidget( m_enableRefresh, 1, 1 ); groupKhtmlSecurityLayout->addWidget( m_enableRefresh, 1, 1 );
m_groupKDEsettingsLayout->addWidget( groupKhtmlSecurity ); m_groupKDEsettingsLayout->addWidget( groupKhtmlSecurity );
Widget9Layout->addWidget( m_groupKDEsettings ); Widget9Layout->addWidget( m_groupKDEsettings );
tabWidget->insertTab( Widget9, QString::fromLatin1("") ); tabWidget->insertTab( Widget9, TQString::tqfromLatin1("") );
TabPage = new QWidget( tabWidget, "TabPage" ); TabPage = new TQWidget( tabWidget, "TabPage" );
TabPageLayout = new QVBoxLayout( TabPage, 11, 6, "TabPageLayout"); TabPageLayout = new TQVBoxLayout( TabPage, 11, 6, "TabPageLayout");
buttonGroup7 = new QButtonGroup( TabPage, "buttonGroup7" ); buttonGroup7 = new TQButtonGroup( TabPage, "buttonGroup7" );
buttonGroup7->setColumnLayout(0, Qt::Vertical ); buttonGroup7->setColumnLayout(0, Qt::Vertical );
buttonGroup7->layout()->setSpacing( 6 ); buttonGroup7->tqlayout()->setSpacing( 6 );
buttonGroup7->layout()->setMargin( 11 ); buttonGroup7->tqlayout()->setMargin( 11 );
buttonGroup7Layout = new QVBoxLayout( buttonGroup7->layout() ); buttonGroup7Layout = new TQVBoxLayout( buttonGroup7->tqlayout() );
buttonGroup7Layout->setAlignment( Qt::AlignTop ); buttonGroup7Layout->tqsetAlignment( TQt::AlignTop );
m_advViewSourceInternal = new QRadioButton( buttonGroup7, "m_advViewSourceInternal" ); m_advViewSourceInternal = new TQRadioButton( buttonGroup7, "m_advViewSourceInternal" );
buttonGroup7Layout->addWidget( m_advViewSourceInternal ); buttonGroup7Layout->addWidget( m_advViewSourceInternal );
m_advViewSourceExternal = new QRadioButton( buttonGroup7, "m_advViewSourceExternal" ); m_advViewSourceExternal = new TQRadioButton( buttonGroup7, "m_advViewSourceExternal" );
buttonGroup7Layout->addWidget( m_advViewSourceExternal ); buttonGroup7Layout->addWidget( m_advViewSourceExternal );
layout4_2 = new QHBoxLayout( 0, 0, 6, "layout4_2"); tqlayout4_2 = new TQHBoxLayout( 0, 0, 6, "tqlayout4_2");
textLabel1_3 = new QLabel( buttonGroup7, "textLabel1_3" ); textLabel1_3 = new TQLabel( buttonGroup7, "textLabel1_3" );
layout4_2->addWidget( textLabel1_3 ); tqlayout4_2->addWidget( textLabel1_3 );
m_advExternalProgramName = new QLineEdit( buttonGroup7, "m_advExternalProgramName" ); m_advExternalProgramName = new TQLineEdit( buttonGroup7, "m_advExternalProgramName" );
layout4_2->addWidget( m_advExternalProgramName ); tqlayout4_2->addWidget( m_advExternalProgramName );
buttonGroup7Layout->addLayout( layout4_2 ); buttonGroup7Layout->addLayout( tqlayout4_2 );
TabPageLayout->addWidget( buttonGroup7 ); TabPageLayout->addWidget( buttonGroup7 );
groupBox6 = new QButtonGroup( TabPage, "groupBox6" ); groupBox6 = new TQButtonGroup( TabPage, "groupBox6" );
groupBox6->setColumnLayout(0, Qt::Vertical ); groupBox6->setColumnLayout(0, Qt::Vertical );
groupBox6->layout()->setSpacing( 6 ); groupBox6->tqlayout()->setSpacing( 6 );
groupBox6->layout()->setMargin( 11 ); groupBox6->tqlayout()->setMargin( 11 );
groupBox6Layout = new QGridLayout( groupBox6->layout() ); groupBox6Layout = new TQGridLayout( groupBox6->tqlayout() );
groupBox6Layout->setAlignment( Qt::AlignTop ); groupBox6Layout->tqsetAlignment( TQt::AlignTop );
m_useSearchEngineInternal = new QRadioButton( groupBox6, "m_useSearchEngineInternal" ); m_useSearchEngineInternal = new TQRadioButton( groupBox6, "m_useSearchEngineInternal" );
groupBox6Layout->addWidget( m_useSearchEngineInternal, 1, 0 ); groupBox6Layout->addWidget( m_useSearchEngineInternal, 1, 0 );
m_labelUseSearchEngineInternal = new QLabel( groupBox6, "m_labelUseSearchEngineInternal" ); m_labelUseSearchEngineInternal = new TQLabel( groupBox6, "m_labelUseSearchEngineInternal" );
m_labelUseSearchEngineInternal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 10, 0, m_labelUseSearchEngineInternal->sizePolicy().hasHeightForWidth() ) ); m_labelUseSearchEngineInternal->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 10, 0, m_labelUseSearchEngineInternal->sizePolicy().hasHeightForWidth() ) );
m_labelUseSearchEngineInternal->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) ); m_labelUseSearchEngineInternal->tqsetAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
groupBox6Layout->addWidget( m_labelUseSearchEngineInternal, 1, 1 ); groupBox6Layout->addWidget( m_labelUseSearchEngineInternal, 1, 1 );
m_useSearchEngineNew = new QRadioButton( groupBox6, "m_useSearchEngineNew" ); m_useSearchEngineNew = new TQRadioButton( groupBox6, "m_useSearchEngineNew" );
groupBox6Layout->addWidget( m_useSearchEngineNew, 0, 0 ); groupBox6Layout->addWidget( m_useSearchEngineNew, 0, 0 );
m_labelUseSearchEngineNew = new QLabel( groupBox6, "m_labelUseSearchEngineNew" ); m_labelUseSearchEngineNew = new TQLabel( groupBox6, "m_labelUseSearchEngineNew" );
m_labelUseSearchEngineNew->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 10, 0, m_labelUseSearchEngineNew->sizePolicy().hasHeightForWidth() ) ); m_labelUseSearchEngineNew->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 10, 0, m_labelUseSearchEngineNew->sizePolicy().hasHeightForWidth() ) );
m_labelUseSearchEngineNew->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) ); m_labelUseSearchEngineNew->tqsetAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
groupBox6Layout->addWidget( m_labelUseSearchEngineNew, 0, 1 ); groupBox6Layout->addWidget( m_labelUseSearchEngineNew, 0, 1 );
TabPageLayout->addWidget( groupBox6 ); TabPageLayout->addWidget( groupBox6 );
tabWidget->insertTab( TabPage, QString::fromLatin1("") ); tabWidget->insertTab( TabPage, TQString::tqfromLatin1("") );
MyDialog1Layout->addWidget( tabWidget ); MyDialog1Layout->addWidget( tabWidget );
Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1");
buttonHelp = new QPushButton( this, "buttonHelp" ); buttonHelp = new TQPushButton( this, "buttonHelp" );
buttonHelp->setAutoDefault( TRUE ); buttonHelp->setAutoDefault( TRUE );
Layout1->addWidget( buttonHelp ); Layout1->addWidget( buttonHelp );
Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout1->addItem( Horizontal_Spacing2 ); Layout1->addItem( Horizontal_Spacing2 );
buttonOk = new QPushButton( this, "buttonOk" ); buttonOk = new TQPushButton( this, "buttonOk" );
buttonOk->setAutoDefault( TRUE ); buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE ); buttonOk->setDefault( TRUE );
Layout1->addWidget( buttonOk ); Layout1->addWidget( buttonOk );
buttonCancel = new QPushButton( this, "buttonCancel" ); buttonCancel = new TQPushButton( this, "buttonCancel" );
buttonCancel->setAutoDefault( TRUE ); buttonCancel->setAutoDefault( TRUE );
Layout1->addWidget( buttonCancel ); Layout1->addWidget( buttonCancel );
MyDialog1Layout->addLayout( Layout1 ); MyDialog1Layout->addLayout( Layout1 );
languageChange(); languageChange();
resize( QSize(654, 343).expandedTo(minimumSizeHint()) ); resize( TQSize(654, 343).expandedTo(tqminimumSizeHint()) );
clearWState( WState_Polished ); clearWState( WState_Polished );
// signals and slots connections // signals and slots connections
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
connect( m_radioUseKHTMLPart, SIGNAL( toggled(bool) ), groupKhtmlSecurity, SLOT( setEnabled(bool) ) ); connect( m_radioUseKHTMLPart, TQT_SIGNAL( toggled(bool) ), groupKhtmlSecurity, TQT_SLOT( setEnabled(bool) ) );
connect( m_advViewSourceExternal, SIGNAL( toggled(bool) ), m_advExternalProgramName, SLOT( setEnabled(bool) ) ); connect( m_advViewSourceExternal, TQT_SIGNAL( toggled(bool) ), m_advExternalProgramName, TQT_SLOT( setEnabled(bool) ) );
connect( m_radioUseQtextBrowser, SIGNAL( toggled(bool) ), groupKhtmlSecurity, SLOT( setDisabled(bool) ) ); connect( m_radioUseQtextBrowser, TQT_SIGNAL( toggled(bool) ), groupKhtmlSecurity, TQT_SLOT( setDisabled(bool) ) );
// tab order // tab order
setTabOrder( m_advViewSourceInternal, m_advViewSourceExternal ); setTabOrder( m_advViewSourceInternal, m_advViewSourceExternal );
@ -316,7 +316,7 @@ KCHMSetupDialog::KCHMSetupDialog( QWidget* parent, const char* name, bool modal,
*/ */
KCHMSetupDialog::~KCHMSetupDialog() KCHMSetupDialog::~KCHMSetupDialog()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, TQt does it all for us
} }
/* /*
@ -329,62 +329,62 @@ void KCHMSetupDialog::languageChange()
buttonGroup1->setTitle( tr( "If no arguments given on load" ) ); buttonGroup1->setTitle( tr( "If no arguments given on load" ) );
m_radioOnBeginOpenDialog->setText( tr( "Open the 'open CHM file' dialog" ) ); m_radioOnBeginOpenDialog->setText( tr( "Open the 'open CHM file' dialog" ) );
m_radioOnBeginOpenLast->setText( tr( "Open the &last used CHM file, if exist" ) ); m_radioOnBeginOpenLast->setText( tr( "Open the &last used CHM file, if exist" ) );
m_radioOnBeginOpenLast->setAccel( QKeySequence( tr( "Alt+L" ) ) ); m_radioOnBeginOpenLast->setAccel( TQKeySequence( tr( "Alt+L" ) ) );
buttonGroup2->setTitle( tr( "History" ) ); buttonGroup2->setTitle( tr( "History" ) );
textLabel1->setText( tr( "Store history information for" ) ); textLabel1->setText( tr( "Store history information for" ) );
m_historySize->setPrefix( QString::null ); m_historySize->setPrefix( TQString() );
textLabel2->setText( tr( "latest files" ) ); textLabel2->setText( tr( "latest files" ) );
m_rememberHistoryInfo->setText( tr( "R&emember extra information for history files" ) ); m_rememberHistoryInfo->setText( tr( "R&emember extra information for history files" ) );
m_rememberHistoryInfo->setAccel( QKeySequence( tr( "Alt+E" ) ) ); m_rememberHistoryInfo->setAccel( TQKeySequence( tr( "Alt+E" ) ) );
QToolTip::add( m_rememberHistoryInfo, tr( "Remembers the information about the files, which were opened. Remembers last opened page, search history, font size, bookmarks and so on." ) ); TQToolTip::add( m_rememberHistoryInfo, tr( "Remembers the information about the files, which were opened. Remembers last opened page, search history, font size, bookmarks and so on." ) );
groupBox1->setTitle( tr( "CHM security settings" ) ); groupBox1->setTitle( tr( "CHM security settings" ) );
buttonGroup4->setTitle( tr( "When external link clicked" ) ); buttonGroup4->setTitle( tr( "When external link clicked" ) );
m_radioExtLinkOpenAlways->setText( tr( "Alwa&ys open it in external browser" ) ); m_radioExtLinkOpenAlways->setText( tr( "Alwa&ys open it in external browser" ) );
m_radioExtLinkOpenAlways->setAccel( QKeySequence( tr( "Alt+Y" ) ) ); m_radioExtLinkOpenAlways->setAccel( TQKeySequence( tr( "Alt+Y" ) ) );
m_radioExtLinkAsk->setText( tr( "Ask for confirmation" ) ); m_radioExtLinkAsk->setText( tr( "Ask for confirmation" ) );
m_radioExtLinkOpenNever->setText( tr( "Do not open the link" ) ); m_radioExtLinkOpenNever->setText( tr( "Do not open the link" ) );
m_radioExtLinkOpenNever->setAccel( QKeySequence( QString::null ) ); m_radioExtLinkOpenNever->setAccel( TQKeySequence( TQString() ) );
buttonGroup5->setTitle( tr( "When link pointed to a new CHM file clicked" ) ); buttonGroup5->setTitle( tr( "When link pointed to a new CHM file clicked" ) );
m_radioNewChmOpenAlways->setText( tr( "Always open a new CHM file" ) ); m_radioNewChmOpenAlways->setText( tr( "Always open a new CHM file" ) );
m_radioNewChmAsk->setText( tr( "Ask for confirmation" ) ); m_radioNewChmAsk->setText( tr( "Ask for confirmation" ) );
m_radioNewChmOpenNever->setText( tr( "Do not open a new CHM file" ) ); m_radioNewChmOpenNever->setText( tr( "Do not open a new CHM file" ) );
tabWidget->changeTab( Widget8, tr( "General behavior" ) ); tabWidget->changeTab( Widget8, tr( "General behavior" ) );
m_groupQtsettings->setTitle( tr( "Qt version settings" ) ); m_groupQtsettings->setTitle( tr( "TQt version settings" ) );
textLabel1_2->setText( tr( "Enter the path to the program, which will be used as a browser for external links. A <i>%s</i> symbol will be replaced by the URL clicked." ) ); textLabel1_2->setText( tr( "Enter the path to the program, which will be used as a browser for external links. A <i>%s</i> symbol will be replaced by the URL clicked." ) );
m_groupKDEsettings->setTitle( tr( "KDE version settings" ) ); m_groupKDEsettings->setTitle( tr( "KDE version settings" ) );
buttonGroup5_2->setTitle( tr( "To show HTML content, use" ) ); buttonGroup5_2->setTitle( tr( "To show HTML content, use" ) );
m_radioUseQtextBrowser->setText( tr( "&QTextBrowser-based widget" ) ); m_radioUseQtextBrowser->setText( tr( "&TQTextBrowser-based widget" ) );
m_radioUseQtextBrowser->setAccel( QKeySequence( tr( "Alt+Q" ) ) ); m_radioUseQtextBrowser->setAccel( TQKeySequence( tr( "Alt+Q" ) ) );
m_radioUseKHTMLPart->setText( tr( "&KHTMLPart-based widget" ) ); m_radioUseKHTMLPart->setText( tr( "&KHTMLPart-based widget" ) );
m_radioUseKHTMLPart->setAccel( QKeySequence( tr( "Alt+K" ) ) ); m_radioUseKHTMLPart->setAccel( TQKeySequence( tr( "Alt+K" ) ) );
groupKhtmlSecurity->setTitle( tr( "KHTMLPart security" ) ); groupKhtmlSecurity->setTitle( tr( "KHTMLPart security" ) );
m_enableJS->setText( tr( "Enable Java&Script" ) ); m_enableJS->setText( tr( "Enable Java&Script" ) );
m_enableJS->setAccel( QKeySequence( tr( "Alt+S" ) ) ); m_enableJS->setAccel( TQKeySequence( tr( "Alt+S" ) ) );
m_enablePlugins->setText( tr( "Enable &plugins" ) ); m_enablePlugins->setText( tr( "Enable &plugins" ) );
m_enablePlugins->setAccel( QKeySequence( tr( "Alt+P" ) ) ); m_enablePlugins->setAccel( TQKeySequence( tr( "Alt+P" ) ) );
m_enableJava->setText( tr( "Enable &Java" ) ); m_enableJava->setText( tr( "Enable &Java" ) );
m_enableJava->setAccel( QKeySequence( tr( "Alt+J" ) ) ); m_enableJava->setAccel( TQKeySequence( tr( "Alt+J" ) ) );
m_enableRefresh->setText( tr( "Enable &refresh" ) ); m_enableRefresh->setText( tr( "Enable &refresh" ) );
m_enableRefresh->setAccel( QKeySequence( tr( "Alt+R" ) ) ); m_enableRefresh->setAccel( TQKeySequence( tr( "Alt+R" ) ) );
tabWidget->changeTab( Widget9, tr( "Version-specific settings" ) ); tabWidget->changeTab( Widget9, tr( "Version-specific settings" ) );
buttonGroup7->setTitle( tr( "View HTML source command uses" ) ); buttonGroup7->setTitle( tr( "View HTML source command uses" ) );
m_advViewSourceInternal->setText( tr( "Built-in HTML source viewer" ) ); m_advViewSourceInternal->setText( tr( "Built-in HTML source viewer" ) );
m_advViewSourceInternal->setAccel( QKeySequence( QString::null ) ); m_advViewSourceInternal->setAccel( TQKeySequence( TQString() ) );
m_advViewSourceExternal->setText( tr( "E&xternal program, specified below" ) ); m_advViewSourceExternal->setText( tr( "E&xternal program, specified below" ) );
m_advViewSourceExternal->setAccel( QKeySequence( tr( "Alt+X" ) ) ); m_advViewSourceExternal->setAccel( TQKeySequence( tr( "Alt+X" ) ) );
textLabel1_3->setText( tr( "External program:" ) ); textLabel1_3->setText( tr( "External program:" ) );
groupBox6->setTitle( tr( "Search engine to use" ) ); groupBox6->setTitle( tr( "Search engine to use" ) );
m_useSearchEngineInternal->setText( QString::null ); m_useSearchEngineInternal->setText( TQString() );
m_labelUseSearchEngineInternal->setText( tr( "Use the search based on internal CHM index. This engine cannot search for any symbols except underscode, does not support multibyte languages, and is not always available." ) ); m_labelUseSearchEngineInternal->setText( tr( "Use the search based on internal CHM index. This engine cannot search for any symbols except underscode, does not support multibyte languages, and is not always available." ) );
m_useSearchEngineNew->setText( QString::null ); m_useSearchEngineNew->setText( TQString() );
m_labelUseSearchEngineNew->setText( tr( "Use new kchmviewer internal search engine (recommended). This engine indexes symbols, so it is possible to search for special symbols (like \"C++\"). All languages are supported. The index will be generated before the first search." ) ); m_labelUseSearchEngineNew->setText( tr( "Use new kchmviewer internal search engine (recommended). This engine indexes symbols, so it is possible to search for special symbols (like \"C++\"). All languages are supported. The index will be generated before the first search." ) );
tabWidget->changeTab( TabPage, tr( "Advanced" ) ); tabWidget->changeTab( TabPage, tr( "Advanced" ) );
buttonHelp->setText( tr( "&Help" ) ); buttonHelp->setText( tr( "&Help" ) );
buttonHelp->setAccel( QKeySequence( tr( "F1" ) ) ); buttonHelp->setAccel( TQKeySequence( tr( "F1" ) ) );
buttonOk->setText( tr( "&OK" ) ); buttonOk->setText( tr( "&OK" ) );
buttonOk->setAccel( QKeySequence( QString::null ) ); buttonOk->setAccel( TQKeySequence( TQString() ) );
buttonCancel->setText( tr( "&Cancel" ) ); buttonCancel->setText( tr( "&Cancel" ) );
buttonCancel->setAccel( QKeySequence( QString::null ) ); buttonCancel->setAccel( TQKeySequence( TQString() ) );
} }
void KCHMSetupDialog::m_radioUseKHTMLPart_toggled(bool) void KCHMSetupDialog::m_radioUseKHTMLPart_toggled(bool)

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KCHMSetupDialog</class> <class>KCHMSetupDialog</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>MyDialog1</cstring> <cstring>MyDialog1</cstring>
</property> </property>
<property name="geometry"> <property name="tqgeometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -42,11 +42,11 @@
<property name="resizeMode"> <property name="resizeMode">
<enum>Minimum</enum> <enum>Minimum</enum>
</property> </property>
<widget class="QTabWidget"> <widget class="TQTabWidget">
<property name="name"> <property name="name">
<cstring>tabWidget</cstring> <cstring>tabWidget</cstring>
</property> </property>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Widget8</cstring> <cstring>Widget8</cstring>
</property> </property>
@ -57,15 +57,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout4</cstring> <cstring>tqlayout4</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>buttonGroup1</cstring> <cstring>buttonGroup1</cstring>
</property> </property>
@ -76,7 +76,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioOnBeginOpenDialog</cstring> <cstring>m_radioOnBeginOpenDialog</cstring>
</property> </property>
@ -84,7 +84,7 @@
<string>Open the 'open CHM file' dialog</string> <string>Open the 'open CHM file' dialog</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioOnBeginOpenLast</cstring> <cstring>m_radioOnBeginOpenLast</cstring>
</property> </property>
@ -97,7 +97,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>buttonGroup2</cstring> <cstring>buttonGroup2</cstring>
</property> </property>
@ -108,15 +108,15 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout3</cstring> <cstring>tqlayout3</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -124,7 +124,7 @@
<string>Store history information for</string> <string>Store history information for</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox"> <widget class="TQSpinBox">
<property name="name"> <property name="name">
<cstring>m_historySize</cstring> <cstring>m_historySize</cstring>
</property> </property>
@ -135,7 +135,7 @@
<number>10</number> <number>10</number>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -145,7 +145,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QCheckBox"> <widget class="TQCheckBox">
<property name="name"> <property name="name">
<cstring>m_rememberHistoryInfo</cstring> <cstring>m_rememberHistoryInfo</cstring>
</property> </property>
@ -163,7 +163,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox1</cstring> <cstring>groupBox1</cstring>
</property> </property>
@ -174,7 +174,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>buttonGroup4</cstring> <cstring>buttonGroup4</cstring>
</property> </property>
@ -185,7 +185,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioExtLinkOpenAlways</cstring> <cstring>m_radioExtLinkOpenAlways</cstring>
</property> </property>
@ -196,7 +196,7 @@
<string>Alt+Y</string> <string>Alt+Y</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioExtLinkAsk</cstring> <cstring>m_radioExtLinkAsk</cstring>
</property> </property>
@ -204,7 +204,7 @@
<string>Ask for confirmation</string> <string>Ask for confirmation</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioExtLinkOpenNever</cstring> <cstring>m_radioExtLinkOpenNever</cstring>
</property> </property>
@ -217,7 +217,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>buttonGroup5</cstring> <cstring>buttonGroup5</cstring>
</property> </property>
@ -228,7 +228,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioNewChmOpenAlways</cstring> <cstring>m_radioNewChmOpenAlways</cstring>
</property> </property>
@ -236,7 +236,7 @@
<string>Always open a new CHM file</string> <string>Always open a new CHM file</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioNewChmAsk</cstring> <cstring>m_radioNewChmAsk</cstring>
</property> </property>
@ -244,7 +244,7 @@
<string>Ask for confirmation</string> <string>Ask for confirmation</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioNewChmOpenNever</cstring> <cstring>m_radioNewChmOpenNever</cstring>
</property> </property>
@ -258,7 +258,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Widget9</cstring> <cstring>Widget9</cstring>
</property> </property>
@ -269,7 +269,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>m_groupQtsettings</cstring> <cstring>m_groupQtsettings</cstring>
</property> </property>
@ -280,7 +280,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_2</cstring> <cstring>textLabel1_2</cstring>
</property> </property>
@ -298,11 +298,11 @@
<property name="text"> <property name="text">
<string>Enter the path to the program, which will be used as a browser for external links. A &lt;i&gt;%s&lt;/i&gt; symbol will be replaced by the URL clicked.</string> <string>Enter the path to the program, which will be used as a browser for external links. A &lt;i&gt;%s&lt;/i&gt; symbol will be replaced by the URL clicked.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLineEdit"> <widget class="TQLineEdit">
<property name="name"> <property name="name">
<cstring>m_qtBrowserPath</cstring> <cstring>m_qtBrowserPath</cstring>
</property> </property>
@ -317,7 +317,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>m_groupKDEsettings</cstring> <cstring>m_groupKDEsettings</cstring>
</property> </property>
@ -328,7 +328,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>buttonGroup5_2</cstring> <cstring>buttonGroup5_2</cstring>
</property> </property>
@ -339,7 +339,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioUseQtextBrowser</cstring> <cstring>m_radioUseQtextBrowser</cstring>
</property> </property>
@ -350,7 +350,7 @@
<string>Alt+Q</string> <string>Alt+Q</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_radioUseKHTMLPart</cstring> <cstring>m_radioUseKHTMLPart</cstring>
</property> </property>
@ -363,7 +363,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>groupKhtmlSecurity</cstring> <cstring>groupKhtmlSecurity</cstring>
</property> </property>
@ -374,7 +374,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QCheckBox" row="0" column="0"> <widget class="TQCheckBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>m_enableJS</cstring> <cstring>m_enableJS</cstring>
</property> </property>
@ -385,7 +385,7 @@
<string>Alt+S</string> <string>Alt+S</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="1"> <widget class="TQCheckBox" row="0" column="1">
<property name="name"> <property name="name">
<cstring>m_enablePlugins</cstring> <cstring>m_enablePlugins</cstring>
</property> </property>
@ -396,7 +396,7 @@
<string>Alt+P</string> <string>Alt+P</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="1" column="0"> <widget class="TQCheckBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>m_enableJava</cstring> <cstring>m_enableJava</cstring>
</property> </property>
@ -407,7 +407,7 @@
<string>Alt+J</string> <string>Alt+J</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="1" column="1"> <widget class="TQCheckBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>m_enableRefresh</cstring> <cstring>m_enableRefresh</cstring>
</property> </property>
@ -424,7 +424,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>TabPage</cstring> <cstring>TabPage</cstring>
</property> </property>
@ -435,7 +435,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>buttonGroup7</cstring> <cstring>buttonGroup7</cstring>
</property> </property>
@ -446,7 +446,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_advViewSourceInternal</cstring> <cstring>m_advViewSourceInternal</cstring>
</property> </property>
@ -457,7 +457,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>m_advViewSourceExternal</cstring> <cstring>m_advViewSourceExternal</cstring>
</property> </property>
@ -468,15 +468,15 @@
<string>Alt+X</string> <string>Alt+X</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout4</cstring> <cstring>tqlayout4</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_3</cstring> <cstring>textLabel1_3</cstring>
</property> </property>
@ -484,7 +484,7 @@
<string>External program:</string> <string>External program:</string>
</property> </property>
</widget> </widget>
<widget class="QLineEdit"> <widget class="TQLineEdit">
<property name="name"> <property name="name">
<cstring>m_advExternalProgramName</cstring> <cstring>m_advExternalProgramName</cstring>
</property> </property>
@ -493,7 +493,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QButtonGroup"> <widget class="TQButtonGroup">
<property name="name"> <property name="name">
<cstring>groupBox6</cstring> <cstring>groupBox6</cstring>
</property> </property>
@ -504,7 +504,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton" row="1" column="0"> <widget class="TQRadioButton" row="1" column="0">
<property name="name"> <property name="name">
<cstring>m_useSearchEngineInternal</cstring> <cstring>m_useSearchEngineInternal</cstring>
</property> </property>
@ -512,7 +512,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="1"> <widget class="TQLabel" row="1" column="1">
<property name="name"> <property name="name">
<cstring>m_labelUseSearchEngineInternal</cstring> <cstring>m_labelUseSearchEngineInternal</cstring>
</property> </property>
@ -527,11 +527,11 @@
<property name="text"> <property name="text">
<string>Use the search based on internal CHM index. This engine cannot search for any symbols except underscode, does not support multibyte languages, and is not always available.</string> <string>Use the search based on internal CHM index. This engine cannot search for any symbols except underscode, does not support multibyte languages, and is not always available.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="0" column="0"> <widget class="TQRadioButton" row="0" column="0">
<property name="name"> <property name="name">
<cstring>m_useSearchEngineNew</cstring> <cstring>m_useSearchEngineNew</cstring>
</property> </property>
@ -539,7 +539,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="1"> <widget class="TQLabel" row="0" column="1">
<property name="name"> <property name="name">
<cstring>m_labelUseSearchEngineNew</cstring> <cstring>m_labelUseSearchEngineNew</cstring>
</property> </property>
@ -554,7 +554,7 @@
<property name="text"> <property name="text">
<string>Use new kchmviewer internal search engine (recommended). This engine indexes symbols, so it is possible to search for special symbols (like "C++"). All languages are supported. The index will be generated before the first search.</string> <string>Use new kchmviewer internal search engine (recommended). This engine indexes symbols, so it is possible to search for special symbols (like "C++"). All languages are supported. The index will be generated before the first search.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -563,7 +563,7 @@
</vbox> </vbox>
</widget> </widget>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>Layout1</cstring> <cstring>Layout1</cstring>
</property> </property>
@ -577,7 +577,7 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>buttonHelp</cstring> <cstring>buttonHelp</cstring>
</property> </property>
@ -601,14 +601,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>buttonOk</cstring> <cstring>buttonOk</cstring>
</property> </property>
@ -625,7 +625,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>buttonCancel</cstring> <cstring>buttonCancel</cstring>
</property> </property>
@ -703,8 +703,8 @@
<tabstop>buttonOk</tabstop> <tabstop>buttonOk</tabstop>
<tabstop>buttonCancel</tabstop> <tabstop>buttonCancel</tabstop>
</tabstops> </tabstops>
<slots> <Q_SLOTS>
<slot>m_radioUseKHTMLPart_toggled( bool )</slot> <slot>m_radioUseKHTMLPart_toggled( bool )</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
</UI> </UI>

@ -19,9 +19,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qcstring.h> #include <tqcstring.h>
#include <qimage.h> #include <tqimage.h>
#include <qdir.h> #include <tqdir.h>
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmurlfactory.h" #include "libchmurlfactory.h"
@ -33,15 +33,15 @@
KCHMSourceFactory::KCHMSourceFactory (KCHMViewWindow * viewwindow) KCHMSourceFactory::KCHMSourceFactory (KCHMViewWindow * viewwindow)
: QMimeSourceFactory() : TQMimeSourceFactory()
{ {
m_viewWindow = viewwindow; 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 // Retreive the data from chm file
LCHMFile * chm = ::mainWindow->chmFile(); LCHMFile * chm = ::mainWindow->chmFile();
@ -49,7 +49,7 @@ const QMimeSource * KCHMSourceFactory::data( const QString & abs_name ) const
if ( !chm ) if ( !chm )
return 0; return 0;
int pos = path.find ('#'); int pos = path.tqfind ('#');
if ( pos != -1 ) if ( pos != -1 )
path = path.left (pos); 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. // to generate the HTML page, and set it.
if ( LCHMUrlFactory::handleFileType( path, data ) ) if ( LCHMUrlFactory::handleFileType( path, data ) )
{ {
((QMimeSourceFactory*)this)->setText (path, data); ((TQMimeSourceFactory*)this)->setText (path, data);
} }
else if ( path.endsWith (".htm") || path.endsWith (".html") ) else if ( path.endsWith (".htm") || path.endsWith (".html") )
{ {
if ( chm->getFileContentAsString( &data, path ) ) if ( chm->getFileContentAsString( &data, path ) )
((QMimeSourceFactory*)this)->setText (path, data); ((TQMimeSourceFactory*)this)->setText (path, data);
} }
else else
{ {
// treat as image // treat as image
QImage img; TQImage img;
QByteArray buf; TQByteArray buf;
QString fpath = KCHMViewWindow_QTextBrowser::decodeUrl( path ); TQString fpath = KCHMViewWindow_QTextBrowser::decodeUrl( path );
if ( chm->getFileContentAsBinary( &buf, fpath ) ) if ( chm->getFileContentAsBinary( &buf, fpath ) )
{ {
if ( img.loadFromData ( (const uchar *) buf.data(), buf.size() ) ) if ( img.loadFromData ( (const uchar *) buf.data(), buf.size() ) )
((QMimeSourceFactory*)this)->setImage (path, img); ((TQMimeSourceFactory*)this)->setImage (path, img);
} }
else else
{ {
((QMimeSourceFactory*)this)->setImage( path, img ); ((TQMimeSourceFactory*)this)->setImage( path, img );
qWarning( "Could not resolve file %s\n", path.ascii() ); 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 ); return m_viewWindow->makeURLabsolute ( abs_or_rel_name, false );
} }

@ -22,19 +22,19 @@
#ifndef KCHMSOURCEFACTORY_H #ifndef KCHMSOURCEFACTORY_H
#define KCHMSOURCEFACTORY_H #define KCHMSOURCEFACTORY_H
#include <qmime.h> #include <tqmime.h>
#include "forwarddeclarations.h" #include "forwarddeclarations.h"
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
class KCHMSourceFactory : public QMimeSourceFactory class KCHMSourceFactory : public TQMimeSourceFactory
{ {
public: public:
KCHMSourceFactory (KCHMViewWindow * viewwindow); KCHMSourceFactory (KCHMViewWindow * viewwindow);
virtual const QMimeSource * data ( const QString & abs_name ) const; virtual const TQMimeSource * data ( const TQString & abs_name ) const;
virtual QString makeAbsolute ( const QString & abs_or_rel_name, const QString & context ) const; virtual TQString makeAbsolute ( const TQString & abs_or_rel_name, const TQString & context ) const;
private: private:
KCHMViewWindow * m_viewWindow; KCHMViewWindow * m_viewWindow;

@ -19,8 +19,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qstringlist.h> #include <tqstringlist.h>
#include <qstyle.h> #include <tqstyle.h>
#include "kchmtreeviewitem.h" #include "kchmtreeviewitem.h"
#include "kchmmainwindow.h" #include "kchmmainwindow.h"
@ -28,16 +28,16 @@
#include "iconstorage.h" #include "iconstorage.h"
KCHMIndTocItem::KCHMIndTocItem( QListViewItem * parent, QListViewItem * after, QString name, QString aurl, int image) : QListViewItem(parent, after, name), url(aurl), image_number(image) KCHMIndTocItem::KCHMIndTocItem( TQListViewItem * tqparent, TQListViewItem * after, TQString name, TQString aurl, int image) : TQListViewItem(tqparent, after, name), url(aurl), image_number(image)
{ {
} }
KCHMIndTocItem::KCHMIndTocItem( QListView * parent, QListViewItem * after, QString name, QString aurl, int image) : QListViewItem(parent, after, name), url(aurl), image_number(image) KCHMIndTocItem::KCHMIndTocItem( TQListView * tqparent, TQListViewItem * after, TQString name, TQString aurl, int image) : TQListViewItem(tqparent, after, name), url(aurl), image_number(image)
{ {
} }
const QPixmap * KCHMIndTocItem::pixmap( int i ) const const TQPixmap * KCHMIndTocItem::pixmap( int i ) const
{ {
int imagenum; int imagenum;
@ -58,24 +58,24 @@ const QPixmap * KCHMIndTocItem::pixmap( int i ) const
} }
QString KCHMIndTocItem::getUrl( ) const TQString KCHMIndTocItem::getUrl( ) const
{ {
if ( url.find ('|') == -1 ) if ( url.tqfind ('|') == -1 )
return url; return url;
// Create a dialog with URLs, and show it, so user can select an URL he/she wants. // Create a dialog with URLs, and show it, so user can select an URL he/she wants.
QStringList urls = QStringList::split ('|', url); TQStringList urls = TQStringList::split ('|', url);
QStringList titles; TQStringList titles;
LCHMFile * xchm = ::mainWindow->chmFile(); LCHMFile * xchm = ::mainWindow->chmFile();
for ( unsigned int i = 0; i < urls.size(); i++ ) for ( unsigned int i = 0; i < urls.size(); i++ )
{ {
QString title = xchm->getTopicByUrl (urls[i]); TQString title = xchm->getTopicByUrl (urls[i]);
if ( !title ) if ( !title )
{ {
qWarning ("Could not get item name for url '%s'", urls[i].ascii()); qWarning ("Could not get item name for url '%s'", urls[i].ascii());
titles.push_back(QString::null); titles.push_back(TQString());
} }
else else
titles.push_back(title); titles.push_back(title);
@ -83,62 +83,62 @@ QString KCHMIndTocItem::getUrl( ) const
KCHMDialogChooseUrlFromList dlg (urls, titles, ::mainWindow); KCHMDialogChooseUrlFromList dlg (urls, titles, ::mainWindow);
if ( dlg.exec() == QDialog::Accepted ) if ( dlg.exec() == TQDialog::Accepted )
return dlg.getSelectedItemUrl(); return dlg.getSelectedItemUrl();
return QString::null; return TQString();
} }
void KCHMIndTocItem::paintBranches( QPainter * p, const QColorGroup & cg, int w, int y, int h ) void KCHMIndTocItem::paintBranches( TQPainter * p, const TQColorGroup & cg, int w, int y, int h )
{ {
if ( image_number != LCHMBookIcons::IMAGE_INDEX ) if ( image_number != LCHMBookIcons::IMAGE_INDEX )
QListViewItem::paintBranches(p, cg, w, y, h); TQListViewItem::paintBranches(p, cg, w, y, h);
else else
{ {
// Too bad that listView()->paintEmptyArea( p, QRect( 0, 0, w, h ) ) is protected. // Too bad that listView()->paintEmptyArea( p, TQRect( 0, 0, w, h ) ) is protected.
// Taken from qt-x11-free-3.0.4/src/widgets/qlistview.cpp // Taken from qt-x11-free-3.0.4/src/widgets/qlistview.cpp
QStyleOption opt( 0, 0 ); TQStyleOption opt( 0, 0 );
QStyle::SFlags how = QStyle::Style_Default | QStyle::Style_Enabled; TQStyle::SFlags how = TQStyle::Style_Default | TQStyle::Style_Enabled;
listView()->style().drawComplexControl( QStyle::CC_ListView, listView()->tqstyle().tqdrawComplexControl( TQStyle::CC_ListView,
p, listView(), QRect( 0, 0, w, h ), cg, p, listView(), TQRect( 0, 0, w, h ), cg,
how, QStyle::SC_ListView, QStyle::SC_None, how, TQStyle::SC_ListView, TQStyle::SC_None,
opt ); opt );
} }
} }
void KCHMIndTocItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ) void KCHMIndTocItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{ {
QColorGroup newcg ( cg ); TQColorGroup newcg ( cg );
QColor c = newcg.text(); TQColor c = newcg.text();
if ( url.find ('|') != -1 ) if ( url.tqfind ('|') != -1 )
newcg.setColor( QColorGroup::Text, Qt::red ); newcg.setColor( TQColorGroup::Text, TQt::red );
else if ( url[0] == ':' ) else if ( url[0] == ':' )
newcg.setColor( QColorGroup::Text, Qt::lightGray ); newcg.setColor( TQColorGroup::Text, TQt::lightGray );
else else
{ {
QListViewItem::paintCell( p, cg, column, width, align ); TQListViewItem::paintCell( p, cg, column, width, align );
return; return;
} }
QListViewItem::paintCell( p, newcg, column, width, align ); TQListViewItem::paintCell( p, newcg, column, width, align );
newcg.setColor( QColorGroup::Text, c ); newcg.setColor( TQColorGroup::Text, c );
} }
void KCHMIndTocItem::setOpen( bool open ) void KCHMIndTocItem::setOpen( bool open )
{ {
if ( image_number != LCHMBookIcons::IMAGE_INDEX || open ) if ( image_number != LCHMBookIcons::IMAGE_INDEX || open )
QListViewItem::setOpen (open); TQListViewItem::setOpen (open);
} }
void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMParsedEntry >& data, QMap<QString, KCHMIndTocItem*> * map ) void kchmFillListViewWithParsedData( TQListView * list, const TQValueVector< LCHMParsedEntry >& data, TQMap<TQString, KCHMIndTocItem*> * map )
{ {
QValueVector< KCHMIndTocItem *> lastchild; TQValueVector< KCHMIndTocItem *> lastchild;
QValueVector< KCHMIndTocItem *> rootentry; TQValueVector< KCHMIndTocItem *> rootentry;
if ( map ) if ( map )
map->clear(); map->clear();
@ -161,7 +161,7 @@ void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMP
// Create the node // Create the node
KCHMIndTocItem * item; KCHMIndTocItem * item;
QString url = data[i].urls.join ("|"); TQString url = data[i].urls.join ("|");
if ( indent == 0 ) if ( indent == 0 )
item = new KCHMIndTocItem( list, lastchild[indent], data[i].name, url, data[i].imageid ); item = new KCHMIndTocItem( list, lastchild[indent], data[i].name, url, data[i].imageid );
@ -202,7 +202,7 @@ void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMP
} }
int real_indent = indent - root_indent_offset; int real_indent = indent - root_indent_offset;
QString url = urls.join ("|"); TQString url = urls.join ("|");
if ( real_indent == 0 ) if ( real_indent == 0 )
{ {
@ -241,7 +241,7 @@ void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMP
qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty."); qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty.");
} }
name = QString::null; name = TQString();
urls.clear(); urls.clear();
in_object = false; in_object = false;
imagenum = defaultimagenum; imagenum = defaultimagenum;

@ -22,8 +22,8 @@
#ifndef CTREEVIEWITEM_H #ifndef CTREEVIEWITEM_H
#define CTREEVIEWITEM_H #define CTREEVIEWITEM_H
#include <qlistview.h> #include <tqlistview.h>
#include <qvaluevector.h> #include <tqvaluevector.h>
#include "libchmfile.h" #include "libchmfile.h"
@ -31,70 +31,70 @@
@author Georgy Yunaev @author Georgy Yunaev
*/ */
//! This is a list item used both in Index and Table Of Content trees //! This is a list item used both in Index and Table Of Content trees
class KCHMIndTocItem : public QListViewItem class KCHMIndTocItem : public TQListViewItem
{ {
public: public:
KCHMIndTocItem( QListViewItem* parent, QListViewItem* after, QString name, QString aurl, int image); KCHMIndTocItem( TQListViewItem* tqparent, TQListViewItem* after, TQString name, TQString aurl, int image);
KCHMIndTocItem( QListView* parent, QListViewItem* after, QString name, QString url, int image); KCHMIndTocItem( TQListView* tqparent, TQListViewItem* after, TQString name, TQString url, int image);
QString getUrl() const; TQString getUrl() const;
virtual void setOpen ( bool open ); virtual void setOpen ( bool open );
private: private:
virtual void paintBranches ( QPainter * p, const QColorGroup & cg, int w, int y, int h ); virtual void paintBranches ( TQPainter * p, const TQColorGroup & cg, int w, int y, int h );
virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ); virtual void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
virtual const QPixmap * pixmap( int i ) const; virtual const TQPixmap * pixmap( int i ) const;
QString url; TQString url;
int image_number; int image_number;
}; };
class KCMSearchTreeViewItem : public QListViewItem class KCMSearchTreeViewItem : public TQListViewItem
{ {
public: public:
KCMSearchTreeViewItem (QListView* parent, QString name, QString loc, QString url) KCMSearchTreeViewItem (TQListView* tqparent, TQString name, TQString loc, TQString url)
: QListViewItem (parent, name, loc) : TQListViewItem (tqparent, name, loc)
{ {
this->url = url; this->url = url;
} }
QString getUrl() const { return url; } TQString getUrl() const { return url; }
private: private:
QString url; TQString url;
}; };
class KCHMSingleTreeViewItem : public QListViewItem class KCHMSingleTreeViewItem : public TQListViewItem
{ {
public: public:
KCHMSingleTreeViewItem (QListView* parent, QString name, QString url) KCHMSingleTreeViewItem (TQListView* tqparent, TQString name, TQString url)
: QListViewItem (parent, name) : TQListViewItem (tqparent, name)
{ {
this->url = url; this->url = url;
} }
QString getUrl() const { return url; } TQString getUrl() const { return url; }
private: private:
QString url; TQString url;
}; };
class KCHMBookmarkTreeViewItem : public QListViewItem class KCHMBookmarkTreeViewItem : public TQListViewItem
{ {
public: public:
KCHMBookmarkTreeViewItem (QListView* parent, QString n, QString u, int s) KCHMBookmarkTreeViewItem (TQListView* tqparent, TQString n, TQString u, int s)
: QListViewItem (parent, n), url(u), name(n), scroll_y(s) { menuid = 0; } : TQListViewItem (tqparent, n), url(u), name(n), scroll_y(s) { menuid = 0; }
QString url; TQString url;
QString name; TQString name;
int scroll_y; int scroll_y;
int menuid; int menuid;
}; };
void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMParsedEntry >& data, QMap<QString, KCHMIndTocItem*> * map ); void kchmFillListViewWithParsedData( TQListView * list, const TQValueVector< LCHMParsedEntry >& data, TQMap<TQString, KCHMIndTocItem*> * map );
#endif #endif

@ -19,11 +19,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
// Do not use tr() or i18n() in this file - this class is not derived from QObject. // Do not use tr() or i18n() in this file - this class is not derived from TQObject.
#include <qregexp.h> #include <tqregexp.h>
#include <qstring.h> #include <tqstring.h>
#include <qdir.h> #include <tqdir.h>
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmurlfactory.h" #include "libchmurlfactory.h"
@ -35,25 +35,25 @@
#include "kchmnavtoolbar.h" #include "kchmnavtoolbar.h"
KCHMViewWindow::KCHMViewWindow( QTabWidget * parent ) KCHMViewWindow::KCHMViewWindow( TQTabWidget * tqparent )
{ {
invalidate(); tqinvalidate();
m_contextMenu = 0; m_contextMenu = 0;
m_contextMenuLink = 0; m_contextMenuLink = 0;
m_historyMaxSize = 25; m_historyMaxSize = 25;
m_parentTabWidget = parent; m_parentTabWidget = tqparent;
} }
KCHMViewWindow::~KCHMViewWindow() KCHMViewWindow::~KCHMViewWindow()
{ {
} }
void KCHMViewWindow::invalidate( ) void KCHMViewWindow::tqinvalidate( )
{ {
m_base_url = "/"; m_base_url = "/";
m_openedPage = QString::null; m_openedPage = TQString();
m_newTabLinkKeeper = QString::null; m_newTabLinkKeeper = TQString();
m_historyCurrentPos = 0; m_historyCurrentPos = 0;
m_history.clear(); m_history.clear();
@ -63,30 +63,30 @@ void KCHMViewWindow::invalidate( )
QString KCHMViewWindow::makeURLabsolute ( const QString & url, bool set_as_base ) TQString KCHMViewWindow::makeURLabsolute ( const TQString & url, bool set_as_base )
{ {
QString p1, p2, newurl = url; TQString p1, p2, newurl = url;
if ( !LCHMUrlFactory::isRemoteURL (url, p1) if ( !LCHMUrlFactory::isRemoteURL (url, p1)
&& !LCHMUrlFactory::isJavascriptURL (url) && !LCHMUrlFactory::isJavascriptURL (url)
&& !LCHMUrlFactory::isNewChmURL (url, p1, p2) ) && !LCHMUrlFactory::isNewChmURL (url, p1, p2) )
{ {
newurl = QDir::cleanDirPath (url); newurl = TQDir::cleanDirPath (url);
// Normalize url, so it becomes absolute // Normalize url, so it becomes absolute
if ( newurl[0] != '/' ) if ( newurl[0] != '/' )
newurl = m_base_url + "/" + newurl; newurl = m_base_url + "/" + newurl;
newurl = QDir::cleanDirPath (newurl); newurl = TQDir::cleanDirPath (newurl);
if ( set_as_base ) if ( set_as_base )
{ {
m_base_url = newurl; m_base_url = newurl;
// and set up new baseurl // and set up new baseurl
int i = newurl.findRev('/'); int i = newurl.tqfindRev('/');
if ( i != -1 ) if ( i != -1 )
m_base_url = QDir::cleanDirPath (newurl.left (i + 1)); m_base_url = TQDir::cleanDirPath (newurl.left (i + 1));
} }
} }
@ -94,19 +94,19 @@ QString KCHMViewWindow::makeURLabsolute ( const QString & url, bool set_as_base
return newurl; return newurl;
} }
bool KCHMViewWindow::openUrl ( const QString& origurl ) bool KCHMViewWindow::openUrl ( const TQString& origurl )
{ {
QString chmfile, page, newurl = origurl; TQString chmfile, page, newurl = origurl;
if ( !origurl ) if ( !origurl )
return true; return true;
// URL could be a complete ms-its link. The file should be already loaded (for QTextBrowser), // URL could be a complete ms-its link. The file should be already loaded (for TQTextBrowser),
// or will be loaded (for kio slave). We care only about the path component. // or will be loaded (for kio slave). We care only about the path component.
if ( LCHMUrlFactory::isNewChmURL( newurl, chmfile, page ) ) if ( LCHMUrlFactory::isNewChmURL( newurl, chmfile, page ) )
{ {
// If a new chm file is opened here, and we do not use KCHMLPart, we better abort // If a new chm file is opened here, and we do not use KCHMLPart, we better abort
if ( chmfile != ::mainWindow->getOpenedFileName() && appConfig.m_kdeUseQTextBrowser ) if ( chmfile != ::mainWindow->getOpenedFileName() && appConfig.m_kdeUseTQTextBrowser )
qFatal("KCHMViewWindow::openUrl(): opened new chm file %s while current is %s", qFatal("KCHMViewWindow::openUrl(): opened new chm file %s while current is %s",
chmfile.ascii(), ::mainWindow->getOpenedFileName().ascii() ); chmfile.ascii(), ::mainWindow->getOpenedFileName().ascii() );
@ -119,7 +119,7 @@ bool KCHMViewWindow::openUrl ( const QString& origurl )
if ( openPage (newurl) ) if ( openPage (newurl) )
{ {
m_newTabLinkKeeper = QString::null; m_newTabLinkKeeper = TQString();
m_openedPage = newurl; m_openedPage = newurl;
mainWindow->viewWindowMgr()->setTabName( this ); mainWindow->viewWindowMgr()->setTabName( this );
@ -129,36 +129,36 @@ bool KCHMViewWindow::openUrl ( const QString& origurl )
return false; return false;
} }
void KCHMViewWindow::handleStartPageAsImage( QString & link ) void KCHMViewWindow::handleStartPageAsImage( TQString & link )
{ {
// Handle pics // Handle pics
if ( link.endsWith( ".jpg", false ) if ( link.tqendsWith( ".jpg", false )
|| link.endsWith( ".jpeg", false ) || link.tqendsWith( ".jpeg", false )
|| link.endsWith( ".gif", false ) || link.tqendsWith( ".gif", false )
|| link.endsWith( ".png", false ) || link.tqendsWith( ".png", false )
|| link.endsWith( ".bmp", false ) ) || link.tqendsWith( ".bmp", false ) )
link += LCHMUrlFactory::getInternalUriExtension(); link += LCHMUrlFactory::getInternalUriExtension();
} }
KQPopupMenu * KCHMViewWindow::createStandardContextMenu( QWidget * parent ) KTQPopupMenu * KCHMViewWindow::createStandardContextMenu( TQWidget * tqparent )
{ {
KQPopupMenu * contextMenu = new KQPopupMenu( parent ); KTQPopupMenu * contextMenu = new KTQPopupMenu( tqparent );
contextMenu->insertItem ( "&Copy", ::mainWindow, SLOT(slotBrowserCopy()) ); contextMenu->insertItem ( "&Copy", ::mainWindow, TQT_SLOT(slotBrowserCopy()) );
contextMenu->insertItem ( "&Select all", ::mainWindow, SLOT(slotBrowserSelectAll()) ); contextMenu->insertItem ( "&Select all", ::mainWindow, TQT_SLOT(slotBrowserSelectAll()) );
return contextMenu; return contextMenu;
} }
KQPopupMenu * KCHMViewWindow::getContextMenu( const QString & link, QWidget * parent ) KTQPopupMenu * KCHMViewWindow::getContextMenu( const TQString & link, TQWidget * tqparent )
{ {
if ( link.isNull() ) if ( link.isNull() )
{ {
// standard context menu // standard context menu
if ( !m_contextMenu ) if ( !m_contextMenu )
m_contextMenu = createStandardContextMenu( parent ); m_contextMenu = createStandardContextMenu( tqparent );
return m_contextMenu; return m_contextMenu;
} }
@ -168,12 +168,12 @@ KQPopupMenu * KCHMViewWindow::getContextMenu( const QString & link, QWidget * pa
// standard context menu // standard context menu
if ( !m_contextMenuLink ) if ( !m_contextMenuLink )
{ {
m_contextMenuLink = createStandardContextMenu( parent ); m_contextMenuLink = createStandardContextMenu( tqparent );
m_contextMenuLink->insertSeparator(); m_contextMenuLink->insertSeparator();
m_contextMenuLink->insertItem ( "&Open this link in a new tab", ::mainWindow, SLOT(slotOpenPageInNewTab()), QKeySequence("Shift+Enter") ); m_contextMenuLink->insertItem ( "&Open this link in a new tab", ::mainWindow, TQT_SLOT(slotOpenPageInNewTab()), TQKeySequence("Shift+Enter") );
m_contextMenuLink->insertItem ( "&Open this link in a new background tab", ::mainWindow, SLOT(slotOpenPageInNewBackgroundTab()), QKeySequence("Ctrl+Enter") ); m_contextMenuLink->insertItem ( "&Open this link in a new background tab", ::mainWindow, TQT_SLOT(slotOpenPageInNewBackgroundTab()), TQKeySequence("Ctrl+Enter") );
} }
setTabKeeper( link ); setTabKeeper( link );
@ -181,9 +181,9 @@ KQPopupMenu * KCHMViewWindow::getContextMenu( const QString & link, QWidget * pa
} }
} }
QString KCHMViewWindow::getTitle() const TQString KCHMViewWindow::getTitle() const
{ {
QString title = ::mainWindow->chmFile()->getTopicByUrl( m_openedPage ); TQString title = ::mainWindow->chmFile()->getTopicByUrl( m_openedPage );
if ( title.isEmpty() ) if ( title.isEmpty() )
title = m_openedPage; title = m_openedPage;
@ -247,7 +247,7 @@ void KCHMViewWindow::navigateHome( )
::mainWindow->openPage( ::mainWindow->chmFile()->homeUrl() ); ::mainWindow->openPage( ::mainWindow->chmFile()->homeUrl() );
} }
void KCHMViewWindow::addNavigationHistory( const QString & url, int scrollpos ) void KCHMViewWindow::addNavigationHistory( const TQString & url, int scrollpos )
{ {
// shred the 'forward' history // shred the 'forward' history
if ( m_historyCurrentPos < m_history.size() ) if ( m_historyCurrentPos < m_history.size() )
@ -274,30 +274,30 @@ void KCHMViewWindow::updateNavigationToolbar( )
if ( mainWindow ) if ( mainWindow )
{ {
mainWindow->navigationToolbar()->updateIconStatus( mainWindow->navigationToolbar()->updateIcontqStatus(
m_historyCurrentPos > 0, m_historyCurrentPos > 0,
m_historyCurrentPos < (m_history.size() - 1) ); m_historyCurrentPos < (m_history.size() - 1) );
} }
} }
KQPopupMenu * KCHMViewWindow::createListItemContextMenu( QWidget * w ) KTQPopupMenu * KCHMViewWindow::createListItemContextMenu( TQWidget * w )
{ {
KQPopupMenu * contextMenu = new KQPopupMenu( w ); KTQPopupMenu * contextMenu = new KTQPopupMenu( w );
contextMenu->insertItem ( "&Open this link in a new tab", contextMenu->insertItem ( "&Open this link in a new tab",
::mainWindow, ::mainWindow,
SLOT( slotOpenPageInNewTab() ), TQT_SLOT( slotOpenPageInNewTab() ),
QKeySequence( "Shift+Enter" ) ); TQKeySequence( "Shift+Enter" ) );
contextMenu->insertItem ( "&Open this link in a new background tab", contextMenu->insertItem ( "&Open this link in a new background tab",
::mainWindow, ::mainWindow,
SLOT( slotOpenPageInNewBackgroundTab() ), TQT_SLOT( slotOpenPageInNewBackgroundTab() ),
QKeySequence( "Ctrl+Enter" ) ); TQKeySequence( "Ctrl+Enter" ) );
return contextMenu; return contextMenu;
} }
void KCHMViewWindow::setTabKeeper( const QString & link ) void KCHMViewWindow::setTabKeeper( const TQString & link )
{ {
// If we clicked on relative link, make sure we convert it to absolute right now, // If we clicked on relative link, make sure we convert it to absolute right now,
// because later we will not have access to this view window variables // because later we will not have access to this view window variables
@ -305,8 +305,8 @@ void KCHMViewWindow::setTabKeeper( const QString & link )
if ( m_newTabLinkKeeper[0] == '#' && !m_openedPage.isEmpty() ) if ( m_newTabLinkKeeper[0] == '#' && !m_openedPage.isEmpty() )
{ {
// Clean up opened page URL // Clean up opened page URL
int pos = m_openedPage.find ('#'); int pos = m_openedPage.tqfind ('#');
QString fixedpath = pos == -1 ? m_openedPage : m_openedPage.left (pos); TQString fixedpath = pos == -1 ? m_openedPage : m_openedPage.left (pos);
m_newTabLinkKeeper = fixedpath + m_newTabLinkKeeper; m_newTabLinkKeeper = fixedpath + m_newTabLinkKeeper;
} }

@ -31,27 +31,27 @@
class KCHMViewWindow class KCHMViewWindow
{ {
public: public:
KCHMViewWindow ( QTabWidget * parent ); KCHMViewWindow ( TQTabWidget * tqparent );
virtual ~KCHMViewWindow(); virtual ~KCHMViewWindow();
//! Open a page from current chm archive //! Open a page from current chm archive
bool openUrl (const QString& url ); bool openUrl (const TQString& url );
QString getBaseUrl() const { return m_base_url; } TQString getBaseUrl() const { return m_base_url; }
QString getOpenedPage() const { return m_openedPage; } TQString getOpenedPage() const { return m_openedPage; }
QString getNewTabLink() const { return m_newTabLinkKeeper; } TQString getNewTabLink() const { return m_newTabLinkKeeper; }
QString makeURLabsolute ( const QString &url, bool set_as_base = true ); TQString makeURLabsolute ( const TQString &url, bool set_as_base = true );
public: public:
// virtual members, which should be implemented by viewers // virtual members, which should be implemented by viewers
//! Invalidate current view, doing all the cleanups etc. //! Invalidate current view, doing all the cleanups etc.
virtual void invalidate(); virtual void tqinvalidate();
//! Popups the print dialog, and prints the current page on the printer. //! Popups the print dialog, and prints the current page on the printer.
virtual bool printCurrentPage() = 0; virtual bool printCurrentPage() = 0;
//! Continues the find-in-page search forward or backward //! Continues the tqfind-in-page search forward or backward
virtual void searchWord( const QString & word, bool forward = true, bool casesensitive = false ) = 0; virtual void searchWord( const TQString & word, bool forward = true, bool casesensitive = false ) = 0;
//! Return current ZoomFactor. //! Return current ZoomFactor.
virtual int getZoomFactor() const = 0; virtual int getZoomFactor() const = 0;
@ -62,8 +62,8 @@ public:
//! Relatively changes ZoomFactor. Most common values are -1 and 1. //! Relatively changes ZoomFactor. Most common values are -1 and 1.
virtual void addZoomFactor (int value) = 0; virtual void addZoomFactor (int value) = 0;
virtual QObject * getQObject() = 0; virtual TQObject * getTQObject() = 0;
virtual QWidget * getQWidget() = 0; virtual TQWidget * getTQWidget() = 0;
/*! /*!
* Return current scrollbar position in view window. Saved on program exit. * Return current scrollbar position in view window. Saved on program exit.
@ -82,7 +82,7 @@ public:
virtual void clipCopy() = 0; virtual void clipCopy() = 0;
//! Returns the window title //! Returns the window title
virtual QString getTitle() const; virtual TQString getTitle() const;
//! Navigation stuff //! Navigation stuff
virtual void navigateBack(); virtual void navigateBack();
@ -91,15 +91,15 @@ public:
//! Navigation auxiliary stuff //! Navigation auxiliary stuff
virtual void setHistoryMaxSize (unsigned int size) { m_historyMaxSize = size; } virtual void setHistoryMaxSize (unsigned int size) { m_historyMaxSize = size; }
virtual void addNavigationHistory( const QString & url, int scrollpos ); virtual void addNavigationHistory( const TQString & url, int scrollpos );
virtual void updateNavigationToolbar(); virtual void updateNavigationToolbar();
/*! /*!
* Used by contents window (and probably by other windows in future) to show * Used by contents window (and probably by other windows in future) to show
* context menu in listviews. Put here to futher reuse code in index and search windows. * context menu in listviews. Put here to futher reuse code in index and search windows.
*/ */
KQPopupMenu * createListItemContextMenu ( QWidget * w ); KTQPopupMenu * createListItemContextMenu ( TQWidget * w );
void setTabKeeper ( const QString& link ); void setTabKeeper ( const TQString& link );
protected: /* signals */ protected: /* signals */
@ -108,49 +108,49 @@ protected: /* signals */
* If linkClicked() return false, the current page should NOT change. * If linkClicked() return false, the current page should NOT change.
* Otherwise it should be changed to the new link value. * Otherwise it should be changed to the new link value.
*/ */
virtual void signalLinkClicked ( const QString & newlink, bool& follow_link ) = 0; virtual void signalLinkClicked ( const TQString & newlink, bool& follow_link ) = 0;
protected: protected:
virtual bool openPage ( const QString& url ) = 0; virtual bool openPage ( const TQString& url ) = 0;
virtual void handleStartPageAsImage( QString& link ); virtual void handleStartPageAsImage( TQString& link );
KQPopupMenu * getContextMenu( const QString& link, QWidget * parent ); KTQPopupMenu * getContextMenu( const TQString& link, TQWidget * tqparent );
KQPopupMenu * createStandardContextMenu( QWidget * parent ); KTQPopupMenu * createStandardContextMenu( TQWidget * tqparent );
//! History //! History
class KCHMUrlHistory class KCHMUrlHistory
{ {
public: public:
KCHMUrlHistory() { scrollbarpos = 0; } KCHMUrlHistory() { scrollbarpos = 0; }
KCHMUrlHistory( const QString& _url, int _scrollbarpos ) KCHMUrlHistory( const TQString& _url, int _scrollbarpos )
: url(_url), scrollbarpos(_scrollbarpos) {}; : url(_url), scrollbarpos(_scrollbarpos) {};
const QString& getUrl() const { return url; } const TQString& getUrl() const { return url; }
int getScrollPosition() const { return scrollbarpos; } int getScrollPosition() const { return scrollbarpos; }
void setScrollPosition( int pos ) { scrollbarpos = pos; } void setScrollPosition( int pos ) { scrollbarpos = pos; }
private: private:
QString url; TQString url;
int scrollbarpos; int scrollbarpos;
}; };
unsigned int m_historyMaxSize; unsigned int m_historyMaxSize;
unsigned int m_historyCurrentPos; unsigned int m_historyCurrentPos;
QValueList<KCHMUrlHistory> m_history; TQValueList<KCHMUrlHistory> m_history;
KQPopupMenu * m_contextMenu; KTQPopupMenu * m_contextMenu;
KQPopupMenu * m_contextMenuLink; KTQPopupMenu * m_contextMenuLink;
// This member keeps a "open new tab" link between getContextMenu() call and appropriate // This member keeps a "open new tab" link between getContextMenu() call and appropriate
// slot call // slot call
QString m_newTabLinkKeeper; TQString m_newTabLinkKeeper;
QString m_openedPage; TQString m_openedPage;
QString m_lastOpenedPage; TQString m_lastOpenedPage;
QString m_base_url; TQString m_base_url;
QTabWidget * m_parentTabWidget; TQTabWidget * m_parentTabWidget;
}; };
#endif #endif

@ -19,10 +19,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qprinter.h> #include <tqprinter.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qsimplerichtext.h> #include <tqsimplerichtext.h>
#include <qpaintdevicemetrics.h> #include <tqpaintdevicemetrics.h>
#include "kde-qt.h" #include "kde-qt.h"
#include "kchmmainwindow.h" #include "kchmmainwindow.h"
@ -39,15 +39,15 @@
*/ */
#define KEEP_ALL_OPENED_DATA_IN_SOURCE_FACTORY #define KEEP_ALL_OPENED_DATA_IN_SOURCE_FACTORY
KCHMViewWindow_QTextBrowser::KCHMViewWindow_QTextBrowser( QTabWidget * parent ) KCHMViewWindow_QTextBrowser::KCHMViewWindow_QTextBrowser( TQTabWidget * tqparent )
: QTextBrowser ( parent ), KCHMViewWindow ( parent ) : TQTextBrowser ( tqparent ), KCHMViewWindow ( tqparent )
{ {
m_zoomfactor = 0; m_zoomfactor = 0;
m_sourcefactory = 0; m_sourcefactory = 0;
invalidate(); tqinvalidate();
setTextFormat ( Qt::RichText ); setTextFormat ( TQt::RichText );
connect( this, SIGNAL( linkClicked (const QString &) ), this, SLOT( slotLinkClicked(const QString &) ) ); connect( this, TQT_SIGNAL( linkClicked (const TQString &) ), this, TQT_SLOT( slotLinkClicked(const TQString &) ) );
} }
@ -56,7 +56,7 @@ KCHMViewWindow_QTextBrowser::~KCHMViewWindow_QTextBrowser()
delete m_sourcefactory; delete m_sourcefactory;
} }
bool KCHMViewWindow_QTextBrowser::openPage (const QString& url) bool KCHMViewWindow_QTextBrowser::openPage (const TQString& url)
{ {
// If we're using a memory saving scheme, we destroy MimeSourceFactory (including all the stored data) // If we're using a memory saving scheme, we destroy MimeSourceFactory (including all the stored data)
// when opening a new page. It saves some memory, but spends more time while looking for already loaded // when opening a new page. It saves some memory, but spends more time while looking for already loaded
@ -71,13 +71,13 @@ bool KCHMViewWindow_QTextBrowser::openPage (const QString& url)
return true; return true;
} }
void KCHMViewWindow_QTextBrowser::setSource ( const QString & name ) void KCHMViewWindow_QTextBrowser::setSource ( const TQString & name )
{ {
if ( m_allowSourceChange ) if ( m_allowSourceChange )
{ {
// Do URI decoding, qtextbrowser does stupid job. // Do URI decoding, qtextbrowser does stupid job.
QString fixedname = decodeUrl( name ); TQString fixedname = decodeUrl( name );
QTextBrowser::setSource (fixedname); TQTextBrowser::setSource (fixedname);
} }
else else
m_allowSourceChange = true; m_allowSourceChange = true;
@ -88,12 +88,12 @@ void KCHMViewWindow_QTextBrowser::setZoomFactor( int zoom )
m_zoomfactor = zoom; m_zoomfactor = zoom;
if ( zoom < 0 ) if ( zoom < 0 )
QTextBrowser::zoomOut( -zoom ); TQTextBrowser::zoomOut( -zoom );
else if ( zoom > 0 ) else if ( zoom > 0 )
QTextBrowser::zoomIn( zoom); TQTextBrowser::zoomIn( zoom);
} }
void KCHMViewWindow_QTextBrowser::invalidate( ) void KCHMViewWindow_QTextBrowser::tqinvalidate( )
{ {
delete m_sourcefactory; delete m_sourcefactory;
m_sourcefactory = new KCHMSourceFactory (this); m_sourcefactory = new KCHMSourceFactory (this);
@ -102,10 +102,10 @@ void KCHMViewWindow_QTextBrowser::invalidate( )
m_allowSourceChange = true; m_allowSourceChange = true;
m_searchLastIndex = 0; m_searchLastIndex = 0;
m_searchLastParagraph = 0; m_searchLastParagraph = 0;
m_searchText = QString::null; m_searchText = TQString();
reload(); reload();
KCHMViewWindow::invalidate( ); KCHMViewWindow::tqinvalidate( );
} }
int KCHMViewWindow_QTextBrowser::getScrollbarPosition( ) int KCHMViewWindow_QTextBrowser::getScrollbarPosition( )
@ -123,7 +123,7 @@ void KCHMViewWindow_QTextBrowser::addZoomFactor( int value )
setZoomFactor( value); setZoomFactor( value);
} }
void KCHMViewWindow_QTextBrowser::slotLinkClicked( const QString & newlink ) void KCHMViewWindow_QTextBrowser::slotLinkClicked( const TQString & newlink )
{ {
emit signalLinkClicked (newlink, m_allowSourceChange); emit signalLinkClicked (newlink, m_allowSourceChange);
} }
@ -131,44 +131,44 @@ void KCHMViewWindow_QTextBrowser::slotLinkClicked( const QString & newlink )
bool KCHMViewWindow_QTextBrowser::printCurrentPage( ) bool KCHMViewWindow_QTextBrowser::printCurrentPage( )
{ {
#if !defined (QT_NO_PRINTER) #if !defined (TQT_NO_PRINTER)
QPrinter printer( QPrinter::HighResolution ); TQPrinter printer( TQPrinter::HighResolution );
printer.setFullPage(TRUE); printer.setFullPage(TRUE);
if ( printer.setup( this ) ) if ( printer.setup( this ) )
{ {
QPainter p( &printer ); TQPainter p( &printer );
if( !p.isActive() ) // starting printing failed if( !p.isActive() ) // starting printing failed
return false; return false;
QPaintDeviceMetrics metrics(p.device()); TQPaintDeviceMetrics metrics(p.device());
int dpiy = metrics.logicalDpiY(); int dpiy = metrics.logicalDpiY();
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin ); TQRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
QSimpleRichText richText( text(), TQSimpleRichText richText( text(),
QFont(), TQFont(),
context(), context(),
styleSheet(), styleSheet(),
mimeSourceFactory(), mimeSourceFactory(),
body.height() ); body.height() );
richText.setWidth( &p, body.width() ); richText.setWidth( &p, body.width() );
QRect view( body ); TQRect view( body );
int page = 1; int page = 1;
do do
{ {
richText.draw( &p, body.left(), body.top(), view, colorGroup() ); richText.draw( &p, body.left(), body.top(), view, tqcolorGroup() );
view.moveBy( 0, body.height() ); view.moveBy( 0, body.height() );
p.translate( 0 , -body.height() ); p.translate( 0 , -body.height() );
p.drawText( view.right() - p.fontMetrics().width( QString::number(page) ), p.drawText( view.right() - p.fontMetrics().width( TQString::number(page) ),
view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page) ); view.bottom() + p.fontMetrics().ascent() + 5, TQString::number(page) );
if ( view.top() >= richText.height() ) if ( view.top() >= richText.height() )
break; break;
QString msg = i18n( "Printing (page %1)...") .arg(page); TQString msg = i18n( "Printing (page %1)...") .tqarg(page);
::mainWindow->showInStatusBar( msg ); ::mainWindow->showInStatusBar( msg );
printer.newPage(); printer.newPage();
@ -183,18 +183,18 @@ bool KCHMViewWindow_QTextBrowser::printCurrentPage( )
::mainWindow->showInStatusBar( i18n( "Printing aborted") ); ::mainWindow->showInStatusBar( i18n( "Printing aborted") );
return false; return false;
#else /* QT_NO_PRINTER */ #else /* TQT_NO_PRINTER */
QMessageBox::warning( this, TQMessageBox::warning( this,
i18n( "%1 - could not print") . arg(APP_NAME), i18n( "%1 - could not print") . arg(APP_NAME),
i18n( "Could not print.\nYour Qt library has been compiled without printing support"); i18n( "Could not print.\nYour TQt library has been compiled without printing support");
return false; return false;
#endif /* QT_NO_PRINTER */ #endif /* TQT_NO_PRINTER */
} }
void KCHMViewWindow_QTextBrowser::searchWord( const QString & word, bool forward, bool ) void KCHMViewWindow_QTextBrowser::searchWord( const TQString & word, bool forward, bool )
{ {
if ( m_searchText == word ) if ( m_searchText == word )
{ {
@ -207,7 +207,7 @@ void KCHMViewWindow_QTextBrowser::searchWord( const QString & word, bool forward
m_searchText = word; m_searchText = word;
} }
if ( find (m_searchText, false, false, forward, &m_searchLastParagraph, &m_searchLastIndex) ) if ( tqfind (m_searchText, false, false, forward, &m_searchLastParagraph, &m_searchLastIndex) )
::mainWindow->showInStatusBar( i18n( "Search failed") ); ::mainWindow->showInStatusBar( i18n( "Search failed") );
} }
@ -222,15 +222,15 @@ void KCHMViewWindow_QTextBrowser::clipCopy( )
} }
// Shamelessly stolen from Qt // Shamelessly stolen from TQt
QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input ) TQString KCHMViewWindow_QTextBrowser::decodeUrl( const TQString &input )
{ {
QString temp; TQString temp;
int i = 0; int i = 0;
int len = input.length(); int len = input.length();
int a, b; int a, b;
QChar c; TQChar c;
while (i < len) while (i < len)
{ {
c = input[i]; c = input[i];
@ -247,7 +247,7 @@ QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input )
else if (b >= 'a' && b <= 'f') b = b - 'a' + 10; else if (b >= 'a' && b <= 'f') b = b - 'a' + 10;
else if (b >= 'A' && b <= 'F') b = b - 'A' + 10; else if (b >= 'A' && b <= 'F') b = b - 'A' + 10;
temp.append( (QChar)((a << 4) | b ) ); temp.append( (TQChar)((a << 4) | b ) );
} }
else else
{ {
@ -260,9 +260,9 @@ QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input )
return temp; return temp;
} }
QPopupMenu * KCHMViewWindow_QTextBrowser::createPopupMenu( const QPoint & pos ) TQPopupMenu * KCHMViewWindow_QTextBrowser::createPopupMenu( const TQPoint & pos )
{ {
KQPopupMenu * menu = getContextMenu( anchorAt( pos ), this ); KTQPopupMenu * menu = getContextMenu( anchorAt( pos ), this );
menu->exec( mapToGlobal( contentsToViewport( pos ) ) ); menu->exec( mapToGlobal( contentsToViewport( pos ) ) );
return 0; return 0;
} }

@ -19,8 +19,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#ifndef KCHMVIEWWINDOW_QTEXTBROWSER_H #ifndef KCHMVIEWWINDOW_TQTEXTBROWSER_H
#define KCHMVIEWWINDOW_QTEXTBROWSER_H #define KCHMVIEWWINDOW_TQTEXTBROWSER_H
#include "kde-qt.h" #include "kde-qt.h"
@ -30,18 +30,19 @@
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
class KCHMViewWindow_QTextBrowser : public QTextBrowser, public KCHMViewWindow class KCHMViewWindow_QTextBrowser : public TQTextBrowser, public KCHMViewWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMViewWindow_QTextBrowser( QTabWidget * parent ); KCHMViewWindow_QTextBrowser( TQTabWidget * tqparent );
~KCHMViewWindow_QTextBrowser(); ~KCHMViewWindow_QTextBrowser();
//! Open a page from current chm archive //! Open a page from current chm archive
virtual bool openPage (const QString& url); virtual bool openPage (const TQString& url);
//! Invalidate current view, doing all the cleanups etc. //! Invalidate current view, doing all the cleanups etc.
virtual void invalidate(); virtual void tqinvalidate();
//! Return current ZoomFactor. //! Return current ZoomFactor.
virtual int getZoomFactor() const { return m_zoomfactor; } virtual int getZoomFactor() const { return m_zoomfactor; }
@ -55,8 +56,8 @@ public:
//! Popups the print dialog, and prints the current page on the printer. //! Popups the print dialog, and prints the current page on the printer.
virtual bool printCurrentPage(); virtual bool printCurrentPage();
//! Initiates the find-in-page search, if succeed, cursor moved to the first entry //! Initiates the tqfind-in-page search, if succeed, cursor moved to the first entry
virtual void searchWord( const QString & word, bool forward = true, bool casesensitive = false ); virtual void searchWord( const TQString & word, bool forward = true, bool casesensitive = false );
//! Select the content of the whole page //! Select the content of the whole page
virtual void clipSelectAll(); virtual void clipSelectAll();
@ -74,10 +75,10 @@ public:
//! Sets the scrollbar position. //! Sets the scrollbar position.
virtual void setScrollbarPosition(int pos); virtual void setScrollbarPosition(int pos);
virtual QObject * getQObject() { return this; } virtual TQObject * getTQObject() { return TQT_TQOBJECT(this); }
virtual QWidget * getQWidget() { return this; } virtual TQWidget * getTQWidget() { return TQT_TQWIDGET(this); }
static QString decodeUrl( const QString &url ); static TQString decodeUrl( const TQString &url );
signals: signals:
/*! /*!
@ -85,23 +86,23 @@ signals:
* If signalLinkClicked() sets follow_link to false, the current page should NOT change. * If signalLinkClicked() sets follow_link to false, the current page should NOT change.
* Otherwise it should be changed to the new link value. * Otherwise it should be changed to the new link value.
*/ */
void signalLinkClicked ( const QString & newlink, bool& follow_link ); void signalLinkClicked ( const TQString & newlink, bool& follow_link );
private slots: private slots:
virtual void slotLinkClicked (const QString & newlink); virtual void slotLinkClicked (const TQString & newlink);
private: private:
QPopupMenu * createPopupMenu ( const QPoint & pos ); TQPopupMenu * createPopupMenu ( const TQPoint & pos );
void setSource ( const QString & name ); void setSource ( const TQString & name );
int m_zoomfactor; int m_zoomfactor;
bool m_allowSourceChange; bool m_allowSourceChange;
int m_searchLastIndex; int m_searchLastIndex;
int m_searchLastParagraph; int m_searchLastParagraph;
QString m_searchText; TQString m_searchText;
KCHMSourceFactory * m_sourcefactory; KCHMSourceFactory * m_sourcefactory;
}; };
#endif /* KCHMVIEWWINDOW_QTEXTBROWSER_H */ #endif /* KCHMVIEWWINDOW_TQTEXTBROWSER_H */

@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qaccel.h> #include <tqaccel.h>
#include "kchmconfig.h" #include "kchmconfig.h"
#include "kchmmainwindow.h" #include "kchmmainwindow.h"
@ -34,22 +34,22 @@
#endif #endif
KCHMViewWindowMgr::KCHMViewWindowMgr( QWidget *parent ) KCHMViewWindowMgr::KCHMViewWindowMgr( TQWidget *tqparent )
: QTabWidget( parent ) //QTabWidget : TQTabWidget( tqparent ) //TQTabWidget
{ {
m_MenuWindow = 0; m_MenuWindow = 0;
// on current tab changed // on current tab changed
connect( this, SIGNAL( currentChanged(QWidget *) ), this, SLOT( onTabChanged(QWidget *) ) ); connect( this, TQT_SIGNAL( currentChanged(TQWidget *) ), this, TQT_SLOT( onTabChanged(TQWidget *) ) );
// Create an iconset for the button // Create an iconset for the button
QIconSet iset( *gIconStorage.getCloseWindowIcon() ); TQIconSet iset( *gIconStorage.getCloseWindowIcon() );
// Create a pushbutton // Create a pushbutton
m_closeButton = new QPushButton( iset, QString::null, this ); m_closeButton = new TQPushButton( iset, TQString(), this );
m_closeButton->setFlat( true ); m_closeButton->setFlat( true );
m_closeButton->setEnabled( false ); m_closeButton->setEnabled( false );
connect( m_closeButton, SIGNAL( clicked() ), this, SLOT( closeCurrentWindow() ) ); connect( m_closeButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( closeCurrentWindow() ) );
setCornerWidget( m_closeButton, TopRight); setCornerWidget( m_closeButton, TopRight);
} }
@ -58,20 +58,20 @@ KCHMViewWindowMgr::~KCHMViewWindowMgr( )
{ {
} }
void KCHMViewWindowMgr::createMenu( KCHMMainWindow * parent ) void KCHMViewWindowMgr::createMenu( KCHMMainWindow * tqparent )
{ {
// Create the approptiate menu entries in 'View' main menu // Create the approptiate menu entries in 'View' main menu
m_MenuWindow = new KQPopupMenu( parent ); m_MenuWindow = new KTQPopupMenu( tqparent );
parent->menuBar()->insertItem( i18n( "&Window"), m_MenuWindow ); tqparent->menuBar()->insertItem( i18n( "&Window"), m_MenuWindow );
m_menuIdClose = m_MenuWindow->insertItem( i18n( "&Close"), this, SLOT( closeCurrentWindow()), CTRL+Key_W ); m_menuIdClose = m_MenuWindow->insertItem( i18n( "&Close"), this, TQT_SLOT( closeCurrentWindow()), CTRL+Key_W );
m_MenuWindow->insertSeparator(); m_MenuWindow->insertSeparator();
//connect( m_MenuWindow, SIGNAL( activated(int) ), this, SLOT ( onCloseWindow(int) )); //connect( m_MenuWindow, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( onCloseWindow(int) ));
connect( m_MenuWindow, SIGNAL( activated(int) ), this, SLOT ( onActiveWindow(int) )); connect( m_MenuWindow, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( onActiveWindow(int) ));
} }
void KCHMViewWindowMgr::invalidate() void KCHMViewWindowMgr::tqinvalidate()
{ {
deleteAllWindows(); deleteAllWindows();
addNewTab( true ); addNewTab( true );
@ -80,10 +80,10 @@ void KCHMViewWindowMgr::invalidate()
KCHMViewWindow * KCHMViewWindowMgr::current() KCHMViewWindow * KCHMViewWindowMgr::current()
{ {
QWidget * w = currentPage(); TQWidget * w = currentPage();
WindowsIterator it; WindowsIterator it;
if ( !w || (it = m_Windows.find( w )) == m_Windows.end() ) if ( !w || (it = m_Windows.tqfind( w )) == m_Windows.end() )
qFatal( "KCHMViewWindowMgr::current called without any windows!" ); qFatal( "KCHMViewWindowMgr::current called without any windows!" );
return it.data().window; return it.data().window;
@ -94,13 +94,13 @@ KCHMViewWindow * KCHMViewWindowMgr::addNewTab( bool set_active )
KCHMViewWindow * viewvnd; KCHMViewWindow * viewvnd;
#if defined (USE_KDE) #if defined (USE_KDE)
if ( !appConfig.m_kdeUseQTextBrowser ) if ( !appConfig.m_kdeUseTQTextBrowser )
viewvnd = new KCHMViewWindow_KHTMLPart( this ); viewvnd = new KCHMViewWindow_KHTMLPart( this );
else else
#endif #endif
viewvnd = new KCHMViewWindow_QTextBrowser( this ); viewvnd = new KCHMViewWindow_QTextBrowser( this );
QWidget * widget = viewvnd->getQWidget(); TQWidget * widget = viewvnd->getTQWidget();
m_Windows[widget].window = viewvnd; m_Windows[widget].window = viewvnd;
m_Windows[widget].menuitem = 0; m_Windows[widget].menuitem = 0;
m_Windows[widget].widget = widget; m_Windows[widget].widget = widget;
@ -114,7 +114,7 @@ KCHMViewWindow * KCHMViewWindowMgr::addNewTab( bool set_active )
showPage( widget ); showPage( widget );
// Handle clicking on link in browser window // Handle clicking on link in browser window
connect( viewvnd->getQObject(), SIGNAL( signalLinkClicked (const QString &, bool &) ), ::mainWindow, SLOT( slotLinkClicked(const QString &, bool &) ) ); connect( viewvnd->getTQObject(), TQT_SIGNAL( signalLinkClicked (const TQString &, bool &) ), ::mainWindow, TQT_SLOT( slotLinkClicked(const TQString &, bool &) ) );
return viewvnd; return viewvnd;
} }
@ -128,18 +128,18 @@ void KCHMViewWindowMgr::deleteAllWindows( )
void KCHMViewWindowMgr::setTabName( KCHMViewWindow * window ) void KCHMViewWindowMgr::setTabName( KCHMViewWindow * window )
{ {
WindowsIterator it = m_Windows.find( window->getQWidget() ); WindowsIterator it = m_Windows.tqfind( window->getTQWidget() );
if ( it == m_Windows.end() ) if ( it == m_Windows.end() )
qFatal( "KCHMViewWindowMgr::setTabName called with unknown window!" ); qFatal( "KCHMViewWindowMgr::setTabName called with unknown window!" );
QString title = window->getTitle(); TQString title = window->getTitle();
// Trim too long string // Trim too long string
if ( title.length() > 25 ) if ( title.length() > 25 )
title = title.left( 22 ) + "..."; title = title.left( 22 ) + "...";
setTabLabel( window->getQWidget(), title ); setTabLabel( window->getTQWidget(), title );
if ( it.data().menuitem == 0 ) if ( it.data().menuitem == 0 )
{ {
@ -154,14 +154,14 @@ void KCHMViewWindowMgr::setTabName( KCHMViewWindow * window )
else else
menuid = m_Windows.size(); menuid = m_Windows.size();
QString menutitle = "&" + QString::number(menuid) + " " + title; TQString menutitle = "&" + TQString::number(menuid) + " " + title;
it.data().menuitem = menuid; it.data().menuitem = menuid;
m_MenuWindow->insertItem(menutitle, menuid); m_MenuWindow->insertItem(menutitle, menuid);
updateTabAccel(); updateTabAccel();
} }
else else
{ {
QString menutitle = "&" + QString::number(it.data().menuitem) + " " + title; TQString menutitle = "&" + TQString::number(it.data().menuitem) + " " + title;
m_MenuWindow->changeItem( it.data().menuitem, menutitle ); m_MenuWindow->changeItem( it.data().menuitem, menutitle );
} }
@ -174,10 +174,10 @@ void KCHMViewWindowMgr::closeCurrentWindow( )
if ( m_Windows.size() == 1 ) if ( m_Windows.size() == 1 )
return; return;
QWidget * w = currentPage(); TQWidget * w = currentPage();
WindowsIterator it; WindowsIterator it;
if ( !w || (it = m_Windows.find( w )) == m_Windows.end() ) if ( !w || (it = m_Windows.tqfind( w )) == m_Windows.end() )
qFatal( "KCHMViewWindowMgr::closeCurrentWindow called without any windows!" ); qFatal( "KCHMViewWindowMgr::closeCurrentWindow called without any windows!" );
closeWindow( it.data() ); closeWindow( it.data() );
@ -185,7 +185,7 @@ void KCHMViewWindowMgr::closeCurrentWindow( )
void KCHMViewWindowMgr::closeWindow( const tab_window_t & tab ) void KCHMViewWindowMgr::closeWindow( const tab_window_t & tab )
{ {
WindowsIterator it = m_Windows.find( tab.widget ); WindowsIterator it = m_Windows.tqfind( tab.widget );
if ( it == m_Windows.end() ) if ( it == m_Windows.end() )
qFatal( "KCHMViewWindowMgr::closeWindow called with unknown widget!" ); qFatal( "KCHMViewWindowMgr::closeWindow called with unknown widget!" );
@ -224,7 +224,7 @@ void KCHMViewWindowMgr::onActiveWindow(int id)
if ( it.data().menuitem != id ) if ( it.data().menuitem != id )
continue; continue;
QWidget *widget = it.data().widget; TQWidget *widget = it.data().widget;
showPage(widget); showPage(widget);
break; break;
} }
@ -252,8 +252,8 @@ void KCHMViewWindowMgr::saveSettings( KCHMSettings::viewindow_saved_settings_t &
for ( int i = 0; i < count(); i++ ) for ( int i = 0; i < count(); i++ )
{ {
QWidget * p = page( i ); TQWidget * p = page( i );
WindowsIterator it = m_Windows.find( p ); WindowsIterator it = m_Windows.tqfind( p );
if ( it == m_Windows.end() ) if ( it == m_Windows.end() )
qFatal( "KCHMViewWindowMgr::saveSettings: could not find widget!" ); qFatal( "KCHMViewWindowMgr::saveSettings: could not find widget!" );
@ -272,9 +272,9 @@ void KCHMViewWindowMgr::updateCloseButtons( )
m_closeButton->setEnabled( m_Windows.size() > 1 ); m_closeButton->setEnabled( m_Windows.size() > 1 );
} }
void KCHMViewWindowMgr::onTabChanged( QWidget * newtab ) void KCHMViewWindowMgr::onTabChanged( TQWidget * newtab )
{ {
WindowsIterator it = m_Windows.find( newtab ); WindowsIterator it = m_Windows.tqfind( newtab );
if ( it == m_Windows.end() ) if ( it == m_Windows.end() )
qFatal( "KCHMViewWindowMgr::onTabChanged called with unknown widget!" ); qFatal( "KCHMViewWindowMgr::onTabChanged called with unknown widget!" );
@ -304,7 +304,7 @@ void KCHMViewWindowMgr::updateTabAccel()
} }
} }
QKeySequence KCHMViewWindowMgr::key(int i) TQKeySequence KCHMViewWindowMgr::key(int i)
{ {
switch (i) switch (i)
{ {

@ -26,13 +26,14 @@
#include "forwarddeclarations.h" #include "forwarddeclarations.h"
#include "kchmsettings.h" #include "kchmsettings.h"
#include <qvaluevector.h> #include <tqvaluevector.h>
class KCHMViewWindowMgr : public QTabWidget class KCHMViewWindowMgr : public TQTabWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMViewWindowMgr( QWidget *parent = 0 ); KCHMViewWindowMgr( TQWidget *tqparent = 0 );
~KCHMViewWindowMgr( ); ~KCHMViewWindowMgr( );
// Returns a handle to a currently viewed window. // Returns a handle to a currently viewed window.
@ -45,10 +46,10 @@ class KCHMViewWindowMgr : public QTabWidget
// Sets the tab name and updates Windows menu // Sets the tab name and updates Windows menu
void setTabName( KCHMViewWindow* window ); void setTabName( KCHMViewWindow* window );
void invalidate(); void tqinvalidate();
// Creates a Window menu // Creates a Window menu
void createMenu( KCHMMainWindow * parent ); void createMenu( KCHMMainWindow * tqparent );
// Saves and restores current settings between sessions // Saves and restores current settings between sessions
void restoreSettings( const KCHMSettings::viewindow_saved_settings_t& settings ); void restoreSettings( const KCHMSettings::viewindow_saved_settings_t& settings );
@ -58,7 +59,7 @@ class KCHMViewWindowMgr : public QTabWidget
void closeCurrentWindow(); void closeCurrentWindow();
protected slots: protected slots:
void onTabChanged( QWidget * newtab ); void onTabChanged( TQWidget * newtab );
void onCloseWindow( int id ); void onCloseWindow( int id );
void onActiveWindow( int id ); void onActiveWindow( int id );
void updateCloseButtons(); void updateCloseButtons();
@ -66,7 +67,7 @@ class KCHMViewWindowMgr : public QTabWidget
private: private:
typedef struct typedef struct
{ {
QWidget * widget; TQWidget * widget;
KCHMViewWindow * window; KCHMViewWindow * window;
int menuitem; int menuitem;
} tab_window_t; } tab_window_t;
@ -74,16 +75,16 @@ class KCHMViewWindowMgr : public QTabWidget
void closeWindow( const tab_window_t& tab ); void closeWindow( const tab_window_t& tab );
void deleteAllWindows(); void deleteAllWindows();
void updateTabAccel(); void updateTabAccel();
QKeySequence key(int); TQKeySequence key(int);
QMap<QWidget*,tab_window_t> m_Windows; TQMap<TQWidget*,tab_window_t> m_Windows;
typedef QMap<QWidget*,tab_window_t>::iterator WindowsIterator; typedef TQMap<TQWidget*,tab_window_t>::iterator WindowsIterator;
QValueList<int> m_idSlot; TQValueList<int> m_idSlot;
typedef QValueList<int>::iterator IdIterator; typedef TQValueList<int>::iterator IdIterator;
QPushButton * m_closeButton; TQPushButton * m_closeButton;
KQPopupMenu * m_MenuWindow; KTQPopupMenu * m_MenuWindow;
int m_menuIdClose; int m_menuIdClose;
}; };

@ -22,17 +22,17 @@
#include "kde-qt.h" #include "kde-qt.h"
#if defined (USE_KDE) #if defined (USE_KDE)
KQListView::KQListView( QWidget * parent, const char * name, int ) KQListView::KQListView( TQWidget * tqparent, const char * name, int )
: KListView (parent, name) : KListView (tqparent, name)
#else #else
KQListView::KQListView( QWidget * parent, const char * name, int f ) KQListView::KQListView( TQWidget * tqparent, const char * name, int f )
: QListView (parent, name, f) : TQListView (tqparent, name, f)
#endif #endif
{ {
} }
#if defined (USE_KDE) #if defined (USE_KDE)
KQProgressModalDialog::KQProgressModalDialog ( const QString & captionText, const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator ) KTQProgressModalDialog::KTQProgressModalDialog ( const TQString & captionText, const TQString & labelText, const TQString & cancelButtonText, int totalSteps, TQWidget * creator )
: KProgressDialog( creator, 0, captionText, labelText, true ) : KProgressDialog( creator, 0, captionText, labelText, true )
{ {
setAllowCancel( true ); setAllowCancel( true );
@ -43,8 +43,8 @@ KQProgressModalDialog::KQProgressModalDialog ( const QString & captionText, cons
setMinimumDuration( 1 ); setMinimumDuration( 1 );
} }
#else #else
KQProgressModalDialog::KQProgressModalDialog ( const QString & captionText, const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator ) KTQProgressModalDialog::KTQProgressModalDialog ( const TQString & captionText, const TQString & labelText, const TQString & cancelButtonText, int totalSteps, TQWidget * creator )
: QProgressDialog( labelText, cancelButtonText, totalSteps, creator, 0, false ) : TQProgressDialog( labelText, cancelButtonText, totalSteps, creator, 0, false )
{ {
setCaption( captionText ); setCaption( captionText );
setMinimumDuration( 1 ); setMinimumDuration( 1 );

@ -19,15 +19,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#ifndef KDE_QT_H #ifndef KDE_TQT_H
#define KDE_QT_H #define KDE_TQT_H
#include "config.h" #include "config.h"
#if defined (USE_KDE) #if defined (USE_KDE)
#define KQ_CLASSNAME(name) K##name #define KTQ_CLASSNAME(name) K##name
#define KQ_DECLARECLASS(name) class KQ##name : public K##name #define KTQ_DECLARECLASS(name) class KQ##name : public K##name
#include <kapplication.h> #include <kapplication.h>
#include <kmainwindow.h> #include <kmainwindow.h>
@ -46,63 +46,63 @@
#else /* !USE_KDE */ #else /* !USE_KDE */
#define KQ_CLASSNAME(name) Q##name #define KTQ_CLASSNAME(name) Q##name
#include <qapplication.h> #include <tqapplication.h>
#include <qmainwindow.h> #include <tqmainwindow.h>
#include <qstring.h> #include <tqstring.h>
#include <qstatusbar.h> #include <statusbar.h>
#include <qlistview.h> #include <tqlistview.h>
#include <qfiledialog.h> #include <tqfiledialog.h>
#include <qmenubar.h> #include <tqmenubar.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <qprogressdialog.h> #include <tqprogressdialog.h>
#define i18n(A) tr(A) #define i18n(A) tr(A)
#endif /* USE_KDE */ #endif /* USE_KDE */
/* common non-wrapped UI classes */ /* common non-wrapped UI classes */
#include <qsplitter.h> #include <tqsplitter.h>
#include <qtoolbutton.h> #include <tqtoolbutton.h>
#include <qheader.h> #include <tqheader.h>
#include <qtextbrowser.h> #include <tqtextbrowser.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
/* common utility classes */ /* common utility classes */
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qstring.h> #include <tqstring.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <qfile.h> #include <tqfile.h>
#include <qdir.h> #include <tqdir.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qmap.h> #include <tqmap.h>
#include <qeventloop.h> #include <tqeventloop.h>
class KQMainWindow : public KQ_CLASSNAME(MainWindow) class KQMainWindow : public KTQ_CLASSNAME(MainWindow)
{ {
public: public:
KQMainWindow ( QWidget * parent, const char * name, WFlags f ) KQMainWindow ( TQWidget * tqparent, const char * name, WFlags f )
: KQ_CLASSNAME(MainWindow) (parent, name, f) {}; : KTQ_CLASSNAME(MainWindow) (tqparent, name, f) {};
}; };
class KQListView : public KQ_CLASSNAME(ListView) class KQListView : public KTQ_CLASSNAME(ListView)
{ {
public: public:
KQListView(QWidget *parent = 0, const char *name = 0, int f = 0); KQListView(TQWidget *tqparent = 0, const char *name = 0, int f = 0);
}; };
class KQProgressModalDialog : public KQ_CLASSNAME(ProgressDialog) class KTQProgressModalDialog : public KTQ_CLASSNAME(ProgressDialog)
{ {
public: public:
KQProgressModalDialog ( const QString & captionText, const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator = 0 ); KTQProgressModalDialog ( const TQString & captionText, const TQString & labelText, const TQString & cancelButtonText, int totalSteps, TQWidget * creator = 0 );
// Seems like people have fun making classes incompatible // Seems like people have fun making classes incompatible
#if defined (USE_KDE) #if defined (USE_KDE)
@ -113,36 +113,36 @@ class KQProgressModalDialog : public KQ_CLASSNAME(ProgressDialog)
#endif #endif
}; };
class KQTabWidget : public KQ_CLASSNAME(TabWidget) class KTQTabWidget : public KTQ_CLASSNAME(TabWidget)
{ {
public: public:
KQTabWidget (QWidget *parent = 0, const char *name = 0, int f = 0) KTQTabWidget (TQWidget *tqparent = 0, const char *name = 0, int f = 0)
: KQ_CLASSNAME(TabWidget) (parent, name, f) {}; : KTQ_CLASSNAME(TabWidget) (tqparent, name, f) {};
}; };
class KQPopupMenu : public KQ_CLASSNAME(PopupMenu) class KTQPopupMenu : public KTQ_CLASSNAME(PopupMenu)
{ {
public: public:
KQPopupMenu (QWidget *parent = 0 ) KTQPopupMenu (TQWidget *tqparent = 0 )
: KQ_CLASSNAME(PopupMenu) (parent) {}; : KTQ_CLASSNAME(PopupMenu) (tqparent) {};
}; };
#include <qinputdialog.h> #include <tqinputdialog.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qtextedit.h> #include <tqtextedit.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qtooltip.h> #include <tqtooltip.h>
class KCHMShowWaitCursor class KCHMShowWaitCursor
{ {
public: public:
KCHMShowWaitCursor() { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); } KCHMShowWaitCursor() { TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); }
~KCHMShowWaitCursor() { QApplication::restoreOverrideCursor(); } ~KCHMShowWaitCursor() { TQApplication::restoreOverrideCursor(); }
}; };
#endif /* KDE_QT_H */ #endif /* KDE_TQT_H */

@ -26,8 +26,8 @@
#include "kchmsearchwindow.h" #include "kchmsearchwindow.h"
KCHMDCOPIface::KCHMDCOPIface(QObject *parent, const char *name) KCHMDCOPIface::KCHMDCOPIface(TQObject *tqparent, const char *name)
: QObject(parent, name), DCOPObject( "KCHMDCOPIface" ) : TQObject(tqparent, name), DCOPObject( "KCHMDCOPIface" )
{ {
} }
@ -37,50 +37,50 @@ KCHMDCOPIface::~KCHMDCOPIface()
} }
void KCHMDCOPIface::loadHelpFile( const QString & filename, const QString & page2open ) void KCHMDCOPIface::loadHelpFile( const TQString & filename, const TQString & page2open )
{ {
QStringList args; TQStringList args;
args.push_back( filename ); args.push_back( filename );
args.push_back( page2open ); args.push_back( page2open );
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "loadAndOpen", args ) ); tqApp->postEvent( ::mainWindow, new KCHMUserEvent( "loadAndOpen", args ) );
} }
void KCHMDCOPIface::openPage( const QString & page2open ) void KCHMDCOPIface::openPage( const TQString & page2open )
{ {
QStringList args; TQStringList args;
args.push_back( page2open ); args.push_back( page2open );
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "openPage", args ) ); tqApp->postEvent( ::mainWindow, new KCHMUserEvent( "openPage", args ) );
} }
void KCHMDCOPIface::guiFindInIndex( const QString & word ) void KCHMDCOPIface::guiFindInIndex( const TQString & word )
{ {
QStringList args; TQStringList args;
args.push_back( word ); args.push_back( word );
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "findInIndex", args ) ); tqApp->postEvent( ::mainWindow, new KCHMUserEvent( "findInIndex", args ) );
} }
void KCHMDCOPIface::guiSearchQuery( const QString & query ) void KCHMDCOPIface::guiSearchQuery( const TQString & query )
{ {
QStringList args; TQStringList args;
args.push_back( query ); args.push_back( query );
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "searchQuery", args ) ); tqApp->postEvent( ::mainWindow, new KCHMUserEvent( "searchQuery", args ) );
} }
QStringList KCHMDCOPIface::searchQuery( const QString & query ) TQStringList KCHMDCOPIface::searchQuery( const TQString & query )
{ {
QStringList results; TQStringList results;
if ( ::mainWindow->searchWindow()->searchQuery( query, &results ) ) if ( ::mainWindow->searchWindow()->searchQuery( query, &results ) )
return results; return results;
else else
return QStringList(); return TQStringList();
} }

@ -22,37 +22,38 @@
#ifndef KCHMDCOPIFACE_H #ifndef KCHMDCOPIFACE_H
#define KCHMDCOPIFACE_H #define KCHMDCOPIFACE_H
#include <qobject.h> #include <tqobject.h>
#include <dcopobject.h> #include <dcopobject.h>
#include <qstring.h> #include <tqstring.h>
#include <qstringlist.h> #include <tqstringlist.h>
class KCHMDCOPIface : public QObject, public DCOPObject class KCHMDCOPIface : public TQObject, public DCOPObject
{ {
Q_OBJECT Q_OBJECT
// TQ_OBJECT
K_DCOP K_DCOP
public: public:
KCHMDCOPIface( QObject *parent = 0, const char *name = 0 ); KCHMDCOPIface( TQObject *tqparent = 0, const char *name = 0 );
~KCHMDCOPIface(); ~KCHMDCOPIface();
k_dcop: k_dcop:
//! Loads a CHM file \a filename , and opens the URL \a url. Use URL "/" to open default homepage //! Loads a CHM file \a filename , and opens the URL \a url. Use URL "/" to open default homepage
void loadHelpFile( const QString& filename, const QString& url ); void loadHelpFile( const TQString& filename, const TQString& url );
//! Opens a specific \a url inside the loaded CHM file //! Opens a specific \a url inside the loaded CHM file
void openPage( const QString& url ); void openPage( const TQString& url );
//! Tries to find word in index, opening the index window and scrolling it there //! Tries to find word in index, opening the index window and scrolling it there
void guiFindInIndex( const QString& word ); void guiFindInIndex( const TQString& word );
//! Executes a search in GUI. \a query contains the complete search query. //! Executes a search in GUI. \a query contains the complete search query.
void guiSearchQuery( const QString& query ); void guiSearchQuery( const TQString& query );
//! Executes a search; GUI is not involved and user sees nothing. //! Executes a search; GUI is not involved and user sees nothing.
//! \a query contains the complete search query. //! \a query contains the complete search query.
//! Returns a list of URLs, or empty array if nothing os //! Returns a list of URLs, or empty array if nothing os
QStringList searchQuery( const QString& query ); TQStringList searchQuery( const TQString& query );
}; };
#endif #endif

@ -12,11 +12,11 @@
static const char* const KCHMDCOPIface_ftable[6][3] = { static const char* const KCHMDCOPIface_ftable[6][3] = {
{ "void", "loadHelpFile(QString,QString)", "loadHelpFile(QString filename,QString url)" }, { "void", "loadHelpFile(TQString,TQString)", "loadHelpFile(TQString filename,TQString url)" },
{ "void", "openPage(QString)", "openPage(QString url)" }, { "void", "openPage(TQString)", "openPage(TQString url)" },
{ "void", "guiFindInIndex(QString)", "guiFindInIndex(QString word)" }, { "void", "guiFindInIndex(TQString)", "guiFindInIndex(TQString word)" },
{ "void", "guiSearchQuery(QString)", "guiSearchQuery(QString query)" }, { "void", "guiSearchQuery(TQString)", "guiSearchQuery(TQString query)" },
{ "QStringList", "searchQuery(QString)", "searchQuery(QString query)" }, { TQSTRINGLIST_OBJECT_NAME_STRING, "searchQuery(TQString)", "searchQuery(TQString query)" },
{ 0, 0, 0 } { 0, 0, 0 }
}; };
static const int KCHMDCOPIface_ftable_hiddens[5] = { static const int KCHMDCOPIface_ftable_hiddens[5] = {
@ -27,46 +27,46 @@ static const int KCHMDCOPIface_ftable_hiddens[5] = {
0, 0,
}; };
bool KCHMDCOPIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) bool KCHMDCOPIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{ {
if ( fun == KCHMDCOPIface_ftable[0][1] ) { // void loadHelpFile(QString,QString) if ( fun == KCHMDCOPIface_ftable[0][1] ) { // void loadHelpFile(TQString,TQString)
QString arg0; TQString arg0;
QString arg1; TQString arg1;
QDataStream arg( data, IO_ReadOnly ); TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false; if (arg.atEnd()) return false;
arg >> arg0; arg >> arg0;
if (arg.atEnd()) return false; if (arg.atEnd()) return false;
arg >> arg1; arg >> arg1;
replyType = KCHMDCOPIface_ftable[0][0]; replyType = KCHMDCOPIface_ftable[0][0];
loadHelpFile(arg0, arg1 ); loadHelpFile(arg0, arg1 );
} else if ( fun == KCHMDCOPIface_ftable[1][1] ) { // void openPage(QString) } else if ( fun == KCHMDCOPIface_ftable[1][1] ) { // void openPage(TQString)
QString arg0; TQString arg0;
QDataStream arg( data, IO_ReadOnly ); TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false; if (arg.atEnd()) return false;
arg >> arg0; arg >> arg0;
replyType = KCHMDCOPIface_ftable[1][0]; replyType = KCHMDCOPIface_ftable[1][0];
openPage(arg0 ); openPage(arg0 );
} else if ( fun == KCHMDCOPIface_ftable[2][1] ) { // void guiFindInIndex(QString) } else if ( fun == KCHMDCOPIface_ftable[2][1] ) { // void guiFindInIndex(TQString)
QString arg0; TQString arg0;
QDataStream arg( data, IO_ReadOnly ); TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false; if (arg.atEnd()) return false;
arg >> arg0; arg >> arg0;
replyType = KCHMDCOPIface_ftable[2][0]; replyType = KCHMDCOPIface_ftable[2][0];
guiFindInIndex(arg0 ); guiFindInIndex(arg0 );
} else if ( fun == KCHMDCOPIface_ftable[3][1] ) { // void guiSearchQuery(QString) } else if ( fun == KCHMDCOPIface_ftable[3][1] ) { // void guiSearchQuery(TQString)
QString arg0; TQString arg0;
QDataStream arg( data, IO_ReadOnly ); TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false; if (arg.atEnd()) return false;
arg >> arg0; arg >> arg0;
replyType = KCHMDCOPIface_ftable[3][0]; replyType = KCHMDCOPIface_ftable[3][0];
guiSearchQuery(arg0 ); guiSearchQuery(arg0 );
} else if ( fun == KCHMDCOPIface_ftable[4][1] ) { // QStringList searchQuery(QString) } else if ( fun == KCHMDCOPIface_ftable[4][1] ) { // TQStringList searchQuery(TQString)
QString arg0; TQString arg0;
QDataStream arg( data, IO_ReadOnly ); TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false; if (arg.atEnd()) return false;
arg >> arg0; arg >> arg0;
replyType = KCHMDCOPIface_ftable[4][0]; replyType = KCHMDCOPIface_ftable[4][0];
QDataStream _replyStream( replyData, IO_WriteOnly ); TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << searchQuery(arg0 ); _replyStream << searchQuery(arg0 );
} else { } else {
return DCOPObject::process( fun, data, replyType, replyData ); return DCOPObject::process( fun, data, replyType, replyData );
@ -87,7 +87,7 @@ QCStringList KCHMDCOPIface::functions()
for ( int i = 0; KCHMDCOPIface_ftable[i][2]; i++ ) { for ( int i = 0; KCHMDCOPIface_ftable[i][2]; i++ ) {
if (KCHMDCOPIface_ftable_hiddens[i]) if (KCHMDCOPIface_ftable_hiddens[i])
continue; continue;
QCString func = KCHMDCOPIface_ftable[i][0]; TQCString func = KCHMDCOPIface_ftable[i][0];
func += ' '; func += ' ';
func += KCHMDCOPIface_ftable[i][2]; func += KCHMDCOPIface_ftable[i][2];
funcs << func; funcs << func;

@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qclipboard.h> #include <tqclipboard.h>
#include <khtmlview.h> #include <khtmlview.h>
#include <kfinddialog.h> #include <kfinddialog.h>
@ -32,25 +32,25 @@
#include "kchmviewwindow_khtmlpart.moc" #include "kchmviewwindow_khtmlpart.moc"
QWidget * KCHMViewWindow_KHTMLPart::getQWidget() TQWidget * KCHMViewWindow_KHTMLPart::getTQWidget()
{ {
return view(); return view();
} }
KCHMViewWindow_KHTMLPart::KCHMViewWindow_KHTMLPart( QTabWidget * parent ) KCHMViewWindow_KHTMLPart::KCHMViewWindow_KHTMLPart( TQTabWidget * tqparent )
: KHTMLPart ( parent ), KCHMViewWindow ( parent ) : KHTMLPart ( tqparent ), KCHMViewWindow ( tqparent )
{ {
m_zoomfactor = 0; m_zoomfactor = 0;
m_currentEncoding = 0; m_currentEncoding = 0;
m_searchForward = true; m_searchForward = true;
invalidate(); tqinvalidate();
connect( browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), connect( browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
this, SLOT ( onOpenURLRequest( const KURL &, const KParts::URLArgs & )) ); this, TQT_SLOT ( onOpenURLRequest( const KURL &, const KParts::URLArgs & )) );
connect( this, SIGNAL ( popupMenu ( const QString &, const QPoint &) ), connect( this, TQT_SIGNAL ( popupMenu ( const TQString &, const TQPoint &) ),
this, SLOT ( onPopupMenu ( const QString &, const QPoint &) ) ); this, TQT_SLOT ( onPopupMenu ( const TQString &, const TQPoint &) ) );
} }
@ -58,7 +58,7 @@ KCHMViewWindow_KHTMLPart::~KCHMViewWindow_KHTMLPart()
{ {
} }
bool KCHMViewWindow_KHTMLPart::openPage (const QString& url) bool KCHMViewWindow_KHTMLPart::openPage (const TQString& url)
{ {
// Set or change the encoding // Set or change the encoding
if ( m_currentEncoding != ::mainWindow->chmFile()->currentEncoding() ) if ( m_currentEncoding != ::mainWindow->chmFile()->currentEncoding() )
@ -67,7 +67,7 @@ bool KCHMViewWindow_KHTMLPart::openPage (const QString& url)
setEncoding ( m_currentEncoding->qtcodec, TRUE ); setEncoding ( m_currentEncoding->qtcodec, TRUE );
} }
QString fullurl = "ms-its:" + ::mainWindow->getOpenedFileName() + "::" + url; TQString fullurl = "ms-its:" + ::mainWindow->getOpenedFileName() + "::" + url;
openURL ( KURL(fullurl) ); openURL ( KURL(fullurl) );
return true; return true;
@ -81,18 +81,18 @@ void KCHMViewWindow_KHTMLPart::setZoomFactor( int zoom )
KHTMLPart::setZoomFactor ( 100 + (m_zoomfactor * 10) ); KHTMLPart::setZoomFactor ( 100 + (m_zoomfactor * 10) );
} }
void KCHMViewWindow_KHTMLPart::invalidate( ) void KCHMViewWindow_KHTMLPart::tqinvalidate( )
{ {
m_zoomfactor = 0; m_zoomfactor = 0;
m_searchForward = true; m_searchForward = true;
m_searchText = QString::null; m_searchText = TQString();
setJScriptEnabled ( appConfig.m_kdeEnableJS ); setJScriptEnabled ( appConfig.m_kdeEnableJS );
setJavaEnabled ( appConfig.m_kdeEnableJava ); setJavaEnabled ( appConfig.m_kdeEnableJava );
setMetaRefreshEnabled ( appConfig.m_kdeEnableRefresh ); setMetaRefreshEnabled ( appConfig.m_kdeEnableRefresh );
setPluginsEnabled ( appConfig.m_kdeEnablePlugins ); setPluginsEnabled ( appConfig.m_kdeEnablePlugins );
KCHMViewWindow::invalidate( ); KCHMViewWindow::tqinvalidate( );
} }
int KCHMViewWindow_KHTMLPart::getScrollbarPosition( ) int KCHMViewWindow_KHTMLPart::getScrollbarPosition( )
@ -116,7 +116,7 @@ bool KCHMViewWindow_KHTMLPart::printCurrentPage()
return true; return true;
} }
void KCHMViewWindow_KHTMLPart::searchWord( const QString & word, bool forward, bool ) void KCHMViewWindow_KHTMLPart::searchWord( const TQString & word, bool forward, bool )
{ {
if ( word != m_searchText || forward != m_searchForward ) if ( word != m_searchText || forward != m_searchForward )
{ {
@ -135,7 +135,7 @@ void KCHMViewWindow_KHTMLPart::onOpenURLRequest( const KURL & url, const KParts:
emit signalLinkClicked ( url.prettyURL(), sourcechange ); emit signalLinkClicked ( url.prettyURL(), sourcechange );
} }
void KCHMViewWindow_KHTMLPart::slotLinkClicked( const QString & newlink ) void KCHMViewWindow_KHTMLPart::slotLinkClicked( const TQString & newlink )
{ {
bool notused; bool notused;
emit signalLinkClicked (newlink, notused); emit signalLinkClicked (newlink, notused);
@ -149,15 +149,15 @@ void KCHMViewWindow_KHTMLPart::clipSelectAll()
void KCHMViewWindow_KHTMLPart::clipCopy() void KCHMViewWindow_KHTMLPart::clipCopy()
{ {
QString text = selectedText(); TQString text = selectedText();
if ( !text.isEmpty() ) if ( !text.isEmpty() )
QApplication::clipboard()->setText( text ); TQApplication::tqclipboard()->setText( text );
} }
void KCHMViewWindow_KHTMLPart::onPopupMenu ( const QString &url, const QPoint & point ) void KCHMViewWindow_KHTMLPart::onPopupMenu ( const TQString &url, const TQPoint & point )
{ {
KQPopupMenu * menu = getContextMenu( url, view() ); KTQPopupMenu * menu = getContextMenu( url, view() );
menu->exec( point ); menu->exec( point );
} }

@ -28,29 +28,33 @@
#include "kchmsourcefactory.h" #include "kchmsourcefactory.h"
#include "libchmtextencoding.h" #include "libchmtextencoding.h"
#ifdef Q_MOC_RUN
#define USE_KDE
#endif // Q_MOC_RUN
/** /**
@author Georgy Yunaev @author Georgy Yunaev
*/ */
/* /*
* For Qt-only version, we cannot compile KCHMViewWindow_KHTMLPart. However, * For TQt-only version, we cannot compile KCHMViewWindow_KHTMLPart. However,
* we cannot just exclude it, because it would not generate a MOC file for a KDE * we cannot just exclude it, because it would not generate a TQMOC file for a KDE
* version. Therefore we declare it, and compile the .moc file, but do not provide * version. Therefore we declare it, and compile the .tqmoc file, but do not provide
* the class methods. * the class methods.
*/ */
#if defined (USE_KDE) #if defined (USE_KDE)
class KCHMViewWindow_KHTMLPart : public KHTMLPart, public KCHMViewWindow class KCHMViewWindow_KHTMLPart : public KHTMLPart, public KCHMViewWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KCHMViewWindow_KHTMLPart( QTabWidget * parent ); KCHMViewWindow_KHTMLPart( TQTabWidget * tqparent );
~KCHMViewWindow_KHTMLPart(); ~KCHMViewWindow_KHTMLPart();
//! Open a page from current chm archive //! Open a page from current chm archive
virtual bool openPage (const QString& url); virtual bool openPage (const TQString& url);
//! Invalidate current view, doing all the cleanups etc. //! Invalidate current view, doing all the cleanups etc.
virtual void invalidate(); virtual void tqinvalidate();
//! Return current ZoomFactor. //! Return current ZoomFactor.
virtual int getZoomFactor() const { return m_zoomfactor; } virtual int getZoomFactor() const { return m_zoomfactor; }
@ -64,8 +68,8 @@ public:
//! Popups the print dialog, and prints the current page on the printer. //! Popups the print dialog, and prints the current page on the printer.
virtual bool printCurrentPage(); virtual bool printCurrentPage();
//! Initiates the find-in-page search, if succeed, cursor moved to the first entry //! Initiates the tqfind-in-page search, if succeed, cursor moved to the first entry
virtual void searchWord( const QString & word, bool forward = true, bool casesensitive = false ); virtual void searchWord( const TQString & word, bool forward = true, bool casesensitive = false );
//! Select the content of the whole page //! Select the content of the whole page
virtual void clipSelectAll(); virtual void clipSelectAll();
@ -83,8 +87,8 @@ public:
//! Sets the scrollbar position. //! Sets the scrollbar position.
virtual void setScrollbarPosition(int pos); virtual void setScrollbarPosition(int pos);
virtual QObject * getQObject() { return this; } virtual TQObject * getTQObject() { return this; }
virtual QWidget * getQWidget(); virtual TQWidget * getTQWidget();
signals: signals:
/*! /*!
@ -92,19 +96,19 @@ signals:
* If signalLinkClicked() sets follow_link to false, the current page should NOT change. * If signalLinkClicked() sets follow_link to false, the current page should NOT change.
* Otherwise it should be changed to the new link value. * Otherwise it should be changed to the new link value.
*/ */
void signalLinkClicked ( const QString & newlink, bool& follow_link ); void signalLinkClicked ( const TQString & newlink, bool& follow_link );
private slots: private slots:
virtual void slotLinkClicked ( const QString & newlink); virtual void slotLinkClicked ( const TQString & newlink);
virtual void onOpenURLRequest( const KURL &, const KParts::URLArgs & ); virtual void onOpenURLRequest( const KURL &, const KParts::URLArgs & );
virtual void onPopupMenu ( const QString & url, const QPoint & point ); virtual void onPopupMenu ( const TQString & url, const TQPoint & point );
private: private:
void setSource ( const QString & name ); void setSource ( const TQString & name );
int m_zoomfactor; int m_zoomfactor;
bool m_searchForward; bool m_searchForward;
QString m_searchText; TQString m_searchText;
const LCHMTextEncoding * m_currentEncoding; const LCHMTextEncoding * m_currentEncoding;
}; };

@ -22,14 +22,14 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
static bool run_process( const QString& command, const QString& filename ) static bool run_process( const TQString& command, const TQString& filename )
{ {
QString safefilename = filename; TQString safefilename = filename;
QString preparedcommand = command; TQString preparedcommand = command;
// To be safe, URL should contain no quotes, apostrofes and \0 symbols // To be safe, URL should contain no quotes, apostrofes and \0 symbols
safefilename.remove (QRegExp ("['\"\0]")); safefilename.remove (TQRegExp ("['\"\0]"));
preparedcommand.replace( "%s", safefilename ); preparedcommand.tqreplace( "%s", safefilename );
// And run an external command with fork()s // And run an external command with fork()s
switch ( fork() ) switch ( fork() )
@ -39,12 +39,12 @@ static bool run_process( const QString& command, const QString& filename )
case 0: // child case 0: // child
if ( fork() != 0 ) if ( fork() != 0 )
exit(0); // exit immediately - our child is now has init as his parent exit(0); // exit immediately - our child is now has init as his tqparent
system( preparedcommand.ascii() ); system( preparedcommand.ascii() );
exit (0); exit (0);
default: // parent default: // tqparent
break; break;
} }

@ -27,7 +27,7 @@
#include "kqtempfile.h" #include "kqtempfile.h"
KQTempFileKeeper::KQTempFileKeeper( ) KTQTempFileKeeper::KTQTempFileKeeper( )
{ {
#if defined(WIN32) #if defined(WIN32)
m_tempDir = ::GetTempDirectory(); m_tempDir = ::GetTempDirectory();
@ -43,19 +43,19 @@ KQTempFileKeeper::KQTempFileKeeper( )
m_fileNumber = 1; m_fileNumber = 1;
} }
KQTempFileKeeper::~ KQTempFileKeeper( ) KTQTempFileKeeper::~ KTQTempFileKeeper( )
{ {
destroyTempFiles(); destroyTempFiles();
} }
bool KQTempFileKeeper::generateTempFile( QFile & file, const QString & tempdir ) bool KTQTempFileKeeper::generateTempFile( TQFile & file, const TQString & tempdir )
{ {
QString usetempdir = ((tempdir != QString::null) ? tempdir : m_tempDir) + "/"; TQString usetempdir = ((tempdir != TQString()) ? tempdir : m_tempDir) + "/";
while( 1 ) while( 1 )
{ {
char fnbuf[128]; char fnbuf[128];
sprintf( fnbuf, "KQTEMPFILE%d-%d-%d.tmp", (int) getpid(), (int) time(0), m_fileNumber++ ); sprintf( fnbuf, "KTQTEMPFILE%d-%d-%d.tmp", (int) getpid(), (int) time(0), m_fileNumber++ );
file.setName( usetempdir + fnbuf ); file.setName( usetempdir + fnbuf );
if ( file.open( IO_WriteOnly ) ) if ( file.open( IO_WriteOnly ) )
@ -65,8 +65,8 @@ bool KQTempFileKeeper::generateTempFile( QFile & file, const QString & tempdir )
return true; return true;
} }
void KQTempFileKeeper::destroyTempFiles( ) void KTQTempFileKeeper::destroyTempFiles( )
{ {
for ( unsigned int i = 0; i < m_tempFiles.size(); i++ ) for ( unsigned int i = 0; i < m_tempFiles.size(); i++ )
QFile::remove( m_tempFiles[i] ); TQFile::remove( m_tempFiles[i] );
} }

@ -19,35 +19,35 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#ifndef KQTEMPFILE_H #ifndef KTQTEMPFILE_H
#define KQTEMPFILE_H #define KTQTEMPFILE_H
#include <qvaluevector.h> #include <tqvaluevector.h>
#include <qfile.h> #include <tqfile.h>
/* /*
* This class generates temp file names in race condition-safe way, * This class generates temp file names in race condition-safe way,
* returns QFile and filename pairs, keeps the track of opened temp files, * returns TQFile and filename pairs, keeps the track of opened temp files,
* and deletes them when program exist. * and deletes them when program exist.
*/ */
class KQTempFileKeeper class KTQTempFileKeeper
{ {
public: public:
KQTempFileKeeper(); KTQTempFileKeeper();
~KQTempFileKeeper(); ~KTQTempFileKeeper();
//! Generates a temporary file name, and creates it on disk at the same time. //! Generates a temporary file name, and creates it on disk at the same time.
//! Returns the file. If tempdir is not empty, it is used as temp directory. //! Returns the file. If tempdir is not empty, it is used as temp directory.
bool generateTempFile( QFile& file, const QString& tempdir = QString::null ); bool generateTempFile( TQFile& file, const TQString& tempdir = TQString() );
//! Closes and removes all the files from disk //! Closes and removes all the files from disk
void destroyTempFiles(); void destroyTempFiles();
private: private:
QValueVector<QString> m_tempFiles; TQValueVector<TQString> m_tempFiles;
QString m_tempDir; TQString m_tempDir;
unsigned int m_fileNumber; unsigned int m_fileNumber;
}; };
#endif /* KQTEMPFILE_H */ #endif /* KTQTEMPFILE_H */

@ -64,7 +64,7 @@ int main( int argc, char ** argv )
KApplication app; KApplication app;
#else #else
QApplication app( argc, argv ); TQApplication app( argc, argv );
#endif #endif
appConfig.load(); appConfig.load();
@ -79,15 +79,15 @@ int main( int argc, char ** argv )
if ( !client->attach() ) if ( !client->attach() )
qWarning("DCOP attach failed"); qWarning("DCOP attach failed");
//QCString realAppId = client->registerAs( kapp->name() ); //TQCString realAppId = client->registerAs( kapp->name() );
QCString realAppId = client->registerAs( "kchmviewer" ); TQCString realAppId = client->registerAs( "kchmviewer" );
#endif #endif
mainWindow = new KCHMMainWindow(); mainWindow = new KCHMMainWindow();
mainWindow->show(); mainWindow->show();
#if !defined(USE_KDE) #if !defined(USE_KDE)
app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); app.connect( &app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit()) );
#else #else
app.setMainWidget( mainWindow ); app.setMainWidget( mainWindow );
#endif #endif

Loading…
Cancel
Save