diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib')
158 files changed, 4508 insertions, 4470 deletions
diff --git a/src/kvilib/config/kvi_debug.h b/src/kvilib/config/kvi_debug.h index 8ae1a120..a54704a5 100644 --- a/src/kvilib/config/kvi_debug.h +++ b/src/kvilib/config/kvi_debug.h @@ -25,7 +25,7 @@ // //============================================================================= -#include <qglobal.h> +#include <tqglobal.h> //============================================================================= // This file contains the definition of the debug macros diff --git a/src/kvilib/config/kvi_defaults.h b/src/kvilib/config/kvi_defaults.h index fc375b05..05b9c032 100644 --- a/src/kvilib/config/kvi_defaults.h +++ b/src/kvilib/config/kvi_defaults.h @@ -26,7 +26,7 @@ //============================================================================= //============================================================================= -// This file contains (more or less) freely customizable compile time defaults +// This file tqcontains (more or less) freely customizable compile time defaults // // You can safely play with the ones you understand the meaning of //============================================================================= @@ -50,7 +50,7 @@ #define KVI_DEFAULT_REALNAME "KVIrc " VERSION " '" KVI_RELEASE_NAME "' http://kvirc.net/" #define KVI_DEFAULT_PART_MESSAGE "No matter how dark the night, somehow the Sun rises once again" -#define KVI_DEFAULT_QUIT_MESSAGE "KVIrc $version $version(r) http://www.kvirc.net/" +#define KVI_DEFAULT_TQUIT_MESSAGE "KVIrc $version $version(r) http://www.kvirc.net/" #define KVI_DEFAULT_CTCP_USERINFO_REPLY "I'm too lazy to edit this field." #define KVI_DEFAULT_CTCP_PAGE_REPLY "Your message has been received and logged" #define KVI_DEFAULT_AWAY_MESSAGE "I'm off to see the wizard." diff --git a/src/kvilib/config/kvi_settings.h b/src/kvilib/config/kvi_settings.h index ee6044bd..5c8d8c13 100644 --- a/src/kvilib/config/kvi_settings.h +++ b/src/kvilib/config/kvi_settings.h @@ -32,7 +32,7 @@ // Better do not touch this //============================================================================= -#include <qglobal.h> +#include <tqglobal.h> #if defined(_OS_WIN32_) || defined(Q_OS_WIN32) || defined(Q_OS_WIN32_) diff --git a/src/kvilib/config/kvi_wincfg.h b/src/kvilib/config/kvi_wincfg.h index f90998a8..3441e7b2 100644 --- a/src/kvilib/config/kvi_wincfg.h +++ b/src/kvilib/config/kvi_wincfg.h @@ -32,7 +32,7 @@ /* define if you want to compile with new parser */ #define COMPILE_NEW_KVS 1 -/* define if you want to use the Qt 4.x support */ +/* define if you want to use the TQt 4.x support */ /* #undef COMPILE_USE_QT4 */ #define COMPILE_USE_QT4 @@ -132,7 +132,7 @@ /* define this if you are on a big endian machine */ /* #undef BIG_ENDIAN_MACHINE_BYTE_ORDER */ -/* define this if you want to use the unicode-local 8bit charset translation */ +/* define this if you want to use the tqunicode-local 8bit charset translation */ /* #undef COMPILE_USE_LOCAL_8BIT */ /* define this if you want to disable the inter-process communication support */ diff --git a/src/kvilib/core/kvi_error.cpp b/src/kvilib/core/kvi_error.cpp index 6497c757..bbd1abcd 100644 --- a/src/kvilib/core/kvi_error.cpp +++ b/src/kvilib/core/kvi_error.cpp @@ -57,7 +57,7 @@ const char * g_errorTable[KVI_NUM_ERRORS]= __tr_no_lookup("Unexpected end of command in dictionary key"), // 006: unexpectedEndInDictionaryKey __tr_no_lookup("Switch dash without switch letter"), // 007: switchDashWithoutSwitchLetter __tr_no_lookup("Unknown function"), // 008: unknownFunction - __tr_no_lookup("Unexpected end of command in parenthesis"), // 009: unexpectedEndInParenthesis + __tr_no_lookup("Unexpected end of command in tqparenthesis"), // 009: unexpectedEndInParenthesis __tr_no_lookup("Unexpected end of command in function parameters"), // 010: unexpectedEndInFunctionParams __tr_no_lookup("Missing variable name"), // 011: missingVariableName __tr_no_lookup("Variable or identifier expected"), // 012: variableOrIdentifierExpected @@ -112,7 +112,7 @@ const char * g_errorTable[KVI_NUM_ERRORS]= __tr_no_lookup("Integer parameter expected"), // 061 __tr_no_lookup("Invalid parameter"), // 062 __tr_no_lookup("No such file"), // 063 - __tr_no_lookup("Open parenthesis expected"), // 064 + __tr_no_lookup("Open tqparenthesis expected"), // 064 __tr_no_lookup("Open brace expected"), // 065 __tr_no_lookup("Can't kill a builtin class"), // 066 __tr_no_lookup("The SOCKSV4 protocol lacks IpV6 support"), // 067 @@ -183,7 +183,7 @@ namespace KviError return g_errorTable[KviError_unknownError]; } - QString getDescription(int iErrorCode) + TQString getDescription(int iErrorCode) { return __tr2qs_no_xgettext(getUntranslatedDescription(iErrorCode)); } diff --git a/src/kvilib/core/kvi_error.h b/src/kvilib/core/kvi_error.h index 7ab55e88..c295dfe2 100644 --- a/src/kvilib/core/kvi_error.h +++ b/src/kvilib/core/kvi_error.h @@ -180,7 +180,7 @@ namespace KviError { - KVILIB_API QString getDescription(int iErrorCode); + KVILIB_API TQString getDescription(int iErrorCode); KVILIB_API const char * getUntranslatedDescription(int iErrorCode); KVILIB_API int translateSystemError(int iErrNo); }; diff --git a/src/kvilib/core/kvi_pointerhashtable.h b/src/kvilib/core/kvi_pointerhashtable.h index 9066c091..4a9b20d8 100644 --- a/src/kvilib/core/kvi_pointerhashtable.h +++ b/src/kvilib/core/kvi_pointerhashtable.h @@ -229,25 +229,25 @@ inline void * & kvi_hash_key_default(void *) return static_default; } -inline unsigned int kvi_hash_hash(const QString &szKey,bool bCaseSensitive) +inline unsigned int kvi_hash_hash(const TQString &szKey,bool bCaseSensitive) { unsigned int uResult = 0; - const QChar * p = KviQString::nullTerminatedArray(szKey); + const TQChar * p = KviTQString::nullTerminatedArray(szKey); if(!p)return 0; if(bCaseSensitive) { - while(p->unicode()) + while(p->tqunicode()) { - uResult += p->unicode(); + uResult += p->tqunicode(); p++; } } else { - while(p->unicode()) + while(p->tqunicode()) { #ifdef COMPILE_USE_QT4 - uResult += p->toLower().unicode(); + uResult += p->toLower().tqunicode(); #else - uResult += p->lower().unicode(); + uResult += p->lower().tqunicode(); #endif p++; } @@ -255,25 +255,25 @@ inline unsigned int kvi_hash_hash(const QString &szKey,bool bCaseSensitive) return uResult; } -inline bool kvi_hash_key_equal(const QString &szKey1,const QString &szKey2,bool bCaseSensitive) +inline bool kvi_hash_key_equal(const TQString &szKey1,const TQString &szKey2,bool bCaseSensitive) { if(bCaseSensitive) - return KviQString::equalCS(szKey1,szKey2); - return KviQString::equalCI(szKey1,szKey2); + return KviTQString::equalCS(szKey1,szKey2); + return KviTQString::equalCI(szKey1,szKey2); } -inline void kvi_hash_key_copy(const QString &szFrom,QString &szTo,bool) +inline void kvi_hash_key_copy(const TQString &szFrom,TQString &szTo,bool) { szTo = szFrom; } -inline void kvi_hash_key_destroy(QString &szKey,bool) +inline void kvi_hash_key_destroy(TQString &szKey,bool) { } -inline const QString & kvi_hash_key_default(QString *) +inline const TQString & kvi_hash_key_default(TQString *) { - return KviQString::empty; + return KviTQString::empty; } template<typename Key,typename T> class KviPointerHashTable; @@ -311,7 +311,7 @@ public: /// \endverbatim /// /// Implementations for the most likey Key data types are provided below. -/// KviPointerHashTable will automagically work with const char *,QString,KviStr +/// KviPointerHashTable will automagically work with const char *,TQString,KviStr /// and integer types as keys. /// /// For string Key types, the hash table may or may not be case sensitive. @@ -349,7 +349,7 @@ public: /// Places the hash table iterator at the position /// of the item found. /// - T * find(const Key & hKey) + T * tqfind(const Key & hKey) { m_uIteratorIdx = kvi_hash_hash(hKey,m_bCaseSensitive) % m_uSize; if(!m_pDataArray[m_uIteratorIdx])return 0; @@ -364,11 +364,11 @@ public: /// Returns the item associated to the key hKey /// or NULL if no such item exists in the hash table. /// Places the hash table iterator at the position - /// of the item found. This is an alias to find(). + /// of the item found. This is an alias to tqfind(). /// T * operator[](const Key & hKey) { - return find(hKey); + return tqfind(hKey); } /// @@ -427,7 +427,7 @@ public: /// The hash table iterator is placed at the newly inserted item. /// This is just an alias to insert() with a different name. /// - void replace(const Key & hKey,T * pData) + void tqreplace(const Key & hKey,T * pData) { insert(hKey,pData); } @@ -522,7 +522,7 @@ public: /// it's hash table entry, if found, and NULL otherwise. /// The hash table iterator is placed at the item found. /// - KviPointerHashTableEntry<Key,T> * findRef(const T * pRef) + KviPointerHashTableEntry<Key,T> * tqfindRef(const T * pRef) { for(m_uIteratorIdx = 0;m_uIteratorIdx<m_uSize;m_uIteratorIdx++) { @@ -540,7 +540,7 @@ public: /// /// Returns the entry pointed by the hash table iterator. /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). + /// or tqfindRef(). /// KviPointerHashTableEntry<Key,T> * currentEntry() { @@ -568,7 +568,7 @@ public: /// Places the hash table iterator at the next entry /// and returns it. /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). + /// or tqfindRef(). /// KviPointerHashTableEntry<Key,T> * nextEntry() { @@ -596,7 +596,7 @@ public: /// /// Returns the data value pointer pointed by the hash table iterator. /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). + /// or tqfindRef(). /// T * current() { @@ -613,7 +613,7 @@ public: /// /// Returns the key pointed by the hash table iterator. /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). + /// or tqfindRef(). /// const Key & currentKey() { @@ -648,7 +648,7 @@ public: /// Places the hash table iterator at the next entry /// and returns the associated data value pointer. /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). + /// or tqfindRef(). /// T * next() { @@ -681,7 +681,7 @@ public: /// Removes all items in the hash table and then /// makes a complete shallow copy of the data contained in t. /// The removed items are deleted if autodeletion is enabled. - /// The hash table iterator is invalidated. + /// The hash table iterator is tqinvalidated. /// Does not change autodelete flag: make sure you not delete the items twice :) /// void copyFrom(KviPointerHashTable<Key,T> &t) @@ -693,7 +693,7 @@ public: /// /// Inserts a complete shallow copy of the data contained in t. - /// The hash table iterator is invalidated. + /// The hash table iterator is tqinvalidated. /// void insert(KviPointerHashTable<Key,T> &t) { diff --git a/src/kvilib/core/kvi_pointerlist.h b/src/kvilib/core/kvi_pointerlist.h index 381780c8..8b5cb9c5 100644 --- a/src/kvilib/core/kvi_pointerlist.h +++ b/src/kvilib/core/kvi_pointerlist.h @@ -32,13 +32,13 @@ // //============================================================================= -// Qt changes the collection classes too much and too frequently. +// TQt changes the collection classes too much and too frequently. // I think we need to be independent of that to the maximum degree possible. // That's why we have our own fast pointer list class. -// This does not depend on Qt AT ALL and has an interface similar -// to the Qt<=3.x series. The pointer lists with the autodelete +// This does not depend on TQt AT ALL and has an interface similar +// to the TQt<=3.x series. The pointer lists with the autodelete // feature was great and I don't completly understand why they have -// been removed from Qt4 in favor of the value based non-autodeleting +// been removed from TQt4 in favor of the value based non-autodeleting // lists... anyway: here we go :) #include "kvi_settings.h" @@ -288,7 +288,7 @@ public: /// Iterating over pointers is also very fast and this /// class contains an internal iterator that allows to /// write loops in a compact and clean way. -/// See the first(), next(), current() and findRef() +/// See the first(), next(), current() and tqfindRef() /// functions for the description of this feature. /// /// There is also a non-const external iterator @@ -297,11 +297,11 @@ public: /// since the list provides the autoDelete() method /// which vould implicitly violate constness. /// If you have to deal with const objects then -/// you need to use a QList instead. +/// you need to use a TQList instead. /// /// Your objects also do not need to support copy constructors /// or >= operators. This class will work fine without them -/// as opposed to a plain QList. +/// as opposed to a plain TQList. /// /// This class also supports automatic deletion of the inseted items. /// See the setAutoDelete() and autoDelete() members for the @@ -618,7 +618,7 @@ public: /// /// Returns the current iteration item /// A call to this function MUST be preceded by a call to - /// first(),last(),at() or findRef() + /// first(),last(),at() or tqfindRef() /// T * current() { @@ -628,9 +628,9 @@ public: /// /// Returns the current iteration item /// A call to this function should be preceded by a call to - /// first(),last(),at() or findRef(). + /// first(),last(),at() or tqfindRef(). /// This function will return a NULL pointer if the current - /// item has been invalidated due to a remove operation. + /// item has been tqinvalidated due to a remove operation. /// T * safeCurrent() { @@ -641,7 +641,7 @@ public: /// /// Returns an iterator pointing to the current item in the list. /// A call to this function MUST be preceded by a call to - /// first(),last(),at() or findRef() + /// first(),last(),at() or tqfindRef() /// KviPointerListIterator<T> iteratorAtCurrent() { @@ -652,7 +652,7 @@ public: /// Sets the iteration pointer to the next item in the list /// and returns that item (or 0 if the end of the list has been reached) /// A call to this function MUST be preceded by a _succesfull_ call to - /// first(),last(),at() or findRef(). + /// first(),last(),at() or tqfindRef(). /// T * next() { @@ -666,7 +666,7 @@ public: /// Sets the iteration pointer to the previous item in the list /// and returns that item (or 0 if the beginning of the list has been reached) /// A call to this function MUST be preceded by a _succesfull_ call to - /// first(),last(),at() or findRef() + /// first(),last(),at() or tqfindRef() /// T * prev() { @@ -715,7 +715,7 @@ public: /// and returns its position (zero based index) in the list or -1 if the /// item cannot be found /// - int findRef(const T * d) + int tqfindRef(const T * d) { int ret = 0; for(T * t = first();t;t = next()) @@ -945,7 +945,7 @@ public: /// bool removeRef(const T * d) { - if(findRef(d) == -1)return false; + if(tqfindRef(d) == -1)return false; removeCurrentSafe(); return true; } @@ -957,7 +957,7 @@ public: /// void insertAfter(const T * ref,const T * d) { - if(findRef(ref) == -1) + if(tqfindRef(ref) == -1) { append(d); return; @@ -981,7 +981,7 @@ public: /// void insertBefore(const T * ref,const T * d) { - if(findRef(ref) == -1) + if(tqfindRef(ref) == -1) { prepend(d); return; diff --git a/src/kvilib/core/kvi_qcstring.h b/src/kvilib/core/kvi_qcstring.h index 0693e205..9406115c 100644 --- a/src/kvilib/core/kvi_qcstring.h +++ b/src/kvilib/core/kvi_qcstring.h @@ -1,5 +1,5 @@ -#ifndef _KVI_QCSTRING_H_ -#define _KVI_QCSTRING_H_ +#ifndef _KVI_TQCSTRING_H_ +#define _KVI_TQCSTRING_H_ //============================================================================= // @@ -28,12 +28,12 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #include <q3cstring.h> // includes <qbytearray.h> - #define KviQCString QByteArray + #include <tq3cstring.h> // includes <qbytearray.h> + #define KviTQCString TQByteArray #else - // this is dead in Qt 4.x - #include <qcstring.h> - #define KviQCString QCString + // this is dead in TQt 4.x + #include <tqcstring.h> + #define KviTQCString TQCString #endif -#endif //!_KVI_QCSTRING_H_ +#endif //!_KVI_TQCSTRING_H_ diff --git a/src/kvilib/core/kvi_qstring.cpp b/src/kvilib/core/kvi_qstring.cpp index eba255aa..fd61aed4 100644 --- a/src/kvilib/core/kvi_qstring.cpp +++ b/src/kvilib/core/kvi_qstring.cpp @@ -24,7 +24,7 @@ //============================================================================= // -// Helper functions for the QString class +// Helper functions for the TQString class // //============================================================================= @@ -38,7 +38,7 @@ #include <ctype.h> // for tolower() #include <stdio.h> // for sprintf() -#include <qregexp.h> +#include <tqregexp.h> // kvi_string.cpp extern unsigned char iso88591_toLower_map[256]; @@ -46,48 +46,48 @@ extern unsigned char iso88591_toUpper_map[256]; #define MY_MIN(a,b) (((a) < (b)) ? (a) : (b)) -namespace KviQString +namespace KviTQString { // The global empty (and null) string - const QString empty; + const TQString empty; - bool equalCSN(const QString &sz1,const QString &sz2,unsigned int len) + bool equalCSN(const TQString &sz1,const TQString &sz2,unsigned int len) { if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); unsigned int lmin = MY_MIN(sz1.length(),sz2.length()); if(lmin < len)return false; - const QChar * c1e = c1 + len; + const TQChar * c1e = c1 + len; if(!c1 || !c2)return (c1 == c2); while(c1 < c1e) { - if(c1->unicode() != c2->unicode())return false; + if(c1->tqunicode() != c2->tqunicode())return false; c1++; c2++; } return (c1 == c1e); } - bool equalCIN(const QString &sz1,const QString &sz2,unsigned int len) + bool equalCIN(const TQString &sz1,const TQString &sz2,unsigned int len) { if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); unsigned int lmin = MY_MIN(sz1.length(),sz2.length()); if(lmin < len)return false; - const QChar * c1e = c1 + len; + const TQChar * c1e = c1 + len; if(!c1 || !c2)return (c1 == c2); while(c1 < c1e) { #ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != c2->toLower().unicode())return false; + if(c1->toLower().tqunicode() != c2->toLower().tqunicode())return false; #else - if(c1->lower().unicode() != c2->lower().unicode())return false; + if(c1->lower().tqunicode() != c2->lower().tqunicode())return false; #endif c1++; c2++; @@ -95,31 +95,31 @@ namespace KviQString return (c1 == c1e); } - bool equalCSN(const QString &sz1,const char * sz2,unsigned int len) + bool equalCSN(const TQString &sz1,const char * sz2,unsigned int len) { if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); + const TQChar * c1 = sz1.tqunicode(); if(sz1.length() < len)return false; - const QChar * c1e = c1 + len; + const TQChar * c1e = c1 + len; if(!sz2)return !c1; if(!c1)return !sz2; while((c1 < c1e) && (*sz2)) { - if(c1->unicode() != *sz2)return false; + if(c1->tqunicode() != *sz2)return false; c1++; sz2++; } return (c1 == c1e); } - bool equalCIN(const QString &sz1,const char * sz2,unsigned int len) + bool equalCIN(const TQString &sz1,const char * sz2,unsigned int len) { if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); + const TQChar * c1 = sz1.tqunicode(); if(sz1.length() < len)return false; - const QChar * c1e = c1 + len; + const TQChar * c1e = c1 + len; if(!sz2)return !c1; if(!c1)return !(*sz2); @@ -127,9 +127,9 @@ namespace KviQString while((c1 < c1e) && (*sz2)) { #ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != tolower(*sz2))return false; + if(c1->toLower().tqunicode() != tolower(*sz2))return false; #else - if(c1->lower().unicode() != tolower(*sz2))return false; + if(c1->lower().tqunicode() != tolower(*sz2))return false; #endif c1++; sz2++; @@ -138,22 +138,22 @@ namespace KviQString } // sz2 is assumed to be null terminated, sz1 is not! - bool equalCIN(const QString &sz1,const QChar *sz2,unsigned int len) + bool equalCIN(const TQString &sz1,const TQChar *sz2,unsigned int len) { if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); + const TQChar * c1 = sz1.tqunicode(); if(sz1.length() < len)return false; - const QChar * c1e = c1 + len; + const TQChar * c1e = c1 + len; if(!sz2)return !c1; - if(!c1)return !(sz2->unicode()); + if(!c1)return !(sz2->tqunicode()); - while((c1 < c1e) && (sz2->unicode())) + while((c1 < c1e) && (sz2->tqunicode())) { #ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != sz2->toLower().unicode())return false; + if(c1->toLower().tqunicode() != sz2->toLower().tqunicode())return false; #else - if(c1->lower().unicode() != sz2->lower().unicode())return false; + if(c1->lower().tqunicode() != sz2->lower().tqunicode())return false; #endif c1++; sz2++; @@ -161,65 +161,65 @@ namespace KviQString return (c1 == c1e); } - QString makeSizeReadable(size_t bytes) + TQString makeSizeReadable(size_t bytes) { double size = bytes; if(size<900) - return QString(__tr2qs("%1 bytes")).arg(size,0,'f',3); + return TQString(__tr2qs("%1 bytes")).tqarg(size,0,'f',3); size/=1024; if(size<900) - return QString(__tr2qs("%1 KB")).arg(size,0,'f',3); + return TQString(__tr2qs("%1 KB")).tqarg(size,0,'f',3); size/=1024; if(size<900) - return QString(__tr2qs("%1 MB")).arg(size,0,'f',3); + return TQString(__tr2qs("%1 MB")).tqarg(size,0,'f',3); //Pirated DVD?;) size/=1024; if(size<900) - return QString(__tr2qs("%1 GB")).arg(size,0,'f',3); + return TQString(__tr2qs("%1 GB")).tqarg(size,0,'f',3); //Uhm.. We are downloading a whole internet:))) size/=1024; - return QString(__tr2qs("%1 TB")).arg(size,0,'f',3); + return TQString(__tr2qs("%1 TB")).tqarg(size,0,'f',3); } - bool equalCS(const QString &sz1,const QString &sz2) + bool equalCS(const TQString &sz1,const TQString &sz2) { if(sz1.length() != sz2.length())return false; - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); if(!c1 || !c2)return (c1 == c2); while(c1 < c1e) { - if(c1->unicode() != c2->unicode())return false; + if(c1->tqunicode() != c2->tqunicode())return false; c1++; c2++; } return (c1 == c1e); } - bool equalCI(const QString &sz1,const QString &sz2) + bool equalCI(const TQString &sz1,const TQString &sz2) { if(sz1.length() != sz2.length())return false; - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); if(!c1 || !c2)return (c1 == c2); while(c1 < c1e) { #ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != c2->toLower().unicode())return false; + if(c1->toLower().tqunicode() != c2->toLower().tqunicode())return false; #else - if(c1->lower().unicode() != c2->lower().unicode())return false; + if(c1->lower().tqunicode() != c2->lower().tqunicode())return false; #endif c1++; c2++; @@ -228,56 +228,56 @@ namespace KviQString } // sz2 is assumed to be null terminated, sz1 is not! - bool equalCI(const QString &sz1,const QChar *sz2) + bool equalCI(const TQString &sz1,const TQChar *sz2) { - const QChar * c1 = sz1.unicode(); - const QChar * c1e = c1 + sz1.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); if(!c1 || !sz2)return (c1 == sz2); while(c1 < c1e) { - if(!sz2->unicode())return false; // sz1 has at least another character + if(!sz2->tqunicode())return false; // sz1 has at least another character #ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != sz2->toLower().unicode())return false; + if(c1->toLower().tqunicode() != sz2->toLower().tqunicode())return false; #else - if(c1->lower().unicode() != sz2->lower().unicode())return false; + if(c1->lower().tqunicode() != sz2->lower().tqunicode())return false; #endif c1++; sz2++; } - return (c1 == c1e) && (!sz2->unicode()); + return (c1 == c1e) && (!sz2->tqunicode()); } - bool equalCS(const QString &sz1,const char * sz2) + bool equalCS(const TQString &sz1,const char * sz2) { - const QChar * c1 = sz1.unicode(); - const QChar * c1e = c1 + sz1.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); if(!c1)return !sz2; while((c1 < c1e) && (*sz2)) { - if(c1->unicode() != *sz2)return false; + if(c1->tqunicode() != *sz2)return false; c1++; sz2++; } return ((c1 == c1e) && (*sz2 == '\0')); } - bool equalCI(const QString &sz1,const char * sz2) + bool equalCI(const TQString &sz1,const char * sz2) { - const QChar * c1 = sz1.unicode(); - const QChar * c1e = c1 + sz1.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); if(!c1)return !sz2; while((c1 < c1e) && (*sz2)) { #ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != tolower(*sz2))return false; + if(c1->toLower().tqunicode() != tolower(*sz2))return false; #else - if(c1->lower().unicode() != tolower(*sz2))return false; + if(c1->lower().tqunicode() != tolower(*sz2))return false; #endif c1++; sz2++; @@ -285,12 +285,12 @@ namespace KviQString return ((c1 == c1e) && (*sz2 == '\0')); } - int cmpCS(const QString &sz1,const QString &sz2) + int cmpCS(const TQString &sz1,const TQString &sz2) { - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); - const QChar * c2e = c2 + sz2.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); + const TQChar * c2e = c2 + sz2.length(); if(!c1) { @@ -304,12 +304,12 @@ namespace KviQString { if(c1 >= c1e) { - if(c2 < c2e)return /* 0 */ - (c2->unicode()); + if(c2 < c2e)return /* 0 */ - (c2->tqunicode()); return 0; } - if(c2 >= c2e)return c1->unicode() /* - 0 */; + if(c2 >= c2e)return c1->tqunicode() /* - 0 */; - int diff = c1->unicode() - c2->unicode(); + int diff = c1->tqunicode() - c2->tqunicode(); if(diff)return diff; c1++; @@ -319,12 +319,12 @@ namespace KviQString return 0; // never here } - int cmpCI(const QString &sz1,const QString &sz2) + int cmpCI(const TQString &sz1,const TQString &sz2) { - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); - const QChar * c2e = c2 + sz2.length(); + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); + const TQChar * c1e = c1 + sz1.length(); + const TQChar * c2e = c2 + sz2.length(); if(!c1) { @@ -338,22 +338,22 @@ namespace KviQString if(c1 >= c1e) { #ifdef COMPILE_USE_QT4 - if(c2 < c2e)return /* 0 */ - (c2->toLower().unicode()); + if(c2 < c2e)return /* 0 */ - (c2->toLower().tqunicode()); #else - if(c2 < c2e)return /* 0 */ - (c2->lower().unicode()); + if(c2 < c2e)return /* 0 */ - (c2->lower().tqunicode()); #endif return 0; } #ifdef COMPILE_USE_QT4 - if(c2 >= c2e)return c1->toLower().unicode() /* - 0 */; + if(c2 >= c2e)return c1->toLower().tqunicode() /* - 0 */; #else - if(c2 >= c2e)return c1->lower().unicode() /* - 0 */; + if(c2 >= c2e)return c1->lower().tqunicode() /* - 0 */; #endif #ifdef COMPILE_USE_QT4 - int diff = c1->toLower().unicode() - c2->toLower().unicode(); + int diff = c1->toLower().tqunicode() - c2->toLower().tqunicode(); #else - int diff = c1->lower().unicode() - c2->lower().unicode(); + int diff = c1->lower().tqunicode() - c2->lower().tqunicode(); #endif if(diff)return diff; @@ -364,15 +364,15 @@ namespace KviQString return 0; // never here } - int cmpCIN(const QString &sz1,const QString &sz2,unsigned int len) + int cmpCIN(const TQString &sz1,const TQString &sz2,unsigned int len) { if(len == 0)return 0; // assume equal unsigned int l1 = MY_MIN(len,sz1.length()); unsigned int l = MY_MIN(l1,sz2.length()); // FIXME: THIS IS NOT OK - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + l; + const TQChar * c1 = sz1.tqunicode(); + const TQChar * c2 = sz2.tqunicode(); + const TQChar * c1e = c1 + l; if(!c1) { @@ -384,9 +384,9 @@ namespace KviQString int diff = 0; #ifdef COMPILE_USE_QT4 - while((c1 < c1e) && !(diff = (c1->toLower().unicode() - c2->toLower().unicode()))) + while((c1 < c1e) && !(diff = (c1->toLower().tqunicode() - c2->toLower().tqunicode()))) #else - while((c1 < c1e) && !(diff = (c1->lower().unicode() - c2->lower().unicode()))) + while((c1 < c1e) && !(diff = (c1->lower().tqunicode() - c2->lower().tqunicode()))) #endif { c1++; @@ -396,12 +396,12 @@ namespace KviQString return diff; } - void ensureLastCharIs(QString &szString,const QChar &c) + void ensureLastCharIs(TQString &szString,const TQChar &c) { if(!lastCharIs(szString,c))szString.append(c); } - QString getToken(QString &szString,const QChar &sep) + TQString getToken(TQString &szString,const TQChar &sep) { int i=0; while(i < szString.length()) @@ -409,7 +409,7 @@ namespace KviQString if(szString[i] == sep)break; i++; } - QString ret; + TQString ret; if(i == szString.length()) { ret = szString; @@ -427,7 +427,7 @@ namespace KviQString return ret; } - void stripRightWhiteSpace(QString &s) + void stripRightWhiteSpace(TQString &s) { int iRemove = 0; while(iRemove < s.length()) @@ -438,7 +438,7 @@ namespace KviQString if(iRemove > 0)s.remove(s.length() - iRemove,iRemove); } - void stripRight(QString &s,const QChar &c) + void stripRight(TQString &s,const TQChar &c) { int iRemove = 0; while(iRemove < s.length()) @@ -449,7 +449,7 @@ namespace KviQString if(iRemove > 0)s.remove(s.length() - iRemove,iRemove); } - void stripLeft(QString &s,const QChar &c) + void stripLeft(TQString &s,const TQChar &c) { int iRemove = 0; while(iRemove < s.length()) @@ -462,7 +462,7 @@ namespace KviQString if(iRemove > 0)s.remove(0,iRemove); } - void detach(QString &sz) + void detach(TQString &sz) { #ifdef COMPILE_USE_QT4 sz.resize(sz.length()); @@ -471,52 +471,52 @@ namespace KviQString #endif } - const QChar * nullTerminatedArray(const QString &sz) + const TQChar * nullTerminatedArray(const TQString &sz) { //sz.setLength(sz.length()); // detach! #ifdef COMPILE_USE_QT4 return sz.constData(); #else - return (const QChar *)sz.ucs2(); // MAY BE NULL! + return (const TQChar *)sz.ucs2(); // MAY BE NULL! #endif } - void appendNumber(QString &s,double dReal) + void appendNumber(TQString &s,double dReal) { char buffer[512]; ::sprintf(buffer,"%f",dReal); s.append(buffer); } - void appendNumber(QString &s,int iInteger) + void appendNumber(TQString &s,int iInteger) { char buffer[64]; ::sprintf(buffer,"%d",iInteger); s.append(buffer); } - void appendNumber(QString &s,kvi_i64_t iInteger) + void appendNumber(TQString &s,kvi_i64_t iInteger) { char buffer[64]; ::sprintf(buffer,"%ld",iInteger); s.append(buffer); } - void appendNumber(QString &s,kvi_u64_t uInteger) + void appendNumber(TQString &s,kvi_u64_t uInteger) { char buffer[64]; ::sprintf(buffer,"%lu",uInteger); s.append(buffer); } - void appendNumber(QString &s,unsigned int uInteger) + void appendNumber(TQString &s,unsigned int uInteger) { char buffer[64]; ::sprintf(buffer,"%u",uInteger); s.append(buffer); } - void vsprintf(QString &s,const QString &szFmt,kvi_va_list list) + void vsprintf(TQString &s,const TQString &szFmt,kvi_va_list list) { #define MEMINCREMENT 32 @@ -525,15 +525,15 @@ namespace KviQString //s.setLength(allocsize); - const QChar * fmt = nullTerminatedArray(szFmt); + const TQChar * fmt = nullTerminatedArray(szFmt); if(!fmt) { - s = QString::null; + s = TQString(); return; } - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * allocsize); - //QChar * p = (QChar *)s.unicode(); + TQChar * buffer = (TQChar *)kvi_malloc(sizeof(TQChar) * allocsize); + //TQChar * p = (TQChar *)s.tqunicode(); char *argString; long argValue; @@ -544,29 +544,29 @@ namespace KviQString char *pNumBuf; unsigned int tmp; - QChar * p = buffer; + TQChar * p = buffer; #define INCREMENT_MEM \ { \ allocsize += MEMINCREMENT; \ - buffer = (QChar *)kvi_realloc(buffer,sizeof(QChar) * allocsize); \ + buffer = (TQChar *)kvi_realloc(buffer,sizeof(TQChar) * allocsize); \ p = buffer + reallen; \ } #define INCREMENT_MEM_BY(numchars) \ { \ allocsize += numchars + MEMINCREMENT; \ - buffer = (QChar *)kvi_realloc(buffer,sizeof(QChar) * allocsize); \ + buffer = (TQChar *)kvi_realloc(buffer,sizeof(TQChar) * allocsize); \ p = buffer + reallen; \ } - for(; fmt->unicode() ; ++fmt) + for(; fmt->tqunicode() ; ++fmt) { if(reallen == allocsize)INCREMENT_MEM //copy up to a '%' - if(fmt->unicode() != '%') + if(fmt->tqunicode() != '%') { *p++ = *fmt; reallen++; @@ -574,16 +574,16 @@ namespace KviQString } ++fmt; //skip this '%' - switch(fmt->unicode()) + switch(fmt->tqunicode()) { case 's': // char * string { argString = kvi_va_arg(list,char *); if(!argString)argString = "[!NULL!]"; - QString str(argString); + TQString str(argString); if(str.isEmpty())continue; int len = str.length(); - const QChar * ch = str.unicode(); + const TQChar * ch = str.tqunicode(); if(!ch)continue; if((allocsize - reallen) < len)INCREMENT_MEM_BY(len) while(len--)*p++ = *ch++; @@ -596,17 +596,17 @@ namespace KviQString if(!str)continue; if((allocsize - reallen) < str->len())INCREMENT_MEM_BY(str->len()) argString = str->ptr(); - while(*argString)*p++ = QChar(*argString++); + while(*argString)*p++ = TQChar(*argString++); reallen += str->len(); continue; } - case 'Q': // QString * string + case 'Q': // TQString * string { - QString * str = kvi_va_arg(list,QString *); + TQString * str = kvi_va_arg(list,TQString *); if(!str)continue; if(str->isEmpty())continue; int len = str->length(); - const QChar * ch = str->unicode(); + const TQChar * ch = str->tqunicode(); if(!ch)continue; if((allocsize - reallen) < len)INCREMENT_MEM_BY(len) while(len--)*p++ = *ch++; @@ -627,7 +627,7 @@ namespace KviQString reallen++; continue; } - case 'q': // QChar * + case 'q': // TQChar * { // // I'm not sure about this... @@ -637,7 +637,7 @@ namespace KviQString // as sizeof(int) bytes value. // Is this always true ? // - *p++ = *((QChar *)kvi_va_arg(list,QChar *)); + *p++ = *((TQChar *)kvi_va_arg(list,TQChar *)); reallen++; continue; } @@ -661,7 +661,7 @@ namespace KviQString //copy now.... argUValue = pNumBuf - numberBuffer; //length of the number string if((allocsize - reallen) < (int)argUValue)INCREMENT_MEM_BY(argUValue) - do { *p++ = QChar(*--pNumBuf); } while(pNumBuf != numberBuffer); + do { *p++ = TQChar(*--pNumBuf); } while(pNumBuf != numberBuffer); reallen += argUValue; continue; } @@ -721,7 +721,7 @@ namespace KviQString { *p++ = '%'; //write it reallen++; - if(fmt->unicode()) + if(fmt->tqunicode()) { if(reallen == allocsize)INCREMENT_MEM *p++ = *fmt; @@ -738,35 +738,35 @@ namespace KviQString } - QString & sprintf(QString &s,const QString &szFmt,...) + TQString & sprintf(TQString &s,const TQString &szFmt,...) { kvi_va_list list; kvi_va_start_by_reference(list,szFmt); //print...with max 256 chars - KviQString::vsprintf(s,szFmt,list); + KviTQString::vsprintf(s,szFmt,list); kvi_va_end(list); return s; } - void appendFormatted(QString &s,const QString &szFmt,...) + void appendFormatted(TQString &s,const TQString &szFmt,...) { - QString tmp; + TQString tmp; kvi_va_list list; kvi_va_start_by_reference(list,szFmt); //print...with max 256 chars - KviQString::vsprintf(tmp,szFmt,list); + KviTQString::vsprintf(tmp,szFmt,list); kvi_va_end(list); s.append(tmp); } - bool matchWildExpressionsCI(const QString &szM1,const QString &szM2) + bool matchWildExpressionsCI(const TQString &szM1,const TQString &szM2) { //Matches two regular expressions containging wildcards (* and ?) // s1 // m1 - // mask1 : *xor - // mask2 : xorand*xor + // tqmask1 : *xor + // tqmask2 : xorand*xor // m2 // s2 @@ -782,28 +782,28 @@ namespace KviQString // #ifdef COMPILE_USE_QT4 - const QChar * m1 = (const QChar *)szM1.constData(); - const QChar * m2 = (const QChar *)szM2.constData(); + const TQChar * m1 = (const TQChar *)szM1.constData(); + const TQChar * m2 = (const TQChar *)szM2.constData(); #else - const QChar * m1 = (const QChar *)szM1.ucs2(); - const QChar * m2 = (const QChar *)szM2.ucs2(); + const TQChar * m1 = (const TQChar *)szM1.ucs2(); + const TQChar * m2 = (const TQChar *)szM2.ucs2(); #endif - if(!(m1 && m2 && (m1->unicode())))return false; - const QChar * savePos1 = 0; - const QChar * savePos2 = m2; - while(m1->unicode()) + if(!(m1 && m2 && (m1->tqunicode())))return false; + const TQChar * savePos1 = 0; + const TQChar * savePos2 = m2; + while(m1->tqunicode()) { - //loop managed by m1 (initially first mask) - if(m1->unicode()=='*') + //loop managed by m1 (initially first tqmask) + if(m1->tqunicode()=='*') { //Found a wildcard in m1 savePos1 = ++m1; //move to the next char and save the position...this is our jolly - if(!savePos1->unicode())return true; //last was a wildcard , matches everything ahead... + if(!savePos1->tqunicode())return true; //last was a wildcard , matches everything ahead... savePos2 = m2+1; //next return state for the second string continue; //and return } - if(!m2->unicode())return false; //m2 finished and we had something to match here! + if(!m2->tqunicode())return false; //m2 finished and we had something to match here! #ifdef COMPILE_USE_QT4 if(m1->toLower()==m2->toLower()) #else @@ -813,7 +813,7 @@ namespace KviQString //chars matched m1++; //Go ahead in the two strings m2++; // - if((!(m1->unicode())) && m2->unicode() && savePos1) + if((!(m1->tqunicode())) && m2->tqunicode() && savePos1) { //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... //retry matching the string following the * from the savePos2 (one char ahead last time) @@ -822,11 +822,11 @@ namespace KviQString savePos2++; //next savePos2 will be next char } } else { - if(m2->unicode() == '*') + if(m2->tqunicode() == '*') { //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... + //Invert the game : tqmask1 <-> tqmask2 + //tqmask2 now leads the game... savePos1 = m1; //aux m1 = m2; //...swap m2 = savePos1; //...swap @@ -835,11 +835,11 @@ namespace KviQString continue; //...and again } // m1 != m2 , m1 != * , m2 != * - if((m1->unicode() == '?') || (m2->unicode() == '?')) + if((m1->tqunicode() == '?') || (m2->tqunicode() == '?')) { m1++; m2++; - if((!(m1->unicode())) && m2->unicode() && savePos1) + if((!(m1->tqunicode())) && m2->tqunicode() && savePos1) { //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... //retry matching the string following the * from the savePos2 (one char ahead last time) @@ -858,21 +858,21 @@ namespace KviQString } } } - return (!(m2->unicode())); //m1 surely finished , so for the match , m2 must be finished too + return (!(m2->tqunicode())); //m1 surely finished , so for the match , m2 must be finished too } - bool matchStringCI(const QString &szExp,const QString &szStr,bool bIsRegExp,bool bExact) + bool matchStringCI(const TQString &szExp,const TQString &szStr,bool bIsRegExp,bool bExact) { - QString szWildcard; + TQString szWildcard; #ifdef COMPILE_USE_QT4 - QChar* ptr=(QChar*)szExp.constData(); + TQChar* ptr=(TQChar*)szExp.constData(); #else - QChar* ptr=(QChar*)szExp.ucs2(); + TQChar* ptr=(TQChar*)szExp.ucs2(); #endif if(!ptr) return 0; - while(ptr->unicode()) + while(ptr->tqunicode()) { - if((ptr->unicode()=='[') || (ptr->unicode()==']')) + if((ptr->tqunicode()=='[') || (ptr->tqunicode()==']')) { szWildcard.append("["); szWildcard.append(*ptr); @@ -883,9 +883,9 @@ namespace KviQString ptr++; } #ifdef COMPILE_USE_QT4 - QRegExp re(szWildcard,Qt::CaseInsensitive,bIsRegExp ? QRegExp::RegExp : QRegExp::Wildcard); + TQRegExp re(szWildcard,TQt::CaseInsensitive,bIsRegExp ? TQRegExp::RegExp : TQRegExp::Wildcard); #else - QRegExp re(szWildcard,false,!bIsRegExp); + TQRegExp re(szWildcard,false,!bIsRegExp); #endif if(bExact) return re.exactMatch(szStr); #ifdef COMPILE_USE_QT4 @@ -895,18 +895,18 @@ namespace KviQString #endif } - bool matchStringCS(const QString &szExp,const QString &szStr,bool bIsRegExp,bool bExact) + bool matchStringCS(const TQString &szExp,const TQString &szStr,bool bIsRegExp,bool bExact) { - QString szWildcard; + TQString szWildcard; #ifdef COMPILE_USE_QT4 - QChar* ptr=(QChar*)szExp.constData(); + TQChar* ptr=(TQChar*)szExp.constData(); #else - QChar* ptr=(QChar*)szExp.ucs2(); + TQChar* ptr=(TQChar*)szExp.ucs2(); #endif if(!ptr) return 0; - while(ptr->unicode()) + while(ptr->tqunicode()) { - if((ptr->unicode()=='[')) // <-- hum ? + if((ptr->tqunicode()=='[')) // <-- hum ? { szWildcard.append("["); szWildcard.append(*ptr); @@ -917,9 +917,9 @@ namespace KviQString ptr++; } #ifdef COMPILE_USE_QT4 - QRegExp re(szWildcard,Qt::CaseSensitive,bIsRegExp ? QRegExp::RegExp : QRegExp::Wildcard); + TQRegExp re(szWildcard,TQt::CaseSensitive,bIsRegExp ? TQRegExp::RegExp : TQRegExp::Wildcard); #else - QRegExp re(szWildcard,true,!bIsRegExp); + TQRegExp re(szWildcard,true,!bIsRegExp); #endif if(bExact) return re.exactMatch(szStr); #ifdef COMPILE_USE_QT4 @@ -929,34 +929,34 @@ namespace KviQString #endif } - void cutFromFirst(QString &s,const QChar &c,bool bIncluded) + void cutFromFirst(TQString &s,const TQChar &c,bool bIncluded) { #ifdef COMPILE_USE_QT4 int idx = s.indexOf(c); #else - int idx = s.find(c); + int idx = s.tqfind(c); #endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + 1); } - void cutFromLast(QString &s,const QChar &c,bool bIncluded) + void cutFromLast(TQString &s,const TQChar &c,bool bIncluded) { #ifdef COMPILE_USE_QT4 int idx = s.lastIndexOf(c); #else - int idx = s.findRev(c); + int idx = s.tqfindRev(c); #endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + 1); } - void cutToFirst(QString &s,const QChar &c,bool bIncluded,bool bClearIfNotFound) + void cutToFirst(TQString &s,const TQChar &c,bool bIncluded,bool bClearIfNotFound) { #ifdef COMPILE_USE_QT4 int idx = s.indexOf(c); #else - int idx = s.find(c); + int idx = s.tqfind(c); #endif if(idx == -1) { @@ -966,12 +966,12 @@ namespace KviQString s.remove(0,bIncluded ? idx + 1 : idx); } - void cutToLast(QString &s,const QChar &c,bool bIncluded,bool bClearIfNotFound) + void cutToLast(TQString &s,const TQChar &c,bool bIncluded,bool bClearIfNotFound) { #ifdef COMPILE_USE_QT4 int idx = s.lastIndexOf(c); #else - int idx = s.findRev(c); + int idx = s.tqfindRev(c); #endif if(idx == -1) { @@ -981,34 +981,34 @@ namespace KviQString s.remove(0,bIncluded ? idx + 1 : idx); } - void cutFromFirst(QString &s,const QString &c,bool bIncluded) + void cutFromFirst(TQString &s,const TQString &c,bool bIncluded) { #ifdef COMPILE_USE_QT4 int idx = s.indexOf(c); #else - int idx = s.find(c); + int idx = s.tqfind(c); #endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + c.length()); } - void cutFromLast(QString &s,const QString &c,bool bIncluded) + void cutFromLast(TQString &s,const TQString &c,bool bIncluded) { #ifdef COMPILE_USE_QT4 int idx = s.lastIndexOf(c); #else - int idx = s.findRev(c); + int idx = s.tqfindRev(c); #endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + c.length()); } - void cutToFirst(QString &s,const QString &c,bool bIncluded,bool bClearIfNotFound) + void cutToFirst(TQString &s,const TQString &c,bool bIncluded,bool bClearIfNotFound) { #ifdef COMPILE_USE_QT4 int idx = s.indexOf(c); #else - int idx = s.find(c); + int idx = s.tqfind(c); #endif if(idx == -1) { @@ -1018,12 +1018,12 @@ namespace KviQString s.remove(0,bIncluded ? idx + c.length() : idx); } - void cutToLast(QString &s,const QString &c,bool bIncluded,bool bClearIfNotFound) + void cutToLast(TQString &s,const TQString &c,bool bIncluded,bool bClearIfNotFound) { #ifdef COMPILE_USE_QT4 int idx = s.lastIndexOf(c); #else - int idx = s.findRev(c); + int idx = s.tqfindRev(c); #endif if(idx == -1) { @@ -1033,60 +1033,60 @@ namespace KviQString s.remove(0,bIncluded ? idx + c.length() : idx); } - QString upperISO88591(const QString &szSrc) + TQString upperISO88591(const TQString &szSrc) { - const QChar * c = nullTerminatedArray(szSrc); + const TQChar * c = nullTerminatedArray(szSrc); if(!c) { - QString ret; + TQString ret; return ret; } - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * szSrc.length()); - QChar * b = buffer; - unsigned short us = c->unicode(); + TQChar * buffer = (TQChar *)kvi_malloc(sizeof(TQChar) * szSrc.length()); + TQChar * b = buffer; + unsigned short us = c->tqunicode(); while(us) { if(us < 256) - *b=QChar((unsigned short)iso88591_toUpper_map[us]); + *b=TQChar((unsigned short)iso88591_toUpper_map[us]); else *b = *c; c++; b++; - us = c->unicode(); + us = c->tqunicode(); } - QString ret(buffer,szSrc.length()); + TQString ret(buffer,szSrc.length()); kvi_free(buffer); return ret; } - QString lowerISO88591(const QString &szSrc) + TQString lowerISO88591(const TQString &szSrc) { - const QChar * c = nullTerminatedArray(szSrc); + const TQChar * c = nullTerminatedArray(szSrc); if(!c) { - QString ret; + TQString ret; return ret; } - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * szSrc.length()); - QChar * b = buffer; - unsigned short us = c->unicode(); + TQChar * buffer = (TQChar *)kvi_malloc(sizeof(TQChar) * szSrc.length()); + TQChar * b = buffer; + unsigned short us = c->tqunicode(); while(us) { if(us < 256) { - *b=QChar((unsigned short)iso88591_toLower_map[us]); + *b=TQChar((unsigned short)iso88591_toLower_map[us]); } else *b = *c; c++; b++; - us = c->unicode(); + us = c->tqunicode(); } - QString ret(buffer,szSrc.length()); + TQString ret(buffer,szSrc.length()); kvi_free(buffer); return ret; } - void transliterate(QString &s,const QString &szToFind,const QString &szReplacement) + void transliterate(TQString &s,const TQString &szToFind,const TQString &szReplacement) { int i=0; int il = MY_MIN(szToFind.length(),szReplacement.length()); @@ -1105,7 +1105,7 @@ namespace KviQString static char hexdigits[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; - void bufferToHex(QString &szRetBuffer,const unsigned char * buffer,unsigned int len) + void bufferToHex(TQString &szRetBuffer,const unsigned char * buffer,unsigned int len) { #ifdef COMPILE_USE_QT4 szRetBuffer.resize(len * 2); @@ -1115,9 +1115,9 @@ namespace KviQString unsigned int i=0; while(i < (len*2)) { - szRetBuffer[int(i)] = QChar( (unsigned int) hexdigits[(*buffer) / 16] ); + szRetBuffer[int(i)] = TQChar( (unsigned int) hexdigits[(*buffer) / 16] ); i++; - szRetBuffer[int(i)] = QChar( (unsigned int)hexdigits[(*buffer) % 16] ); + szRetBuffer[int(i)] = TQChar( (unsigned int)hexdigits[(*buffer) % 16] ); i++; buffer++; } diff --git a/src/kvilib/core/kvi_qstring.h b/src/kvilib/core/kvi_qstring.h index c82063e9..d5addebf 100644 --- a/src/kvilib/core/kvi_qstring.h +++ b/src/kvilib/core/kvi_qstring.h @@ -1,5 +1,5 @@ -#ifndef _KVI_QSTRING_H_ -#define _KVI_QSTRING_H_ +#ifndef _KVI_TQSTRING_H_ +#define _KVI_TQSTRING_H_ //============================================================================= // @@ -27,7 +27,7 @@ //============================================================================= // -// Helper functions for the QString class +// Helper functions for the TQString class // //============================================================================= @@ -36,109 +36,110 @@ #include "kvi_stdarg.h" #include "kvi_qcstring.h" -#include <qstring.h> +#include <tqstring.h> +#include <tqregexp.h> /// -/// \namespace KviQString +/// \namespace KviTQString /// -/// \brief A namespace for QString helper functions +/// \brief A namespace for TQString helper functions /// /// This namespace contains several helper functions -/// that are used when dealing with QString. +/// that are used when dealing with TQString. /// -namespace KviQString +namespace KviTQString { - extern KVILIB_API QString makeSizeReadable(size_t size); - extern KVILIB_API bool equalCS(const QString &sz1,const QString &sz2); - extern KVILIB_API bool equalCI(const QString &sz1,const QString &sz2); - extern KVILIB_API bool equalCS(const QString &sz1,const char * sz2); - extern KVILIB_API bool equalCI(const QString &sz1,const char * sz2); + extern KVILIB_API TQString makeSizeReadable(size_t size); + extern KVILIB_API bool equalCS(const TQString &sz1,const TQString &sz2); + extern KVILIB_API bool equalCI(const TQString &sz1,const TQString &sz2); + extern KVILIB_API bool equalCS(const TQString &sz1,const char * sz2); + extern KVILIB_API bool equalCI(const TQString &sz1,const char * sz2); // sz2 is assumed to be null terminated here! - extern KVILIB_API bool equalCI(const QString &sz1,const QChar * sz2); - inline bool equalCS(const char * sz1,const QString &sz2) + extern KVILIB_API bool equalCI(const TQString &sz1,const TQChar * sz2); + inline bool equalCS(const char * sz1,const TQString &sz2) { return equalCS(sz2,sz1); }; - inline bool equalCI(const char * sz1,const QString &sz2) + inline bool equalCI(const char * sz1,const TQString &sz2) { return equalCI(sz2,sz1); }; // sz1 is assumed to be null terminated here! - inline bool equalCI(const QChar * sz1,const QString &sz2) + inline bool equalCI(const TQChar * sz1,const TQString &sz2) { return equalCI(sz2,sz1); }; - extern KVILIB_API bool equalCSN(const QString &sz1,const QString &sz2,unsigned int len); - extern KVILIB_API bool equalCIN(const QString &sz1,const QString &sz2,unsigned int len); - extern KVILIB_API bool equalCSN(const QString &sz1,const char * sz2,unsigned int len); - extern KVILIB_API bool equalCIN(const QString &sz1,const char * sz2,unsigned int len); + extern KVILIB_API bool equalCSN(const TQString &sz1,const TQString &sz2,unsigned int len); + extern KVILIB_API bool equalCIN(const TQString &sz1,const TQString &sz2,unsigned int len); + extern KVILIB_API bool equalCSN(const TQString &sz1,const char * sz2,unsigned int len); + extern KVILIB_API bool equalCIN(const TQString &sz1,const char * sz2,unsigned int len); // sz2 is assumed to be null terminated here! - extern KVILIB_API bool equalCIN(const QString &sz1,const QChar * sz2,unsigned int len); - inline bool equalCSN(const char * sz1,const QString &sz2,unsigned int len) + extern KVILIB_API bool equalCIN(const TQString &sz1,const TQChar * sz2,unsigned int len); + inline bool equalCSN(const char * sz1,const TQString &sz2,unsigned int len) { return equalCSN(sz2,sz1,len); }; - inline bool equalCIN(const char * sz1,const QString &sz2,unsigned int len) + inline bool equalCIN(const char * sz1,const TQString &sz2,unsigned int len) { return equalCIN(sz2,sz1,len); }; // sz1 is assumed to be null terminated here! - inline bool equalCIN(const QChar * sz1,const QString &sz2,unsigned int len) + inline bool equalCIN(const TQChar * sz1,const TQString &sz2,unsigned int len) { return equalCIN(sz2,sz1,len); }; //note that greater here means that come AFTER in the alphabetic order // return < 0 ---> str1 < str2 // return = 0 ---> str1 = str2 // return > 0 ---> str1 > str2 - extern KVILIB_API int cmpCI(const QString &sz1,const QString &sz2); - extern KVILIB_API int cmpCIN(const QString &sz1,const QString &sz2,unsigned int len); - extern KVILIB_API int cmpCS(const QString &sz1,const QString &sz2); + extern KVILIB_API int cmpCI(const TQString &sz1,const TQString &sz2); + extern KVILIB_API int cmpCIN(const TQString &sz1,const TQString &sz2,unsigned int len); + extern KVILIB_API int cmpCS(const TQString &sz1,const TQString &sz2); - extern KVILIB_API void detach(QString &sz); + extern KVILIB_API void detach(TQString &sz); - // this makes the QString sz appear as a null terminated array - // it MAY RETURN 0 when the QString is null! - extern KVILIB_API const QChar * nullTerminatedArray(const QString &sz); + // this makes the TQString sz appear as a null terminated array + // it MAY RETURN 0 when the TQString is null! + extern KVILIB_API const TQChar * nullTerminatedArray(const TQString &sz); - inline bool lastCharIs(QString &szString,const QChar &c) + inline bool lastCharIs(TQString &szString,const TQChar &c) { return szString.endsWith(c); }; - extern KVILIB_API void ensureLastCharIs(QString &szString,const QChar &c); + extern KVILIB_API void ensureLastCharIs(TQString &szString,const TQChar &c); // wild expression matching - extern KVILIB_API bool matchWildExpressionsCI(const QString &szM1,const QString &szM2); + extern KVILIB_API bool matchWildExpressionsCI(const TQString &szM1,const TQString &szM2); // wild or regexp matching - extern KVILIB_API bool matchStringCI(const QString &szExp,const QString &szStr,bool bIsRegExp = false,bool bExact = false); - extern KVILIB_API bool matchStringCS(const QString &szExp,const QString &szStr,bool bIsRegExp = false,bool bExact = false); + extern KVILIB_API bool matchStringCI(const TQString &szExp,const TQString &szStr,bool bIsRegExp = false,bool bExact = false); + extern KVILIB_API bool matchStringCS(const TQString &szExp,const TQString &szStr,bool bIsRegExp = false,bool bExact = false); - extern KVILIB_API void vsprintf(QString &s,const QString &szFmt,kvi_va_list list); - extern KVILIB_API QString & sprintf(QString &s,const QString &szFmt,...); - extern KVILIB_API void stripRightWhiteSpace(QString &s); - extern KVILIB_API void stripLeft(QString &s,const QChar &c); - extern KVILIB_API void stripRight(QString &s,const QChar &c); - extern KVILIB_API void appendFormatted(QString &s,const QString &szFmt,...); - extern KVILIB_API void appendNumber(QString &s,double dReal); - extern KVILIB_API void appendNumber(QString &s,kvi_i64_t iInteger); - extern KVILIB_API void appendNumber(QString &s,int iInteger); - extern KVILIB_API void appendNumber(QString &s,unsigned int uInteger); - extern KVILIB_API void appendNumber(QString &s,kvi_u64_t uInteger); + extern KVILIB_API void vsprintf(TQString &s,const TQString &szFmt,kvi_va_list list); + extern KVILIB_API TQString & sprintf(TQString &s,const TQString &szFmt,...); + extern KVILIB_API void stripRightWhiteSpace(TQString &s); + extern KVILIB_API void stripLeft(TQString &s,const TQChar &c); + extern KVILIB_API void stripRight(TQString &s,const TQChar &c); + extern KVILIB_API void appendFormatted(TQString &s,const TQString &szFmt,...); + extern KVILIB_API void appendNumber(TQString &s,double dReal); + extern KVILIB_API void appendNumber(TQString &s,kvi_i64_t iInteger); + extern KVILIB_API void appendNumber(TQString &s,int iInteger); + extern KVILIB_API void appendNumber(TQString &s,unsigned int uInteger); + extern KVILIB_API void appendNumber(TQString &s,kvi_u64_t uInteger); - extern KVILIB_API void cutFromFirst(QString &s,const QChar &c,bool bIncluded = true); - extern KVILIB_API void cutFromLast(QString &s,const QChar &c,bool bIncluded = true); - extern KVILIB_API void cutToFirst(QString &s,const QChar &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API void cutToLast(QString &s,const QChar &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API void cutFromFirst(QString &s,const QString &c,bool bIncluded = true); - extern KVILIB_API void cutFromLast(QString &s,const QString &c,bool bIncluded = true); - extern KVILIB_API void cutToFirst(QString &s,const QString &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API void cutToLast(QString &s,const QString &c,bool bIncluded = true,bool bClearIfNotFound = false); + extern KVILIB_API void cutFromFirst(TQString &s,const TQChar &c,bool bIncluded = true); + extern KVILIB_API void cutFromLast(TQString &s,const TQChar &c,bool bIncluded = true); + extern KVILIB_API void cutToFirst(TQString &s,const TQChar &c,bool bIncluded = true,bool bClearIfNotFound = false); + extern KVILIB_API void cutToLast(TQString &s,const TQChar &c,bool bIncluded = true,bool bClearIfNotFound = false); + extern KVILIB_API void cutFromFirst(TQString &s,const TQString &c,bool bIncluded = true); + extern KVILIB_API void cutFromLast(TQString &s,const TQString &c,bool bIncluded = true); + extern KVILIB_API void cutToFirst(TQString &s,const TQString &c,bool bIncluded = true,bool bClearIfNotFound = false); + extern KVILIB_API void cutToLast(TQString &s,const TQString &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API QString upperISO88591(const QString &szSrc); - extern KVILIB_API QString lowerISO88591(const QString &szSrc); - extern KVILIB_API QString getToken(QString &szString,const QChar &sep); + extern KVILIB_API TQString upperISO88591(const TQString &szSrc); + extern KVILIB_API TQString lowerISO88591(const TQString &szSrc); + extern KVILIB_API TQString getToken(TQString &szString,const TQChar &sep); - extern KVILIB_API void transliterate(QString &s,const QString &szToFind,const QString &szReplacement); + extern KVILIB_API void transliterate(TQString &s,const TQString &szToFind,const TQString &szReplacement); - extern KVILIB_API void bufferToHex(QString &szRetBuffer,const unsigned char * buffer,unsigned int len); + extern KVILIB_API void bufferToHex(TQString &szRetBuffer,const unsigned char * buffer,unsigned int len); - // a global empty string (note that this is ALSO NULL under Qt 3.x) - extern KVILIB_API const QString empty; + // a global empty string (note that this is ALSO NULL under TQt 3.x) + extern KVILIB_API const TQString empty; /// - /// A portability wrapper which with Qt3 and Qt4. + /// A portability wrapper which with TQt3 and TQt4. /// Returns a lowcase version of the parameter string. /// - inline QString toLower(const QString &s) + inline TQString toLower(const TQString &s) { #ifdef COMPILE_USE_QT4 return s.toLower(); @@ -147,97 +148,97 @@ namespace KviQString #endif } - inline int find(const QString &s,QChar c,int index = 0,bool cs = true) + inline int tqfind(const TQString &s,TQChar c,int index = 0,bool cs = true) { #ifdef COMPILE_USE_QT4 - return s.indexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); + return s.indexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); #else - return s.find(c,index,cs); + return s.tqfind(c,index,cs); #endif } - inline int find(const QString &s,char c,int index = 0,bool cs = true) + inline int tqfind(const TQString &s,char c,int index = 0,bool cs = true) { #ifdef COMPILE_USE_QT4 - return s.indexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); + return s.indexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); #else - return s.find(c,index,cs); + return s.tqfind(c,index,cs); #endif } - inline int find(const QString &s,const QString & str,int index = 0,bool cs = true) + inline int tqfind(const TQString &s,const TQString & str,int index = 0,bool cs = true) { #ifdef COMPILE_USE_QT4 - return s.indexOf(str,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); + return s.indexOf(str,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); #else - return s.find(str,index,cs); + return s.tqfind(str,index,cs); #endif } - inline int find(const QString &s,const QRegExp & rx,int index = 0) + inline int tqfind(const TQString &s,const TQRegExp & rx,int index = 0) { #ifdef COMPILE_USE_QT4 return s.indexOf(rx,index); #else - return s.find(rx,index); + return s.tqfind(rx,index); #endif } - inline int find(const QString &s,const char * str,int index = 0) + inline int tqfind(const TQString &s,const char * str,int index = 0) { #ifdef COMPILE_USE_QT4 - return s.indexOf(QString(str),index); + return s.indexOf(TQString(str),index); #else - return s.find(str,index); + return s.tqfind(str,index); #endif } - inline int findRev(const QString &s,QChar c,int index = -1,bool cs = true) + inline int tqfindRev(const TQString &s,TQChar c,int index = -1,bool cs = true) { #ifdef COMPILE_USE_QT4 - return s.lastIndexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); + return s.lastIndexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); #else - return s.findRev(c,index,cs); + return s.tqfindRev(c,index,cs); #endif } - inline int findRev(const QString &s,char c,int index = -1,bool cs = true) + inline int tqfindRev(const TQString &s,char c,int index = -1,bool cs = true) { #ifdef COMPILE_USE_QT4 - return s.lastIndexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); + return s.lastIndexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); #else - return s.findRev(c,index,cs); + return s.tqfindRev(c,index,cs); #endif } - inline int findRev(const QString &s,const QString & str,int index = -1,bool cs = true) + inline int tqfindRev(const TQString &s,const TQString & str,int index = -1,bool cs = true) { #ifdef COMPILE_USE_QT4 - return s.lastIndexOf(str,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); + return s.lastIndexOf(str,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); #else - return s.findRev(str,index,cs); + return s.tqfindRev(str,index,cs); #endif } - inline int findRev(const QString &s,const QRegExp & rx,int index = -1) + inline int tqfindRev(const TQString &s,const TQRegExp & rx,int index = -1) { #ifdef COMPILE_USE_QT4 return s.lastIndexOf(rx,index); #else - return s.findRev(rx,index); + return s.tqfindRev(rx,index); #endif } - inline int findRev(const QString &s,const char * str,int index = -1) + inline int tqfindRev(const TQString &s,const char * str,int index = -1) { #ifdef COMPILE_USE_QT4 - return s.lastIndexOf(QString(str),index); + return s.lastIndexOf(TQString(str),index); #else - return s.findRev(str,index); + return s.tqfindRev(str,index); #endif } - inline QString trimmed(const QString &s) + inline TQString trimmed(const TQString &s) { #ifdef COMPILE_USE_QT4 return s.trimmed(); @@ -246,16 +247,16 @@ namespace KviQString #endif } - // WARNING: DO NOT USE CONSTRUCTS LIKE char * c = KviQString::toUtf8(something).data(); + // WARNING: DO NOT USE CONSTRUCTS LIKE char * c = KviTQString::toUtf8(something).data(); // They are dangerous since with many compilers the returned string gets destroyed - // at the end of the instruction and the c pointer gets thus invalidated. + // at the end of the instruction and the c pointer gets thus tqinvalidated. // Use - // KviQCString tmp = KviQString::toUtf8(something); + // KviTQCString tmp = KviTQString::toUtf8(something); // char * c = tmp.data(); // instead. // Yes, I know that it sucks, but it's the only way to // transit to qt 4.x more or less cleanly... - inline KviQCString toUtf8(const QString &s) + inline KviTQCString toUtf8(const TQString &s) { #ifdef COMPILE_USE_QT4 return s.toUtf8(); @@ -264,12 +265,12 @@ namespace KviQString #endif } - inline KviQCString toLocal8Bit(const QString &s) + inline KviTQCString toLocal8Bit(const TQString &s) { return s.local8Bit(); } - inline kvi_i64_t toI64(QString &szNumber,bool * bOk) + inline kvi_i64_t toI64(TQString &szNumber,bool * bOk) { #if SIZEOF_LONG_INT == 8 return szNumber.toLong(bOk); @@ -278,7 +279,7 @@ namespace KviQString #endif } - inline kvi_u64_t toU64(QString &szNumber,bool * bOk) + inline kvi_u64_t toU64(TQString &szNumber,bool * bOk) { #if SIZEOF_LONG_INT == 8 return szNumber.toULong(bOk); @@ -288,6 +289,6 @@ namespace KviQString } }; -// QT4SUX: Because QString::null is gone. QString() is SLOWER than QString::null since it invokes a constructor and destructor. +// QT4SUX: Because TQString() is gone. TQString() is SLOWER than TQString() since it invokes a constructor and destructor. -#endif //!_KVI_QSTRING_H_ +#endif //!_KVI_TQSTRING_H_ diff --git a/src/kvilib/core/kvi_string.cpp b/src/kvilib/core/kvi_string.cpp index 3f201352..df89122a 100644 --- a/src/kvilib/core/kvi_string.cpp +++ b/src/kvilib/core/kvi_string.cpp @@ -55,7 +55,7 @@ kvi_wslen_t kvi_wstrlen(const kvi_wchar_t * str) // %S = Latin1 KviStr pointer (#ifdef WSTRINGCONFIG_USE_KVISTR) : can't be NULL! // %W = KviWStr pointer : can't be NULL! -// %Q = QString pointer : can't be NULL! +// %Q = TQString pointer : can't be NULL! #define _WSTRING_WMEMCPY(_dst,_src,_len) kvi_fastmoveodd((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len)) #define _WSTRING_STRLEN(_str) kvi_strLen(_str) @@ -105,11 +105,11 @@ kvi_wslen_t kvi_wstrlen(const kvi_wchar_t * str) break; \ case 'Q': \ { \ - QString * pString = kvi_va_arg(list,QString *); \ + TQString * pString = kvi_va_arg(list,TQString *); \ if(pString->length() > 0) \ { \ if(len <= ((int)(pString->length())))return (-1); \ - _WSTRING_WMEMCPY(p,pString->unicode(),pString->length()); \ + _WSTRING_WMEMCPY(p,pString->tqunicode(),pString->length()); \ p += pString->length(); \ len -= pString->length(); \ } \ @@ -190,10 +190,10 @@ int kvi_wvsnprintf(kvi_wchar_t *buffer,kvi_wslen_t len,const kvi_wchar_t *fmt,kv WVSNPRINTF_BODY } -bool kvi_qstringEqualCI(const QString &s1,const QString &s2) +bool kvi_qstringEqualCI(const TQString &s1,const TQString &s2) { - const QChar * p1 = s1.unicode(); - const QChar * p2 = s2.unicode(); + const TQChar * p1 = s1.tqunicode(); + const TQChar * p2 = s2.tqunicode(); int l = s1.length() < s2.length() ? s1.length() : s2.length(); #ifdef COMPILE_USE_QT4 while(l-- && (p1->toLower() == p2->toLower()))p1++,p2++; @@ -402,8 +402,8 @@ bool kvi_matchWildExpr(register const char *m1,register const char *m2) // s1 // m1 - // mask1 : *xor - // mask2 : xorand*xor + // tqmask1 : *xor + // tqmask2 : xorand*xor // m2 // s2 @@ -423,7 +423,7 @@ bool kvi_matchWildExpr(register const char *m1,register const char *m2) const char * savePos2 = m2; while(*m1) { - //loop managed by m1 (initially first mask) + //loop managed by m1 (initially first tqmask) if(*m1=='*') { //Found a wildcard in m1 @@ -450,8 +450,8 @@ bool kvi_matchWildExpr(register const char *m1,register const char *m2) if(*m2 == '*') { //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... + //Invert the game : tqmask1 <-> tqmask2 + //tqmask2 now leads the game... savePos1 = m1; //aux m1 = m2; //...swap m2 = savePos1; //...swap @@ -497,7 +497,7 @@ bool kvi_matchWildExprCS(register const char *m1,register const char *m2) if(!(m1 && m2 && (*m1)))return false; const char * savePos1 = 0; const char * savePos2 = m2; - while(*m1){ //loop managed by m1 (initially first mask) + while(*m1){ //loop managed by m1 (initially first tqmask) if(*m1=='*'){ //Found a wildcard in m1 savePos1 = ++m1; //move to the next char and save the position...this is our jolly @@ -520,8 +520,8 @@ bool kvi_matchWildExprCS(register const char *m1,register const char *m2) } else { if(*m2 == '*'){ //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... + //Invert the game : tqmask1 <-> tqmask2 + //tqmask2 now leads the game... savePos1 = m1; //aux m1 = m2; //...swap m2 = savePos1; //...swap @@ -554,7 +554,7 @@ bool kvi_matchWildExprWithTerminator(register const char *m1,register const char const char * savePos2 = m2; while(NOT_AT_END(m1)) { - //loop managed by m1 (initially first mask) + //loop managed by m1 (initially first tqmask) if(*m1=='*') { //Found a wildcard in m1 @@ -588,8 +588,8 @@ bool kvi_matchWildExprWithTerminator(register const char *m1,register const char if(*m2 == '*') { //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... + //Invert the game : tqmask1 <-> tqmask2 + //tqmask2 now leads the game... bSwapped = !bSwapped; savePos1 = m1; //aux m1 = m2; //...swap @@ -745,10 +745,10 @@ int kvi_vsnprintf(char *buffer,int len,const char *fmt,kvi_va_list list) *p++ = (char)kvi_va_arg(list,int); --len; continue; - case 'Q': // QString! (this should almost never happen) + case 'Q': // TQString! (this should almost never happen) { - QString * s = kvi_va_arg(list,QString *); - KviQCString cs = KviQString::toUtf8(*s); + TQString * s = kvi_va_arg(list,TQString *); + KviTQCString cs = KviTQString::toUtf8(*s); const char * t = cs.data(); if(!t)continue; // nothing to do //check for space... @@ -810,10 +810,10 @@ int kvi_irc_vsnprintf(char *buffer,const char *fmt,kvi_va_list list,bool *bTrunc if(--len < 3)goto truncate; } continue; - case 'Q': // QString! (this should almost never happen) + case 'Q': // TQString! (this should almost never happen) { - QString * s = kvi_va_arg(list,QString *); - KviQCString cs = KviQString::toUtf8(*s); + TQString * s = kvi_va_arg(list,TQString *); + KviTQCString cs = KviTQString::toUtf8(*s); const char * t = cs.data(); if(!t)continue; // nothing to do while(*t) @@ -1038,7 +1038,7 @@ KviStr::KviStr(const char *str) } } -KviStr::KviStr(const KviQCString &str) +KviStr::KviStr(const KviTQCString &str) { //Deep copy constructor if(str.data()) @@ -1115,9 +1115,9 @@ KviStr::KviStr(const KviStr &str) kvi_fastmove(m_ptr,str.m_ptr,m_len+1); } -KviStr::KviStr(const QString &str) +KviStr::KviStr(const TQString &str) { - KviQCString sz = KviQString::toUtf8(str); + KviTQCString sz = KviTQString::toUtf8(str); if(sz.length() > 0) { m_len = sz.length(); @@ -1141,23 +1141,23 @@ KviStr::KviStr(char c,int fillLen) } -KviStr::KviStr(const kvi_wchar_t * unicode) +KviStr::KviStr(const kvi_wchar_t * tqunicode) { - if(!unicode) + if(!tqunicode) { m_len = 0; m_ptr = (char *)kvi_malloc(1); *m_ptr = 0; } else { - m_len = kvi_wstrlen(unicode); + m_len = kvi_wstrlen(tqunicode); m_ptr = (char *)kvi_malloc(m_len + 1); register char * p = m_ptr; - while(*unicode)*p++ = *unicode++; + while(*tqunicode)*p++ = *tqunicode++; *p = 0; } } -KviStr::KviStr(const kvi_wchar_t * unicode,int len) +KviStr::KviStr(const kvi_wchar_t * tqunicode,int len) { m_len = len; m_ptr = (char *)kvi_malloc(m_len + 1); @@ -1165,7 +1165,7 @@ KviStr::KviStr(const kvi_wchar_t * unicode,int len) char * end = p + len; while(p != end) { - *p++ = *unicode++; + *p++ = *tqunicode++; } *p = 0; } @@ -1196,7 +1196,7 @@ KviStr & KviStr::operator=(const KviStr &str) return (*this); } -KviStr & KviStr::operator=(const KviQCString &str) +KviStr & KviStr::operator=(const KviTQCString &str) { m_len = str.length(); m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); @@ -1342,7 +1342,7 @@ int KviStr::hexToBuffer(char ** buffer,bool bNullToNewlines) return len; } -static const char * base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const char * base64_chars = "ABCDEFGHIJKLMNOPTQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; void KviStr::bufferToBase64(const char * buffer,int len) @@ -1490,9 +1490,9 @@ KviStr & KviStr::setStr(const char *str,int len) return (*this); } -KviStr & KviStr::operator=(const QString &str) +KviStr & KviStr::operator=(const TQString &str) { - KviQCString sz = KviQString::toUtf8(str); + KviTQCString sz = KviTQString::toUtf8(str); if(sz.length() > 0){ m_len = sz.length(); m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); @@ -1539,9 +1539,9 @@ void KviStr::append(const char *str) m_len += len; } -void KviStr::append(const QString &str) +void KviStr::append(const TQString &str) { - KviQCString sz = KviQString::toUtf8(str); + KviTQCString sz = KviTQString::toUtf8(str); if(sz.length() < 1)return; m_ptr = (char *)kvi_realloc(m_ptr,m_len+sz.length()+1); kvi_fastmove((m_ptr+m_len),sz.data(),sz.length()+1); @@ -2203,7 +2203,7 @@ int KviStr::occurences(const char *str,bool caseS) const return cnt; } -bool KviStr::contains(char c,bool caseS) const +bool KviStr::tqcontains(char c,bool caseS) const { register char *p = m_ptr; if(caseS) @@ -2224,7 +2224,7 @@ bool KviStr::contains(char c,bool caseS) const return false; } -bool KviStr::contains(const char *str,bool caseS) const +bool KviStr::tqcontains(const char *str,bool caseS) const { __range_valid(str); register char *p = m_ptr; @@ -2657,7 +2657,7 @@ KviStr & KviStr::sprintf(const char *fmt,...) return (*this); } -int KviStr::find(const char *str,int idx,bool caseS) const +int KviStr::tqfind(const char *str,int idx,bool caseS) const { if(idx >= m_len)return -1; register char *p=m_ptr + idx; @@ -2682,7 +2682,7 @@ int KviStr::find(const char *str,int idx,bool caseS) const } } -int KviStr::find(char c,int idx) const +int KviStr::tqfind(char c,int idx) const { if(idx >= m_len)return -1; register char *p=m_ptr + idx; @@ -2691,7 +2691,7 @@ int KviStr::find(char c,int idx) const } -int KviStr::findRev(const char *str,int idx,bool caseS) const +int KviStr::tqfindRev(const char *str,int idx,bool caseS) const { if((m_len + idx) < 0)return -1; register char *p=m_ptr + m_len + idx; @@ -2729,17 +2729,17 @@ int KviStr::findFirstIdx(const char *str,bool caseS) const { // This function can't be used to search inside // multibyte encoded strings... convert your - // code to QString and use QString::findRev(). + // code to TQString and use TQString::tqfindRev(). // We must throw away KviStr at all in this case... - // return QString(m_ptr).find(QString(str),0,caseS);; + // return TQString(m_ptr).tqfind(TQString(str),0,caseS);; // Both this KviStr and the const char * str are assumed // to be in the proper (and same) encoding. - // If KviStr is in encoding A then QString(m_ptr) might + // If KviStr is in encoding A then TQString(m_ptr) might // or not be decoded correctly. // Also if KviStr is in UTF-8 (for example), then - // a position in QString() does not map to the position in the char array + // a position in TQString() does not map to the position in the char array // since a single UNICODE char may use one or more bytes... __range_valid(str); @@ -2782,10 +2782,10 @@ int KviStr::findLastIdx(const char *str,bool caseS) const { // This function can't be used to search inside // multibyte encoded strings... convert your - // code to QString and use QString::findRev(). + // code to TQString and use TQString::tqfindRev(). // We must throw away KviStr at all in this case... - // return QString(m_ptr).findRev(QString(str),-1,caseS); + // return TQString(m_ptr).tqfindRev(TQString(str),-1,caseS); __range_valid(str); //Calc the len of the searched string @@ -2948,7 +2948,7 @@ KviStr & KviStr::emptyString() } -bool KviStr::ext_contains(register const char * data,const char * item,bool caseS) +bool KviStr::ext_tqcontains(register const char * data,const char * item,bool caseS) { if(item && data) { diff --git a/src/kvilib/core/kvi_string.h b/src/kvilib/core/kvi_string.h index 602173cd..4a7991bb 100644 --- a/src/kvilib/core/kvi_string.h +++ b/src/kvilib/core/kvi_string.h @@ -34,8 +34,8 @@ #include <strings.h> // useless ? #endif -#include <qglobal.h> -#include <qstring.h> +#include <tqglobal.h> +#include <tqstring.h> #include "kvi_qcstring.h" @@ -58,7 +58,7 @@ #endif -__KVI_EXTERN KVILIB_API bool kvi_qstringEqualCI(const QString &s1,const QString &s2); +__KVI_EXTERN KVILIB_API bool kvi_qstringEqualCI(const TQString &s1,const TQString &s2); // Include inlined assembly implementations if required @@ -146,18 +146,18 @@ public: // Compat with QT...<br> // WARNING : With QT2.x it WILL loose UNICODE data.<br> - // Safe even if the QString is null. - KviStr(const QString &str); + // Safe even if the TQString is null. + KviStr(const TQString &str); - KviStr(const KviQCString &str); + KviStr(const KviTQCString &str); // Fill sonstructor. // Creates a string long fillLen characters filled with character c.<br> KviStr(char c,int fillLen = 1); - KviStr(const kvi_wchar_t * unicode); + KviStr(const kvi_wchar_t * tqunicode); - KviStr(const kvi_wchar_t * unicode,int len); + KviStr(const kvi_wchar_t * tqunicode,int len); // just free(m_ptr) ~KviStr(); @@ -233,7 +233,7 @@ public: // append functions void append(const KviStr &str); - void append(const QString &str); + void append(const TQString &str); void append(char c); void append(const char *str); // str CAN be 0 void append(const char *str,int len); // str CAN NOT be 0, and MUST be at least len chars long @@ -257,14 +257,14 @@ public: KviStr & operator=(const KviStr &str); // deep copy KviStr & operator=(const char *str); // str can be NULL here KviStr & operator=(char c); // 2 bytes allocated ,m_len = 1 - KviStr & operator=(const QString &str); - KviStr & operator=(const KviQCString &str); + KviStr & operator=(const TQString &str); + KviStr & operator=(const KviTQCString &str); // Append operators KviStr & operator+=(const KviStr &str) { append(str); return (*this); }; KviStr & operator+=(const char *str) { append(str); return (*this); }; KviStr & operator+=(char c) { append(c); return (*this); }; - KviStr & operator+=(const QString &str) { append(str); return (*this); }; + KviStr & operator+=(const TQString &str) { append(str); return (*this); }; // Comparison bool equalsCI(const KviStr &other) const { if(m_len != other.m_len)return false; return kvi_strEqualCI(m_ptr,other.m_ptr); }; @@ -376,9 +376,9 @@ public: //============================================================================= // Returns true if at least one occurence of str is found - bool contains(const char *str,bool caseS=true) const; + bool tqcontains(const char *str,bool caseS=true) const; // Returns true if at least one occurence of character c is found in this string - bool contains(char c,bool caseS=true) const; + bool tqcontains(char c,bool caseS=true) const; // Returns the number of occurences of string str in this string.<br> // Overlapped matches are counted. int occurences(const char *str,bool caseS=true) const; @@ -405,9 +405,9 @@ public: // str can NOT be 0 here. int findLastIdx(const char *str,bool caseS = true) const; - int find(char c,int startIdx) const; - int find(const char * str,int startIdx,bool caseS = true) const; - int findRev(const char * str,int startIdx,bool caseS = true) const; + int tqfind(char c,int startIdx) const; + int tqfind(const char * str,int startIdx,bool caseS = true) const; + int tqfindRev(const char * str,int startIdx,bool caseS = true) const; //============================================================================= // Numbers @@ -462,7 +462,7 @@ public: //============================================================================= // FIXME: Should it be KviStrExt::contains namespace ? - static bool ext_contains(register const char * data,const char * item,bool caseS = true); + static bool ext_tqcontains(register const char * data,const char * item,bool caseS = true); }; // FIXME: the functions below should end in the KviStr namespace ??? diff --git a/src/kvilib/core/kvi_valuelist.h b/src/kvilib/core/kvi_valuelist.h index fde9d5b6..9ad234f2 100644 --- a/src/kvilib/core/kvi_valuelist.h +++ b/src/kvilib/core/kvi_valuelist.h @@ -27,11 +27,11 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #include <q3valuelist.h> + #include <tq3valuelist.h> #define KviValueList Q3ValueList #else - #include <qvaluelist.h> - #define KviValueList QValueList + #include <tqvaluelist.h> + #define KviValueList TQValueList #endif #endif //_KVI_VALUELIST_H_ diff --git a/src/kvilib/ext/kvi_accel.h b/src/kvilib/ext/kvi_accel.h index 34cca3c1..1014b2cb 100644 --- a/src/kvilib/ext/kvi_accel.h +++ b/src/kvilib/ext/kvi_accel.h @@ -28,11 +28,11 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #include <q3accel.h> + #include <tq3accel.h> #define KviAccel Q3Accel #else - #include <qaccel.h> - #define KviAccel QAccel + #include <tqaccel.h> + #define KviAccel TQAccel #endif #endif //!_KVI_ACCEL_H_ diff --git a/src/kvilib/ext/kvi_cmdformatter.cpp b/src/kvilib/ext/kvi_cmdformatter.cpp index e2b3e1f6..153557b2 100644 --- a/src/kvilib/ext/kvi_cmdformatter.cpp +++ b/src/kvilib/ext/kvi_cmdformatter.cpp @@ -50,10 +50,10 @@ namespace KviCommandFormatter return bGotIt; } - bool hasLeadingChars(QStringList &list,const QChar &c) + bool hasLeadingChars(TQStringList &list,const TQChar &c) { bool bGotIt = false; - for(QStringList::Iterator it = list.begin();it != list.end();++it) + for(TQStringList::Iterator it = list.begin();it != list.end();++it) { if((*it).length() < 1)continue; if((*it).at(0) == c) @@ -62,7 +62,7 @@ namespace KviCommandFormatter bGotIt = true; } else { // we pretend this line to be empty - QString tmp = *it; + TQString tmp = *it; #ifdef COMPILE_USE_QT4 tmp = tmp.trimmed(); #else @@ -84,9 +84,9 @@ namespace KviCommandFormatter } } - void trimLeading(QStringList &list) + void trimLeading(TQStringList &list) { - for(QStringList::Iterator it = list.begin();it != list.end();++it) + for(TQStringList::Iterator it = list.begin();it != list.end();++it) { (*it).remove(0,1); } @@ -102,9 +102,9 @@ namespace KviCommandFormatter } } - void addLeading(QStringList &list,const QChar & c) + void addLeading(TQStringList &list,const TQChar & c) { - for(QStringList::Iterator it = list.begin();it != list.end();++it) + for(TQStringList::Iterator it = list.begin();it != list.end();++it) { (*it).prepend(c); } @@ -125,21 +125,21 @@ namespace KviCommandFormatter } - void unindent(QString &buffer) + void unindent(TQString &buffer) { #ifdef COMPILE_USE_QT4 - QStringList list = buffer.split("\n",QString::KeepEmptyParts); + TQStringList list = buffer.split("\n",TQString::KeepEmptyParts); #else - QStringList list = QStringList::split("\n",buffer,true); + TQStringList list = TQStringList::split("\n",buffer,true); #endif - while(hasLeadingChars(list,QChar('\t')) || hasLeadingChars(list,QChar(' ')))trimLeading(list); + while(hasLeadingChars(list,TQChar('\t')) || hasLeadingChars(list,TQChar(' ')))trimLeading(list); //buffer = list.join("\n"); join implementation sux :D // we WANT the last newline buffer = ""; - for(QStringList::Iterator it = list.begin();it != list.end();++it) + for(TQStringList::Iterator it = list.begin();it != list.end();++it) { buffer.append(*it); - buffer.append(QChar('\n')); + buffer.append(TQChar('\n')); } } @@ -160,7 +160,7 @@ namespace KviCommandFormatter buffer.stripWhiteSpace(); } - void bufferFromBlock(QString &buffer) + void bufferFromBlock(TQString &buffer) { #ifdef COMPILE_USE_QT4 buffer = buffer.trimmed(); @@ -170,11 +170,11 @@ namespace KviCommandFormatter if(buffer.isEmpty())return; - if((buffer.at(0) == QChar('{')) && buffer.endsWith(QChar('}'))) + if((buffer.at(0) == TQChar('{')) && buffer.endsWith(TQChar('}'))) { buffer.remove(0,1); buffer.remove(buffer.length() - 1,1); - while((buffer.length() > 0) && ((buffer.at(0) == QChar('\n')) || (buffer.at(0) == QChar('\r')))) + while((buffer.length() > 0) && ((buffer.at(0) == TQChar('\n')) || (buffer.at(0) == TQChar('\r')))) buffer.remove(0,1); } @@ -201,21 +201,21 @@ namespace KviCommandFormatter } } - void indent(QString &buffer) + void indent(TQString &buffer) { #ifdef COMPILE_USE_QT4 - QStringList list = buffer.split("\n",QString::KeepEmptyParts); + TQStringList list = buffer.split("\n",TQString::KeepEmptyParts); #else - QStringList list = QStringList::split("\n",buffer,true); + TQStringList list = TQStringList::split("\n",buffer,true); #endif - addLeading(list,QChar('\t')); + addLeading(list,TQChar('\t')); //buffer = list.join("\n"); join implementation sux :D // we WANT the last newline buffer = ""; - for(QStringList::Iterator it = list.begin();it != list.end();++it) + for(TQStringList::Iterator it = list.begin();it != list.end();++it) { buffer.append(*it); - buffer.append(QChar('\n')); + buffer.append(TQChar('\n')); } } @@ -229,12 +229,12 @@ namespace KviCommandFormatter buffer.append("}\n"); } - void blockFromBuffer(QString &buffer) + void blockFromBuffer(TQString &buffer) { indent(buffer); buffer.prepend("{\n"); - KviQString::stripRightWhiteSpace(buffer); - KviQString::ensureLastCharIs(buffer,'\n'); + KviTQString::stripRightWhiteSpace(buffer); + KviTQString::ensureLastCharIs(buffer,'\n'); buffer.append("}\n"); } }; diff --git a/src/kvilib/ext/kvi_cmdformatter.h b/src/kvilib/ext/kvi_cmdformatter.h index b6efa98b..043a6ec1 100644 --- a/src/kvilib/ext/kvi_cmdformatter.h +++ b/src/kvilib/ext/kvi_cmdformatter.h @@ -29,36 +29,36 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <qstringlist.h> +#include <tqstringlist.h> namespace KviCommandFormatter { extern KVILIB_API bool hasLeadingChars(KviStr * array,char c); - extern KVILIB_API bool hasLeadingChars(QStringList &list,const QChar &c); + extern KVILIB_API bool hasLeadingChars(TQStringList &list,const TQChar &c); extern KVILIB_API void trimLeading(KviStr ** array); - extern KVILIB_API void trimLeading(QStringList &list); + extern KVILIB_API void trimLeading(TQStringList &list); extern KVILIB_API void addLeading(KviStr ** array,char c); - extern KVILIB_API void addLeading(QStringList &list,const QChar &c); + extern KVILIB_API void addLeading(TQStringList &list,const TQChar &c); extern KVILIB_API void trimBlockBraces(KviStr &buffer); - extern KVILIB_API void trimBlockBraces(QString &buffer); + extern KVILIB_API void trimBlockBraces(TQString &buffer); extern KVILIB_API void unindent(KviStr &buffer); - extern KVILIB_API void unindent(QString &buffer); + extern KVILIB_API void unindent(TQString &buffer); extern KVILIB_API void bufferFromBlock(KviStr &buffer); - extern KVILIB_API void bufferFromBlock(QString &buffer); + extern KVILIB_API void bufferFromBlock(TQString &buffer); extern KVILIB_API void addBlockBraces(KviStr &buffer); - extern KVILIB_API void addBlockBraces(QString &buffer); + extern KVILIB_API void addBlockBraces(TQString &buffer); extern KVILIB_API void indent(KviStr &buffer); - extern KVILIB_API void indent(QString &buffer); + extern KVILIB_API void indent(TQString &buffer); extern KVILIB_API void blockFromBuffer(KviStr &buffer); - extern KVILIB_API void blockFromBuffer(QString &buffer); + extern KVILIB_API void blockFromBuffer(TQString &buffer); }; #endif //_KVI_CMDFORMATTER_H_ diff --git a/src/kvilib/ext/kvi_config.cpp b/src/kvilib/ext/kvi_config.cpp index eb3dc0bc..c0eb124e 100644 --- a/src/kvilib/ext/kvi_config.cpp +++ b/src/kvilib/ext/kvi_config.cpp @@ -34,7 +34,7 @@ #include "kvi_file.h" -KviConfig::KviConfig(const QString &filename,FileMode f,bool bLocal8Bit) +KviConfig::KviConfig(const TQString &filename,FileMode f,bool bLocal8Bit) { m_bLocal8Bit = bLocal8Bit; m_szFileName = filename; @@ -42,7 +42,7 @@ KviConfig::KviConfig(const QString &filename,FileMode f,bool bLocal8Bit) m_szGroup = KVI_CONFIG_DEFAULT_GROUP; m_bPreserveEmptyGroups = false; m_bReadOnly = (f == KviConfig::Read); - m_pDict = new KviPointerHashTable<QString,KviConfigGroup>(17,false); + m_pDict = new KviPointerHashTable<TQString,KviConfigGroup>(17,false); m_pDict->setAutoDelete(true); if(f != KviConfig::Write)load(); } @@ -50,12 +50,12 @@ KviConfig::KviConfig(const QString &filename,FileMode f,bool bLocal8Bit) KviConfig::KviConfig(const char* filename,FileMode f,bool bLocal8Bit) { m_bLocal8Bit = bLocal8Bit; - m_szFileName = QString::fromUtf8(filename); + m_szFileName = TQString::fromUtf8(filename); m_bDirty = false; m_szGroup = KVI_CONFIG_DEFAULT_GROUP; m_bPreserveEmptyGroups = false; m_bReadOnly = (f == KviConfig::Read); - m_pDict = new KviPointerHashTable<QString,KviConfigGroup>(17,false); + m_pDict = new KviPointerHashTable<TQString,KviConfigGroup>(17,false); m_pDict->setAutoDelete(true); if(f != KviConfig::Write)load(); } @@ -70,20 +70,20 @@ KviConfig::~KviConfig() void KviConfig::clear() { delete m_pDict; - m_pDict = new KviPointerHashTable<QString,KviConfigGroup>(17,false); + m_pDict = new KviPointerHashTable<TQString,KviConfigGroup>(17,false); m_pDict->setAutoDelete(true); m_bDirty = false; m_szGroup = KVI_CONFIG_DEFAULT_GROUP; } -void KviConfig::clearGroup(const QString & szGroup) +void KviConfig::clearGroup(const TQString & szGroup) { m_bDirty = true; m_pDict->remove(szGroup); - if(!m_pDict->find(m_szGroup))m_szGroup = KVI_CONFIG_DEFAULT_GROUP; //removed the current one + if(!m_pDict->tqfind(m_szGroup))m_szGroup = KVI_CONFIG_DEFAULT_GROUP; //removed the current one } -void KviConfig::clearKey(const QString & szKey) +void KviConfig::clearKey(const TQString & szKey) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); @@ -99,13 +99,13 @@ void KviConfig::getContentsString(KviStr &buffer) buffer.append('\n'); int sections = 0; int keys = 0; - KviPointerHashTableIterator<QString,KviStrDict> it(*m_pDict); + KviPointerHashTableIterator<TQString,KviStrDict> it(*m_pDict); while(it.current()){ buffer.append(" Section ["); buffer.append(it.currentKey()); buffer.append("]\n"); int sectionKeys = 0; - KviPointerHashTableIterator<QString,KviStr> it2(*it.current()); + KviPointerHashTableIterator<TQString,KviStr> it2(*it.current()); while(it2.current()){ buffer.append(" Key ["); buffer.append(it2.currentKey()); @@ -279,10 +279,10 @@ bool KviConfig::load() if(!tmp.isEmpty()) { - QString szGroup = m_bLocal8Bit ? - QString::fromLocal8Bit(tmp.ptr(),tmp.len()) : - QString::fromUtf8(tmp.ptr(),tmp.len()); - p_group = m_pDict->find(szGroup); + TQString szGroup = m_bLocal8Bit ? + TQString::fromLocal8Bit(tmp.ptr(),tmp.len()) : + TQString::fromUtf8(tmp.ptr(),tmp.len()); + p_group = m_pDict->tqfind(szGroup); if(!p_group) { p_group = new KviConfigGroup(17,false); @@ -304,17 +304,17 @@ bool KviConfig::load() tmp.stripRightWhiteSpace(); // No external spaces at all in keys if(!tmp.isEmpty()) { - QString szKey = m_bLocal8Bit ? - QString::fromLocal8Bit(tmp.ptr(),tmp.len()) : - QString::fromUtf8(tmp.ptr(),tmp.len()); + TQString szKey = m_bLocal8Bit ? + TQString::fromLocal8Bit(tmp.ptr(),tmp.len()) : + TQString::fromUtf8(tmp.ptr(),tmp.len()); z++; while(*z && ((*z == ' ') || (*z == '\t')))z++; if(*z) { tmp.hexDecode(z); - QString * pVal = new QString( m_bLocal8Bit ? - QString::fromLocal8Bit(tmp.ptr(),tmp.len()) : - QString::fromUtf8(tmp.ptr(),tmp.len()) + TQString * pVal = new TQString( m_bLocal8Bit ? + TQString::fromLocal8Bit(tmp.ptr(),tmp.len()) : + TQString::fromUtf8(tmp.ptr(),tmp.len()) ); if(!p_group) { @@ -324,13 +324,13 @@ bool KviConfig::load() p_group->setAutoDelete(true); m_pDict->insert(KVI_CONFIG_DEFAULT_GROUP,p_group); } - p_group->replace(szKey,pVal); + p_group->tqreplace(szKey,pVal); } else { // we in fact need this (mercy :D) // otherwise the empty options will be treated as non-existing ones // and will get the defaults (which is bad) - QString * pVal = new QString(QString::null); - p_group->replace(szKey,pVal); + TQString * pVal = new TQString(TQString()); + p_group->tqreplace(szKey,pVal); } } } @@ -362,7 +362,7 @@ bool KviConfig::load() bool KviConfig::load() { - QFile f(m_szFileName); + TQFile f(m_szFileName); if(!f.open(IO_ReadOnly))return false; @@ -389,8 +389,8 @@ bool KviConfig::load() dataLine.hexDecode(); if(dataLine.hasData()) { - QString szUtf8 = QString::fromUtf8(dataLine.ptr()); - p_group = m_pDict->find(szUtf8); + TQString szUtf8 = TQString::fromUtf8(dataLine.ptr()); + p_group = m_pDict->tqfind(szUtf8); if(!p_group) { @@ -412,7 +412,7 @@ bool KviConfig::load() dataLine.stripLeftWhiteSpace(); // strip any whitespace added externally dataLine.hexDecode(); //insert (replace items if needed) - QString *p_data=new QString(QString::fromUtf8(dataLine.ptr())); + TQString *p_data=new TQString(TQString::fromUtf8(dataLine.ptr())); if(!p_group) { // ops...we're missing a group @@ -421,8 +421,8 @@ bool KviConfig::load() p_group->setAutoDelete(true); m_pDict->insert(KVI_CONFIG_DEFAULT_GROUP,p_group); } - QString szName = QString::fromUtf8(name.ptr()); - p_group->replace(szName,p_data); + TQString szName = TQString::fromUtf8(name.ptr()); + p_group->tqreplace(szName,p_data); } } break; @@ -497,12 +497,12 @@ bool KviConfig::save() if(!f.openForWriting())return false; if(f.writeBlock("# KVIrc configuration file\n",27) != 27)return false; - KviPointerHashTableIterator<QString,KviConfigGroup> it(*m_pDict); + KviPointerHashTableIterator<TQString,KviConfigGroup> it(*m_pDict); while (it.current()) { if((it.current()->count() != 0) || (m_bPreserveEmptyGroups)) { - KviStr group(m_bLocal8Bit ? KviQString::toLocal8Bit(it.currentKey()) : KviQString::toUtf8(it.currentKey())); + KviStr group(m_bLocal8Bit ? KviTQString::toLocal8Bit(it.currentKey()) : KviTQString::toUtf8(it.currentKey())); group.hexEncodeWithTable(encode_table); if(!f.putChar('['))return false; @@ -513,10 +513,10 @@ bool KviConfig::save() KviConfigGroupIterator it2(*dict); KviStr szName,szValue; - while(QString * p_str = it2.current()) + while(TQString * p_str = it2.current()) { - szName = m_bLocal8Bit ? KviQString::toLocal8Bit(it2.currentKey()) : KviQString::toUtf8(it2.currentKey()); - szValue = m_bLocal8Bit ? KviQString::toLocal8Bit(*p_str) : KviQString::toUtf8(*p_str); + szName = m_bLocal8Bit ? KviTQString::toLocal8Bit(it2.currentKey()) : KviTQString::toUtf8(it2.currentKey()); + szValue = m_bLocal8Bit ? KviTQString::toLocal8Bit(*p_str) : KviTQString::toUtf8(*p_str); szName.hexEncodeWithTable(encode_table); szValue.hexEncodeWhiteSpace(); @@ -534,7 +534,7 @@ bool KviConfig::save() return true; } -void KviConfig::setGroup(const QString & szGroup) +void KviConfig::setGroup(const TQString & szGroup) { m_szGroup = szGroup; if(m_bPreserveEmptyGroups) @@ -547,21 +547,21 @@ void KviConfig::setGroup(const QString & szGroup) } } -bool KviConfig::hasKey(const QString & szKey) +bool KviConfig::hasKey(const TQString & szKey) { KviConfigGroup * p_group = getCurrentGroup(); - return (p_group->find(szKey) != 0); + return (p_group->tqfind(szKey) != 0); } -bool KviConfig::hasGroup(const QString & szGroup) +bool KviConfig::hasGroup(const TQString & szGroup) { - return (m_pDict->find(szGroup) != 0); + return (m_pDict->tqfind(szGroup) != 0); } KviConfigGroup * KviConfig::getCurrentGroup() { if(m_szGroup.isEmpty())m_szGroup = KVI_CONFIG_DEFAULT_GROUP; - KviConfigGroup * p_group = m_pDict->find(m_szGroup); + KviConfigGroup * p_group = m_pDict->tqfind(m_szGroup); if(!p_group) { //create the group @@ -574,20 +574,20 @@ KviConfigGroup * KviConfig::getCurrentGroup() ////////////////////////////////// KviStr -void KviConfig::writeEntry(const QString & szKey,const QString & szValue) +void KviConfig::writeEntry(const TQString & szKey,const TQString & szValue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data=new QString(szValue); - p_group->replace(szKey,p_data); + TQString *p_data=new TQString(szValue); + p_group->tqreplace(szKey,p_data); } // FIXME: #warning "We have probs here ?" -QString KviConfig::readEntry(const QString & szKey,const QString & szDefault) +TQString KviConfig::readEntry(const TQString & szKey,const TQString & szDefault) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str) { m_szStrBuffer = szDefault; @@ -597,72 +597,72 @@ QString KviConfig::readEntry(const QString & szKey,const QString & szDefault) return m_szStrBuffer; } -//////////////////////////////////// QString +//////////////////////////////////// TQString /* -QString KviConfig::readQStringEntry(const char *szKey,const QString &szDefault) +TQString KviConfig::readTQStringEntry(const char *szKey,const TQString &szDefault) { KviStrDict * p_group = getCurrentGroup(); - KviStr * p_str = p_group->find(szKey); + KviStr * p_str = p_group->tqfind(szKey); if(!p_str)return szDefault; - return QString::fromUtf8(p_str->ptr()); + return TQString::fromUtf8(p_str->ptr()); } */ /* -void KviConfig::writeEntry(const char *szKey,const QString &szValue) +void KviConfig::writeEntry(const char *szKey,const TQString &szValue) { m_bDirty = true; KviStrDict * p_group = getCurrentGroup(); - p_group->replace(szKey,new KviStr(szValue.utf8().data())); + p_group->tqreplace(szKey,new KviStr(szValue.utf8().data())); } */ -////////////////////////////////// QStringList +////////////////////////////////// TQStringList -static QString g_szConfigStringListSeparator(",\\[ITEM],"); +static TQString g_szConfigStringListSeparator(",\\[ITEM],"); -QStringList KviConfig::readStringListEntry(const QString & szKey,const QStringList &list) +TQStringList KviConfig::readStringListEntry(const TQString & szKey,const TQStringList &list) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return list; #ifdef COMPILE_USE_QT4 return p_str->split(g_szConfigStringListSeparator); #else - return QStringList::split(g_szConfigStringListSeparator,*p_str); + return TQStringList::split(g_szConfigStringListSeparator,*p_str); #endif } -void KviConfig::writeEntry(const QString & szKey,const QStringList &list) +void KviConfig::writeEntry(const TQString & szKey,const TQStringList &list) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data=new QString(list.join(g_szConfigStringListSeparator)); - p_group->replace(szKey,p_data); + TQString *p_data=new TQString(list.join(g_szConfigStringListSeparator)); + p_group->tqreplace(szKey,p_data); } ////////////////////////////////// KviValueList<int> -KviValueList<int> KviConfig::readIntListEntry(const QString & szKey,const KviValueList<int> &list) +KviValueList<int> KviConfig::readIntListEntry(const TQString & szKey,const KviValueList<int> &list) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str) { //debug("Returning default list for group %s and key %s",m_szGroup.latin1(),szKey.latin1()); return list; } #ifdef COMPILE_USE_QT4 - QStringList sl = p_str->split(","); + TQStringList sl = p_str->split(","); #else - QStringList sl = QStringList::split(",",*p_str); + TQStringList sl = TQStringList::split(",",*p_str); #endif KviValueList<int> ret; //debug("Got option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),p_str->latin1()); - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) + for(TQStringList::Iterator it = sl.begin();it != sl.end();++it) { bool bOk; int iTmp = (*it).toInt(&bOk); @@ -673,7 +673,7 @@ KviValueList<int> KviConfig::readIntListEntry(const QString & szKey,const KviVal } -void KviConfig::writeEntry(const QString & szKey,const KviValueList<int> &list) +void KviConfig::writeEntry(const TQString & szKey,const KviValueList<int> &list) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); @@ -685,26 +685,26 @@ void KviConfig::writeEntry(const QString & szKey,const KviValueList<int> &list) } //debug("Writing option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),szData.ptr()); - p_group->replace(szKey,new QString(szData.ptr())); + p_group->tqreplace(szKey,new TQString(szData.ptr())); } ////////////////////////////////// KviPixmap // FIXME: #warning "Spaces in image names ?" -void KviConfig::writeEntry(const QString & szKey,const KviPixmap &pixmap) +void KviConfig::writeEntry(const TQString & szKey,const KviPixmap &pixmap) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data=new QString(); + TQString *p_data=new TQString(); KviStringConversion::toString(pixmap,*p_data); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -KviPixmap KviConfig::readPixmapEntry(const QString & szKey,const KviPixmap &pixDef) +KviPixmap KviConfig::readPixmapEntry(const TQString & szKey,const KviPixmap &pixDef) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(p_str) { KviPixmap ret(""); @@ -716,40 +716,40 @@ KviPixmap KviConfig::readPixmapEntry(const QString & szKey,const KviPixmap &pixD ////////////////////////////////// KviMsgType -void KviConfig::writeEntry(const QString & szKey,const KviMsgType &msg) +void KviConfig::writeEntry(const TQString & szKey,const KviMsgType &msg) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString szData; + TQString szData; KviStringConversion::toString(msg,szData); - p_group->replace(szKey,new QString(szData)); + p_group->tqreplace(szKey,new TQString(szData)); } -KviMsgType KviConfig::readMsgTypeEntry(const QString & szKey,const KviMsgType &msgDef) +KviMsgType KviConfig::readMsgTypeEntry(const TQString & szKey,const KviMsgType &msgDef) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return msgDef; KviMsgType ret = msgDef; KviStringConversion::fromString(*p_str,ret); return ret; } -////////////////////////////////// QColor +////////////////////////////////// TQColor -void KviConfig::writeEntry(const QString & szKey,const QColor &clr) +void KviConfig::writeEntry(const TQString & szKey,const TQColor &clr) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); KviStr szData(KviStr::Format,"%d,%d,%d",clr.red(),clr.green(),clr.blue()); - p_group->replace(szKey,new QString(szData.ptr())); + p_group->tqreplace(szKey,new TQString(szData.ptr())); } -QColor KviConfig::readColorEntry(const QString & szKey,const QColor &clr) +TQColor KviConfig::readColorEntry(const TQString & szKey,const TQColor &clr) { KviConfigGroup * p_group = getCurrentGroup(); - QColor color(clr); - QString * pointer_that_IS_initialized = p_group->find(szKey); + TQColor color(clr); + TQString * pointer_that_IS_initialized = p_group->tqfind(szKey); if(pointer_that_IS_initialized) @@ -778,35 +778,35 @@ QColor KviConfig::readColorEntry(const QString & szKey,const QColor &clr) return color; } -////////////////////////////////// QFont +////////////////////////////////// TQFont -void KviConfig::getFontProperties(KviStr & buffer,QFont *fnt) +void KviConfig::getFontProperties(KviStr & buffer,TQFont *fnt) { - QString tmp; + TQString tmp; KviStringConversion::toString(*fnt,tmp); buffer = tmp; } -void KviConfig::writeEntry(const QString & szKey,QFont &fnt) +void KviConfig::writeEntry(const TQString & szKey,TQFont &fnt) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); + TQString *p_data = new TQString(); KviStringConversion::toString(fnt,*p_data); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -void KviConfig::setFontProperties(KviStr & str,QFont *fnt) +void KviConfig::setFontProperties(KviStr & str,TQFont *fnt) { KviStringConversion::fromString(str.ptr(),*fnt); } -QFont KviConfig::readFontEntry(const QString & szKey,const QFont &fnt) +TQFont KviConfig::readFontEntry(const TQString & szKey,const TQFont &fnt) { - QFont font(fnt); + TQFont font(fnt); KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(p_str) { //FontEntry=Arial,12,9,0,100,italic,underline,strikeout, @@ -819,58 +819,58 @@ QFont KviConfig::readFontEntry(const QString & szKey,const QFont &fnt) ////////////////////////////////// bool -void KviConfig::writeEntry(const QString & szKey,bool bTrue) +void KviConfig::writeEntry(const TQString & szKey,bool bTrue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(bTrue ? "true" : "false"); - p_group->replace(szKey,p_data); + TQString *p_data = new TQString(bTrue ? "true" : "false"); + p_group->tqreplace(szKey,p_data); } -bool KviConfig::readBoolEntry(const QString & szKey,bool bTrue) +bool KviConfig::readBoolEntry(const TQString & szKey,bool bTrue) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return bTrue; - static QString szTrue = "true"; - return (KviQString::toLower(*p_str) == szTrue); + static TQString szTrue = "true"; + return (KviTQString::toLower(*p_str) == szTrue); } -////////////////////////////////// QRect +////////////////////////////////// TQRect -void KviConfig::writeEntry(const QString & szKey,const QRect &rct) +void KviConfig::writeEntry(const TQString & szKey,const TQRect &rct) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString szBuf; + TQString szBuf; KviStringConversion::toString(rct,szBuf); - p_group->replace(szKey,new QString(szBuf)); + p_group->tqreplace(szKey,new TQString(szBuf)); } -QRect KviConfig::readRectEntry(const QString & szKey,const QRect &rct) +TQRect KviConfig::readRectEntry(const TQString & szKey,const TQRect &rct) { KviConfigGroup * p_group = getCurrentGroup(); - QString * str = p_group->find(szKey); + TQString * str = p_group->tqfind(szKey); if(!str)return rct; - QRect ret; + TQRect ret; return KviStringConversion::fromString(*str,ret) ? ret : rct; } ////////////////////////////////// unsigned short -void KviConfig::writeEntry(const QString & szKey,unsigned short usValue) +void KviConfig::writeEntry(const TQString & szKey,unsigned short usValue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); + TQString *p_data = new TQString(); p_data->setNum(usValue); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -unsigned short int KviConfig::readUShortEntry(const QString & szKey,unsigned short int usDefault) +unsigned short int KviConfig::readUShortEntry(const TQString & szKey,unsigned short int usDefault) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return usDefault; bool bOk; unsigned short int usVal=p_str->toUShort(&bOk); @@ -887,13 +887,13 @@ void KviConfig::writeEntry(const char *szKey,unsigned long lValue) KviStrDict * p_group = getCurrentGroup(); KviStr *p_data = new KviStr(); p_data->setNum(lValue); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } unsigned long KviConfig::readULongEntry(const char *szKey,unsigned long lDefault) { KviStrDict * p_group = getCurrentGroup(); - KviStr * p_str = p_group->find(szKey); + KviStr * p_str = p_group->tqfind(szKey); if(!p_str)return lDefault; bool bOk; unsigned long lVal=p_str->toULong(&bOk); @@ -903,19 +903,19 @@ unsigned long KviConfig::readULongEntry(const char *szKey,unsigned long lDefault ////////////////////////////////// int -void KviConfig::writeEntry(const QString & szKey,int iValue) +void KviConfig::writeEntry(const TQString & szKey,int iValue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); + TQString *p_data = new TQString(); p_data->setNum(iValue); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -int KviConfig::readIntEntry(const QString & szKey,int iDefault) +int KviConfig::readIntEntry(const TQString & szKey,int iDefault) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return iDefault; bool bOk; int iVal=p_str->toInt(&bOk); @@ -924,19 +924,19 @@ int KviConfig::readIntEntry(const QString & szKey,int iDefault) ////////////////////////////////// unsigned int -void KviConfig::writeEntry(const QString & szKey,unsigned int iValue) +void KviConfig::writeEntry(const TQString & szKey,unsigned int iValue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); + TQString *p_data = new TQString(); p_data->setNum(iValue); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -unsigned int KviConfig::readUIntEntry(const QString & szKey,unsigned int iDefault) +unsigned int KviConfig::readUIntEntry(const TQString & szKey,unsigned int iDefault) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return iDefault; bool bOk; unsigned int iVal=p_str->toUInt(&bOk); @@ -945,19 +945,19 @@ unsigned int KviConfig::readUIntEntry(const QString & szKey,unsigned int iDefaul ////////////////////////////////// char -void KviConfig::writeEntry(const QString & szKey,char iValue) +void KviConfig::writeEntry(const TQString & szKey,char iValue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString * p_data = new QString(); + TQString * p_data = new TQString(); p_data->setNum(iValue); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -char KviConfig::readCharEntry(const QString & szKey,char iDefault) +char KviConfig::readCharEntry(const TQString & szKey,char iDefault) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return iDefault; bool bOk; char iVal=(char)p_str->toInt(&bOk); @@ -966,19 +966,19 @@ char KviConfig::readCharEntry(const QString & szKey,char iDefault) ////////////////////////////////// unsigned char -void KviConfig::writeEntry(const QString & szKey,unsigned char iValue) +void KviConfig::writeEntry(const TQString & szKey,unsigned char iValue) { m_bDirty = true; KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); + TQString *p_data = new TQString(); p_data->setNum(iValue); - p_group->replace(szKey,p_data); + p_group->tqreplace(szKey,p_data); } -unsigned char KviConfig::readUCharEntry(const QString & szKey,unsigned char iDefault) +unsigned char KviConfig::readUCharEntry(const TQString & szKey,unsigned char iDefault) { KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); + TQString * p_str = p_group->tqfind(szKey); if(!p_str)return iDefault; bool bOk; unsigned char iVal=(unsigned char)p_str->toUInt(&bOk); diff --git a/src/kvilib/ext/kvi_config.h b/src/kvilib/ext/kvi_config.h index 6eef4e05..46924418 100644 --- a/src/kvilib/ext/kvi_config.h +++ b/src/kvilib/ext/kvi_config.h @@ -31,35 +31,35 @@ #include "kvi_pointerhashtable.h" #include "kvi_valuelist.h" -#include <qcolor.h> -#include <qfont.h> -#include <qrect.h> -#include <qstringlist.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqrect.h> +#include <tqstringlist.h> #define KVI_CONFIG_DEFAULT_GROUP "KVIrc" class KviPixmap; class KviMsgType; -typedef KviPointerHashTable<QString,QString> KviConfigGroup; -typedef KviPointerHashTableIterator<QString,QString> KviConfigGroupIterator; -typedef KviPointerHashTableIterator<QString,KviConfigGroup> KviConfigIterator; +typedef KviPointerHashTable<TQString,TQString> KviConfigGroup; +typedef KviPointerHashTableIterator<TQString,TQString> KviConfigGroupIterator; +typedef KviPointerHashTableIterator<TQString,KviConfigGroup> KviConfigIterator; class KVILIB_API KviConfig : public KviHeapObject { public: enum FileMode { Read = 1 , Write = 2 , ReadWrite = 3 }; public: - KviConfig(const QString &filename,FileMode f/* = ReadWrite*/,bool bLocal8Bit = false); + KviConfig(const TQString &filename,FileMode f/* = ReadWrite*/,bool bLocal8Bit = false); KviConfig(const char *filename,FileMode f/* = ReadWrite*/,bool bLocal8Bit = false); ~KviConfig(); private: bool m_bLocal8Bit; - KviPointerHashTable<QString,KviConfigGroup> * m_pDict; - QString m_szFileName; + KviPointerHashTable<TQString,KviConfigGroup> * m_pDict; + TQString m_szFileName; bool m_bDirty; - QString m_szStrBuffer; - QString m_szGroup; + TQString m_szStrBuffer; + TQString m_szGroup; bool m_bPreserveEmptyGroups; bool m_bReadOnly; private: @@ -79,7 +79,7 @@ public: // as modified). // void preserveEmptyGroups(bool bPreserve){ m_bPreserveEmptyGroups = bPreserve; }; - const QString & fileName(){ return m_szFileName; }; + const TQString & fileName(){ return m_szFileName; }; bool readOnly(){ return m_bReadOnly; }; void setReadOnly(bool bReadOnly){ m_bReadOnly = bReadOnly; }; bool dirty(){ return m_bDirty; }; @@ -88,65 +88,65 @@ public: // In this way you can load a system-wide read-only config file // as default configuration, alter its settings and save it to the // user local configuration directory - void setSavePath(const QString & savePath){ m_szFileName = savePath; }; - KviPointerHashTable<QString,KviConfigGroup> *dict(){ return m_pDict; }; + void setSavePath(const TQString & savePath){ m_szFileName = savePath; }; + KviPointerHashTable<TQString,KviConfigGroup> *dict(){ return m_pDict; }; void clearDirtyFlag(){ m_bDirty = false; }; void clear(); - void clearGroup(const QString & szGroup); - void clearKey(const QString & szKey); + void clearGroup(const TQString & szGroup); + void clearKey(const TQString & szKey); unsigned int groupsCount(){ return m_pDict->count(); }; bool sync(){ return save(); }; - bool hasKey(const QString & szKey); - bool hasGroup(const QString & szGroup); - void setGroup(const QString & szGroup); + bool hasKey(const TQString & szKey); + bool hasGroup(const TQString & szGroup); + void setGroup(const TQString & szGroup); //void getContentsString(KviStr &buffer); - const QString & group(){ return m_szGroup; }; - void writeEntry(const QString & szKey,const QString & szValue); - void writeEntry(const QString & szKey,const char * szValue) - { writeEntry(szKey,QString::fromUtf8(szValue)); }; - QString readEntry(const QString & szKey,const QString & szDefault = QString::null); + const TQString & group(){ return m_szGroup; }; + void writeEntry(const TQString & szKey,const TQString & szValue); + void writeEntry(const TQString & szKey,const char * szValue) + { writeEntry(szKey,TQString::fromUtf8(szValue)); }; + TQString readEntry(const TQString & szKey,const TQString & szDefault = TQString()); // HACK for KviOptions.. (FIXME) - QString readKviStrEntry(const QString &szKey,const KviStr &szDefault) + TQString readKviStrEntry(const TQString &szKey,const KviStr &szDefault) { return readEntry(szKey,szDefault.ptr()); }; //void writeEntry(const char *szKey,KviStr &szValue); //const char * readEntry(const char *szKey,KviStr &szDefault); - void writeEntry(const QString & szKey,const KviPixmap &pixmap); - KviPixmap readPixmapEntry(const QString & szKey,const KviPixmap &pixDef); - void writeEntry(const QString & szKey,const KviMsgType &msg); - KviMsgType readMsgTypeEntry(const QString & szKey,const KviMsgType &msgDef); - void writeEntry(const QString & szKey,const QColor &clr); - QColor readColorEntry(const QString & szKey,const QColor &clr); - void writeEntry(const QString & szKey,QFont &fnt); - QFont readFontEntry(const QString & szKey,const QFont &fnt); - void writeEntry(const QString & szKey,bool bTrue); - bool readBoolEntry(const QString & szKey,bool bTrue); - QRect readRectEntry(const QString & szKey,const QRect &rct); - void writeEntry(const QString & szKey,const QRect &rct); - QStringList readStringListEntry(const QString & szKey,const QStringList &list); - void writeEntry(const QString & szKey,const QStringList &list); - KviValueList<int> readIntListEntry(const QString & ,const KviValueList<int> &list); - void writeEntry(const QString & szKey,const KviValueList<int> &list); - QString readQStringEntry(const QString & szKey,const QString &szDefault = QString::null) + void writeEntry(const TQString & szKey,const KviPixmap &pixmap); + KviPixmap readPixmapEntry(const TQString & szKey,const KviPixmap &pixDef); + void writeEntry(const TQString & szKey,const KviMsgType &msg); + KviMsgType readMsgTypeEntry(const TQString & szKey,const KviMsgType &msgDef); + void writeEntry(const TQString & szKey,const TQColor &clr); + TQColor readColorEntry(const TQString & szKey,const TQColor &clr); + void writeEntry(const TQString & szKey,TQFont &fnt); + TQFont readFontEntry(const TQString & szKey,const TQFont &fnt); + void writeEntry(const TQString & szKey,bool bTrue); + bool readBoolEntry(const TQString & szKey,bool bTrue); + TQRect readRectEntry(const TQString & szKey,const TQRect &rct); + void writeEntry(const TQString & szKey,const TQRect &rct); + TQStringList readStringListEntry(const TQString & szKey,const TQStringList &list); + void writeEntry(const TQString & szKey,const TQStringList &list); + KviValueList<int> readIntListEntry(const TQString & ,const KviValueList<int> &list); + void writeEntry(const TQString & szKey,const KviValueList<int> &list); + TQString readTQStringEntry(const TQString & szKey,const TQString &szDefault = TQString()) { return readEntry(szKey,szDefault); }; - //void writeEntry(const QString & szKey,const QString &szValue); + //void writeEntry(const TQString & szKey,const TQString &szValue); //void writeEntry(const char *szKey,unsigned long lValue); //unsigned long readULongEntry(const char *szKey,unsigned long lDefault); //void writeEntry(const char *szKey,long lValue); //long readLongEntry(const char *szKey,long lDefault); - void writeEntry(const QString & szKey,int iValue); - int readIntEntry(const QString & szKey,int iDefault); - void writeEntry(const QString & szKey,unsigned short int usValue); - unsigned short int readUShortEntry(const QString & szKey,unsigned short int usDefault); - void writeEntry(const QString & szKey,unsigned int iValue); - unsigned int readUIntEntry(const QString & szKey,unsigned int iDefault); - void writeEntry(const QString & szKey,char iValue); - char readCharEntry(const QString & szKey,char iDefault); - void writeEntry(const QString & szKey,unsigned char iValue); - unsigned char readUCharEntry(const QString & szKey,unsigned char iDefault); + void writeEntry(const TQString & szKey,int iValue); + int readIntEntry(const TQString & szKey,int iDefault); + void writeEntry(const TQString & szKey,unsigned short int usValue); + unsigned short int readUShortEntry(const TQString & szKey,unsigned short int usDefault); + void writeEntry(const TQString & szKey,unsigned int iValue); + unsigned int readUIntEntry(const TQString & szKey,unsigned int iDefault); + void writeEntry(const TQString & szKey,char iValue); + char readCharEntry(const TQString & szKey,char iDefault); + void writeEntry(const TQString & szKey,unsigned char iValue); + unsigned char readUCharEntry(const TQString & szKey,unsigned char iDefault); - static void getFontProperties(KviStr & buffer,QFont *fnt); - static void setFontProperties(KviStr & str,QFont *fnt); + static void getFontProperties(KviStr & buffer,TQFont *fnt); + static void setFontProperties(KviStr & str,TQFont *fnt); #ifdef COMPILE_ON_WINDOWS // On windows we need to override new and delete operators diff --git a/src/kvilib/ext/kvi_crypt.cpp b/src/kvilib/ext/kvi_crypt.cpp index 84a636aa..52a747ae 100644 --- a/src/kvilib/ext/kvi_crypt.cpp +++ b/src/kvilib/ext/kvi_crypt.cpp @@ -189,7 +189,7 @@ KviCryptEngineManager::KviCryptEngineManager() { - m_pEngineDict = new KviPointerHashTable<QString,KviCryptEngineDescription>; + m_pEngineDict = new KviPointerHashTable<TQString,KviCryptEngineDescription>; m_pEngineDict->setAutoDelete(true); } @@ -200,17 +200,17 @@ void KviCryptEngineManager::registerEngine(KviCryptEngineDescription * d) { - m_pEngineDict->replace(d->szName,d); + m_pEngineDict->tqreplace(d->szName,d); } - void KviCryptEngineManager::unregisterEngine(const QString &szName) + void KviCryptEngineManager::unregisterEngine(const TQString &szName) { m_pEngineDict->remove(szName); } void KviCryptEngineManager::unregisterEngines(void * providerHandle) { - KviPointerHashTableIterator<QString,KviCryptEngineDescription> it(*m_pEngineDict); + KviPointerHashTableIterator<TQString,KviCryptEngineDescription> it(*m_pEngineDict); while(it.current()) { if(it.current()->providerHandle == providerHandle) @@ -220,9 +220,9 @@ } } - KviCryptEngine * KviCryptEngineManager::allocateEngine(const QString &szName) + KviCryptEngine * KviCryptEngineManager::allocateEngine(const TQString &szName) { - KviCryptEngineDescription * d = m_pEngineDict->find(szName); + KviCryptEngineDescription * d = m_pEngineDict->tqfind(szName); if(!d)return 0; KviCryptEngine * e = d->allocFunc(); if(!e)return 0; diff --git a/src/kvilib/ext/kvi_crypt.h b/src/kvilib/ext/kvi_crypt.h index ae3bc4f0..8b36d0be 100644 --- a/src/kvilib/ext/kvi_crypt.h +++ b/src/kvilib/ext/kvi_crypt.h @@ -42,7 +42,7 @@ #include "kvi_heapobject.h" #include "kvi_pointerhashtable.h" -#include <qobject.h> +#include <tqobject.h> #ifdef COMPILE_CRYPT_SUPPORT class KviCryptEngine; @@ -51,12 +51,13 @@ typedef void (*crypt_engine_deallocator_func)(KviCryptEngine *); #endif //COMPILE_CRYPT_SUPPORT - // we must include this declaration to make moc happy even + // we must include this declaration to make tqmoc happy even // if we're not compiling the crypt support - class KVILIB_API KviCryptEngine : public QObject, public KviHeapObject + class KVILIB_API KviCryptEngine : public TQObject, public KviHeapObject { Q_OBJECT + TQ_OBJECT friend class KviCryptEngineManager; public: KviCryptEngine(); @@ -65,7 +66,7 @@ #ifdef COMPILE_CRYPT_SUPPORT private: crypt_engine_deallocator_func m_deallocFunc; // this is accessed by KviCryptEngineManager only - QString m_szLastError; + TQString m_szLastError; int m_iMaxEncryptLen; public: void setMaxEncryptLen(int m){ m_iMaxEncryptLen = m; }; @@ -101,13 +102,13 @@ // of the last error or an empty string if there // was no error after the last init() call. // - const QString &lastError(){ return m_szLastError; }; + const TQString &lastError(){ return m_szLastError; }; protected: // // The following two should have clear meaning // void clearLastError(){ m_szLastError = ""; }; - void setLastError(const QString &err){ m_szLastError = err; }; + void setLastError(const TQString &err){ m_szLastError = err; }; #endif //COMPILE_CRYPT_SUPPORT }; @@ -123,9 +124,9 @@ KviCryptEngineDescription(){}; virtual ~KviCryptEngineDescription(){}; public: - QString szName; // engine name - QString szDescription; // details - QString szAuthor; // algorithm author + TQString szName; // engine name + TQString szDescription; // details + TQString szAuthor; // algorithm author int iFlags; // properties crypt_engine_allocator_func allocFunc; // engine allocator crypt_engine_deallocator_func deallocFunc; // deallocation function (if called from outside the origin module) @@ -139,18 +140,18 @@ KviCryptEngineManager(); virtual ~KviCryptEngineManager(); private: - KviPointerHashTable<QString,KviCryptEngineDescription> * m_pEngineDict; + KviPointerHashTable<TQString,KviCryptEngineDescription> * m_pEngineDict; public: - const KviPointerHashTable<QString,KviCryptEngineDescription> * engineDict(){ return m_pEngineDict; }; + const KviPointerHashTable<TQString,KviCryptEngineDescription> * engineDict(){ return m_pEngineDict; }; void registerEngine(KviCryptEngineDescription * d); - void unregisterEngine(const QString &szName); + void unregisterEngine(const TQString &szName); void unregisterEngines(void * providerHandle); // // Allocates a crypt engine // Please note that the engine may be deleted from outside // so you'd better connect the "destroyed" signal // - KviCryptEngine * allocateEngine(const QString &szName); + KviCryptEngine * allocateEngine(const TQString &szName); void deallocateEngine(KviCryptEngine * e); }; diff --git a/src/kvilib/ext/kvi_databuffer.cpp b/src/kvilib/ext/kvi_databuffer.cpp index 7cad39c4..b0ca288c 100644 --- a/src/kvilib/ext/kvi_databuffer.cpp +++ b/src/kvilib/ext/kvi_databuffer.cpp @@ -56,7 +56,7 @@ KviDataBuffer::~KviDataBuffer() } } -int KviDataBuffer::find(const unsigned char * block,int uSize) +int KviDataBuffer::tqfind(const unsigned char * block,int uSize) { if(uSize < 1)return -1; if(uSize > m_uSize)return -1; @@ -85,7 +85,7 @@ int KviDataBuffer::find(const unsigned char * block,int uSize) return -1; } -int KviDataBuffer::find(unsigned char c) +int KviDataBuffer::tqfind(unsigned char c) { const unsigned char * p = m_pData; const unsigned char * e = p + m_uSize; diff --git a/src/kvilib/ext/kvi_databuffer.h b/src/kvilib/ext/kvi_databuffer.h index 62e09b06..9fa7487b 100644 --- a/src/kvilib/ext/kvi_databuffer.h +++ b/src/kvilib/ext/kvi_databuffer.h @@ -49,8 +49,8 @@ public: void addSize(int uSize){ resize(m_uSize + uSize); }; void append(const unsigned char * data,int uSize); void append(const KviDataBuffer &b){ append(b.data(),b.size()); }; - int find(unsigned char c); - int find(const unsigned char * block,int uSize); + int tqfind(unsigned char c); + int tqfind(const unsigned char * block,int uSize); }; #endif //_KVI_DATABUFFER_H_ diff --git a/src/kvilib/ext/kvi_dcophelper.cpp b/src/kvilib/ext/kvi_dcophelper.cpp index 83f34f4e..7528c5a7 100644 --- a/src/kvilib/ext/kvi_dcophelper.cpp +++ b/src/kvilib/ext/kvi_dcophelper.cpp @@ -30,15 +30,15 @@ #include "dcopclient.h" -#include <qdatastream.h> -#include <qvaluelist.h> +#include <tqdatastream.h> +#include <tqvaluelist.h> // must be included this way, since kvilib is built // before kvirc and symlinks to headers aren't set yet #include "../../kvirc/kernel/kvi_app.h" #include "kvi_thread.h" -KviDCOPHelper::KviDCOPHelper(bool bStartApp, const KviQCString &szAppId) +KviDCOPHelper::KviDCOPHelper(bool bStartApp, const KviTQCString &szAppId) { m_szAppId = szAppId; } @@ -47,7 +47,7 @@ KviDCOPHelper::~KviDCOPHelper() { } -bool KviDCOPHelper::ensureAppRunning(const QString &szApp) +bool KviDCOPHelper::ensureAppRunning(const TQString &szApp) { if (findRunningApp(m_szAppId)) return true; @@ -59,79 +59,79 @@ bool KviDCOPHelper::ensureAppRunning(const QString &szApp) } -bool KviDCOPHelper::voidRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc) +bool KviDCOPHelper::voidRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; + TQByteArray data; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::voidRetBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal) +bool KviDCOPHelper::voidRetBoolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool bVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << bVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::voidRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal) +bool KviDCOPHelper::voidRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << iVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::voidRetIntBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal, bool bVal) +bool KviDCOPHelper::voidRetIntBoolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal, bool bVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << iVal; arg << bVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::voidRetIntIntIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal1, int iVal2, int iVal3) +bool KviDCOPHelper::voidRetIntIntIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal1, int iVal2, int iVal3) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << iVal1; arg << iVal2; arg << iVal3; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::voidRetFloatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal) +bool KviDCOPHelper::voidRetFloatDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,float fVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << fVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::voidRetStringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,const QString &szVal) +bool KviDCOPHelper::voidRetStringDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,const TQString &szVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << szVal; return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); } -bool KviDCOPHelper::stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet) +bool KviDCOPHelper::stringRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &szRet) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "QString") + TQDataStream reply( replyData, IO_ReadOnly ); + if(replyType == TQSTRING_OBJECT_NAME_STRING) { reply >> szRet; return true; @@ -139,20 +139,20 @@ bool KviDCOPHelper::stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCSt return false; } -bool KviDCOPHelper::stringRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet,int iVal) +bool KviDCOPHelper::stringRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &szRet,int iVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQDataStream arg(data, IO_WriteOnly); arg << iVal; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "QString") + TQDataStream reply( replyData, IO_ReadOnly ); + if(replyType == TQSTRING_OBJECT_NAME_STRING) { reply >> szRet; return true; @@ -160,14 +160,14 @@ bool KviDCOPHelper::stringRetIntDCOPCall(const KviQCString &szObj,const KviQCStr return false; } -bool KviDCOPHelper::intRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret) +bool KviDCOPHelper::intRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); + TQDataStream reply( replyData, IO_ReadOnly ); if(replyType == "int") { reply >> ret; @@ -176,19 +176,19 @@ bool KviDCOPHelper::intRetVoidDCOPCall(const KviQCString &szObj,const KviQCStrin return false; } -bool KviDCOPHelper::intRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret, int iVal) +bool KviDCOPHelper::intRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret, int iVal) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQDataStream arg(data, IO_WriteOnly); arg << iVal; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); + TQDataStream reply( replyData, IO_ReadOnly ); if(replyType == "int") { reply >> ret; @@ -197,14 +197,14 @@ bool KviDCOPHelper::intRetIntDCOPCall(const KviQCString &szObj,const KviQCString return false; } -bool KviDCOPHelper::boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret) +bool KviDCOPHelper::boolRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool &ret) { if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - QDataStream reply( replyData, IO_ReadOnly ); + TQDataStream reply( replyData, IO_ReadOnly ); if(replyType == "bool") { reply >> ret; @@ -213,14 +213,14 @@ bool KviDCOPHelper::boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCStri return false; } -bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviValueList<int> &ret, int iVal) +bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviValueList<int> &ret, int iVal) { if(!ensureAppRunning(m_szAppId)) return false; - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + KviTQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << iVal; @@ -228,19 +228,19 @@ bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const K if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; - if(replyType != "QValueList<int>") + if(replyType != "TQValueList<int>") return false; - QDataStream replyStream(replyData, IO_ReadOnly); + TQDataStream replyStream(replyData, IO_ReadOnly); replyStream >> ret; return true; } -bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret) +bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviQCStringList &ret) { - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; if (!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) return false; @@ -248,18 +248,18 @@ bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviQCString &szObj,const K if (replyType != "KviQCStringList") return false; - QDataStream replyStream(replyData, IO_ReadOnly); + TQDataStream replyStream(replyData, IO_ReadOnly); replyStream >> ret; return true; } -bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret, int iVal) +bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviQCStringList &ret, int iVal) { - QByteArray data, replyData; - KviQCString replyType; + TQByteArray data, replyData; + KviTQCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQDataStream arg(data, IO_WriteOnly); arg << iVal; if (!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) @@ -268,17 +268,17 @@ bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviQCString &szObj,const Kv if (replyType != "KviQCStringList") return false; - QDataStream replyStream(replyData, IO_ReadOnly); + TQDataStream replyStream(replyData, IO_ReadOnly); replyStream >> ret; return true; } -bool KviDCOPHelper::findRunningApp(const QString &szApp) +bool KviDCOPHelper::findRunningApp(const TQString &szApp) { - QValueList<KviQCString> allApps = g_pApp->dcopClient() ->registeredApplications(); - QValueList<KviQCString>::iterator iterator; - KviQCString sz = szApp.local8Bit(); + TQValueList<KviTQCString> allApps = g_pApp->dcopClient() ->registeredApplications(); + TQValueList<KviTQCString>::iterator iterator; + KviTQCString sz = szApp.local8Bit(); for (iterator = allApps.begin();iterator != allApps.end();iterator++) { if(*iterator == sz) @@ -287,7 +287,7 @@ bool KviDCOPHelper::findRunningApp(const QString &szApp) return false; } -int KviDCOPHelper::detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) +int KviDCOPHelper::detectApp(const TQString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) { // dcop available if(!g_pApp->dcopClient()) @@ -309,30 +309,30 @@ int KviDCOPHelper::detectApp(const QString &szApp,bool bStart,int iScoreWhenFoun } -bool KviDCOPHelper::startApp(const QString &szApp,int iWaitMSecs) +bool KviDCOPHelper::startApp(const TQString &szApp,int iWaitMSecs) { // we could use KApplication::startServiceByDesktopName here // but we want to be able to wait a defined amount of time - QStringList tmp; - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQStringList tmp; + TQByteArray data, replyData; + KviTQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << szApp << tmp; if(!g_pApp->dcopClient()->call( "klauncher", "klauncher", - "start_service_by_desktop_name(QString,QStringList)", + "start_service_by_desktop_name(TQString,TQStringList)", data, replyType, replyData)) { return false; } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if(replyType != "serviceResult")return false; int result; - KviQCString dcopName; - QString error; + KviTQCString dcopName; + TQString error; reply >> result >> dcopName >> error; if(result != 0)return false; } diff --git a/src/kvilib/ext/kvi_dcophelper.h b/src/kvilib/ext/kvi_dcophelper.h index de605e37..431394d3 100644 --- a/src/kvilib/ext/kvi_dcophelper.h +++ b/src/kvilib/ext/kvi_dcophelper.h @@ -32,7 +32,7 @@ #ifdef COMPILE_KDE_SUPPORT -typedef KviValueList<KviQCString> KviQCStringList; +typedef KviValueList<KviTQCString> KviQCStringList; class KVILIB_API KviDCOPHelper { @@ -42,39 +42,39 @@ public: // Constructs a DCOP helper object. // bStartApp: tries to start application when a dcop call is about to be made and the app is not already running // szAppID: application name as seen by DCOP - KviDCOPHelper(bool bStartApp, const KviQCString &szAppId); + KviDCOPHelper(bool bStartApp, const KviTQCString &szAppId); ~KviDCOPHelper(); protected: - KviQCString m_szAppId; + KviTQCString m_szAppId; bool m_bStartApp; protected: - bool ensureAppRunning(const QString &szApp); - bool findRunningApp(const QString &szApp); - bool startApp(const QString &szApp,int iWaitMSecs = 0); - int detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted); + bool ensureAppRunning(const TQString &szApp); + bool findRunningApp(const TQString &szApp); + bool startApp(const TQString &szApp,int iWaitMSecs = 0); + int detectApp(const TQString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted); // naming convention: [return value] Ret [argument type(s)] DCOPCall - bool voidRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc); - bool voidRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal); - bool voidRetIntBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal, bool bVal); - bool voidRetIntIntIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal1, int iVal2, int iVal3); - bool voidRetBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal); - bool voidRetStringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,const QString &szVal); - bool voidRetFloatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal); - bool stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet); - bool stringRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet,int iVal); - bool intRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret); - bool intRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret, int iVal); - bool boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret); + bool voidRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc); + bool voidRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal); + bool voidRetIntBoolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal, bool bVal); + bool voidRetIntIntIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal1, int iVal2, int iVal3); + bool voidRetBoolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool bVal); + bool voidRetStringDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,const TQString &szVal); + bool voidRetFloatDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,float fVal); + bool stringRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &szRet); + bool stringRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &szRet,int iVal); + bool intRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret); + bool intRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret, int iVal); + bool boolRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool &ret); - bool qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviValueList<int> &ret, int iVal); - bool qcstringListRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret, int iVal); - bool qcstringListRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret); + bool qvalueListIntRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviValueList<int> &ret, int iVal); + bool qcstringListRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviQCStringList &ret, int iVal); + bool qcstringListRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviQCStringList &ret); }; #endif //COMPILE_KDE_SUPPORT diff --git a/src/kvilib/ext/kvi_doublebuffer.cpp b/src/kvilib/ext/kvi_doublebuffer.cpp index 5997e934..5f48a0cb 100644 --- a/src/kvilib/ext/kvi_doublebuffer.cpp +++ b/src/kvilib/ext/kvi_doublebuffer.cpp @@ -26,7 +26,7 @@ #include "kvi_doublebuffer.h" -static QPixmap * g_pMemoryPixmap = 0; +static TQPixmap * g_pMemoryPixmap = 0; static unsigned int g_uMaxRequestedWidth = 0; static unsigned int g_uMaxRequestedHeight = 0; @@ -39,8 +39,8 @@ KviDoubleBuffer::KviDoubleBuffer(unsigned int uWidth,unsigned int uHeight) unsigned int uMaxW = uWidth > g_pMemoryPixmap->width() ? uWidth : g_pMemoryPixmap->width(); unsigned int uMaxH = uHeight > g_pMemoryPixmap->height() ? uHeight : g_pMemoryPixmap->height(); #ifdef COMPILE_USE_QT4 - // QT4SUX: QPixmap::resize() is missing (it's a widely used function and assigning a new QPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = QPixmap(uMaxW,uMaxH); + // QT4SUX: TQPixmap::resize() is missing (it's a widely used function and assigning a new TQPixmap() seems to be slower and not intuitive) + *g_pMemoryPixmap = TQPixmap(uMaxW,uMaxH); #else g_pMemoryPixmap->resize(uMaxW,uMaxH); #endif @@ -55,7 +55,7 @@ KviDoubleBuffer::~KviDoubleBuffer() // We never shrink here (it's time consuming) } -QPixmap * KviDoubleBuffer::pixmap() +TQPixmap * KviDoubleBuffer::pixmap() { return g_pMemoryPixmap; } @@ -63,7 +63,7 @@ QPixmap * KviDoubleBuffer::pixmap() void KviDoubleBuffer::init() { if(g_pMemoryPixmap)return; - g_pMemoryPixmap = new QPixmap(); + g_pMemoryPixmap = new TQPixmap(); } void KviDoubleBuffer::done() @@ -79,8 +79,8 @@ void KviDoubleBuffer::heartbeat() { // do shrink :) #ifdef COMPILE_USE_QT4 - // QT4SUX: QPixmap::resize() is missing (it's a widely used function and assigning a new QPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = QPixmap(g_uMaxRequestedWidth,g_uMaxRequestedHeight); + // QT4SUX: TQPixmap::resize() is missing (it's a widely used function and assigning a new TQPixmap() seems to be slower and not intuitive) + *g_pMemoryPixmap = TQPixmap(g_uMaxRequestedWidth,g_uMaxRequestedHeight); #else g_pMemoryPixmap->resize(g_uMaxRequestedWidth,g_uMaxRequestedHeight); #endif diff --git a/src/kvilib/ext/kvi_doublebuffer.h b/src/kvilib/ext/kvi_doublebuffer.h index 103759a1..0d78fb4c 100644 --- a/src/kvilib/ext/kvi_doublebuffer.h +++ b/src/kvilib/ext/kvi_doublebuffer.h @@ -26,7 +26,7 @@ #include "kvi_settings.h" -#include <qpixmap.h> +#include <tqpixmap.h> // // This class is basically a huge shared memory pixmap meant to be used in double-buffer @@ -48,7 +48,7 @@ public: public: // This returns a pointer to the memory buffer. The buffer is at least // of the size declared in the constructor. - QPixmap * pixmap(); + TQPixmap * pixmap(); // The stuff below is internal (used only by KviApp) diff --git a/src/kvilib/ext/kvi_draganddrop.h b/src/kvilib/ext/kvi_draganddrop.h index c8bd9f3e..0ad6e9a2 100644 --- a/src/kvilib/ext/kvi_draganddrop.h +++ b/src/kvilib/ext/kvi_draganddrop.h @@ -29,17 +29,17 @@ #ifdef COMPILE_USE_QT4 - #include <q3dragobject.h> + #include <tq3dragobject.h> #define KviDragObject Q3DragObject #define KviUriDrag Q3UriDrag #define KviTextDrag Q3TextDrag #define KviImageDrag Q3ImageDrag #else - #include <qdragobject.h> - #define KviDragObject QDragObject - #define KviUriDrag QUriDrag - #define KviTextDrag QTextDrag - #define KviImageDrag QImageDrag + #include <tqdragobject.h> + #define KviDragObject TQDragObject + #define KviUriDrag TQUriDrag + #define KviTextDrag TQTextDrag + #define KviImageDrag TQImageDrag #endif #endif //!_KVI_DRAGANDDROP_H_ diff --git a/src/kvilib/ext/kvi_garbage.cpp b/src/kvilib/ext/kvi_garbage.cpp index 0e2e8881..10aacd26 100644 --- a/src/kvilib/ext/kvi_garbage.cpp +++ b/src/kvilib/ext/kvi_garbage.cpp @@ -25,10 +25,10 @@ #include "kvi_garbage.h" -#include <qvariant.h> +#include <tqvariant.h> KviGarbageCollector::KviGarbageCollector() -: QObject(0) +: TQObject(0) { m_pGarbageList = 0; m_pCleanupTimer = 0; @@ -41,17 +41,17 @@ KviGarbageCollector::~KviGarbageCollector() cleanup(); } -void KviGarbageCollector::collect(QObject * g) +void KviGarbageCollector::collect(TQObject * g) { if(!m_pGarbageList) { - m_pGarbageList = new KviPointerList<QObject>; + m_pGarbageList = new KviPointerList<TQObject>; m_pGarbageList->setAutoDelete(true); } //debug("COLLECTING GARBAGE %s",g->className()); m_pGarbageList->append(g); // debug("Registering garbage object %d (%s:%s)",g,g->className(),g->name()); - connect(g,SIGNAL(destroyed()),this,SLOT(garbageSuicide())); + connect(g,TQT_SIGNAL(destroyed()),this,TQT_SLOT(garbageSuicide())); triggerCleanup(0); } @@ -62,13 +62,13 @@ void KviGarbageCollector::garbageSuicide() debug("Ops... garbage suicide while no garbage list"); return; } - int idx = m_pGarbageList->findRef(sender()); + int idx = m_pGarbageList->tqfindRef(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))); if(idx == -1) { debug("Ops... unregistered garbage suicide"); return; } - m_pGarbageList->removeRef(sender()); + m_pGarbageList->removeRef(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))); if(m_pGarbageList->isEmpty()) { cleanup(); @@ -82,8 +82,8 @@ void KviGarbageCollector::triggerCleanup(int iTimeout) { m_pCleanupTimer->stop(); } else { - m_pCleanupTimer = new QTimer(this); - connect(m_pCleanupTimer,SIGNAL(timeout()),this,SLOT(cleanup())); + m_pCleanupTimer = new TQTimer(this); + connect(m_pCleanupTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(cleanup())); } m_pCleanupTimer->start(iTimeout); } @@ -94,16 +94,16 @@ void KviGarbageCollector::cleanup() if(m_pGarbageList) { //debug("SOME GARBAGE TO DELETE"); - KviPointerList<QObject> dying; + KviPointerList<TQObject> dying; dying.setAutoDelete(false); - for(QObject * o = m_pGarbageList->first();o;o = m_pGarbageList->next()) + for(TQObject * o = m_pGarbageList->first();o;o = m_pGarbageList->next()) { //debug("CHECKING GARBAGE CLASS %s",o->className()); bool bDeleteIt = m_bForceCleanupNow; if(!bDeleteIt) { //debug("CLEANUP NOT FORCED"); - QVariant v = o->property("blockingDelete"); + TQVariant v = o->property("blockingDelete"); if(v.isValid()) { //debug("HAS A VALID VARIANT!"); @@ -115,10 +115,10 @@ void KviGarbageCollector::cleanup() if(bDeleteIt)dying.append(o); } - for(QObject * o2 = dying.first();o2;o2 = dying.next()) + for(TQObject * o2 = dying.first();o2;o2 = dying.next()) { //debug("KILLING GARBAGE CLASS %s",o2->className()); - disconnect(o2,SIGNAL(destroyed()),this,SLOT(garbageSuicide())); + disconnect(o2,TQT_SIGNAL(destroyed()),this,TQT_SLOT(garbageSuicide())); m_pGarbageList->removeRef(o2); } diff --git a/src/kvilib/ext/kvi_garbage.h b/src/kvilib/ext/kvi_garbage.h index 6bb75641..8c8e71e4 100644 --- a/src/kvilib/ext/kvi_garbage.h +++ b/src/kvilib/ext/kvi_garbage.h @@ -24,23 +24,24 @@ #include "kvi_settings.h" -#include <qobject.h> +#include <tqobject.h> #include "kvi_pointerlist.h" -#include <qtimer.h> +#include <tqtimer.h> -class KVILIB_API KviGarbageCollector : public QObject +class KVILIB_API KviGarbageCollector : public TQObject { Q_OBJECT + TQ_OBJECT public: KviGarbageCollector(); ~KviGarbageCollector(); protected: - KviPointerList<QObject> * m_pGarbageList; - QTimer * m_pCleanupTimer; + KviPointerList<TQObject> * m_pGarbageList; + TQTimer * m_pCleanupTimer; bool m_bForceCleanupNow; public: - void collect(QObject * g); + void collect(TQObject * g); protected: void triggerCleanup(int iTimeout); protected slots: diff --git a/src/kvilib/ext/kvi_imagelib.cpp b/src/kvilib/ext/kvi_imagelib.cpp index 10835b25..90b21af6 100644 --- a/src/kvilib/ext/kvi_imagelib.cpp +++ b/src/kvilib/ext/kvi_imagelib.cpp @@ -24,31 +24,31 @@ #define __KVILIB__ -#include <qnamespace.h> +#include <tqnamespace.h> #include "kvi_imagelib.h" #include "kvi_fileutils.h" #include "kvi_locale.h" #include "kvi_memmove.h" -#include <qpixmap.h> +#include <tqpixmap.h> -//KviImageLibrary::KviImageLibrary(const QPixmap &pixmap,int imageWidth,int imageHeight) +//KviImageLibrary::KviImageLibrary(const TQPixmap &pixmap,int imageWidth,int imageHeight) //{ // if(pixmap.isNull())m_pLibrary=0; -// else m_pLibrary=new QPixmap(pixmap); +// else m_pLibrary=new TQPixmap(pixmap); // setImageSize(imageWidth,imageHeight); //} -KviImageLibrary::KviImageLibrary(const QString &path,int imageWidth,int imageHeight) +KviImageLibrary::KviImageLibrary(const TQString &path,int imageWidth,int imageHeight) { m_pLibrary=0; loadLibrary(path); setImageSize(imageWidth,imageHeight); } -KviImageLibrary::KviImageLibrary(const QString &path1,const QString &path2,int imageWidth,int imageHeight) +KviImageLibrary::KviImageLibrary(const TQString &path1,const TQString &path2,int imageWidth,int imageHeight) { m_pLibrary=0; if(KviFileUtils::fileExists(path1)) @@ -78,15 +78,15 @@ bool KviImageLibrary::setImageSize(int imageWidth,int imageHeight) return true; } -bool KviImageLibrary::loadLibrary(const QString &path) +bool KviImageLibrary::loadLibrary(const TQString &path) { if(m_pLibrary)delete m_pLibrary; - m_pLibrary=new QImage(path); + m_pLibrary=new TQImage(path); if(m_pLibrary->isNull()) { delete m_pLibrary; m_pLibrary=0; - debug("WARNING : Can not load image library %s",KviQString::toUtf8(path).data()); + debug("WARNING : Can not load image library %s",KviTQString::toUtf8(path).data()); } return (m_pLibrary != 0); } @@ -99,11 +99,11 @@ int KviImageLibrary::imageCount() return ( nRows * (m_pLibrary->height()/m_iHeight)); } -QPixmap KviImageLibrary::getImage(int zeroBasedIndex) +TQPixmap KviImageLibrary::getImage(int zeroBasedIndex) { if((zeroBasedIndex >= imageCount())||(zeroBasedIndex < 0)||(m_pLibrary->depth() < 8)) { - QPixmap image(32,32); + TQPixmap image(32,32); image.fill(); //White fill return image; } @@ -114,25 +114,25 @@ QPixmap KviImageLibrary::getImage(int zeroBasedIndex) int yOffset=(zeroBasedIndex / imPerRow) * m_iHeight; #ifdef COMPILE_USE_QT4 - QImage image(m_iWidth,m_iHeight,m_pLibrary->format()); + TQImage image(m_iWidth,m_iHeight,m_pLibrary->format()); #else - QImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); + TQImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); #endif int d = image.depth() / 8; #ifndef COMPILE_USE_QT4 - if(d == 4)image.setAlphaBuffer(true); // Qt 4.x should manage it automagically + if(d == 4)image.setAlphaBuffer(true); // TQt 4.x should manage it automagically #endif //Copy the image data - //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,Qt::CopyROP,false); + //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,TQt::CopyROP,false); for(int i=0;i<m_iHeight;i++) kvi_memmove(image.scanLine(i),m_pLibrary->scanLine(i + yOffset) + (xOffset * d),m_iWidth * d); #ifdef COMPILE_USE_QT4 - QPixmap p = QPixmap::fromImage(image); + TQPixmap p = TQPixmap::fromImage(image); #else - QPixmap p(image); + TQPixmap p(image); #endif return p; } diff --git a/src/kvilib/ext/kvi_imagelib.h b/src/kvilib/ext/kvi_imagelib.h index d78c8d19..1bbccb1b 100644 --- a/src/kvilib/ext/kvi_imagelib.h +++ b/src/kvilib/ext/kvi_imagelib.h @@ -25,7 +25,7 @@ // // A class to manage multiple image libraries. -// The library is in fact a big image that contains +// The library is in fact a big image that tqcontains // several rows of other smaller images of the same size. // The images inside the 'library' are indexed in the following way: // @@ -47,26 +47,26 @@ #include "kvi_settings.h" -#include <qimage.h> +#include <tqimage.h> class KVILIB_API KviImageLibrary { public: // Consruction & Destruction -// KviImageLibrary(const QPixmap &pixmap,int imageWidth,int imageHeight); - KviImageLibrary(const QString &path,int imageWidth,int imageHeight); - KviImageLibrary(const QString &path1,const QString &path2,int imageWidth,int imageHeight); +// KviImageLibrary(const TQPixmap &pixmap,int imageWidth,int imageHeight); + KviImageLibrary(const TQString &path,int imageWidth,int imageHeight); + KviImageLibrary(const TQString &path1,const TQString &path2,int imageWidth,int imageHeight); ~KviImageLibrary(); public: // Fields - QImage *m_pLibrary; + TQImage *m_pLibrary; int m_iWidth; int m_iHeight; public: // Methods - bool loadLibrary(const QString &path); + bool loadLibrary(const TQString &path); void unloadLibrary(); int imageCount(); bool libraryLoaded(){ return (m_pLibrary != 0); }; - QImage *getLibrary(){ return m_pLibrary; }; - QPixmap getImage(int zeroBasedIndex); + TQImage *getLibrary(){ return m_pLibrary; }; + TQPixmap getImage(int zeroBasedIndex); bool setImageSize(int imageWidth,int imageHeight); }; diff --git a/src/kvilib/ext/kvi_mediatype.cpp b/src/kvilib/ext/kvi_mediatype.cpp index 87c7926d..36cc6dfc 100644 --- a/src/kvilib/ext/kvi_mediatype.cpp +++ b/src/kvilib/ext/kvi_mediatype.cpp @@ -36,8 +36,8 @@ #include "kvi_settings.h" -#include <qregexp.h> -#include <qdir.h> +#include <tqregexp.h> +#include <tqdir.h> #include <sys/types.h> #include <sys/stat.h> @@ -98,13 +98,13 @@ KviMediaType * KviMediaManager::findMediaTypeByIanaType(const char * ianaType) return 0; } -KviMediaType * KviMediaManager::findMediaTypeByFileMask(const char * filemask) +KviMediaType * KviMediaManager::findMediaTypeByFileMask(const char * filetqmask) { __range_valid(locked()); for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next()) { // FIXME: #warning "Should this be case sensitive ?" - if(kvi_strEqualCI(mt->szFileMask.ptr(),filemask))return mt; + if(kvi_strEqualCI(mt->szFileMask.ptr(),filetqmask))return mt; } return 0; @@ -129,7 +129,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m) int iWildCount = m->szFileMask.occurences('*'); int iNonWildCount = m->szFileMask.len() - iWildCount; - // The masks with no wildcards go first in the list + // The tqmasks with no wildcards go first in the list // then we insert the ones with more non-wild chars int index = 0; @@ -137,7 +137,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m) { if(iWildCount) { - // the new mask has wildcards... if the current one has none, skip it + // the new tqmask has wildcards... if the current one has none, skip it int iWildCountExisting = mt->szFileMask.occurences('*'); if(iWildCountExisting) { @@ -164,15 +164,15 @@ void KviMediaManager::insertMediaType(KviMediaType * m) } } // else the current has no wildcards...skip } else { - // the new mask has no wildcards.... - if(mt->szFileMask.contains('*')) + // the new tqmask has no wildcards.... + if(mt->szFileMask.tqcontains('*')) { // current one has wildcards...insert m_pMediaTypeList->insert(index,m); return; } // the current one has no wildcards... - // the longer masks go first.... + // the longer tqmasks go first.... if(mt->szFileMask.len() < m->szFileMask.len()) { // the current one is shorter than the new one...insert @@ -185,10 +185,10 @@ void KviMediaManager::insertMediaType(KviMediaType * m) m_pMediaTypeList->append(m); /* - // the masks with no wildcards go first - // longer masks go first + // the tqmasks with no wildcards go first + // longer tqmasks go first - bool bHasWildcards = m->szFileMask.contains('*'); + bool bHasWildcards = m->szFileMask.tqcontains('*'); int index = 0; for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next()) { @@ -207,7 +207,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m) } } } else { - if(mt->szFileMask.contains('*')) + if(mt->szFileMask.tqcontains('*')) { m_pMediaTypeList->insert(index,m); return; @@ -235,16 +235,16 @@ void KviMediaManager::insertMediaType(KviMediaType * m) KviMediaType * KviMediaManager::findMediaType(const char * filename,bool bCheckMagic) { - // FIXME: This should be ported at least to QString.... + // FIXME: This should be ported at least to TQString.... __range_valid(locked()); KviStr szFullPath = filename; if(!kvi_isAbsolutePath(szFullPath.ptr())) { #ifdef COMPILE_USE_QT4 - KviStr tmp = QDir::currentPath(); + KviStr tmp = TQDir::currentPath(); #else - KviStr tmp = QDir::currentDirPath(); + KviStr tmp = TQDir::currentDirPath(); #endif tmp.ensureLastCharIs('/'); szFullPath.prepend(tmp); @@ -382,7 +382,7 @@ KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullP if(bCheckMagic) { - QString szTmp=QString::fromUtf8(szFullPath); + TQString szTmp=TQString::fromUtf8(szFullPath); KviFile f(szTmp); if(f.openForReading()) { @@ -403,17 +403,13 @@ KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullP { if(len && m->szMagicBytes.hasData()) { - QRegExp re(m->szMagicBytes.ptr()); + TQRegExp re(m->szMagicBytes.ptr()); // It looks like they can't decide the name for this function :D // ... well, maybe the latest choice is the best one. #ifdef COMPILE_USE_QT4 if(re.indexIn(buffer) > -1)return m; // matched! #else - #if QT_VERSION >= 300 if(re.search(buffer) > -1)return m; // matched! - #else - if(re.find(buffer,0) > -1)return m; // matched! - #endif #endif // else magic failed...not a match } else return m; // matched! (no magic check) @@ -437,7 +433,7 @@ KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullP typedef struct _KviDefaultMediaType { - const char * filemask; + const char * filetqmask; const char * magicbytes; const char * ianatype; const char * description; @@ -493,12 +489,12 @@ void KviMediaManager::load(const char * filename) insertMediaType(m); } - for(int u = 0;g_defMediaTypes[u].filemask;u++) + for(int u = 0;g_defMediaTypes[u].filetqmask;u++) { - if(!findMediaTypeByFileMask(g_defMediaTypes[u].filemask)) + if(!findMediaTypeByFileMask(g_defMediaTypes[u].filetqmask)) { KviMediaType * m = new KviMediaType; - m->szFileMask = g_defMediaTypes[u].filemask; + m->szFileMask = g_defMediaTypes[u].filetqmask; m->szMagicBytes = g_defMediaTypes[u].magicbytes; m->szIanaType = g_defMediaTypes[u].ianatype; m->szDescription = g_defMediaTypes[u].description; diff --git a/src/kvilib/ext/kvi_mediatype.h b/src/kvilib/ext/kvi_mediatype.h index 77e96594..99b427f9 100644 --- a/src/kvilib/ext/kvi_mediatype.h +++ b/src/kvilib/ext/kvi_mediatype.h @@ -67,7 +67,7 @@ private: KviMediaType * findMediaTypeForRegularFile(const char * szFullPath,const char * szFileName,bool bCheckMagic); public: KviPointerList<KviMediaType> * mediaTypeList(){ return m_pMediaTypeList; }; - KviMediaType * findMediaTypeByFileMask(const char * filemask); + KviMediaType * findMediaTypeByFileMask(const char * filetqmask); KviMediaType * findMediaTypeByIanaType(const char * ianaType); bool removeMediaType(KviMediaType * t){ return m_pMediaTypeList->removeRef(t); }; void clear(){ m_pMediaTypeList->clear(); }; diff --git a/src/kvilib/ext/kvi_miscutils.cpp b/src/kvilib/ext/kvi_miscutils.cpp index 184345ed..7b3c4caa 100644 --- a/src/kvilib/ext/kvi_miscutils.cpp +++ b/src/kvilib/ext/kvi_miscutils.cpp @@ -25,22 +25,22 @@ #define __KVILIB__ #include "kvi_miscutils.h" -#include <qstringlist.h> +#include <tqstringlist.h> namespace KviMiscUtils { - int compareVersions(const QString &szVersion1,const QString &szVersion2) + int compareVersions(const TQString &szVersion1,const TQString &szVersion2) { #ifdef COMPILE_USE_QT4 - QStringList sl1 = szVersion1.split("."); - QStringList sl2 = szVersion2.split("."); + TQStringList sl1 = szVersion1.split("."); + TQStringList sl2 = szVersion2.split("."); #else - QStringList sl1 = QStringList::split(".",szVersion1); - QStringList sl2 = QStringList::split(".",szVersion2); + TQStringList sl1 = TQStringList::split(".",szVersion1); + TQStringList sl2 = TQStringList::split(".",szVersion2); #endif - QStringList::Iterator it1 = sl1.begin(); - QStringList::Iterator it2 = sl2.begin(); + TQStringList::Iterator it1 = sl1.begin(); + TQStringList::Iterator it2 = sl2.begin(); while((it1 != sl1.end()) && (it2 != sl2.end())) { bool bOk; @@ -64,16 +64,16 @@ namespace KviMiscUtils return 0; } - bool isValidVersionString(const QString &szVersion) + bool isValidVersionString(const TQString &szVersion) { #ifdef COMPILE_USE_QT4 - QStringList sl = szVersion.split("."); + TQStringList sl = szVersion.split("."); #else - QStringList sl = QStringList::split(".",szVersion); + TQStringList sl = TQStringList::split(".",szVersion); #endif if(sl.isEmpty())return false; // must all be numbers - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) + for(TQStringList::Iterator it = sl.begin();it != sl.end();++it) { bool bOk; int i = (*it).toInt(&bOk); diff --git a/src/kvilib/ext/kvi_miscutils.h b/src/kvilib/ext/kvi_miscutils.h index f09d63a7..7bda3277 100644 --- a/src/kvilib/ext/kvi_miscutils.h +++ b/src/kvilib/ext/kvi_miscutils.h @@ -34,10 +34,10 @@ namespace KviMiscUtils // Compare two x.y.z... version strings. // The function behaves like strcmp: it returns 0 when the versions // are equal, -1 if the szVersion1 is greater and 1 if szVersion2 is greater - extern KVILIB_API int compareVersions(const QString &szVersion1,const QString &szVersion2); + extern KVILIB_API int compareVersions(const TQString &szVersion1,const TQString &szVersion2); // Check if the argument string is a valid x.y.z.... version string - extern KVILIB_API bool isValidVersionString(const QString &szVersion); + extern KVILIB_API bool isValidVersionString(const TQString &szVersion); }; diff --git a/src/kvilib/ext/kvi_osinfo.cpp b/src/kvilib/ext/kvi_osinfo.cpp index 51037a48..9d443c0b 100644 --- a/src/kvilib/ext/kvi_osinfo.cpp +++ b/src/kvilib/ext/kvi_osinfo.cpp @@ -78,9 +78,9 @@ typedef BOOL (WINAPI *PGETPRODUCTINFO)(DWORD,DWORD,DWORD,DWORD,PDWORD); #define PRODUCT_ULTIMATE 0x00000001 #define PRODUCT_WEB_SERVER 0x00000011 -static QString queryWinInfo( QueryInfo info) +static TQString queryWinInfo( QueryInfo info) { - QString szVersion; + TQString szVersion; OSVERSIONINFOEX osvi; SYSTEM_INFO si; PGNSI pGNSI; @@ -317,7 +317,7 @@ static QString queryWinInfo( QueryInfo info) lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"), - 0, KEY_QUERY_VALUE, &hKey ); + 0, KEY_TQUERY_VALUE, &hKey ); if( lRet != ERROR_SUCCESS ) return FALSE; @@ -348,19 +348,19 @@ static QString queryWinInfo( QueryInfo info) // Test for SP6 versus SP6a. lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009"), - 0, KEY_QUERY_VALUE, &hKey ); + 0, KEY_TQUERY_VALUE, &hKey ); if( lRet == ERROR_SUCCESS ) - szVersion+= QString("Service Pack 6a (Build %1)").arg( osvi.dwBuildNumber & 0xFFFF ); + szVersion+= TQString("Service Pack 6a (Build %1)").tqarg( osvi.dwBuildNumber & 0xFFFF ); else // Windows NT 4.0 prior to SP6a { - szVersion+= QString( "%1 (Build %2)").arg( osvi.szCSDVersion).arg( osvi.dwBuildNumber & 0xFFFF); + szVersion+= TQString( "%1 (Build %2)").tqarg( osvi.szCSDVersion).tqarg( osvi.dwBuildNumber & 0xFFFF); } RegCloseKey( hKey ); } else // not Windows NT 4.0 { - szVersion+= QString( "%1 (Build %2)").arg( osvi.szCSDVersion).arg( osvi.dwBuildNumber & 0xFFFF); + szVersion+= TQString( "%1 (Build %2)").tqarg( osvi.szCSDVersion).tqarg( osvi.dwBuildNumber & 0xFFFF); } break; @@ -398,7 +398,7 @@ static QString queryWinInfo( QueryInfo info) unsigned long major = osvi.dwMajorVersion; unsigned long minor = osvi.dwMinorVersion; unsigned long release = osvi.dwBuildNumber; - QString szMajor, szMinor, szRelease, szVersion; + TQString szMajor, szMinor, szRelease, szVersion; szMajor.setNum(major); szMinor.setNum(minor); szRelease.setNum(release); @@ -424,7 +424,7 @@ static QString queryWinInfo( QueryInfo info) namespace KviOsInfo { - QString type() + TQString type() { #ifdef COMPILE_ON_WINDOWS return queryWinInfo(Os_Type); @@ -437,74 +437,74 @@ namespace KviOsInfo #endif } - QString name() + TQString name() { #ifdef COMPILE_ON_WINDOWS return "windows"; #else struct utsname uts; if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.sysname); - return KviQString::empty; + return TQString::fromLocal8Bit(uts.sysname); + return KviTQString::empty; #endif } - QString version() + TQString version() { #ifdef COMPILE_ON_WINDOWS return queryWinInfo(Os_Version); #else struct utsname uts; if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.version); - return KviQString::empty; + return TQString::fromLocal8Bit(uts.version); + return KviTQString::empty; #endif } - QString release() + TQString release() { #ifdef COMPILE_ON_WINDOWS return queryWinInfo(Os_Release); #else struct utsname uts; if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.release); - return KviQString::empty; + return TQString::fromLocal8Bit(uts.release); + return KviTQString::empty; #endif } - QString machine() + TQString machine() { #ifdef COMPILE_ON_WINDOWS - QString mach = getenv("PROCESSOR_IDENTIFIER"); + TQString mach = getenv("PROCESSOR_IDENTIFIER"); return mach.section(",",0,0); #else struct utsname uts; if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.machine); - return KviQString::empty; + return TQString::fromLocal8Bit(uts.machine); + return KviTQString::empty; #endif } - QString nodename() + TQString nodename() { #ifdef COMPILE_ON_WINDOWS return "windows"; #else struct utsname uts; if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.nodename); - return KviQString::empty; + return TQString::fromLocal8Bit(uts.nodename); + return KviTQString::empty; #endif } - QString hostname() + TQString hostname() { char hbuffer[1024]; if(gethostname(hbuffer,1024) == 0) - return QString::fromLocal8Bit(hbuffer); + return TQString::fromLocal8Bit(hbuffer); else - return KviQString::empty; + return KviTQString::empty; } } diff --git a/src/kvilib/ext/kvi_osinfo.h b/src/kvilib/ext/kvi_osinfo.h index 9df4a990..5f864657 100644 --- a/src/kvilib/ext/kvi_osinfo.h +++ b/src/kvilib/ext/kvi_osinfo.h @@ -27,17 +27,17 @@ #include "kvi_settings.h" -#include <qstring.h> +#include <tqstring.h> namespace KviOsInfo { - extern KVILIB_API QString type(); - extern KVILIB_API QString name(); - extern KVILIB_API QString version(); - extern KVILIB_API QString release(); - extern KVILIB_API QString machine(); - extern KVILIB_API QString nodename(); - extern KVILIB_API QString hostname(); + extern KVILIB_API TQString type(); + extern KVILIB_API TQString name(); + extern KVILIB_API TQString version(); + extern KVILIB_API TQString release(); + extern KVILIB_API TQString machine(); + extern KVILIB_API TQString nodename(); + extern KVILIB_API TQString hostname(); }; #endif //!_KVI_OSINFO_H_ diff --git a/src/kvilib/ext/kvi_parameterlist.cpp b/src/kvilib/ext/kvi_parameterlist.cpp index 318cd3d1..9affcab3 100644 --- a/src/kvilib/ext/kvi_parameterlist.cpp +++ b/src/kvilib/ext/kvi_parameterlist.cpp @@ -166,7 +166,7 @@ unsigned int KviParameterList::getUInt(bool * bOk) return 0; } -QRect KviParameterList::getRect(bool * bOk) +TQRect KviParameterList::getRect(bool * bOk) { int val[4]; for(int i=0;i<4;i++) @@ -176,21 +176,21 @@ QRect KviParameterList::getRect(bool * bOk) if(!pszv) { if(bOk)*bOk = false; - return QRect(); // invalid + return TQRect(); // invalid } bool mybOk; val[i] = pszv->toInt(&mybOk); if(!mybOk) { if(bOk)*bOk = false; - return QRect(); // invalid + return TQRect(); // invalid } } if(bOk)*bOk = true; - return QRect(val[0],val[1],val[2],val[3]); + return TQRect(val[0],val[1],val[2],val[3]); } -QPoint KviParameterList::getPoint(bool * bOk) +TQPoint KviParameterList::getPoint(bool * bOk) { int val[2]; for(int i=0;i<2;i++) @@ -200,21 +200,21 @@ QPoint KviParameterList::getPoint(bool * bOk) if(!pszv) { if(bOk)*bOk = false; - return QPoint(); // invalid + return TQPoint(); // invalid } bool mybOk; val[i] = pszv->toInt(&mybOk); if(!mybOk) { if(bOk)*bOk = false; - return QPoint(); // invalid + return TQPoint(); // invalid } } if(bOk)*bOk = true; - return QPoint(val[0],val[1]); + return TQPoint(val[0],val[1]); } -QSize KviParameterList::getSize(bool * bOk) +TQSize KviParameterList::getSize(bool * bOk) { int val[2]; for(int i=0;i<2;i++) @@ -224,18 +224,18 @@ QSize KviParameterList::getSize(bool * bOk) if(!pszv) { if(bOk)*bOk = false; - return QSize(); // invalid + return TQSize(); // invalid } bool mybOk; val[i] = pszv->toInt(&mybOk); if(!mybOk) { if(bOk)*bOk = false; - return QSize(); // invalid + return TQSize(); // invalid } } if(bOk)*bOk = true; - return QSize(val[0],val[1]); + return TQSize(val[0],val[1]); } //#ifdef COMPILE_ON_WINDOWS diff --git a/src/kvilib/ext/kvi_parameterlist.h b/src/kvilib/ext/kvi_parameterlist.h index 51c573e0..3d3dd6db 100644 --- a/src/kvilib/ext/kvi_parameterlist.h +++ b/src/kvilib/ext/kvi_parameterlist.h @@ -28,9 +28,9 @@ #include "kvi_string.h" #include "kvi_pointerlist.h" -#include <qrect.h> -#include <qpoint.h> -#include <qsize.h> +#include <tqrect.h> +#include <tqpoint.h> +#include <tqsize.h> class KVILIB_API KviParameterList : public KviPointerList<KviStr>, public KviHeapObject { @@ -57,9 +57,9 @@ public: bool getBool(); int getInt(bool * bOk = 0); unsigned int getUInt(bool * bOk = 0); - QRect getRect(bool * bOk = 0); - QPoint getPoint(bool * bOk = 0); - QSize getSize(bool * bOk = 0); + TQRect getRect(bool * bOk = 0); + TQPoint getPoint(bool * bOk = 0); + TQSize getSize(bool * bOk = 0); KviStr * safeFirst(); KviStr * safeNext(); const char * safeFirstParam(){ return safeFirst()->ptr(); }; diff --git a/src/kvilib/ext/kvi_pixmap.cpp b/src/kvilib/ext/kvi_pixmap.cpp index f22b03ef..c5877300 100644 --- a/src/kvilib/ext/kvi_pixmap.cpp +++ b/src/kvilib/ext/kvi_pixmap.cpp @@ -30,7 +30,7 @@ #include "kvi_pixmap.h" #include "kvi_qstring.h" -#include <qpainter.h> +#include <tqpainter.h> KviPixmap::KviPixmap() { @@ -52,7 +52,7 @@ KviPixmap::KviPixmap(const KviPixmap &pix) { if(pix.pixmap()) { - m_pPix = new QPixmap(*(pix.pixmap())); + m_pPix = new TQPixmap(*(pix.pixmap())); } } } @@ -70,7 +70,7 @@ bool KviPixmap::load(const char * path) m_szPath = path; if(m_szPath.isEmpty())return false; - m_pPix = new QPixmap(m_szPath); + m_pPix = new TQPixmap(m_szPath); if(m_pPix->isNull()) { @@ -82,14 +82,14 @@ bool KviPixmap::load(const char * path) return true; } -bool KviPixmap::load(const QString& path) +bool KviPixmap::load(const TQString& path) { if(m_pPix)delete m_pPix; m_pPix = 0; m_szPath = path; if(m_szPath.isEmpty())return false; - m_pPix = new QPixmap(m_szPath); + m_pPix = new TQPixmap(m_szPath); if(m_pPix->isNull()) { @@ -101,7 +101,7 @@ bool KviPixmap::load(const QString& path) return true; } -void KviPixmap::set(const QPixmap &pix,const QString &szPath) +void KviPixmap::set(const TQPixmap &pix,const TQString &szPath) { if(pix.isNull()) { @@ -110,7 +110,7 @@ void KviPixmap::set(const QPixmap &pix,const QString &szPath) } if(m_pPix)delete m_pPix; - m_pPix = new QPixmap(pix); + m_pPix = new TQPixmap(pix); m_szPath = szPath; } @@ -125,7 +125,7 @@ void KviPixmap::setNull() KviPixmap & KviPixmap::operator=(const KviPixmap &pix) { if(m_pPix == pix.m_pPix)return (*this); // self assignment (!!!) - if(KviQString::equalCI(m_szPath,pix.path()))return (*this); // same pix + if(KviTQString::equalCI(m_szPath,pix.path()))return (*this); // same pix if(m_pPix)delete m_pPix; m_pPix = 0; @@ -135,14 +135,14 @@ KviPixmap & KviPixmap::operator=(const KviPixmap &pix) { if(pix.pixmap()) { - m_pPix = new QPixmap(*(pix.pixmap())); + m_pPix = new TQPixmap(*(pix.pixmap())); } } return (*this); } -void KviPixmapUtils::drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,const QRect& paintRect,int iWidgetWidth,int iWidgetHeight,int dx,int dy) +void KviPixmapUtils::drawPixmapWithPainter(TQPainter* p,TQPixmap * pix,int flags,const TQRect& paintRect,int iWidgetWidth,int iWidgetHeight,int dx,int dy) { if(!pix)return; if(!flags) @@ -156,18 +156,18 @@ void KviPixmapUtils::drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,c int x=0; int y=0; - if( !(flags & Qt::AlignHorizontal_Mask )) + if( !(flags & TQt::AlignHorizontal_Mask )) x=-1; - else if ( flags & Qt::AlignRight ) + else if ( flags & TQt::AlignRight ) x=iWidgetWidth - iPixWidth; - else if( flags & Qt::AlignHCenter ) + else if( flags & TQt::AlignHCenter ) x=(iWidgetWidth - iPixWidth)/2; - if( !(flags & Qt::AlignVertical_Mask )) + if( !(flags & TQt::AlignVertical_Mask )) y=-1; - else if ( flags & Qt::AlignBottom ) + else if ( flags & TQt::AlignBottom ) y=iWidgetHeight - iPixHeight; - else if( flags & Qt::AlignVCenter ) + else if( flags & TQt::AlignVCenter ) y=(iWidgetHeight - iPixHeight)/2; if(x==-1) { diff --git a/src/kvilib/ext/kvi_pixmap.h b/src/kvilib/ext/kvi_pixmap.h index 7ba91cec..9f92e456 100644 --- a/src/kvilib/ext/kvi_pixmap.h +++ b/src/kvilib/ext/kvi_pixmap.h @@ -28,7 +28,7 @@ #include "kvi_settings.h" #include "kvi_string.h" -#include <qpixmap.h> +#include <tqpixmap.h> class KVILIB_API KviPixmap { @@ -38,23 +38,23 @@ public: KviPixmap(const KviPixmap &pix); ~KviPixmap(); private: - QPixmap * m_pPix; - QString m_szPath; + TQPixmap * m_pPix; + TQString m_szPath; public: bool isNull(){ return m_pPix == 0; }; bool load(const char * path); - bool load(const QString& path); - const QString& path() const { return m_szPath; }; - QPixmap * pixmap() const { return m_pPix; }; - void set(const QPixmap &pix,const QString &szPath); + bool load(const TQString& path); + const TQString& path() const { return m_szPath; }; + TQPixmap * pixmap() const { return m_pPix; }; + void set(const TQPixmap &pix,const TQString &szPath); KviPixmap & operator=(const KviPixmap &pix); // deep copy void setNull(); }; namespace KviPixmapUtils { - extern KVILIB_API void drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,const QRect& paintRect,int iWidgetWidth,int iWidgetHeight,int dx,int dy); - inline void drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,const QRect& paintRect,int iWidgetWidth,int iWidgetHeight) + extern KVILIB_API void drawPixmapWithPainter(TQPainter* p,TQPixmap * pix,int flags,const TQRect& paintRect,int iWidgetWidth,int iWidgetHeight,int dx,int dy); + inline void drawPixmapWithPainter(TQPainter* p,TQPixmap * pix,int flags,const TQRect& paintRect,int iWidgetWidth,int iWidgetHeight) { KviPixmapUtils::drawPixmapWithPainter(p,pix,flags,paintRect,iWidgetWidth,iWidgetHeight,paintRect.left(),paintRect.top()); }; }; diff --git a/src/kvilib/ext/kvi_proxydb.cpp b/src/kvilib/ext/kvi_proxydb.cpp index 917795c3..95bf66a4 100644 --- a/src/kvilib/ext/kvi_proxydb.cpp +++ b/src/kvilib/ext/kvi_proxydb.cpp @@ -71,9 +71,9 @@ void KviProxy::setNamedProtocol(const char * proto) else m_protocol = KviProxy::Socks4; } -void KviProxy::getSupportedProtocolNames(QStringList & buf) +void KviProxy::getSupportedProtocolNames(TQStringList & buf) { - for(int i=0;i<3;i++)buf.append(QString(proxy_protocols_table[i])); + for(int i=0;i<3;i++)buf.append(TQString(proxy_protocols_table[i])); } void KviProxy::normalizeUserAndPass() diff --git a/src/kvilib/ext/kvi_proxydb.h b/src/kvilib/ext/kvi_proxydb.h index 92fa2c44..0ab18f5e 100644 --- a/src/kvilib/ext/kvi_proxydb.h +++ b/src/kvilib/ext/kvi_proxydb.h @@ -28,7 +28,7 @@ #include "kvi_string.h" #include "kvi_inttypes.h" #include "kvi_pointerlist.h" -#include <qstringlist.h> +#include <tqstringlist.h> class KVILIB_API KviProxy { @@ -60,7 +60,7 @@ public: bool hasUser() const { return m_szUser.hasData(); }; unsigned int passLen() const { return (unsigned int)m_szPass.len(); }; unsigned int userLen() const { return (unsigned int)m_szUser.len(); }; - static void getSupportedProtocolNames(QStringList & buf); + static void getSupportedProtocolNames(TQStringList & buf); }; diff --git a/src/kvilib/ext/kvi_regchan.cpp b/src/kvilib/ext/kvi_regchan.cpp index a26c5969..d5eff0a3 100644 --- a/src/kvilib/ext/kvi_regchan.cpp +++ b/src/kvilib/ext/kvi_regchan.cpp @@ -28,10 +28,10 @@ #include "kvi_config.h" #include "kvi_qstring.h" -KviRegisteredChannel::KviRegisteredChannel(const KviStr &name,const KviStr &netmask) +KviRegisteredChannel::KviRegisteredChannel(const KviStr &name,const KviStr &nettqmask) { m_szName = name; - m_szNetMask = netmask; + m_szNetMask = nettqmask; m_pPropertyDict = new KviPointerHashTable<const char *,KviStr>(7,false,true); m_pPropertyDict->setAutoDelete(true); } @@ -67,9 +67,9 @@ void KviRegisteredChannelDataBase::load(const char * filename) KviRegisteredChannel * c = new KviRegisteredChannel(szChan,szMask); add(c); KviConfigGroupIterator sit(*d); - while(QString * s = sit.current()) + while(TQString * s = sit.current()) { - c->setProperty(KviQString::toUtf8(sit.currentKey()).data(),new KviStr(*s)); + c->setProperty(KviTQString::toUtf8(sit.currentKey()).data(),new KviStr(*s)); ++sit; } ++it; @@ -99,9 +99,9 @@ void KviRegisteredChannelDataBase::save(const char * filename) } } -KviRegisteredChannel * KviRegisteredChannelDataBase::find(const char * name,const char * net) +KviRegisteredChannel * KviRegisteredChannelDataBase::tqfind(const char * name,const char * net) { - KviRegisteredChannelList * l = m_pChannelDict->find(name); + KviRegisteredChannelList * l = m_pChannelDict->tqfind(name); if(!l)return 0; for(KviRegisteredChannel * c = l->first();c;c = l->next()) { @@ -111,20 +111,20 @@ KviRegisteredChannel * KviRegisteredChannelDataBase::find(const char * name,cons return 0; } -KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name,const char * netmask) +KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name,const char * nettqmask) { - KviRegisteredChannelList * l = m_pChannelDict->find(name); + KviRegisteredChannelList * l = m_pChannelDict->tqfind(name); if(!l)return 0; for(KviRegisteredChannel * c = l->first();c;c = l->next()) { - if(kvi_strEqualCI(c->netMask().ptr(),netmask))return c; + if(kvi_strEqualCI(c->netMask().ptr(),nettqmask))return c; } return 0; } void KviRegisteredChannelDataBase::remove(KviRegisteredChannel * c) { - KviRegisteredChannelList * l = m_pChannelDict->find(c->name().ptr()); + KviRegisteredChannelList * l = m_pChannelDict->tqfind(c->name().ptr()); if(!l)return; for(KviRegisteredChannel * ch = l->first();ch;ch = l->next()) { @@ -156,7 +156,7 @@ void KviRegisteredChannelDataBase::add(KviRegisteredChannel * c) } remove(old); } - KviRegisteredChannelList * l = m_pChannelDict->find(c->name().ptr()); + KviRegisteredChannelList * l = m_pChannelDict->tqfind(c->name().ptr()); if(!l) { l = new KviRegisteredChannelList; diff --git a/src/kvilib/ext/kvi_regchan.h b/src/kvilib/ext/kvi_regchan.h index f447c313..65393918 100644 --- a/src/kvilib/ext/kvi_regchan.h +++ b/src/kvilib/ext/kvi_regchan.h @@ -35,7 +35,7 @@ class KVILIB_API KviRegisteredChannel : public KviHeapObject { friend class KviRegisteredChannelDataBase; public: - KviRegisteredChannel(const KviStr &name,const KviStr &netmask); + KviRegisteredChannel(const KviStr &name,const KviStr &nettqmask); ~KviRegisteredChannel(); protected: KviStr m_szName; @@ -45,9 +45,9 @@ public: KviPointerHashTable<const char *,KviStr> * propertyDict(){ return m_pPropertyDict; }; const KviStr & name(){ return m_szName; }; const KviStr & netMask(){ return m_szNetMask; }; - KviStr * property(const char * name){ return m_pPropertyDict->find(name); }; + KviStr * property(const char * name){ return m_pPropertyDict->tqfind(name); }; // val must be allocated with NEW! - void setProperty(const char * name,KviStr * val){ m_pPropertyDict->replace(name,val); }; + void setProperty(const char * name,KviStr * val){ m_pPropertyDict->tqreplace(name,val); }; void removeProperty(const char * name){ m_pPropertyDict->remove(name); }; }; @@ -62,8 +62,8 @@ protected: KviPointerHashTable<const char *,KviRegisteredChannelList> * m_pChannelDict; public: KviPointerHashTable<const char *,KviRegisteredChannelList> * channelDict(){ return m_pChannelDict; }; - KviRegisteredChannel * find(const char * name,const char * net); - KviRegisteredChannel * findExact(const char * name,const char * netmask); + KviRegisteredChannel * tqfind(const char * name,const char * net); + KviRegisteredChannel * findExact(const char * name,const char * nettqmask); void remove(KviRegisteredChannel * c); void add(KviRegisteredChannel * c); void load(const char * filename); diff --git a/src/kvilib/ext/kvi_regusersdb.cpp b/src/kvilib/ext/kvi_regusersdb.cpp index 6d36c975..c60d2c9e 100644 --- a/src/kvilib/ext/kvi_regusersdb.cpp +++ b/src/kvilib/ext/kvi_regusersdb.cpp @@ -42,12 +42,12 @@ @short: Registration of users in KVIrc @keyterms: - registered users, registration mask, registered user properties, + registered users, registration tqmask, registered user properties, user properties, notify property, avatar property @body: [big]Introduction[/big][br] The "registered user database" is basically a set of users with associated - [doc:irc_masks]irc-masks[/doc] and properties.[br] + [doc:irc_tqmasks]irc-tqmasks[/doc] and properties.[br] It is used to recognize users on IRC and associate properties to them.[br] This works more or less like the IRC ban list, K-Line list, or invite list.[br] [big]User entry[/big][br] @@ -55,50 +55,50 @@ It may be the nickname of the user that you want to match, or the real name (if you know it) or any other string (even with spaces). The name is an "internal identifier" for the user entry: each name maps to a single entry and each entry has a single name.[br] - Each entry has a set of registration [doc:irc_masks]irc-masks[/doc]: these masks + Each entry has a set of registration [doc:irc_tqmasks]irc-tqmasks[/doc]: these tqmasks are used to recognize the user on irc.[br] [br] - [big]Registration masks[/big][br] - The masks have the common IRC mask format: [b]<nick>!<user>@<host>[/b][br] - The masks may contain '*' and '?' wildcards that match any portion of text.[br] + [big]Registration tqmasks[/big][br] + The tqmasks have the common IRC tqmask format: [b]<nick>!<user>@<host>[/b][br] + The tqmasks may contain '*' and '?' wildcards that match any portion of text.[br] [b]*!*@*[/b][br] [b]Pragma!*@*[/b][br] [b]*!~daemon@*[/b][br] [b]Pragma!*daemon@*.it[/b][br] [b]Pragma!?daemon@some*.it[/b][br] [b]Pragma!~daemon@some.host.it[/b][br] - Are examples of valid registration masks.[br] - The masks with wildcards can actually match more than a single user.[br] - For example the mask *!root@*.host.com will match all the users + Are examples of valid registration tqmasks.[br] + The tqmasks with wildcards can actually match more than a single user.[br] + For example the tqmask *!root@*.host.com will match all the users having root as username and coming from the host.com domain.[br] For this reason putting wildcards in nicknames could become a problem if not used carefully (but may also be used to achieve interesting tricks).[br] If you don't use wildcards in nicknames you are sure that - in a single irc connection , a mask will always refer to a single user.[br] + in a single irc connection , a tqmask will always refer to a single user.[br] You will commonly use the following format:[br] <nick>!*<username>@*.<host>.<top>[br] or[br] <nick>!*<username>@<number>.<number>.<number>.*[br] - In this way you can be 95% sure that the mask will really match the correct user.[br] + In this way you can be 95% sure that the tqmask will really match the correct user.[br] [br] [big]Example of registration and lookups[/big] Assume that you want to registere a friend of yours: Derek Riggs.[br] Derek often uses "Eddie" as his nickname "stranger" as username and has a dial-up connection that makes his IP address appear as <variable-number>.somewhere.in.time.org.[br] - You will add an entry with name "Derek Riggs" and a registration mask like the following: + You will add an entry with name "Derek Riggs" and a registration tqmask like the following: Eddie!stranger@*.somewhere.in.time.org.[br] - If the IRC servers keep adding strange characters ([doc:irc_masks]prefixes[/doc]) at the beginning of his username you may use + If the IRC servers keep adding strange characters ([doc:irc_tqmasks]prefixes[/doc]) at the beginning of his username you may use Eddie!*stranger@*.somewhere.in.time.org.[br] - If Eddie also often connects from the wasted.years.org domain and gets 'eddie' as username there, you might add a second registration mask as follows: + If Eddie also often connects from the wasted.years.org domain and gets 'eddie' as username there, you might add a second registration tqmask as follows: Eddie!*eddie@*.wasted.years.org.[br] - An alternative could be use only one mask with *.org as domain and allow any username (Eddie!*@*.org) but this + An alternative could be use only one tqmask with *.org as domain and allow any username (Eddie!*@*.org) but this could become dangerous since it could match the users that you don't want to.[br] On the other hand, if you dislike the users with the nickname Eddie that come from .org - and you're implementing an auto-kick system, the correct mask to register is "Eddie!*@*.org".[br] + and you're implementing an auto-kick system, the correct tqmask to register is "Eddie!*@*.org".[br] [br] KVirc ties to be smart , and always find the most correct match for an user: - If you have two masks registered: Pragma!*xor@*.myisp.it and *!*@*.myisp.it, + If you have two tqmasks registered: Pragma!*xor@*.myisp.it and *!*@*.myisp.it, kvirc will match Pragma!~xor@233-dyn.myisp.it with the first one even if the second one matches too; the firs one is a best match.[br] [br] @@ -117,7 +117,7 @@ [br] [big]The interface to the database[/big][br] The [module:reguser]reguser module[/module] is the interface to the "registered users database".[br] - It provides a set of commands for adding and removing masks and manipulating properties.[br] + It provides a set of commands for adding and removing tqmasks and manipulating properties.[br] */ //============================================================================================================ @@ -140,7 +140,7 @@ KviRegisteredMask::KviRegisteredMask(KviRegisteredUser * u,KviIrcMask * m) // -KviRegisteredUser::KviRegisteredUser(const QString & name) +KviRegisteredUser::KviRegisteredUser(const TQString & name) { m_iIgnoreFlags =0; m_bIgnoreEnabled=false; @@ -162,52 +162,52 @@ bool KviRegisteredUser::isIgnoreEnabledFor(IgnoreFlags flag) return m_iIgnoreFlags & flag; } -KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &mask) +KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &tqmask) { for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) { - if(*m == mask)return m; + if(*m == tqmask)return m; } return 0; } -bool KviRegisteredUser::addMask(KviIrcMask * mask) +bool KviRegisteredUser::addMask(KviIrcMask * tqmask) { - if(findMask(*mask)) + if(findMask(*tqmask)) { - delete mask; - mask = 0; + delete tqmask; + tqmask = 0; return false; } - m_pMaskList->append(mask); + m_pMaskList->append(tqmask); return true; } -bool KviRegisteredUser::removeMask(KviIrcMask * mask) +bool KviRegisteredUser::removeMask(KviIrcMask * tqmask) { - if(!mask)return false; - return m_pMaskList->removeRef(mask); + if(!tqmask)return false; + return m_pMaskList->removeRef(tqmask); } -bool KviRegisteredUser::matches(const KviIrcMask &mask) +bool KviRegisteredUser::matches(const KviIrcMask &tqmask) { for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) { - if(m->matches(mask))return true; + if(m->matches(tqmask))return true; } return false; } -bool KviRegisteredUser::matchesFixed(const KviIrcMask &mask) +bool KviRegisteredUser::matchesFixed(const KviIrcMask &tqmask) { for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) { - if(m->matchesFixed(mask))return true; + if(m->matchesFixed(tqmask))return true; } return false; } -bool KviRegisteredUser::matchesFixed(const QString & nick,const QString & user,const QString & host) +bool KviRegisteredUser::matchesFixed(const TQString & nick,const TQString & user,const TQString & host) { for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) { @@ -216,28 +216,28 @@ bool KviRegisteredUser::matchesFixed(const QString & nick,const QString & user,c return false; } -void KviRegisteredUser::setProperty(const QString &name,bool value) +void KviRegisteredUser::setProperty(const TQString &name,bool value) { - setProperty(name,value ? QString("true") : QString("false")); + setProperty(name,value ? TQString("true") : TQString("false")); } -void KviRegisteredUser::setProperty(const QString & name,const QString & value) +void KviRegisteredUser::setProperty(const TQString & name,const TQString & value) { if(!value.isEmpty()) { if(!m_pPropertyDict) { - m_pPropertyDict = new KviPointerHashTable<QString,QString>(7,false); + m_pPropertyDict = new KviPointerHashTable<TQString,TQString>(7,false); m_pPropertyDict->setAutoDelete(true); } #ifdef COMPILE_USE_QT4 - QString * val = new QString(value.trimmed()); + TQString * val = new TQString(value.trimmed()); #else - QString * val = new QString(value.stripWhiteSpace()); + TQString * val = new TQString(value.stripWhiteSpace()); #endif if(!val->isEmpty()) { - m_pPropertyDict->replace(name,val); + m_pPropertyDict->tqreplace(name,val); } else { delete val; val = 0; @@ -247,39 +247,39 @@ void KviRegisteredUser::setProperty(const QString & name,const QString & value) } } -bool KviRegisteredUser::getProperty(const QString & name,QString &value) +bool KviRegisteredUser::getProperty(const TQString & name,TQString &value) { if(!m_pPropertyDict)return false; if(name.isEmpty()) return false; - QString * pValue = m_pPropertyDict->find(name); + TQString * pValue = m_pPropertyDict->tqfind(name); if(pValue)value = *pValue; else return false; return true; } -const QString & KviRegisteredUser::getProperty(const QString & name) +const TQString & KviRegisteredUser::getProperty(const TQString & name) { - if(!m_pPropertyDict)return KviQString::empty; - if(name.isEmpty())return KviQString::empty; - QString * pValue = m_pPropertyDict->find(name); + if(!m_pPropertyDict)return KviTQString::empty; + if(name.isEmpty())return KviTQString::empty; + TQString * pValue = m_pPropertyDict->tqfind(name); if(pValue)return *pValue; - return KviQString::empty; + return KviTQString::empty; } -bool KviRegisteredUser::getBoolProperty(const QString & name,bool def) +bool KviRegisteredUser::getBoolProperty(const TQString & name,bool def) { if(!m_pPropertyDict)return def; if(name.isEmpty()) return def; - QString * pValue = m_pPropertyDict->find(name); + TQString * pValue = m_pPropertyDict->tqfind(name); if(pValue) { // be flexible , allow more "true" values (pragma) - if(KviQString::equalCS(*pValue,"1"))return true; - if(KviQString::equalCI(*pValue,"true"))return true; - if(KviQString::equalCI(*pValue,"yes"))return true; - //if(KviQString::equalCI(*pValue,"yeah"))return true; - //if(KviQString::equalCI(*pValue,"sure"))return true; - //if(KviQString::equalCI(*pValue,"sureashell"))return true; + if(KviTQString::equalCS(*pValue,"1"))return true; + if(KviTQString::equalCI(*pValue,"true"))return true; + if(KviTQString::equalCI(*pValue,"yes"))return true; + //if(KviTQString::equalCI(*pValue,"yeah"))return true; + //if(KviTQString::equalCI(*pValue,"sure"))return true; + //if(KviTQString::equalCI(*pValue,"sureashell"))return true; } return def; } @@ -289,7 +289,7 @@ bool KviRegisteredUser::getBoolProperty(const QString & name,bool def) // KviRegisteredUserGroup // -KviRegisteredUserGroup::KviRegisteredUserGroup(const QString &name) +KviRegisteredUserGroup::KviRegisteredUserGroup(const TQString &name) { setName(name); } @@ -306,16 +306,16 @@ KviRegisteredUserGroup::~KviRegisteredUserGroup() KviRegisteredUserDataBase::KviRegisteredUserDataBase() { - m_pUserDict = new KviPointerHashTable<QString,KviRegisteredUser>(31,false); // do not copy keys + m_pUserDict = new KviPointerHashTable<TQString,KviRegisteredUser>(31,false); // do not copy keys m_pUserDict->setAutoDelete(true); m_pWildMaskList = new KviRegisteredMaskList; m_pWildMaskList->setAutoDelete(true); - m_pMaskDict = new KviPointerHashTable<QString,KviRegisteredMaskList>(49,false); // copy keys here! + m_pMaskDict = new KviPointerHashTable<TQString,KviRegisteredMaskList>(49,false); // copy keys here! m_pMaskDict->setAutoDelete(true); - m_pGroupDict = new KviPointerHashTable<QString,KviRegisteredUserGroup>(5,false); // copy keys here! + m_pGroupDict = new KviPointerHashTable<TQString,KviRegisteredUserGroup>(5,false); // copy keys here! m_pGroupDict->setAutoDelete(true); } @@ -328,40 +328,40 @@ KviRegisteredUserDataBase::~KviRegisteredUserDataBase() delete m_pGroupDict; } -KviRegisteredUser * KviRegisteredUserDataBase::addUser(const QString & name) +KviRegisteredUser * KviRegisteredUserDataBase::addUser(const TQString & name) { if(name.isEmpty()) return false; - if(m_pUserDict->find(name))return 0; + if(m_pUserDict->tqfind(name))return 0; KviRegisteredUser * u = new KviRegisteredUser(name); - m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys! + m_pUserDict->tqreplace(u->name(),u); //u->name() because we're NOT copying keys! emit(userAdded(name)); return u; } -KviRegisteredUserGroup * KviRegisteredUserDataBase::addGroup(const QString & name) +KviRegisteredUserGroup * KviRegisteredUserDataBase::addGroup(const TQString & name) { if(name.isEmpty()) return false; - if(m_pGroupDict->find(name))return 0; + if(m_pGroupDict->tqfind(name))return 0; KviRegisteredUserGroup * pGroup = new KviRegisteredUserGroup(name); - m_pGroupDict->replace(pGroup->name(),pGroup); //u->name() because we're NOT copying keys! + m_pGroupDict->tqreplace(pGroup->name(),pGroup); //u->name() because we're NOT copying keys! return pGroup; } -KviRegisteredUser * KviRegisteredUserDataBase::getUser(const QString & name) +KviRegisteredUser * KviRegisteredUserDataBase::getUser(const TQString & name) { if(name.isEmpty()) return 0; - KviRegisteredUser * u = m_pUserDict->find(name); + KviRegisteredUser * u = m_pUserDict->tqfind(name); if(!u) { u = new KviRegisteredUser(name); - m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys! + m_pUserDict->tqreplace(u->name(),u); //u->name() because we're NOT copying keys! } return u; } -static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,KviIrcMask *mask) +static void append_tqmask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,KviIrcMask *tqmask) { - KviRegisteredMask * newMask = new KviRegisteredMask(u,mask); + KviRegisteredMask * newMask = new KviRegisteredMask(u,tqmask); int idx = 0; for(KviRegisteredMask * m = l->first();m;m = l->next()) { @@ -375,65 +375,65 @@ static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,Kv l->append(newMask); } -KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,KviIrcMask * mask) +KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,KviIrcMask * tqmask) { - if(!u || !mask) return 0; - __range_valid(u == m_pUserDict->find(u->name())); + if(!u || !tqmask) return 0; + __range_valid(u == m_pUserDict->tqfind(u->name())); KviRegisteredMaskList * l; - if(mask->hasWildNick()) + if(tqmask->hasWildNick()) { for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) { - if(*(m->mask()) == *mask) + if(*(m->tqmask()) == *tqmask) { - delete mask; - mask = 0; + delete tqmask; + tqmask = 0; return m->user(); } } // not found ...ok... add it - // masks with more info go first in the list + // tqmasks with more info go first in the list l = m_pWildMaskList; } else { - l = m_pMaskDict->find(mask->nick()); + l = m_pMaskDict->tqfind(tqmask->nick()); if(l) { // FIXME: #warning "Here we could compare the host and username only: nick matches for sure" for(KviRegisteredMask * m = l->first();m;m = l->next()) { - if(*(m->mask()) == *mask) + if(*(m->tqmask()) == *tqmask) { - delete mask; - mask = 0; + delete tqmask; + tqmask = 0; return m->user(); } } // not found ...ok... add it } else { // not found ...ok... add it - // this is the first mask in the list + // this is the first tqmask in the list l = new KviRegisteredMaskList; l->setAutoDelete(true); - if(!u->addMask(mask)) + if(!u->addMask(tqmask)) { debug(" Ops...got an incoherent regusers action...recovered ?"); delete l; l = 0; } else { - append_mask_to_list(l,u,mask); - m_pMaskDict->insert(mask->nick(),l); + append_tqmask_to_list(l,u,tqmask); + m_pMaskDict->insert(tqmask->nick(),l); } return 0; } } // Ok...add it - if(!u->addMask(mask)) + if(!u->addMask(tqmask)) { debug("ops...got an incoherent regusers action...recovered ?"); return 0; // ops...already there ? } - append_mask_to_list(l,u,mask); + append_tqmask_to_list(l,u,tqmask); return 0; } @@ -445,23 +445,23 @@ void KviRegisteredUserDataBase::copyFrom(KviRegisteredUserDataBase * db) m_pGroupDict->clear(); emit(databaseCleared()); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*(db->m_pUserDict)); + KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*(db->m_pUserDict)); while(KviRegisteredUser * theCur = it.current()) { KviRegisteredUser * u = getUser(theCur->name()); - // copy masks - KviPointerList<KviIrcMask> * l = theCur->maskList(); + // copy tqmasks + KviPointerList<KviIrcMask> * l = theCur->tqmaskList(); for(KviIrcMask * m=l->first();m;m = l->next()) { KviIrcMask * m2 = new KviIrcMask(*m); addMask(u,m2); } // copy properties - KviPointerHashTable<QString,QString> * pd = theCur->propertyDict(); + KviPointerHashTable<TQString,TQString> * pd = theCur->propertyDict(); if(pd) { - KviPointerHashTableIterator<QString,QString> pdi(*pd); + KviPointerHashTableIterator<TQString,TQString> pdi(*pd); while(pdi.current()) { u->setProperty(pdi.currentKey(),*(pdi.current())); @@ -474,7 +474,7 @@ void KviRegisteredUserDataBase::copyFrom(KviRegisteredUserDataBase * db) ++it; } - KviPointerHashTableIterator<QString,KviRegisteredUserGroup> git(*db->m_pGroupDict); + KviPointerHashTableIterator<TQString,KviRegisteredUserGroup> git(*db->m_pGroupDict); while(git.current()) { addGroup(git.currentKey()); @@ -483,34 +483,34 @@ void KviRegisteredUserDataBase::copyFrom(KviRegisteredUserDataBase * db) } -bool KviRegisteredUserDataBase::removeUser(const QString & name) +bool KviRegisteredUserDataBase::removeUser(const TQString & name) { if(name.isEmpty()) return false; - KviRegisteredUser * u = m_pUserDict->find(name); + KviRegisteredUser * u = m_pUserDict->tqfind(name); if(!u)return false; - while(KviIrcMask * mask = u->maskList()->first()) + while(KviIrcMask * tqmask = u->tqmaskList()->first()) { - if(!removeMaskByPointer(mask)) - debug("Ops... removeMaskByPointer(%s) failed ?",KviQString::toUtf8(name).data()); + if(!removeMaskByPointer(tqmask)) + debug("Ops... removeMaskByPointer(%s) failed ?",KviTQString::toUtf8(name).data()); } emit(userRemoved(name)); m_pUserDict->remove(name); return true; } -bool KviRegisteredUserDataBase::removeGroup(const QString & name) +bool KviRegisteredUserDataBase::removeGroup(const TQString & name) { if(name.isEmpty()) return false; m_pGroupDict->remove(name); return true; } -bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &mask) +bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &tqmask) { - // find the mask pointer - KviRegisteredMask * m = findExactMask(mask); + // find the tqmask pointer + KviRegisteredMask * m = findExactMask(tqmask); // and remove it if(m){ - if(removeMaskByPointer(m->mask())) + if(removeMaskByPointer(m->tqmask())) { return true; } @@ -518,36 +518,36 @@ bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &mask) return 0; } -bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * mask) +bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * tqmask) { - if(!mask) return 0; - if(mask->hasWildNick()) + if(!tqmask) return 0; + if(tqmask->hasWildNick()) { // remove from the wild list for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) { - if(m->mask() == mask) + if(m->tqmask() == tqmask) { // ok..got it, remove from the list and from the user struct (user struct deletes it!) - emit(userChanged(mask->nick())); - m->user()->removeMask(mask); // this one deletes m->mask() + emit(userChanged(tqmask->nick())); + m->user()->removeMask(tqmask); // this one deletes m->tqmask() m_pWildMaskList->removeRef(m); // this one deletes m return true; } } // not found ...opz :) } else { - KviRegisteredMaskList * l = m_pMaskDict->find(mask->nick()); + KviRegisteredMaskList * l = m_pMaskDict->tqfind(tqmask->nick()); if(l) { // FIXME: #warning "Here we could compare the host and username only: nick matches for sure" for(KviRegisteredMask * m = l->first();m;m = l->next()) { - if(m->mask() == mask) + if(m->tqmask() == tqmask) { - QString nick = mask->nick(); + TQString nick = tqmask->nick(); emit(userChanged(nick)); - m->user()->removeMask(mask); // this one deletes m->mask() (or mask) + m->user()->removeMask(tqmask); // this one deletes m->tqmask() (or tqmask) l->removeRef(m); // this one deletes m if(l->count() == 0)m_pMaskDict->remove(nick); return true; @@ -563,89 +563,89 @@ bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * mask) /* -KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const KviIrcMask &mask) +KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const KviIrcMask &tqmask) { - // first lookup the nickname in the maskDict - KviRegisteredMaskList * l = m_pMaskDict->find(mask.nick()); + // first lookup the nickname in the tqmaskDict + KviRegisteredMaskList * l = m_pMaskDict->tqfind(tqmask.nick()); if(l) { for(KviRegisteredMask *m = l->first();m;m = l->next()) { - if(m->mask()->matchesFixed(0,mask.user(),mask.host()))return m->user(); + if(m->tqmask()->matchesFixed(0,tqmask.user(),tqmask.host()))return m->user(); } } // not found....lookup the wild ones for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) { - if(m->mask()->matchesFixed(mask))return m->user(); + if(m->tqmask()->matchesFixed(tqmask))return m->user(); } return 0; // no match at all } */ -KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const QString & nick,const QString &user,const QString & host) +KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const TQString & nick,const TQString &user,const TQString & host) { KviRegisteredMask * m = findMatchingMask(nick,user,host); if(m)return m->user(); return 0; // no match at all } -KviRegisteredMask * KviRegisteredUserDataBase::findMatchingMask(const QString & nick,const QString &user,const QString & host) +KviRegisteredMask * KviRegisteredUserDataBase::findMatchingMask(const TQString & nick,const TQString &user,const TQString & host) { - // first lookup the nickname in the maskDict + // first lookup the nickname in the tqmaskDict if(nick.isEmpty()) return false; - KviRegisteredMaskList * l = m_pMaskDict->find(nick); + KviRegisteredMaskList * l = m_pMaskDict->tqfind(nick); if(l) { for(KviRegisteredMask *m = l->first();m;m = l->next()) { - if(m->mask()->matchesFixed(nick,user,host))return m; + if(m->tqmask()->matchesFixed(nick,user,host))return m; } } // not found....lookup the wild ones for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) { - if(m->mask()->matchesFixed(nick,user,host))return m; + if(m->tqmask()->matchesFixed(nick,user,host))return m; } return 0; // no match at all } -KviRegisteredUser * KviRegisteredUserDataBase::findUserWithMask(const KviIrcMask &mask) +KviRegisteredUser * KviRegisteredUserDataBase::findUserWithMask(const KviIrcMask &tqmask) { - KviRegisteredMask * m = findExactMask(mask); + KviRegisteredMask * m = findExactMask(tqmask); if(m)return m->user(); return 0; } -KviRegisteredMask * KviRegisteredUserDataBase::findExactMask(const KviIrcMask &mask) +KviRegisteredMask * KviRegisteredUserDataBase::findExactMask(const KviIrcMask &tqmask) { - // first lookup the nickname in the maskDict - if(mask.nick()=="") return 0; - KviRegisteredMaskList * l = m_pMaskDict->find(mask.nick()); + // first lookup the nickname in the tqmaskDict + if(tqmask.nick()=="") return 0; + KviRegisteredMaskList * l = m_pMaskDict->tqfind(tqmask.nick()); if(l) { for(KviRegisteredMask *m = l->first();m;m = l->next()) { - if(*(m->mask()) == mask)return m; + if(*(m->tqmask()) == tqmask)return m; } } // not found....lookup the wild ones for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) { - if(*(m->mask()) == mask)return m; + if(*(m->tqmask()) == tqmask)return m; } return 0; // no match at all } /* -bool KviRegisteredUserDataBase::isIgnoredUser(const QString & nick,const QString & user,const QString & host) +bool KviRegisteredUserDataBase::isIgnoredUser(const TQString & nick,const TQString & user,const TQString & host) { KviRegisteredUser * u = findMatchingUser(nick,user,host); if(u)return u->getBoolProperty("IGNORE"); else return false; } */ -void KviRegisteredUserDataBase::load(const QString & filename) +void KviRegisteredUserDataBase::load(const TQString & filename) { - QString szCurrent; + TQString szCurrent; KviConfig cfg(filename,KviConfig::Read); KviConfigIterator it(*cfg.dict()); @@ -653,7 +653,7 @@ void KviRegisteredUserDataBase::load(const QString & filename) { cfg.setGroup(it.currentKey()); szCurrent=it.currentKey(); - if(KviQString::equalCSN("#Group ",szCurrent,7)) + if(KviTQString::equalCSN("#Group ",szCurrent,7)) { szCurrent.remove(0,7); addGroup(szCurrent); @@ -667,16 +667,16 @@ void KviRegisteredUserDataBase::load(const QString & filename) KviConfigGroupIterator sdi(*(it.current())); while(sdi.current()) { - QString tmp = sdi.currentKey(); - if(KviQString::equalCSN("prop_",tmp,5)) + TQString tmp = sdi.currentKey(); + if(KviTQString::equalCSN("prop_",tmp,5)) { tmp.remove(0,5); u->setProperty(tmp,*(sdi.current())); - } else if(KviQString::equalCSN("mask_",tmp,5)) + } else if(KviTQString::equalCSN("tqmask_",tmp,5)) { - KviIrcMask * mask = new KviIrcMask(*(sdi.current())); - addMask(u,mask); - } else if(KviQString::equalCI(tmp,"Group")) + KviIrcMask * tqmask = new KviIrcMask(*(sdi.current())); + addMask(u,tqmask); + } else if(KviTQString::equalCI(tmp,"Group")) { u->setGroup(*(sdi.current())); } @@ -686,18 +686,18 @@ void KviRegisteredUserDataBase::load(const QString & filename) } ++it; } - if(!m_pGroupDict->find(__tr("Default"))) + if(!m_pGroupDict->tqfind(__tr("Default"))) addGroup(__tr("Default")); } -void KviRegisteredUserDataBase::save(const QString & filename) +void KviRegisteredUserDataBase::save(const TQString & filename) { KviConfig cfg(filename,KviConfig::Write); cfg.clear(); cfg.preserveEmptyGroups(true); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*m_pUserDict); + KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*m_pUserDict); while(it.current()) { @@ -707,35 +707,35 @@ void KviRegisteredUserDataBase::save(const QString & filename) cfg.writeEntry("IgnoreFlags",it.current()->ignoreFlags()); if(it.current()->propertyDict()) { - KviPointerHashTableIterator<QString,QString> pit(*(it.current()->propertyDict())); + KviPointerHashTableIterator<TQString,TQString> pit(*(it.current()->propertyDict())); while(pit.current()) { - QString tmp = "prop_"; + TQString tmp = "prop_"; tmp.append(pit.currentKey()); cfg.writeEntry(tmp,*(pit.current())); ++pit; } } - // Write masks + // Write tqmasks int idx = 0; - for(KviIrcMask * m = it.current()->maskList()->first();m;m = it.current()->maskList()->next()) + for(KviIrcMask * m = it.current()->tqmaskList()->first();m;m = it.current()->tqmaskList()->next()) { - QString tmp; - KviQString::sprintf(tmp,"mask_%d",idx); - QString mask; - m->mask(mask,KviIrcMask::NickUserHost); - cfg.writeEntry(tmp,mask); + TQString tmp; + KviTQString::sprintf(tmp,"tqmask_%d",idx); + TQString tqmask; + m->tqmask(tqmask,KviIrcMask::NickUserHost); + cfg.writeEntry(tmp,tqmask); ++idx; } cfg.writeEntry("Group",it.current()->group()); ++it; } - KviPointerHashTableIterator<QString,KviRegisteredUserGroup> git(*m_pGroupDict); - QString szTmp; + KviPointerHashTableIterator<TQString,KviRegisteredUserGroup> git(*m_pGroupDict); + TQString szTmp; while(git.current()) { - KviQString::sprintf(szTmp,"#Group %Q",&(git.current()->name())); + KviTQString::sprintf(szTmp,"#Group %Q",&(git.current()->name())); cfg.setGroup(szTmp); ++git; } diff --git a/src/kvilib/ext/kvi_regusersdb.h b/src/kvilib/ext/kvi_regusersdb.h index 06152f24..0cfd6c71 100644 --- a/src/kvilib/ext/kvi_regusersdb.h +++ b/src/kvilib/ext/kvi_regusersdb.h @@ -27,7 +27,7 @@ // // REGISTERED USERS // -// Here we manage users resigered by mask and their (generic!) properties +// Here we manage users resigered by tqmask and their (generic!) properties // #include "kvi_settings.h" @@ -38,7 +38,7 @@ #include "kvi_pointerlist.h" #include "kvi_pointerhashtable.h" -#include <qobject.h> +#include <tqobject.h> class KviRegisteredUserDataBase; @@ -64,20 +64,20 @@ public: Dcc=32 }; - KviRegisteredUser(const QString &name); + KviRegisteredUser(const TQString &name); ~KviRegisteredUser(); private: int m_iIgnoreFlags; bool m_bIgnoreEnabled; - QString m_szName; - QString m_szGroup; - KviPointerHashTable<QString,QString> * m_pPropertyDict; // owned properties - KviPointerList<KviIrcMask> * m_pMaskList; // owned masks + TQString m_szName; + TQString m_szGroup; + KviPointerHashTable<TQString,TQString> * m_pPropertyDict; // owned properties + KviPointerList<KviIrcMask> * m_pMaskList; // owned tqmasks protected: - // mask ownership is transferred! (always!) returns false if the mask was already there - bool addMask(KviIrcMask * mask); - bool removeMask(KviIrcMask * mask); - KviIrcMask * findMask(const KviIrcMask &mask); + // tqmask ownership is transferred! (always!) returns false if the tqmask was already there + bool addMask(KviIrcMask * tqmask); + bool removeMask(KviIrcMask * tqmask); + KviIrcMask * findMask(const KviIrcMask &tqmask); public: int ignoreFlags() { return m_iIgnoreFlags; }; void setIgnoreFlags(int flags) {m_iIgnoreFlags=flags; }; @@ -85,24 +85,24 @@ public: void setIgnoreEnabled(bool enabled) {m_bIgnoreEnabled=enabled;}; bool isIgnoreEnabledFor(IgnoreFlags flag); - const QString &name(){ return m_szName; }; - bool matches(const KviIrcMask &mask); - bool matchesFixed(const KviIrcMask &mask); - bool matchesFixed(const QString &nick,const QString &user,const QString &host); + const TQString &name(){ return m_szName; }; + bool matches(const KviIrcMask &tqmask); + bool matchesFixed(const KviIrcMask &tqmask); + bool matchesFixed(const TQString &nick,const TQString &user,const TQString &host); - void setProperty(const QString &name,const QString &value); - void setProperty(const QString &name,bool value); + void setProperty(const TQString &name,const TQString &value); + void setProperty(const TQString &name,bool value); - void setGroup(const QString &name) { m_szGroup=name; }; - const QString &group(){ return m_szGroup; }; + void setGroup(const TQString &name) { m_szGroup=name; }; + const TQString &group(){ return m_szGroup; }; - const QString & getProperty(const QString &name); // returns 0 if the property is not there - bool getProperty(const QString &name,QString &value); // returns false if the property is not there - bool getBoolProperty(const QString &name,bool def=FALSE); // returns true if the property is there and is true + const TQString & getProperty(const TQString &name); // returns 0 if the property is not there + bool getProperty(const TQString &name,TQString &value); // returns false if the property is not there + bool getBoolProperty(const TQString &name,bool def=FALSE); // returns true if the property is there and is true // the propertyDict may be 0! - KviPointerHashTable<QString,QString> * propertyDict(){ return m_pPropertyDict; }; - // this is never zero (but may contain no masks) - KviPointerList<KviIrcMask> * maskList(){ return m_pMaskList; }; + KviPointerHashTable<TQString,TQString> * propertyDict(){ return m_pPropertyDict; }; + // this is never zero (but may contain no tqmasks) + KviPointerList<KviIrcMask> * tqmaskList(){ return m_pMaskList; }; }; //============================================================================================================ @@ -114,13 +114,13 @@ class KVILIB_API KviRegisteredUserGroup : public KviHeapObject { friend class KviRegisteredUserDataBase; public: - KviRegisteredUserGroup(const QString &name); + KviRegisteredUserGroup(const TQString &name); ~KviRegisteredUserGroup(); - void setName(const QString &name) { m_szName=name; }; - const QString &name(){ return m_szName; }; + void setName(const TQString &name) { m_szName=name; }; + const TQString &name(){ return m_szName; }; private: - QString m_szName; + TQString m_szName; }; //============================================================================================================ // @@ -139,7 +139,7 @@ public: public: int nonWildChars(){ return m_iMaskNonWildChars; }; KviRegisteredUser * user(){ return m_pUser; }; - KviIrcMask * mask(){ return m_pMask; }; + KviIrcMask * tqmask(){ return m_pMask; }; }; typedef KviPointerList<KviRegisteredMask> KviRegisteredMaskList; @@ -149,51 +149,52 @@ typedef KviPointerList<KviRegisteredMask> KviRegisteredMaskList; // KviRegisteredUsersDb // // Manages a set of KviRegisteredUser instances stored in the m_pUserDict dictionary -// The users are identified by masks stored in m_pMaskDict and m_pWildMaskList +// The users are identified by tqmasks stored in m_pMaskDict and m_pWildMaskList // m_pMaskDict contains lists of non wild-nick KviRegisteredMask that point to users // m_pWildMaskList is a list of wild-nick KviRegisteredMask that point to users // -class KVILIB_API KviRegisteredUserDataBase : public QObject +class KVILIB_API KviRegisteredUserDataBase : public TQObject { Q_OBJECT + TQ_OBJECT public: KviRegisteredUserDataBase(); ~KviRegisteredUserDataBase(); private: - KviPointerHashTable<QString,KviRegisteredUser> * m_pUserDict; // unique namespace, owns the objects, does not copy keys - KviPointerHashTable<QString,KviRegisteredMaskList> * m_pMaskDict; // owns the objects, copies the keys + KviPointerHashTable<TQString,KviRegisteredUser> * m_pUserDict; // unique namespace, owns the objects, does not copy keys + KviPointerHashTable<TQString,KviRegisteredMaskList> * m_pMaskDict; // owns the objects, copies the keys KviRegisteredMaskList * m_pWildMaskList; // owns the objects - KviPointerHashTable<QString,KviRegisteredUserGroup>* m_pGroupDict; + KviPointerHashTable<TQString,KviRegisteredUserGroup>* m_pGroupDict; public: void copyFrom(KviRegisteredUserDataBase * db); - KviRegisteredUser * addUser(const QString &name); // returns 0 if already there - KviRegisteredUser * getUser(const QString &name); // returns existing or adds - bool removeUser(const QString &name); - bool removeGroup(const QString &name); - KviRegisteredUser * findUserByName(const QString &name){ return m_pUserDict->find(name); }; - // mask must be allocated on the heap and the ownership is transferred! - // returns non zero if there is already an user with this mask (returns the pointer to it!) - KviRegisteredUser * addMask(KviRegisteredUser * u,KviIrcMask * mask); - bool removeMaskByPointer(KviIrcMask * mask); - bool removeMask(const KviIrcMask &mask); - KviRegisteredUser * findMatchingUser(const QString &nick,const QString &user,const QString &host); - KviRegisteredUser * findUserWithMask(const KviIrcMask &mask); - KviRegisteredMask * findExactMask(const KviIrcMask &mask); - KviRegisteredMask * findMatchingMask(const QString &nick,const QString &user,const QString &host); + KviRegisteredUser * addUser(const TQString &name); // returns 0 if already there + KviRegisteredUser * getUser(const TQString &name); // returns existing or adds + bool removeUser(const TQString &name); + bool removeGroup(const TQString &name); + KviRegisteredUser * findUserByName(const TQString &name){ return m_pUserDict->tqfind(name); }; + // tqmask must be allocated on the heap and the ownership is transferred! + // returns non zero if there is already an user with this tqmask (returns the pointer to it!) + KviRegisteredUser * addMask(KviRegisteredUser * u,KviIrcMask * tqmask); + bool removeMaskByPointer(KviIrcMask * tqmask); + bool removeMask(const KviIrcMask &tqmask); + KviRegisteredUser * findMatchingUser(const TQString &nick,const TQString &user,const TQString &host); + KviRegisteredUser * findUserWithMask(const KviIrcMask &tqmask); + KviRegisteredMask * findExactMask(const KviIrcMask &tqmask); + KviRegisteredMask * findMatchingMask(const TQString &nick,const TQString &user,const TQString &host); //Only used in few places (actually one) of the code, but lot of times;perfect for inlining... //bool isIgnoredUser(const char * nick,const char * user,const char * host); - void load(const QString &filename); - void save(const QString &filename); + void load(const TQString &filename); + void save(const TQString &filename); - KviPointerHashTable<QString,KviRegisteredUser> * userDict(){ return m_pUserDict; }; - KviPointerHashTable<QString,KviRegisteredUserGroup>* groupDict() { return m_pGroupDict; }; + KviPointerHashTable<TQString,KviRegisteredUser> * userDict(){ return m_pUserDict; }; + KviPointerHashTable<TQString,KviRegisteredUserGroup>* groupDict() { return m_pGroupDict; }; - KviRegisteredUserGroup* addGroup(const QString &name); + KviRegisteredUserGroup* addGroup(const TQString &name); signals: - void userRemoved(const QString&); - void userChanged(const QString&); - void userAdded (const QString&); + void userRemoved(const TQString&); + void userChanged(const TQString&); + void userAdded (const TQString&); void databaseCleared(); }; diff --git a/src/kvilib/ext/kvi_sharedfiles.cpp b/src/kvilib/ext/kvi_sharedfiles.cpp index 65ce0d69..b3c96e11 100644 --- a/src/kvilib/ext/kvi_sharedfiles.cpp +++ b/src/kvilib/ext/kvi_sharedfiles.cpp @@ -30,7 +30,7 @@ #include "kvi_config.h" #include "kvi_fileutils.h" -#include <qfileinfo.h> +#include <tqfileinfo.h> // TODO: Match servers that the file requests come from // TODO: Max number of downloads ? @@ -60,7 +60,7 @@ with /usr/arch/mp3/SonataArctica_SingInSilence_Live.mp3 as real file path , something like "SonataArctica_SingInSilence.mp3". A remote user will then request you a DCC GET SonataArctica_SingInSilence.mp3 and KVIrc will automatically send the file.[br] - Each file offer has an "user mask" that the requesting remote users must match to + Each file offer has an "user tqmask" that the requesting remote users must match to obtain the file: *!*@* matches any user, Pragma!*@* matches any user with nickname pragma, *!*@*.omnikron.net matches any user coming from the omnikron.net domain.[br] Each offer can have an expire time: the offer will be automatically removed after @@ -69,8 +69,8 @@ use an additional "size" parameter in the DCC GET request.[br] [big]Security issues[/big] This is a nice but unsecure method of sharing files.[br] - The user mask is a good protection but you have to use it properly!.[br] - Setting the user mask to Nick!*@* can be easily exploited (just by making an user disconnect + The user tqmask is a good protection but you have to use it properly!.[br] + Setting the user tqmask to Nick!*@* can be easily exploited (just by making an user disconnect in one of the well known ways and then by using his nickname).[br] On the other side, the remote end must know exactly the visible name of the offer to request and noone but you will tell him that name.[br] @@ -79,7 +79,7 @@ Please don't send complains if someone stoles your /etc/passwd : it is because you have permitted that.[br] */ -KviSharedFile::KviSharedFile(const QString &szName,const QString &szAbsPath,const QString &szUserMask,time_t expireTime,unsigned int uFileSize) +KviSharedFile::KviSharedFile(const TQString &szName,const TQString &szAbsPath,const TQString &szUserMask,time_t expireTime,unsigned int uFileSize) { m_szName = szName; m_szAbsFilePath = szAbsPath; @@ -87,10 +87,10 @@ KviSharedFile::KviSharedFile(const QString &szName,const QString &szAbsPath,cons m_expireTime = expireTime; m_uFileSize = uFileSize; #ifdef COMPILE_USE_QT4 - // QT4ROX: Because they have finally moved the functionality of QString::contains() to QString::count(), and QString::contains() now does the right job + // QT4ROX: Because they have finally moved the functionality of TQString::tqcontains() to TQString::count(), and TQString::tqcontains() now does the right job m_uWildCount = m_szUserMask.count('*'); #else - m_uWildCount = m_szUserMask.contains('*'); + m_uWildCount = m_szUserMask.tqcontains('*'); #endif m_uNonWildCount = m_szUserMask.length() - m_uWildCount; } @@ -101,12 +101,12 @@ KviSharedFile::~KviSharedFile() KviSharedFilesManager::KviSharedFilesManager() -: QObject() +: TQObject() { - m_pSharedListDict = new KviPointerHashTable<QString,KviSharedFileList>(); + m_pSharedListDict = new KviPointerHashTable<TQString,KviSharedFileList>(); m_pSharedListDict->setAutoDelete(true); - m_pCleanupTimer = new QTimer(); - connect(m_pCleanupTimer,SIGNAL(timeout()),this,SLOT(cleanup())); + m_pCleanupTimer = new TQTimer(); + connect(m_pCleanupTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(cleanup())); } KviSharedFilesManager::~KviSharedFilesManager() @@ -118,13 +118,13 @@ KviSharedFilesManager::~KviSharedFilesManager() void KviSharedFilesManager::cleanup() { - KviPointerHashTableIterator<QString,KviSharedFileList> it(*m_pSharedListDict); + KviPointerHashTableIterator<TQString,KviSharedFileList> it(*m_pSharedListDict); time_t curTime = time(0); bool bOtherStuffToCleanup = false; //bool bChanged = false; - KviPointerList<QString> lDying; + KviPointerList<TQString> lDying; lDying.setAutoDelete(true); while(KviSharedFileList * l = it.current()) @@ -150,12 +150,12 @@ void KviSharedFilesManager::cleanup() emit sharedFileRemoved(fo); } if(l->count() == 0) - lDying.append(new QString(it.currentKey())); + lDying.append(new TQString(it.currentKey())); ++it; } - for(QString * pDyingKey = lDying.first();pDyingKey;pDyingKey = lDying.next()) + for(TQString * pDyingKey = lDying.first();pDyingKey;pDyingKey = lDying.next()) m_pSharedListDict->remove(*pDyingKey); if(!bOtherStuffToCleanup)m_pCleanupTimer->stop(); @@ -175,7 +175,7 @@ void KviSharedFilesManager::doInsert(KviSharedFileList * l, KviSharedFile * o) { if(o->wildcardCount() > 0) { - // the new mask has wildcards... if the current one has none, skip it + // the new tqmask has wildcards... if the current one has none, skip it if(fo->wildcardCount() > 0) { // the one in the list has wildcards too... @@ -200,7 +200,7 @@ void KviSharedFilesManager::doInsert(KviSharedFileList * l, KviSharedFile * o) } } // else the current has no wildcards...skip } else { - // the new mask has no wildcards.... + // the new tqmask has no wildcards.... if(fo->wildcardCount() > 0) { // current one has wildcards...insert @@ -208,8 +208,8 @@ void KviSharedFilesManager::doInsert(KviSharedFileList * l, KviSharedFile * o) return; } // the current one has no wildcards... - // the longer masks go first.... - if(fo->maskLength() < o->maskLength()) + // the longer tqmasks go first.... + if(fo->tqmaskLength() < o->tqmaskLength()) { // the current one is shorter than the new one...insert l->insert(index,o); @@ -224,12 +224,12 @@ void KviSharedFilesManager::doInsert(KviSharedFileList * l, KviSharedFile * o) void KviSharedFilesManager::addSharedFile(KviSharedFile * f) { // First find the list - KviSharedFileList * l = m_pSharedListDict->find(f->name()); + KviSharedFileList * l = m_pSharedListDict->tqfind(f->name()); if(!l) { l = new KviSharedFileList; l->setAutoDelete(true); - m_pSharedListDict->replace(f->name(),l); + m_pSharedListDict->tqreplace(f->name(),l); } doInsert(l,f); @@ -242,18 +242,18 @@ void KviSharedFilesManager::addSharedFile(KviSharedFile * f) emit sharedFileAdded(f); } -KviSharedFile * KviSharedFilesManager::addSharedFile(const QString &szName,const QString &szAbsPath,const QString &szMask,int timeoutInSecs) +KviSharedFile * KviSharedFilesManager::addSharedFile(const TQString &szName,const TQString &szAbsPath,const TQString &szMask,int timeoutInSecs) { - QFileInfo inf(szAbsPath); + TQFileInfo inf(szAbsPath); if(inf.exists() && inf.isFile() && inf.isReadable() && (inf.size() > 0)) { // First find the list - KviSharedFileList * l = m_pSharedListDict->find(szName); + KviSharedFileList * l = m_pSharedListDict->tqfind(szName); if(!l) { l = new KviSharedFileList; l->setAutoDelete(true); - m_pSharedListDict->replace(szName,l); + m_pSharedListDict->tqreplace(szName,l); } // Now insert @@ -270,24 +270,24 @@ KviSharedFile * KviSharedFilesManager::addSharedFile(const QString &szName,const return o; } else { - debug("File %s unreadable: can't add offer",KviQString::toUtf8(szAbsPath).data()); + debug("File %s unreadable: can't add offer",KviTQString::toUtf8(szAbsPath).data()); return 0; } } -KviSharedFile * KviSharedFilesManager::lookupSharedFile(const QString &szName,KviIrcMask * mask,unsigned int uFileSize) +KviSharedFile * KviSharedFilesManager::lookupSharedFile(const TQString &szName,KviIrcMask * tqmask,unsigned int uFileSize) { - KviSharedFileList * l = m_pSharedListDict->find(szName); + KviSharedFileList * l = m_pSharedListDict->tqfind(szName); if(!l)return 0; for(KviSharedFile * o = l->first();o;o = l->next()) { bool bMatch; - if(mask) + if(tqmask) { KviIrcMask umask(o->userMask()); - bMatch = mask->matchedBy(umask); - } else bMatch = KviQString::equalCS(o->userMask(),"*!*@*"); + bMatch = tqmask->matchedBy(umask); + } else bMatch = KviTQString::equalCS(o->userMask(),"*!*@*"); if(bMatch) { if(uFileSize > 0) @@ -299,18 +299,18 @@ KviSharedFile * KviSharedFilesManager::lookupSharedFile(const QString &szName,Kv return 0; } -bool KviSharedFilesManager::removeSharedFile(const QString &szName,const QString &szMask,unsigned int uFileSize) +bool KviSharedFilesManager::removeSharedFile(const TQString &szName,const TQString &szMask,unsigned int uFileSize) { - KviSharedFileList * l = m_pSharedListDict->find(szName); + KviSharedFileList * l = m_pSharedListDict->tqfind(szName); if(!l)return false; for(KviSharedFile * o = l->first();o;o = l->next()) { - if(KviQString::equalCI(szMask,o->userMask())) + if(KviTQString::equalCI(szMask,o->userMask())) { bool bMatch = uFileSize > 0 ? uFileSize == o->fileSize() : true; if(bMatch) { - QString save = szName; // <-- szName MAY Be a pointer to o->name() + TQString save = szName; // <-- szName MAY Be a pointer to o->name() l->removeRef(o); if(l->count() == 0)m_pSharedListDict->remove(save); emit sharedFileRemoved(o); @@ -321,15 +321,15 @@ bool KviSharedFilesManager::removeSharedFile(const QString &szName,const QString return false; } -bool KviSharedFilesManager::removeSharedFile(const QString &szName,KviSharedFile * off) +bool KviSharedFilesManager::removeSharedFile(const TQString &szName,KviSharedFile * off) { - KviSharedFileList * l = m_pSharedListDict->find(szName); + KviSharedFileList * l = m_pSharedListDict->tqfind(szName); if(!l)return false; for(KviSharedFile * o = l->first();o;o = l->next()) { if(off == o) { - QString save = szName; // <-- szName MAY Be a pointer to o->name() + TQString save = szName; // <-- szName MAY Be a pointer to o->name() l->removeRef(o); if(l->count() == 0)m_pSharedListDict->remove(save); emit sharedFileRemoved(off); @@ -340,7 +340,7 @@ bool KviSharedFilesManager::removeSharedFile(const QString &szName,KviSharedFile } -void KviSharedFilesManager::load(const QString &filename) +void KviSharedFilesManager::load(const TQString &filename) { KviConfig cfg(filename,KviConfig::Read); //cfg.clear(); @@ -348,25 +348,25 @@ void KviSharedFilesManager::load(const QString &filename) int num = cfg.readIntEntry("NEntries",0); for(int idx=0;idx<num;idx++) { - QString tmp; - KviQString::sprintf(tmp,"%dFName",idx); - QString szName = cfg.readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%dFilePath",idx); - QString szPath = cfg.readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%dUserMask",idx); - QString szMask = cfg.readQStringEntry(tmp,""); + TQString tmp; + KviTQString::sprintf(tmp,"%dFName",idx); + TQString szName = cfg.readTQStringEntry(tmp,""); + KviTQString::sprintf(tmp,"%dFilePath",idx); + TQString szPath = cfg.readTQStringEntry(tmp,""); + KviTQString::sprintf(tmp,"%dUserMask",idx); + TQString szMask = cfg.readTQStringEntry(tmp,""); if(!szMask.isEmpty() && !szPath.isEmpty() && !szName.isEmpty()) addSharedFile(szName,szPath,szMask,0); } } -void KviSharedFilesManager::save(const QString &filename) +void KviSharedFilesManager::save(const TQString &filename) { KviConfig cfg(filename,KviConfig::Write); cfg.clear(); cfg.setGroup("PermanentFileOffers"); - KviPointerHashTableIterator<QString,KviSharedFileList> it(*m_pSharedListDict); + KviPointerHashTableIterator<TQString,KviSharedFileList> it(*m_pSharedListDict); int idx = 0; while(KviSharedFileList * l = it.current()) { @@ -374,12 +374,12 @@ void KviSharedFilesManager::save(const QString &filename) { if(((int)(o->expireTime())) == 0) { - QString tmp; - KviQString::sprintf(tmp,"%dFName",idx); + TQString tmp; + KviTQString::sprintf(tmp,"%dFName",idx); cfg.writeEntry(tmp,it.currentKey()); - KviQString::sprintf(tmp,"%dFilePath",idx); + KviTQString::sprintf(tmp,"%dFilePath",idx); cfg.writeEntry(tmp,o->absFilePath()); - KviQString::sprintf(tmp,"%dUserMask",idx); + KviTQString::sprintf(tmp,"%dUserMask",idx); cfg.writeEntry(tmp,o->userMask()); ++idx; } diff --git a/src/kvilib/ext/kvi_sharedfiles.h b/src/kvilib/ext/kvi_sharedfiles.h index 3a6d2239..560e7494 100644 --- a/src/kvilib/ext/kvi_sharedfiles.h +++ b/src/kvilib/ext/kvi_sharedfiles.h @@ -34,28 +34,28 @@ #include "kvi_pointerhashtable.h" #include <time.h> -#include <qtimer.h> +#include <tqtimer.h> class KVILIB_API KviSharedFile : public KviHeapObject { public: - KviSharedFile(const QString &szName,const QString &szAbsPath,const QString &szUserMask,time_t expireTime,unsigned int uFileSize); + KviSharedFile(const TQString &szName,const TQString &szAbsPath,const TQString &szUserMask,time_t expireTime,unsigned int uFileSize); ~KviSharedFile(); private: - QString m_szName; - QString m_szAbsFilePath; + TQString m_szName; + TQString m_szAbsFilePath; time_t m_expireTime; - QString m_szUserMask; + TQString m_szUserMask; unsigned int m_uFileSize; unsigned int m_uWildCount; unsigned int m_uNonWildCount; public: - const QString &name(){ return m_szName; }; + const TQString &name(){ return m_szName; }; - const QString &absFilePath(){ return m_szAbsFilePath; }; + const TQString &absFilePath(){ return m_szAbsFilePath; }; - const QString &userMask(){ return m_szUserMask; }; + const TQString &userMask(){ return m_szUserMask; }; time_t expireTime(){ return m_expireTime; }; bool expires(){ return (m_expireTime != 0); }; @@ -64,32 +64,33 @@ public: unsigned int wildcardCount(){ return m_uWildCount; }; unsigned int nonWildcardCount(){ return m_uNonWildCount; }; - int maskLength(){ return m_szUserMask.length(); }; + int tqmaskLength(){ return m_szUserMask.length(); }; }; typedef KviPointerList<KviSharedFile> KviSharedFileList; -class KVILIB_API KviSharedFilesManager : public QObject +class KVILIB_API KviSharedFilesManager : public TQObject { Q_OBJECT + TQ_OBJECT public: KviSharedFilesManager(); ~KviSharedFilesManager(); private: - QTimer * m_pCleanupTimer; - KviPointerHashTable<QString,KviSharedFileList> * m_pSharedListDict; + TQTimer * m_pCleanupTimer; + KviPointerHashTable<TQString,KviSharedFileList> * m_pSharedListDict; public: void addSharedFile(KviSharedFile * f); - KviSharedFile * addSharedFile(const QString &szName,const QString &szAbsPath,const QString &szMask,int timeoutInSecs); - KviSharedFile * lookupSharedFile(const QString &szName,KviIrcMask * mask,unsigned int uFileSize = 0); - bool removeSharedFile(const QString &szName,const QString &szMask,unsigned int uFileSize); - bool removeSharedFile(const QString &szName,KviSharedFile * off); - void load(const QString &filename); - void save(const QString &filename); + KviSharedFile * addSharedFile(const TQString &szName,const TQString &szAbsPath,const TQString &szMask,int timeoutInSecs); + KviSharedFile * lookupSharedFile(const TQString &szName,KviIrcMask * tqmask,unsigned int uFileSize = 0); + bool removeSharedFile(const TQString &szName,const TQString &szMask,unsigned int uFileSize); + bool removeSharedFile(const TQString &szName,KviSharedFile * off); + void load(const TQString &filename); + void save(const TQString &filename); void clear(); - KviPointerHashTable<QString,KviSharedFileList> * sharedFileListDict(){ return m_pSharedListDict; }; + KviPointerHashTable<TQString,KviSharedFileList> * sharedFileListDict(){ return m_pSharedListDict; }; private: void doInsert(KviSharedFileList * l, KviSharedFile * o); private slots: diff --git a/src/kvilib/ext/kvi_stringconversion.cpp b/src/kvilib/ext/kvi_stringconversion.cpp index 3d0255cc..accba786 100644 --- a/src/kvilib/ext/kvi_stringconversion.cpp +++ b/src/kvilib/ext/kvi_stringconversion.cpp @@ -31,25 +31,25 @@ #include "kvi_qstring.h" #include <stdio.h> -QString g_szGlobalDir; -QString g_szLocalDir; +TQString g_szGlobalDir; +TQString g_szLocalDir; namespace KviStringConversion { - void init(const QString& szGlobalDir,const QString& szLocalDir) + void init(const TQString& szGlobalDir,const TQString& szLocalDir) { g_szGlobalDir=szGlobalDir; g_szLocalDir=szLocalDir; } - void encodePath(QString& buffer) + void encodePath(TQString& buffer) { if(!buffer.isEmpty()) { if(!g_szLocalDir.isEmpty()) { - if(KviQString::find(buffer,g_szLocalDir)==0) + if(KviTQString::tqfind(buffer,g_szLocalDir)==0) { buffer.remove(0,g_szLocalDir.length()); buffer.prepend("local://"); @@ -57,7 +57,7 @@ namespace KviStringConversion } if(!g_szGlobalDir.isEmpty()) { - if(KviQString::find(buffer,g_szGlobalDir)==0) + if(KviTQString::tqfind(buffer,g_szGlobalDir)==0) { buffer.remove(0,g_szGlobalDir.length()); buffer.prepend("global://"); @@ -66,13 +66,13 @@ namespace KviStringConversion } } - void decodePath(QString& buffer) + void decodePath(TQString& buffer) { if(!buffer.isEmpty()) { if(!g_szLocalDir.isEmpty()) { - if(KviQString::find(buffer,"local://")==0) + if(KviTQString::tqfind(buffer,"local://")==0) { buffer.remove(0,8); buffer.prepend(g_szLocalDir); @@ -80,7 +80,7 @@ namespace KviStringConversion } if(!g_szGlobalDir.isEmpty()) { - if(KviQString::find(buffer,"global://")==0) + if(KviTQString::tqfind(buffer,"global://")==0) { buffer.remove(0,9); buffer.prepend(g_szGlobalDir); @@ -89,66 +89,66 @@ namespace KviStringConversion } } - void encodePath(QStringList& buffer) + void encodePath(TQStringList& buffer) { - for ( QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it ) + for ( TQStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it ) { encodePath(*it); } } - void decodePath(QStringList& buffer) + void decodePath(TQStringList& buffer) { - for ( QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it ) + for ( TQStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it ) { decodePath(*it); } } - void toString(const bool bValue,QString &buffer) + void toString(const bool bValue,TQString &buffer) { buffer = bValue ? '1' : '0'; } - bool fromString(const QString & szValue,bool &buffer) + bool fromString(const TQString & szValue,bool &buffer) { if(szValue.isEmpty())buffer = false; - else buffer = !((KviQString::equalCS(szValue,"0")) || (KviQString::equalCI(szValue,"false"))); + else buffer = !((KviTQString::equalCS(szValue,"0")) || (KviTQString::equalCI(szValue,"false"))); return true; } - void toString(const int iValue,QString &buffer) + void toString(const int iValue,TQString &buffer) { buffer.setNum(iValue); } - bool fromString(const QString &szValue,int &buffer) + bool fromString(const TQString &szValue,int &buffer) { bool bOk; buffer = szValue.toInt(&bOk); return bOk; } - void toString(const unsigned int uValue,QString &buffer) + void toString(const unsigned int uValue,TQString &buffer) { buffer.setNum(uValue); } - bool fromString(const QString & szValue,unsigned int &buffer) + bool fromString(const TQString & szValue,unsigned int &buffer) { bool bOk; buffer= szValue.toUInt(&bOk); return bOk; } - void toString(const QRect &rValue,QString &buffer) + void toString(const TQRect &rValue,TQString &buffer) { buffer.sprintf("%d,%d,%d,%d",rValue.x(),rValue.y(),rValue.width(),rValue.height()); } - bool fromString(const QString & szValue,QRect &buffer) + bool fromString(const TQString & szValue,TQRect &buffer) { - KviQCString tmp = KviQString::toUtf8(szValue); + KviTQCString tmp = KviTQString::toUtf8(szValue); const char * c = tmp.data(); if(!c)return false; int l,t,w,h; @@ -157,26 +157,26 @@ namespace KviStringConversion return true; } - void toString(const QString &szValue,QString &buffer) + void toString(const TQString &szValue,TQString &buffer) { buffer = szValue; } - bool fromString(const QString & szValue,QString &buffer) + bool fromString(const TQString & szValue,TQString &buffer) { buffer = szValue; return true; } - void toString(const KviPixmap &pValue,QString &buffer) + void toString(const KviPixmap &pValue,TQString &buffer) { buffer=pValue.path(); encodePath(buffer); } - bool fromString(const QString & szValue,KviPixmap &buffer) + bool fromString(const TQString & szValue,KviPixmap &buffer) { - QString szPath(szValue); + TQString szPath(szValue); decodePath(szPath); if(szPath.isEmpty()) { buffer.setNull(); @@ -186,16 +186,16 @@ namespace KviStringConversion } } - void toString(const KviMsgType &mValue,QString &buffer) + void toString(const KviMsgType &mValue,TQString &buffer) { buffer.sprintf("%d,%u,%u,%d,%d",mValue.m_iPixId,mValue.m_cForeColor,mValue.m_cBackColor,mValue.m_bLogEnabled,mValue.m_iLevel); } - bool fromString(const QString & szValue,KviMsgType &buffer) + bool fromString(const TQString & szValue,KviMsgType &buffer) { int iId,iLog,iLevel; unsigned int uFore,uBack; - KviQCString tmp = KviQString::toUtf8(szValue); + KviTQCString tmp = KviTQString::toUtf8(szValue); char * cx = tmp.data(); if(!cx)return false; if(sscanf(cx,"%d,%u,%u,%d,%d",&iId,&uFore,&uBack,&iLog,&iLevel) != 5)return false; @@ -203,21 +203,21 @@ namespace KviStringConversion return true; } - void toString(const QColor &cValue,QString &buffer) + void toString(const TQColor &cValue,TQString &buffer) { buffer = cValue.name(); } - bool fromString(const QString & szValue,QColor &buffer) + bool fromString(const TQString & szValue,TQColor &buffer) { buffer.setNamedColor(szValue); return true; } - void toString(const QFont &fValue,QString &buffer) + void toString(const TQFont &fValue,TQString &buffer) { - QString family(fValue.family()); - buffer.sprintf("%s,%d,%d,%d",KviQString::toUtf8(family).data(),fValue.pointSize(),fValue.styleHint(),fValue.weight()); - QString options; + TQString family(fValue.family()); + buffer.sprintf("%s,%d,%d,%d",KviTQString::toUtf8(family).data(),fValue.pointSize(),fValue.styleHint(),fValue.weight()); + TQString options; if(fValue.bold())options.append('b'); if(fValue.italic())options.append('i'); if(fValue.underline())options.append('u'); @@ -231,45 +231,45 @@ namespace KviStringConversion } } - bool fromString(const QString & szValue,QFont &buffer) + bool fromString(const TQString & szValue,TQFont &buffer) { KviStr str = szValue; - KviStr family,pointSize,styleHint,weight,options; + KviStr family,pointSize,tqstyleHint,weight,options; str.getToken(family,','); str.getToken(pointSize,','); - str.getToken(styleHint,','); + str.getToken(tqstyleHint,','); str.getToken(weight,','); if(!family.isEmpty())buffer.setFamily(family.ptr()); int i; bool bOk; i = pointSize.toInt(&bOk); if(bOk && (i > 0))buffer.setPointSize(i); - i = styleHint.toInt(&bOk); - if(bOk && (i >= 0))buffer.setStyleHint((QFont::StyleHint)i); + i = tqstyleHint.toInt(&bOk); + if(bOk && (i >= 0))buffer.setStyleHint((TQFont::StyleHint)i); i = weight.toInt(&bOk); if(bOk && (i >= 0))buffer.setWeight(i); if(!str.isEmpty()) { - buffer.setBold(str.contains("b")); - buffer.setItalic(str.contains("i")); - buffer.setUnderline(str.contains("u")); - buffer.setStrikeOut(str.contains("s")); - buffer.setFixedPitch(str.contains("f")); + buffer.setBold(str.tqcontains("b")); + buffer.setItalic(str.tqcontains("i")); + buffer.setUnderline(str.tqcontains("u")); + buffer.setStrikeOut(str.tqcontains("s")); + buffer.setFixedPitch(str.tqcontains("f")); } return true; } - void toString(const QStringList &sValue,QString &buffer) + void toString(const TQStringList &sValue,TQString &buffer) { buffer = sValue.join(","); } - bool fromString(const QString & szValue,QStringList &buffer) + bool fromString(const TQString & szValue,TQStringList &buffer) { #ifdef COMPILE_USE_QT4 buffer = szValue.split(","); #else - buffer = QStringList::split(",",szValue); + buffer = TQStringList::split(",",szValue); #endif return true; } diff --git a/src/kvilib/ext/kvi_stringconversion.h b/src/kvilib/ext/kvi_stringconversion.h index 78f8d417..0412a0e4 100644 --- a/src/kvilib/ext/kvi_stringconversion.h +++ b/src/kvilib/ext/kvi_stringconversion.h @@ -30,62 +30,62 @@ #include "kvi_pixmap.h" #include "kvi_msgtype.h" -#include <qrect.h> -#include <qcolor.h> -#include <qfont.h> -#include <qstringlist.h> -#include <qstring.h> +#include <tqrect.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqstringlist.h> +#include <tqstring.h> namespace KviStringConversion { - extern KVILIB_API void init(const QString& szGlobalDir,const QString& szLocalDir); + extern KVILIB_API void init(const TQString& szGlobalDir,const TQString& szLocalDir); - extern KVILIB_API void encodePath(QString& buffer); - extern KVILIB_API void decodePath(QString& buffer); + extern KVILIB_API void encodePath(TQString& buffer); + extern KVILIB_API void decodePath(TQString& buffer); - extern KVILIB_API void encodePath(QStringList& buffer); - extern KVILIB_API void decodePath(QStringList& buffer); + extern KVILIB_API void encodePath(TQStringList& buffer); + extern KVILIB_API void decodePath(TQStringList& buffer); // bool <-> - extern KVILIB_API void toString(const bool bValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,bool &buffer); + extern KVILIB_API void toString(const bool bValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,bool &buffer); - // int <-> QString - extern KVILIB_API void toString(const int iValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,int &buffer); + // int <-> TQString + extern KVILIB_API void toString(const int iValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,int &buffer); - // uint <-> QString - extern KVILIB_API void toString(const unsigned int uValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,unsigned int &buffer); + // uint <-> TQString + extern KVILIB_API void toString(const unsigned int uValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,unsigned int &buffer); - // QRect <-> QString - extern KVILIB_API void toString(const QRect &rValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QRect &buffer); + // TQRect <-> TQString + extern KVILIB_API void toString(const TQRect &rValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,TQRect &buffer); - // QString <-> QString (Null conversion) - extern KVILIB_API void toString(const QString &szValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QString &buffer); + // TQString <-> TQString (Null conversion) + extern KVILIB_API void toString(const TQString &szValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,TQString &buffer); - // KviPixmap <-> QString - extern KVILIB_API void toString(const KviPixmap &pValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,KviPixmap &buffer); + // KviPixmap <-> TQString + extern KVILIB_API void toString(const KviPixmap &pValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,KviPixmap &buffer); - // QFont <-> QString - extern KVILIB_API void toString(const QFont &fValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QFont &buffer); + // TQFont <-> TQString + extern KVILIB_API void toString(const TQFont &fValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,TQFont &buffer); - // KviMsgType <-> QString - extern KVILIB_API void toString(const KviMsgType &mValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,KviMsgType &buffer); + // KviMsgType <-> TQString + extern KVILIB_API void toString(const KviMsgType &mValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,KviMsgType &buffer); - // QColor <-> QString - extern KVILIB_API void toString(const QColor &cValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QColor &buffer); + // TQColor <-> TQString + extern KVILIB_API void toString(const TQColor &cValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,TQColor &buffer); - // QStringList <-> QString - extern KVILIB_API void toString(const QStringList &sValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QStringList &buffer); + // TQStringList <-> TQString + extern KVILIB_API void toString(const TQStringList &sValue,TQString &buffer); + extern KVILIB_API bool fromString(const TQString &szValue,TQStringList &buffer); }; #endif //!_KVI_STRINGCONVERSION_H_ diff --git a/src/kvilib/ext/kvi_xlib.h b/src/kvilib/ext/kvi_xlib.h index ef6ca177..0c14a05e 100644 --- a/src/kvilib/ext/kvi_xlib.h +++ b/src/kvilib/ext/kvi_xlib.h @@ -37,7 +37,7 @@ // Too bad that X11/Xlib.h defines Bool, Error and Success... this basically // SUX since we can't use them anywhere in the source! - // this breaks, enums in Qt, enums in KVIrc and other stuff all around... + // this breaks, enums in TQt, enums in KVIrc and other stuff all around... // Shame on you Xlib.h author :D #endif // !COMPILE_NO_X diff --git a/src/kvilib/ext/moc_kvi_crypt.cpp b/src/kvilib/ext/moc_kvi_crypt.cpp index 89c29d46..cbb8ef7d 100644 --- a/src/kvilib/ext/moc_kvi_crypt.cpp +++ b/src/kvilib/ext/moc_kvi_crypt.cpp @@ -2,21 +2,21 @@ ** KviCryptEngine meta object code from reading C++ file 'kvi_crypt.h' ** ** Created: Sun Mar 23 20:56:10 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_crypt.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviCryptEngine::className() const @@ -24,71 +24,71 @@ const char *KviCryptEngine::className() const return "KviCryptEngine"; } -QMetaObject *KviCryptEngine::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviCryptEngine( "KviCryptEngine", &KviCryptEngine::staticMetaObject ); +TQMetaObject *KviCryptEngine::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviCryptEngine( "KviCryptEngine", &KviCryptEngine::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviCryptEngine::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviCryptEngine::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviCryptEngine", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviCryptEngine", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviCryptEngine::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviCryptEngine::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviCryptEngine", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviCryptEngine", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviCryptEngine::staticMetaObject() +TQMetaObject* KviCryptEngine::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - metaObj = QMetaObject::new_metaobject( - "KviCryptEngine", parentObject, + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + metaObj = TQMetaObject::new_metaobject( + "KviCryptEngine", tqparentObject, 0, 0, 0, 0, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviCryptEngine.setMetaObject( metaObj ); return metaObj; } -void* KviCryptEngine::qt_cast( const char* clname ) +void* KviCryptEngine::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviCryptEngine" ) ) return this; if ( !qstrcmp( clname, "KviHeapObject" ) ) return (KviHeapObject*)this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -bool KviCryptEngine::qt_invoke( int _id, QUObject* _o ) +bool KviCryptEngine::qt_invoke( int _id, TQUObject* _o ) { - return QObject::qt_invoke(_id,_o); + return TQObject::qt_invoke(_id,_o); } -bool KviCryptEngine::qt_emit( int _id, QUObject* _o ) +bool KviCryptEngine::qt_emit( int _id, TQUObject* _o ) { - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviCryptEngine::qt_property( int id, int f, QVariant* v) +bool KviCryptEngine::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviCryptEngine::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviCryptEngine::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/ext/moc_kvi_garbage.cpp b/src/kvilib/ext/moc_kvi_garbage.cpp index 0c1a98ef..a54094dc 100644 --- a/src/kvilib/ext/moc_kvi_garbage.cpp +++ b/src/kvilib/ext/moc_kvi_garbage.cpp @@ -2,21 +2,21 @@ ** KviGarbageCollector meta object code from reading C++ file 'kvi_garbage.h' ** ** Created: Sun Mar 23 20:56:12 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_garbage.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviGarbageCollector::className() const @@ -24,81 +24,81 @@ const char *KviGarbageCollector::className() const return "KviGarbageCollector"; } -QMetaObject *KviGarbageCollector::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviGarbageCollector( "KviGarbageCollector", &KviGarbageCollector::staticMetaObject ); +TQMetaObject *KviGarbageCollector::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviGarbageCollector( "KviGarbageCollector", &KviGarbageCollector::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviGarbageCollector::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviGarbageCollector::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviGarbageCollector", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviGarbageCollector", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviGarbageCollector::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviGarbageCollector::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviGarbageCollector", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviGarbageCollector", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviGarbageCollector::staticMetaObject() +TQMetaObject* KviGarbageCollector::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUMethod slot_0 = {"cleanup", 0, 0 }; - static const QUMethod slot_1 = {"garbageSuicide", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "cleanup()", &slot_0, QMetaData::Protected }, - { "garbageSuicide()", &slot_1, QMetaData::Protected } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUMethod slot_0 = {"cleanup", 0, 0 }; + static const TQUMethod slot_1 = {"garbageSuicide", 0, 0 }; + static const TQMetaData slot_tbl[] = { + { "cleanup()", &slot_0, TQMetaData::Protected }, + { "garbageSuicide()", &slot_1, TQMetaData::Protected } }; - metaObj = QMetaObject::new_metaobject( - "KviGarbageCollector", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviGarbageCollector", tqparentObject, slot_tbl, 2, 0, 0, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviGarbageCollector.setMetaObject( metaObj ); return metaObj; } -void* KviGarbageCollector::qt_cast( const char* clname ) +void* KviGarbageCollector::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviGarbageCollector" ) ) return this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -bool KviGarbageCollector::qt_invoke( int _id, QUObject* _o ) +bool KviGarbageCollector::qt_invoke( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: cleanup(); break; case 1: garbageSuicide(); break; default: - return QObject::qt_invoke( _id, _o ); + return TQObject::qt_invoke( _id, _o ); } return TRUE; } -bool KviGarbageCollector::qt_emit( int _id, QUObject* _o ) +bool KviGarbageCollector::qt_emit( int _id, TQUObject* _o ) { - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviGarbageCollector::qt_property( int id, int f, QVariant* v) +bool KviGarbageCollector::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviGarbageCollector::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviGarbageCollector::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/ext/moc_kvi_regusersdb.cpp b/src/kvilib/ext/moc_kvi_regusersdb.cpp index 092add9f..88a76f83 100644 --- a/src/kvilib/ext/moc_kvi_regusersdb.cpp +++ b/src/kvilib/ext/moc_kvi_regusersdb.cpp @@ -2,21 +2,21 @@ ** KviRegisteredUserDataBase meta object code from reading C++ file 'kvi_regusersdb.h' ** ** Created: Sun Mar 23 20:56:14 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_regusersdb.h" -#include <qmetaobject.h> -#include <qapplication.h> - -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <tqmetaobject.h> +#include <tqapplication.h> + +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviRegisteredUserDataBase::className() const @@ -24,120 +24,120 @@ const char *KviRegisteredUserDataBase::className() const return "KviRegisteredUserDataBase"; } -QMetaObject *KviRegisteredUserDataBase::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviRegisteredUserDataBase( "KviRegisteredUserDataBase", &KviRegisteredUserDataBase::staticMetaObject ); +TQMetaObject *KviRegisteredUserDataBase::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviRegisteredUserDataBase( "KviRegisteredUserDataBase", &KviRegisteredUserDataBase::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviRegisteredUserDataBase::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviRegisteredUserDataBase::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviRegisteredUserDataBase", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviRegisteredUserDataBase", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviRegisteredUserDataBase::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviRegisteredUserDataBase::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviRegisteredUserDataBase", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviRegisteredUserDataBase", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviRegisteredUserDataBase::staticMetaObject() +TQMetaObject* KviRegisteredUserDataBase::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUParameter param_signal_0[] = { - { 0, &static_QUType_QString, 0, QUParameter::In } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUParameter param_signal_0[] = { + { 0, &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_0 = {"userRemoved", 1, param_signal_0 }; - static const QUParameter param_signal_1[] = { - { 0, &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod signal_0 = {"userRemoved", 1, param_signal_0 }; + static const TQUParameter param_signal_1[] = { + { 0, &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_1 = {"userChanged", 1, param_signal_1 }; - static const QUParameter param_signal_2[] = { - { 0, &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod signal_1 = {"userChanged", 1, param_signal_1 }; + static const TQUParameter param_signal_2[] = { + { 0, &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_2 = {"userAdded", 1, param_signal_2 }; - static const QUMethod signal_3 = {"databaseCleared", 0, 0 }; - static const QMetaData signal_tbl[] = { - { "userRemoved(const QString&)", &signal_0, QMetaData::Public }, - { "userChanged(const QString&)", &signal_1, QMetaData::Public }, - { "userAdded(const QString&)", &signal_2, QMetaData::Public }, - { "databaseCleared()", &signal_3, QMetaData::Public } + static const TQUMethod signal_2 = {"userAdded", 1, param_signal_2 }; + static const TQUMethod signal_3 = {"databaseCleared", 0, 0 }; + static const TQMetaData signal_tbl[] = { + { "userRemoved(const TQString&)", &signal_0, TQMetaData::Public }, + { "userChanged(const TQString&)", &signal_1, TQMetaData::Public }, + { "userAdded(const TQString&)", &signal_2, TQMetaData::Public }, + { "databaseCleared()", &signal_3, TQMetaData::Public } }; - metaObj = QMetaObject::new_metaobject( - "KviRegisteredUserDataBase", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviRegisteredUserDataBase", tqparentObject, 0, 0, signal_tbl, 4, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviRegisteredUserDataBase.setMetaObject( metaObj ); return metaObj; } -void* KviRegisteredUserDataBase::qt_cast( const char* clname ) +void* KviRegisteredUserDataBase::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviRegisteredUserDataBase" ) ) return this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -// SIGNAL userRemoved -void KviRegisteredUserDataBase::userRemoved( const QString& t0 ) +// TQT_SIGNAL userRemoved +void KviRegisteredUserDataBase::userRemoved( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 0, t0 ); } -// SIGNAL userChanged -void KviRegisteredUserDataBase::userChanged( const QString& t0 ) +// TQT_SIGNAL userChanged +void KviRegisteredUserDataBase::userChanged( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 1, t0 ); } -// SIGNAL userAdded -void KviRegisteredUserDataBase::userAdded( const QString& t0 ) +// TQT_SIGNAL userAdded +void KviRegisteredUserDataBase::userAdded( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 2, t0 ); } -// SIGNAL databaseCleared +// TQT_SIGNAL databaseCleared void KviRegisteredUserDataBase::databaseCleared() { activate_signal( staticMetaObject()->signalOffset() + 3 ); } -bool KviRegisteredUserDataBase::qt_invoke( int _id, QUObject* _o ) +bool KviRegisteredUserDataBase::qt_invoke( int _id, TQUObject* _o ) { - return QObject::qt_invoke(_id,_o); + return TQObject::qt_invoke(_id,_o); } -bool KviRegisteredUserDataBase::qt_emit( int _id, QUObject* _o ) +bool KviRegisteredUserDataBase::qt_emit( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { - case 0: userRemoved((const QString&)static_QUType_QString.get(_o+1)); break; - case 1: userChanged((const QString&)static_QUType_QString.get(_o+1)); break; - case 2: userAdded((const QString&)static_QUType_QString.get(_o+1)); break; + case 0: userRemoved((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 1: userChanged((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 2: userAdded((const TQString&)static_TQUType_TQString.get(_o+1)); break; case 3: databaseCleared(); break; default: - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } return TRUE; } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviRegisteredUserDataBase::qt_property( int id, int f, QVariant* v) +bool KviRegisteredUserDataBase::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviRegisteredUserDataBase::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviRegisteredUserDataBase::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/ext/moc_kvi_sharedfiles.cpp b/src/kvilib/ext/moc_kvi_sharedfiles.cpp index 83ea82a4..86c1837e 100644 --- a/src/kvilib/ext/moc_kvi_sharedfiles.cpp +++ b/src/kvilib/ext/moc_kvi_sharedfiles.cpp @@ -2,21 +2,21 @@ ** KviSharedFilesManager meta object code from reading C++ file 'kvi_sharedfiles.h' ** ** Created: Sun Mar 23 20:56:15 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_sharedfiles.h" -#include <qmetaobject.h> -#include <qapplication.h> - -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <tqmetaobject.h> +#include <tqapplication.h> + +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviSharedFilesManager::className() const @@ -24,134 +24,134 @@ const char *KviSharedFilesManager::className() const return "KviSharedFilesManager"; } -QMetaObject *KviSharedFilesManager::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviSharedFilesManager( "KviSharedFilesManager", &KviSharedFilesManager::staticMetaObject ); +TQMetaObject *KviSharedFilesManager::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviSharedFilesManager( "KviSharedFilesManager", &KviSharedFilesManager::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviSharedFilesManager::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviSharedFilesManager::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviSharedFilesManager", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviSharedFilesManager", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviSharedFilesManager::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviSharedFilesManager::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviSharedFilesManager", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviSharedFilesManager", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviSharedFilesManager::staticMetaObject() +TQMetaObject* KviSharedFilesManager::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUMethod slot_0 = {"cleanup", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "cleanup()", &slot_0, QMetaData::Private } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUMethod slot_0 = {"cleanup", 0, 0 }; + static const TQMetaData slot_tbl[] = { + { "cleanup()", &slot_0, TQMetaData::Private } }; - static const QUMethod signal_0 = {"sharedFilesChanged", 0, 0 }; - static const QUParameter param_signal_1[] = { - { "f", &static_QUType_ptr, "KviSharedFile", QUParameter::In } + static const TQUMethod signal_0 = {"sharedFilesChanged", 0, 0 }; + static const TQUParameter param_signal_1[] = { + { "f", &static_TQUType_ptr, "KviSharedFile", TQUParameter::In } }; - static const QUMethod signal_1 = {"sharedFileAdded", 1, param_signal_1 }; - static const QUParameter param_signal_2[] = { - { "f", &static_QUType_ptr, "KviSharedFile", QUParameter::In } + static const TQUMethod signal_1 = {"sharedFileAdded", 1, param_signal_1 }; + static const TQUParameter param_signal_2[] = { + { "f", &static_TQUType_ptr, "KviSharedFile", TQUParameter::In } }; - static const QUMethod signal_2 = {"sharedFileRemoved", 1, param_signal_2 }; - static const QMetaData signal_tbl[] = { - { "sharedFilesChanged()", &signal_0, QMetaData::Private }, - { "sharedFileAdded(KviSharedFile*)", &signal_1, QMetaData::Private }, - { "sharedFileRemoved(KviSharedFile*)", &signal_2, QMetaData::Private } + static const TQUMethod signal_2 = {"sharedFileRemoved", 1, param_signal_2 }; + static const TQMetaData signal_tbl[] = { + { "sharedFilesChanged()", &signal_0, TQMetaData::Private }, + { "sharedFileAdded(KviSharedFile*)", &signal_1, TQMetaData::Private }, + { "sharedFileRemoved(KviSharedFile*)", &signal_2, TQMetaData::Private } }; - metaObj = QMetaObject::new_metaobject( - "KviSharedFilesManager", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviSharedFilesManager", tqparentObject, slot_tbl, 1, signal_tbl, 3, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviSharedFilesManager.setMetaObject( metaObj ); return metaObj; } -void* KviSharedFilesManager::qt_cast( const char* clname ) +void* KviSharedFilesManager::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviSharedFilesManager" ) ) return this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -// SIGNAL sharedFilesChanged +// TQT_SIGNAL sharedFilesChanged void KviSharedFilesManager::sharedFilesChanged() { activate_signal( staticMetaObject()->signalOffset() + 0 ); } -#include <qobjectdefs.h> -#include <qsignalslotimp.h> +#include <tqobjectdefs.h> +#include <tqtqsignalslotimp.h> -// SIGNAL sharedFileAdded +// TQT_SIGNAL sharedFileAdded void KviSharedFilesManager::sharedFileAdded( KviSharedFile* t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 1 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_ptr.set(o+1,t0); + TQUObject o[2]; + static_TQUType_ptr.set(o+1,t0); activate_signal( clist, o ); } -// SIGNAL sharedFileRemoved +// TQT_SIGNAL sharedFileRemoved void KviSharedFilesManager::sharedFileRemoved( KviSharedFile* t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 2 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 2 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_ptr.set(o+1,t0); + TQUObject o[2]; + static_TQUType_ptr.set(o+1,t0); activate_signal( clist, o ); } -bool KviSharedFilesManager::qt_invoke( int _id, QUObject* _o ) +bool KviSharedFilesManager::qt_invoke( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: cleanup(); break; default: - return QObject::qt_invoke( _id, _o ); + return TQObject::qt_invoke( _id, _o ); } return TRUE; } -bool KviSharedFilesManager::qt_emit( int _id, QUObject* _o ) +bool KviSharedFilesManager::qt_emit( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: sharedFilesChanged(); break; - case 1: sharedFileAdded((KviSharedFile*)static_QUType_ptr.get(_o+1)); break; - case 2: sharedFileRemoved((KviSharedFile*)static_QUType_ptr.get(_o+1)); break; + case 1: sharedFileAdded((KviSharedFile*)static_TQUType_ptr.get(_o+1)); break; + case 2: sharedFileRemoved((KviSharedFile*)static_TQUType_ptr.get(_o+1)); break; default: - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } return TRUE; } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviSharedFilesManager::qt_property( int id, int f, QVariant* v) +bool KviSharedFilesManager::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviSharedFilesManager::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviSharedFilesManager::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/file/kvi_file.cpp b/src/kvilib/file/kvi_file.cpp index 8ab1e739..227a4997 100644 --- a/src/kvilib/file/kvi_file.cpp +++ b/src/kvilib/file/kvi_file.cpp @@ -30,12 +30,12 @@ KviFile::KviFile() -: QFile() +: TQFile() { } -KviFile::KviFile(const QString &name) -: QFile(name) +KviFile::KviFile(const TQString &name) +: TQFile(name) { } @@ -46,7 +46,7 @@ KviFile::~KviFile() bool KviFile::openForReading() { #ifdef COMPILE_USE_QT4 - return open(QFile::ReadOnly); + return open(TQFile::ReadOnly); #else return open(IO_ReadOnly); #endif @@ -55,41 +55,41 @@ bool KviFile::openForReading() bool KviFile::openForWriting(bool bAppend) { #ifdef COMPILE_USE_QT4 - return open(QFile::WriteOnly | (bAppend ? QFile::Append : QFile::Truncate)); + return open(TQFile::WriteOnly | (bAppend ? TQFile::Append : TQFile::Truncate)); #else return open(IO_WriteOnly | (bAppend ? IO_Append : IO_Truncate)); #endif } -bool KviFile::save(const QByteArray &bData) +bool KviFile::save(const TQByteArray &bData) { if(!save((kvi_u32_t)(bData.size())))return false; return (writeBlock(bData.data(),bData.size()) == ((int)(bData.size()))); } -bool KviFile::load(QByteArray &bData) +bool KviFile::load(TQByteArray &bData) { kvi_u32_t iLen; if(!load(iLen))return false; - bData.resize(iLen); // it is automatically null terminated in Qt 4.x... BLEAH :D + bData.resize(iLen); // it is automatically null terminated in TQt 4.x... BLEAH :D if(readBlock((char *)(bData.data()),iLen) != iLen)return false; return true; } #ifndef COMPILE_USE_QT4 -bool KviFile::save(const KviQCString &szData) +bool KviFile::save(const KviTQCString &szData) { if(!save((kvi_u32_t)(szData.length())))return false; return (writeBlock(szData.data(),szData.length()) == ((int)(szData.length()))); } -bool KviFile::load(KviQCString &szData) +bool KviFile::load(KviTQCString &szData) { kvi_u32_t iLen; if(!load(iLen))return false; - szData.resize(iLen + 1); // this would allocate one extra byte with Qt 4.x... + szData.resize(iLen + 1); // this would allocate one extra byte with TQt 4.x... if(readBlock((char *)(szData.data()),iLen) != iLen)return false; *(szData.data() + iLen) = 0; return true; @@ -98,22 +98,22 @@ bool KviFile::load(KviQCString &szData) #endif -bool KviFile::save(const QString &szData) +bool KviFile::save(const TQString &szData) { - KviQCString c = KviQString::toUtf8(szData); + KviTQCString c = KviTQString::toUtf8(szData); if(!save((kvi_u32_t)(c.length())))return false; return (writeBlock(c.data(),c.length()) == ((int)(c.length()))); } -bool KviFile::load(QString &szData) +bool KviFile::load(TQString &szData) { kvi_u32_t iLen; if(!load(iLen))return false; - KviQCString tmp; + KviTQCString tmp; tmp.resize(iLen + 1); if(readBlock((char *)(tmp.data()),iLen) != iLen)return false; *(tmp.data() + iLen) = 0; - szData = QString::fromUtf8(tmp.data()); + szData = TQString::fromUtf8(tmp.data()); return true; } diff --git a/src/kvilib/file/kvi_file.h b/src/kvilib/file/kvi_file.h index 188a9dad..7cce041f 100644 --- a/src/kvilib/file/kvi_file.h +++ b/src/kvilib/file/kvi_file.h @@ -33,29 +33,33 @@ #include "kvi_inttypes.h" #include "kvi_qcstring.h" -#include <qfile.h> +#include <tqfile.h> #include <time.h> #ifdef COMPILE_USE_QT4 #define kvi_file_offset_t qlonglong #else - #define kvi_file_offset_t QFile::Offset +#ifdef USE_QT4 + #define kvi_file_offset_t qint64 +#else // USE_QT4 + #define kvi_file_offset_t TQFile::Offset +#endif // USE_QT4 #endif -class KVILIB_API KviFile : public QFile, public KviHeapObject +class KVILIB_API KviFile : public TQFile, public KviHeapObject { public: KviFile(); - KviFile(const QString &name); + KviFile(const TQString &name); ~KviFile(); public: - // Wrappers portable across Qt 3.x and Qt 4.x + // Wrappers portable across TQt 3.x and TQt 4.x bool openForReading(); bool openForWriting(bool bAppend = false); #ifndef COMPILE_USE_QT4 - // Functions present in Qt 4.x but not Qt 3.x + // Functions present in TQt 4.x but not TQt 3.x bool putChar(char c){ return putch(c) != -1; }; bool ungetChar(char c){ return ungetch(c) != -1; }; bool getChar(char * c){ *c = getch(); return *c != -1; }; @@ -64,7 +68,7 @@ public: #endif #ifdef COMPILE_USE_QT4 - // Missing functions in Qt 4.x + // Missing functions in TQt 4.x quint64 writeBlock(const char * data,quint64 uLen){ return write(data,uLen); }; quint64 readBlock(char * data,quint64 uLen){ return read(data,uLen); }; #endif @@ -98,16 +102,16 @@ public: bool load(KviStr &szData); #ifndef COMPILE_USE_QT4 - // Under Qt 4.x these collide with QByteArray - bool save(const KviQCString &szData); - bool load(KviQCString &szData); + // Under TQt 4.x these collide with TQByteArray + bool save(const KviTQCString &szData); + bool load(KviTQCString &szData); #endif - bool save(const QByteArray &bData); - bool load(QByteArray &bData); + bool save(const TQByteArray &bData); + bool load(TQByteArray &bData); - bool save(const QString &szData); - bool load(QString &szData); + bool save(const TQString &szData); + bool load(TQString &szData); bool skipFirst(char t,unsigned int maxdist = 0xffffffff); bool skipFirst(const KviStr &t,unsigned int maxdist = 0xffffffff); diff --git a/src/kvilib/file/kvi_fileutils.cpp b/src/kvilib/file/kvi_fileutils.cpp index 648d9125..1ad09d60 100644 --- a/src/kvilib/file/kvi_fileutils.cpp +++ b/src/kvilib/file/kvi_fileutils.cpp @@ -31,18 +31,18 @@ #include "kvi_file.h" #include "kvi_malloc.h" -#include <qdir.h> -#include <qfileinfo.h> -#include <qglobal.h> -#include <qtextcodec.h> -#include <qtextstream.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqglobal.h> +#include <tqtextcodec.h> +#include <tqtextstream.h> namespace KviFileUtils { /* WORKING CODE BUT UNUSED FOR NOW - bool readLine(QFile * f,QString &szBuffer,bool bClearBuffer) + bool readLine(TQFile * f,TQString &szBuffer,bool bClearBuffer) { // FIXME: Should this assume UTF8 encoding ? char tmp_buf[256]; @@ -60,7 +60,7 @@ namespace KviFileUtils if(tmp_buf[255] == '\r')cur_len--; //Ignore CR... int lastlen = szBuffer.length(); szBuffer.setLength(lastlen + cur_len); - QChar *p1 = szBuffer.unicode() + lastlen; + TQChar *p1 = szBuffer.tqunicode() + lastlen; char * p2 = tmp_buf; for(int i=0;i<cur_len;i++)*p1++ = *p2++; cur_len = 0; @@ -76,16 +76,16 @@ namespace KviFileUtils if(tmp_buf[cur_len - 1] == '\r')cur_len--; //Ignore CR... int lastlen = szBuffer.length(); szBuffer.setLength(lastlen + cur_len); - QChar *p1 = szBuffer.unicode() + lastlen; + TQChar *p1 = szBuffer.tqunicode() + lastlen; char * p2 = tmp_buf; for(int i=0;i<cur_len;i++)*p1++ = *p2++; } return (ch == '\n'); //more data to read else a broken file or EOF } - bool loadFileStripCR(const QString &szPath,QString &szBuffer) + bool loadFileStripCR(const TQString &szPath,TQString &szBuffer) { - QFile f(szPath); + TQFile f(szPath); if(!f.open(IO_ReadOnly))return false; szBuffer = ""; while(readLine(&f,szBuffer,false)) @@ -97,18 +97,18 @@ namespace KviFileUtils } */ - bool makeDir(const QString &szPath) + bool makeDir(const TQString &szPath) { - QDir d; - QString dir = KviQString::trimmed(szPath); + TQDir d; + TQString dir = KviTQString::trimmed(szPath); adjustFilePath(dir); - QString createdDir; + TQString createdDir; #ifdef COMPILE_ON_WINDOWS #ifdef COMPILE_USE_QT4 int idx = dir.indexOf(':'); #else - int idx = dir.find(':'); + int idx = dir.tqfind(':'); #endif if(idx == 1) { @@ -117,44 +117,44 @@ namespace KviFileUtils } #endif - KviQString::stripLeft(dir,KVI_PATH_SEPARATOR_CHAR); + KviTQString::stripLeft(dir,KVI_PATH_SEPARATOR_CHAR); while(!dir.isEmpty()) { createdDir += KVI_PATH_SEPARATOR; - createdDir += KviQString::getToken(dir,KVI_PATH_SEPARATOR_CHAR); + createdDir += KviTQString::getToken(dir,KVI_PATH_SEPARATOR_CHAR); if(!directoryExists(createdDir)) { if(!d.mkdir(createdDir)) { - debug("Can't create directory %s",KviQString::toUtf8(createdDir).data()); + debug("Can't create directory %s",KviTQString::toUtf8(createdDir).data()); return false; } } - KviQString::stripLeft(dir,KVI_PATH_SEPARATOR_CHAR); + KviTQString::stripLeft(dir,KVI_PATH_SEPARATOR_CHAR); } return true; } bool makeDir(const char* path) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return makeDir(szPath); } - bool renameFile(const QString &szSrc,const QString &szDst) + bool renameFile(const TQString &szSrc,const TQString &szDst) { - QDir d; + TQDir d; return d.rename(szSrc,szDst); } bool renameFile(const char* path,const char* path2) { - QString szPath=QString::fromUtf8(path); - QString szPath2=QString::fromUtf8(path2); + TQString szPath=TQString::fromUtf8(path); + TQString szPath2=TQString::fromUtf8(path2); return renameFile(szPath,szPath2); } - bool copyFile(const QString &szSrc,const QString &szDst) + bool copyFile(const TQString &szSrc,const TQString &szDst) { KviFile f1(szSrc); if(!f1.openForReading())return false; @@ -183,139 +183,139 @@ namespace KviFileUtils bool copyFile(const char* path,const char* path2) { - QString szPath=QString::fromUtf8(path); - QString szPath2=QString::fromUtf8(path2); + TQString szPath=TQString::fromUtf8(path); + TQString szPath2=TQString::fromUtf8(path2); return copyFile(szPath,szPath2); } - bool loadFile(const QString &szPath,QString &szBuffer,bool bUtf8) + bool loadFile(const TQString &szPath,TQString &szBuffer,bool bUtf8) { KviFile f(szPath); if(!f.openForReading())return false; if(bUtf8) { - QByteArray ba = f.readAll(); - szBuffer = QString::fromUtf8(ba.data(),ba.size()); + TQByteArray ba = f.readAll(); + szBuffer = TQString::fromUtf8(ba.data(),ba.size()); //debug("BUFFERLEN: %d",szBuffer.length()); } else { - szBuffer = QString(f.readAll()); + szBuffer = TQString(f.readAll()); } return true; } - bool loadFile(const char* path,QString &szBuffer,bool bUtf8) + bool loadFile(const char* path,TQString &szBuffer,bool bUtf8) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return loadFile(szPath,szBuffer,bUtf8); } - void adjustFilePath(QString &szPath) + void adjustFilePath(TQString &szPath) { #ifdef COMPILE_ON_WINDOWS - szPath.replace('/',"\\"); + szPath.tqreplace('/',"\\"); #ifdef COMPILE_USE_QT4 - szPath.replace("\\\\","\\"); + szPath.tqreplace("\\\\","\\"); #else - while(szPath.find("\\\\") != -1)szPath.replace("\\\\","\\"); + while(szPath.tqfind("\\\\") != -1)szPath.tqreplace("\\\\","\\"); #endif // FIXME: Use the default drive here ? if(szPath.startsWith("\\"))szPath.prepend("C:"); #else - szPath.replace('\\',"/"); + szPath.tqreplace('\\',"/"); #ifdef COMPILE_USE_QT4 - szPath.replace("//","/"); + szPath.tqreplace("//","/"); #else - while(KviQString::find(szPath,"//") != -1)szPath.replace("//","/"); + while(KviTQString::tqfind(szPath,"//") != -1)szPath.tqreplace("//","/"); #endif // deal with windows paths - if((szPath.length() > 2) && (szPath.at(0) != QChar('/'))) + if((szPath.length() > 2) && (szPath.at(0) != TQChar('/'))) { - if((szPath.at(1) == QChar(':')) && (szPath.at(2) == QChar('/'))) + if((szPath.at(1) == TQChar(':')) && (szPath.at(2) == TQChar('/'))) { szPath.remove(0,2); } } #ifdef COMPILE_USE_QT4 - szPath=QDir::cleanPath(szPath); + szPath=TQDir::cleanPath(szPath); #else - szPath=QDir::cleanDirPath(szPath); + szPath=TQDir::cleanDirPath(szPath); #endif #endif } - bool directoryExists(const QString &szPath) + bool directoryExists(const TQString &szPath) { - QFileInfo f(szPath); + TQFileInfo f(szPath); return (f.exists() && f.isDir()); } bool directoryExists(const char* path) { - QString szPath=QString::fromUtf8(path); - QFileInfo f(szPath); + TQString szPath=TQString::fromUtf8(path); + TQFileInfo f(szPath); return (f.exists() && f.isDir()); } - bool fileExists(const QString &szPath) + bool fileExists(const TQString &szPath) { - QFileInfo f(szPath); + TQFileInfo f(szPath); return (f.exists() && f.isFile()); } bool fileExists(const char* path) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return fileExists(szPath); } - bool removeFile(const QString &szPath) + bool removeFile(const TQString &szPath) { - QDir d; + TQDir d; return d.remove(szPath); } bool removeFile(const char* path) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return removeFile(szPath); } - bool removeDir(const QString &szPath) + bool removeDir(const TQString &szPath) { - QDir d; + TQDir d; return d.rmdir(szPath); } bool removeDir(const char* path) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return removeDir(szPath); } - bool deleteDir(const QString &szPath) + bool deleteDir(const TQString &szPath) { - QDir d(szPath); - QStringList sl = d.entryList(QDir::Dirs); - QStringList::Iterator it; + TQDir d(szPath); + TQStringList sl = d.entryList(TQDir::Dirs); + TQStringList::Iterator it; for(it=sl.begin();it != sl.end();it++) { - QString szSubdir = *it; - if(!(KviQString::equalCS(szSubdir,"..") || KviQString::equalCS(szSubdir,"."))) + TQString szSubdir = *it; + if(!(KviTQString::equalCS(szSubdir,"..") || KviTQString::equalCS(szSubdir,"."))) { - QString szSubPath = szPath; - KviQString::ensureLastCharIs(szSubPath,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szSubPath = szPath; + KviTQString::ensureLastCharIs(szSubPath,TQChar(KVI_PATH_SEPARATOR_CHAR)); szSubPath += szSubdir; if(!KviFileUtils::deleteDir(szSubPath)) return false; } } - sl = d.entryList(QDir::Files); + sl = d.entryList(TQDir::Files); for(it=sl.begin();it != sl.end();it++) { - QString szFilePath = szPath; - KviQString::ensureLastCharIs(szFilePath,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szFilePath = szPath; + KviTQString::ensureLastCharIs(szFilePath,TQChar(KVI_PATH_SEPARATOR_CHAR)); szFilePath += *it; if(!KviFileUtils::removeFile(szFilePath)) return false; @@ -324,39 +324,39 @@ namespace KviFileUtils return KviFileUtils::removeDir(szPath); } - bool writeFile(const QString &szPath,const QString &szData,bool bAppend) + bool writeFile(const TQString &szPath,const TQString &szData,bool bAppend) { KviFile f(szPath); if(!f.openForWriting(bAppend))return false; - KviQCString szTmp = KviQString::toUtf8(szData); + KviTQCString szTmp = KviTQString::toUtf8(szData); if(!szTmp.data())return true; if(f.writeBlock(szTmp.data(),szTmp.length()) != ((int)(szTmp.length())))return false; return true; } - bool writeFile(const char* path,const QString &szData,bool bAppend) + bool writeFile(const char* path,const TQString &szData,bool bAppend) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return writeFile(szPath,szData,bAppend); } - bool writeFileLocal8Bit(const QString &szPath,const QString &szData,bool bAppend) + bool writeFileLocal8Bit(const TQString &szPath,const TQString &szData,bool bAppend) { KviFile f(szPath); if(!f.openForWriting(bAppend))return false; - KviQCString szTmp = QTextCodec::codecForLocale()->fromUnicode(szData); + KviTQCString szTmp = TQTextCodec::codecForLocale()->fromUnicode(szData); if(!szTmp.data())return true; if(f.writeBlock(szTmp.data(),szTmp.length()) != ((int)(szTmp.length())))return false; return true; } - bool writeFileLocal8Bit(const char* path,const QString &szData,bool bAppend) + bool writeFileLocal8Bit(const char* path,const TQString &szData,bool bAppend) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return writeFileLocal8Bit(szPath,szData,bAppend); } - bool readFile(const QString &szPath,QString &szBuffer,unsigned int uMaxSize) + bool readFile(const TQString &szPath,TQString &szBuffer,unsigned int uMaxSize) { KviFile f(szPath); if(!f.openForReading())return false; @@ -375,40 +375,40 @@ namespace KviFileUtils return false; } buf[f.size()] = '\0'; - szBuffer = QString::fromUtf8(buf); + szBuffer = TQString::fromUtf8(buf); delete[] buf; return true; } - bool readFile(const char* path,QString &szBuffer,unsigned int uMaxSize) + bool readFile(const char* path,TQString &szBuffer,unsigned int uMaxSize) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return readFile(szPath,szBuffer,uMaxSize); } - QString extractFileName(const QString &szFileNameWithPath) + TQString extractFileName(const TQString &szFileNameWithPath) { - return QFileInfo(szFileNameWithPath).fileName(); + return TQFileInfo(szFileNameWithPath).fileName(); } - QString extractFilePath(const QString &szFileNameWithPath) + TQString extractFilePath(const TQString &szFileNameWithPath) { - return QFileInfo(szFileNameWithPath).dirPath(true); + return TQFileInfo(szFileNameWithPath).dirPath(true); } - bool readLine(QFile * f,QString &szBuffer,bool bUtf8) + bool readLine(TQFile * f,TQString &szBuffer,bool bUtf8) { - QTextStream stream(f); - stream.setEncoding(bUtf8 ? QTextStream::UnicodeUTF8 : QTextStream::Locale); + TQTextStream stream(f); + stream.setEncoding(bUtf8 ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale); szBuffer=stream.readLine(); return !szBuffer.isNull(); } - bool readLines(QFile * f,QStringList &buffer,int iStartLine, int iCount, bool bUtf8) + bool readLines(TQFile * f,TQStringList &buffer,int iStartLine, int iCount, bool bUtf8) { - QTextStream stream( f ); - stream.setEncoding(bUtf8 ? QTextStream::UnicodeUTF8 : QTextStream::Locale); + TQTextStream stream( f ); + stream.setEncoding(bUtf8 ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale); for(int i=0;i<iStartLine;i++) stream.readLine(); @@ -424,21 +424,21 @@ namespace KviFileUtils return buffer.count()!= 0; } - bool isReadable(const QString &szFname) + bool isReadable(const TQString &szFname) { - QFileInfo f(szFname); + TQFileInfo f(szFname); return (f.exists() && f.isFile() && f.isReadable()); } bool isReadable(const char* path) { - QString szPath=QString::fromUtf8(path); + TQString szPath=TQString::fromUtf8(path); return isReadable(szPath); } - bool isAbsolutePath(const QString &szPath) + bool isAbsolutePath(const TQString &szPath) { - QFileInfo f(szPath); + TQFileInfo f(szPath); return !f.isRelative(); } }; @@ -448,18 +448,18 @@ static char hexchars[16] = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' void kvi_encodeFileName(KviStr & path) { - QString szPath(path.ptr()); + TQString szPath(path.ptr()); kvi_encodeFileName(szPath); path=szPath; } -void kvi_encodeFileName(QString & path) +void kvi_encodeFileName(TQString & path) { - QString src(path); + TQString src(path); path=""; for(int i=0;i<src.length();i++) { - QChar cur=src[i]; + TQChar cur=src[i]; if( ! (cur.isLetter() || cur.isDigit() || cur==' ' || cur=='_' || cur=='.' || cur=='#' || cur=='%') ) { if(cur.row()!=0) @@ -494,10 +494,10 @@ bool kvi_isAbsolutePath(const char *path) //=================== kvi_readLine =====================// -bool kvi_readLine(QFile *f,KviStr &str) +bool kvi_readLine(TQFile *f,KviStr &str) { - QTextStream stream(f); - QString szBuff=stream.readLine(); + TQTextStream stream(f); + TQString szBuff=stream.readLine(); str=szBuff; return szBuff.isNull() ? 1 : 0; } diff --git a/src/kvilib/file/kvi_fileutils.h b/src/kvilib/file/kvi_fileutils.h index dcead8ae..bea07fed 100644 --- a/src/kvilib/file/kvi_fileutils.h +++ b/src/kvilib/file/kvi_fileutils.h @@ -26,8 +26,8 @@ #include "kvi_settings.h" #include "kvi_string.h" -#include <qfile.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqstringlist.h> #include <time.h> @@ -44,55 +44,55 @@ // #warning "or should it be availible only for dirbrowser module ?" namespace KviFileUtils { - //extern KVILIB_API bool readLine(QFile * f,QString &szBuffer,bool bClearBuffer = true); - //extern KVILIB_API bool loadFileStripCR(const QString &szPath,QString &szBuffer); + //extern KVILIB_API bool readLine(TQFile * f,TQString &szBuffer,bool bClearBuffer = true); + //extern KVILIB_API bool loadFileStripCR(const TQString &szPath,TQString &szBuffer); // loads the file at szPath to szBuffer eventually converting from utf8 - extern KVILIB_API bool loadFile(const QString &szPath,QString &szBuffer,bool bUtf8 = true); - extern KVILIB_API bool loadFile(const char* szPath,QString &szBuffer,bool bUtf8 = true); + extern KVILIB_API bool loadFile(const TQString &szPath,TQString &szBuffer,bool bUtf8 = true); + extern KVILIB_API bool loadFile(const char* szPath,TQString &szBuffer,bool bUtf8 = true); // adjusts the file path to the current platform - extern KVILIB_API void adjustFilePath(QString &szPath); + extern KVILIB_API void adjustFilePath(TQString &szPath); // returns true if szPath points to an existing directory - extern KVILIB_API bool directoryExists(const QString &szPath); + extern KVILIB_API bool directoryExists(const TQString &szPath); extern KVILIB_API bool directoryExists(const char* path); // returns true if szPath points to an existing file - extern KVILIB_API bool fileExists(const QString &szPath); + extern KVILIB_API bool fileExists(const TQString &szPath); extern KVILIB_API bool fileExists(const char* szPath); // removes a file - extern KVILIB_API bool removeFile(const QString &szPath); + extern KVILIB_API bool removeFile(const TQString &szPath); extern KVILIB_API bool removeFile(const char* path); // removes a dir (must be empty) - extern KVILIB_API bool removeDir(const QString &szPath); + extern KVILIB_API bool removeDir(const TQString &szPath); extern KVILIB_API bool removeDir(const char* path); // removes a dir recursively - extern KVILIB_API bool deleteDir(const QString &szPath); + extern KVILIB_API bool deleteDir(const TQString &szPath); // writes a complete file (utf8 version) - extern KVILIB_API bool writeFile(const QString &szPath,const QString &szData,bool bAppend = false); - extern KVILIB_API bool writeFile(const char* path,const QString &szData,bool bAppend = false); + extern KVILIB_API bool writeFile(const TQString &szPath,const TQString &szData,bool bAppend = false); + extern KVILIB_API bool writeFile(const char* path,const TQString &szData,bool bAppend = false); // writes a complete file (local 8 bit version) - extern KVILIB_API bool writeFileLocal8Bit(const QString &szPath,const QString &szData,bool bAppend = false); - extern KVILIB_API bool writeFileLocal8Bit(const char* path,const QString &szData,bool bAppend = false); + extern KVILIB_API bool writeFileLocal8Bit(const TQString &szPath,const TQString &szData,bool bAppend = false); + extern KVILIB_API bool writeFileLocal8Bit(const char* path,const TQString &szData,bool bAppend = false); // reads a complete file and puts it in the string szBuffer, if the file is smaller than uMaxSize bytes - extern KVILIB_API bool readFile(const QString &szPath,QString &szBuffer,unsigned int uMaxSize = 65535); - extern KVILIB_API bool readFile(const char* path,QString &szBuffer,unsigned int uMaxSize = 65535); + extern KVILIB_API bool readFile(const TQString &szPath,TQString &szBuffer,unsigned int uMaxSize = 65535); + extern KVILIB_API bool readFile(const char* path,TQString &szBuffer,unsigned int uMaxSize = 65535); // extracts the filename from a complete path (strips leading path) - extern KVILIB_API QString extractFileName(const QString &szFileNameWithPath); + extern KVILIB_API TQString extractFileName(const TQString &szFileNameWithPath); - extern KVILIB_API QString extractFilePath(const QString &szFileNameWithPath); + extern KVILIB_API TQString extractFilePath(const TQString &szFileNameWithPath); // cp -f - extern KVILIB_API bool copyFile(const QString &szSrc,const QString &szDst); + extern KVILIB_API bool copyFile(const TQString &szSrc,const TQString &szDst); extern KVILIB_API bool copyFile(const char* src,const char* dst); // mv - extern KVILIB_API bool renameFile(const QString &szSrc,const QString &szDst); + extern KVILIB_API bool renameFile(const TQString &szSrc,const TQString &szDst); extern KVILIB_API bool renameFile(const char* src,const char* dst); // mkdir - extern KVILIB_API bool makeDir(const QString &szPath); + extern KVILIB_API bool makeDir(const TQString &szPath); extern KVILIB_API bool makeDir(const char* path); // reads a text line, returns false if EOF is reached - extern KVILIB_API bool readLine(QFile * f,QString &szBuffer,bool bUtf8 = true); - extern KVILIB_API bool readLines(QFile * f,QStringList &buffer,int iStartLine = 0, int iCount = -1, bool bUtf8 = true); - extern KVILIB_API bool isReadable(const QString &szFname); - extern KVILIB_API bool isAbsolutePath(const QString &szPath); + extern KVILIB_API bool readLine(TQFile * f,TQString &szBuffer,bool bUtf8 = true); + extern KVILIB_API bool readLines(TQFile * f,TQStringList &buffer,int iStartLine = 0, int iCount = -1, bool bUtf8 = true); + extern KVILIB_API bool isReadable(const TQString &szFname); + extern KVILIB_API bool isAbsolutePath(const TQString &szPath); }; // ALL THIS STUFF BELOW SHOULD DIE: IF YOU SEE IT, REPLACE WITH THE FUNCTIONS IN THE NAMESPACE ABOVE @@ -103,10 +103,10 @@ KVILIB_API extern bool kvi_isAbsolutePath(const char *path); // There is NO way to come back to the original string // the algo is one-way only KVILIB_API extern void kvi_encodeFileName(KviStr & path); -KVILIB_API extern void kvi_encodeFileName(QString & path); +KVILIB_API extern void kvi_encodeFileName(TQString & path); // Reads a single line from the file and returns false if EOF was encountered. -KVILIB_API extern bool kvi_readLine(QFile *f,KviStr &str); +KVILIB_API extern bool kvi_readLine(TQFile *f,KviStr &str); // Removes a file #endif //_KVI_FILEUTILS_H_INCLUDED_ diff --git a/src/kvilib/file/kvi_packagefile.cpp b/src/kvilib/file/kvi_packagefile.cpp index 3e7bcc17..5700f4e8 100644 --- a/src/kvilib/file/kvi_packagefile.cpp +++ b/src/kvilib/file/kvi_packagefile.cpp @@ -30,10 +30,10 @@ #include "kvi_locale.h" #include "kvi_inttypes.h" -#include <qprogressdialog.h> -#include <qlabel.h> +#include <tqprogressdialog.h> +#include <tqlabel.h> -#include <qdir.h> +#include <tqdir.h> #ifdef COMPILE_ZLIB_SUPPORT #include <zlib.h> @@ -98,7 +98,7 @@ // FieldData Variable FieldLen The data of the field, see below for defined values // FieldData for FieldType 1 (file field) -// Flags uint32 4 Bitmask. Bits: 1=FileIsDeflated +// Flags uint32 4 Bittqmask. Bits: 1=FileIsDeflated // Path UniString Variable A relative path expressed as utf8 string. \ AND / are considered to be separators // Size uint32 4 Size of the following file data // FilePayload Bytes Variable @@ -111,9 +111,9 @@ KviPackageIOEngine::KviPackageIOEngine() { m_pProgressDialog = 0; - m_pStringInfoFields = new KviPointerHashTable<QString,QString>(); + m_pStringInfoFields = new KviPointerHashTable<TQString,TQString>(); m_pStringInfoFields->setAutoDelete(true); - m_pBinaryInfoFields = new KviPointerHashTable<QString,QByteArray>(); + m_pBinaryInfoFields = new KviPointerHashTable<TQString,TQByteArray>(); m_pBinaryInfoFields->setAutoDelete(true); } @@ -125,7 +125,7 @@ KviPackageIOEngine::~KviPackageIOEngine() } -bool KviPackageIOEngine::updateProgress(int iProgress,const QString &szLabel) +bool KviPackageIOEngine::updateProgress(int iProgress,const TQString &szLabel) { if(!m_pProgressDialog)return true; #ifdef COMPILE_USE_QT4 @@ -134,7 +134,7 @@ bool KviPackageIOEngine::updateProgress(int iProgress,const QString &szLabel) m_pProgressDialog->setProgress(iProgress); #endif m_pProgressDialogLabel->setText(szLabel); - qApp->processEvents(); + tqApp->processEvents(); if(m_pProgressDialog->wasCanceled()) { setLastError(__tr2qs("Operation cancelled")); @@ -143,17 +143,17 @@ bool KviPackageIOEngine::updateProgress(int iProgress,const QString &szLabel) return true; } -void KviPackageIOEngine::showProgressDialog(const QString &szCaption,int iTotalSteps) +void KviPackageIOEngine::showProgressDialog(const TQString &szCaption,int iTotalSteps) { #ifdef COMPILE_USE_QT4 - m_pProgressDialog = new QProgressDialog(QString(""),__tr2qs("Cancel"),0,iTotalSteps,0); + m_pProgressDialog = new TQProgressDialog(TQString(""),__tr2qs("Cancel"),0,iTotalSteps,0); m_pProgressDialog->setModal(true); m_pProgressDialog->setWindowTitle(szCaption); #else - m_pProgressDialog = new QProgressDialog(QString(""),__tr2qs("Cancel"),iTotalSteps,0,"",true); + m_pProgressDialog = new TQProgressDialog(TQString(""),__tr2qs("Cancel"),iTotalSteps,0,"",true); m_pProgressDialog->setCaption(szCaption); #endif - m_pProgressDialogLabel = new QLabel(m_pProgressDialog); + m_pProgressDialogLabel = new TQLabel(m_pProgressDialog); m_pProgressDialogLabel->setMaximumSize(500,300); m_pProgressDialog->setLabel(m_pProgressDialogLabel); } @@ -194,23 +194,23 @@ KviPackageWriter::~KviPackageWriter() delete m_pDataFields; } -void KviPackageWriter::addInfoField(const QString &szName,const QString &szValue) +void KviPackageWriter::addInfoField(const TQString &szName,const TQString &szValue) { - m_pStringInfoFields->replace(szName,new QString(szValue)); + m_pStringInfoFields->tqreplace(szName,new TQString(szValue)); } -void KviPackageWriter::addInfoField(const QString &szName,QByteArray * pValue) +void KviPackageWriter::addInfoField(const TQString &szName,TQByteArray * pValue) { - m_pBinaryInfoFields->replace(szName,pValue); + m_pBinaryInfoFields->tqreplace(szName,pValue); } -bool KviPackageWriter::addFile(const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags) +bool KviPackageWriter::addFile(const TQString &szLocalFileName,const TQString &szTargetFileName,kvi_u32_t uAddFileFlags) { - QFileInfo fi(szLocalFileName); + TQFileInfo fi(szLocalFileName); return addFileInternal(&fi,szLocalFileName,szTargetFileName,uAddFileFlags); } -bool KviPackageWriter::addFileInternal(const QFileInfo * fi,const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags) +bool KviPackageWriter::addFileInternal(const TQFileInfo * fi,const TQString &szLocalFileName,const TQString &szTargetFileName,kvi_u32_t uAddFileFlags) { if(!(fi->isFile() && fi->isReadable())) return false; @@ -231,42 +231,42 @@ bool KviPackageWriter::addFileInternal(const QFileInfo * fi,const QString &szLoc return true; } -bool KviPackageWriter::addDirectory(const QString &szLocalDirectoryName,const QString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags) +bool KviPackageWriter::addDirectory(const TQString &szLocalDirectoryName,const TQString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags) { - QDir d(szLocalDirectoryName); + TQDir d(szLocalDirectoryName); #ifdef COMPILE_USE_QT4 - QDir::Filters iFlags; + TQDir::Filters iFlags; #else int iFlags; #endif - iFlags = QDir::Files | QDir::Readable; + iFlags = TQDir::Files | TQDir::Readable; if(!(uAddFileFlags & FollowSymLinks)) - iFlags |= QDir::NoSymLinks; + iFlags |= TQDir::NoSymLinks; - // QT4SUX: Because the QDir::entryInfoList() breaks really a lot of code by returning an object that behaves in a _totally_ different way.. it's also much slower + // QT4SUX: Because the TQDir::entryInfoList() breaks really a lot of code by returning an object that behaves in a _totally_ different way.. it's also much slower #ifdef COMPILE_USE_QT4 int j; - QFileInfoList sl = d.entryInfoList(iFlags); + TQFileInfoList sl = d.entryInfoList(iFlags); for(j=0;j<sl.size();j++) { #else - const QFileInfoList * sl = d.entryInfoList(iFlags); + const TQFileInfoList * sl = d.entryInfoList(iFlags); if(!sl)return false; - QFileInfoListIterator it(*sl); - while(QFileInfo * fi = it.current()) + TQFileInfoListIterator it(*sl); + while(TQFileInfo * fi = it.current()) { #endif - QString szSFileName = szLocalDirectoryName; - KviQString::ensureLastCharIs(szSFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szSFileName = szLocalDirectoryName; + KviTQString::ensureLastCharIs(szSFileName,TQChar(KVI_PATH_SEPARATOR_CHAR)); #ifdef COMPILE_USE_QT4 - QFileInfo slowCopy = sl.at(j); + TQFileInfo slowCopy = sl.at(j); szSFileName += slowCopy.fileName(); #else szSFileName += fi->fileName(); #endif - QString szDFileName = szTargetDirectoryPrefix; - KviQString::ensureLastCharIs(szDFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szDFileName = szTargetDirectoryPrefix; + KviTQString::ensureLastCharIs(szDFileName,TQChar(KVI_PATH_SEPARATOR_CHAR)); #ifdef COMPILE_USE_QT4 szDFileName += slowCopy.fileName(); if(!addFileInternal(&slowCopy,szSFileName,szDFileName,uAddFileFlags)) @@ -280,28 +280,28 @@ bool KviPackageWriter::addDirectory(const QString &szLocalDirectoryName,const QS ++it; #endif } - iFlags = QDir::Dirs | QDir::Readable; + iFlags = TQDir::Dirs | TQDir::Readable; if(!(uAddFileFlags & FollowSymLinks)) - iFlags |= QDir::NoSymLinks; + iFlags |= TQDir::NoSymLinks; sl = d.entryInfoList(iFlags); #ifdef COMPILE_USE_QT4 for(j=0;j<sl.size();j++) { - QString szDir = sl.at(j).fileName(); + TQString szDir = sl.at(j).fileName(); #else if(!sl)return false; - QFileInfoListIterator it2(*sl); - while(QFileInfo * fi2 = it2.current()) + TQFileInfoListIterator it2(*sl); + while(TQFileInfo * fi2 = it2.current()) { - QString szDir = fi2->fileName(); + TQString szDir = fi2->fileName(); #endif - if(!KviQString::equalCS(szDir,"..") && !KviQString::equalCS(szDir,".")) + if(!KviTQString::equalCS(szDir,"..") && !KviTQString::equalCS(szDir,".")) { - QString szSDirName = szLocalDirectoryName; - KviQString::ensureLastCharIs(szSDirName,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szSDirName = szLocalDirectoryName; + KviTQString::ensureLastCharIs(szSDirName,TQChar(KVI_PATH_SEPARATOR_CHAR)); szSDirName += szDir; - QString szDDirName = szTargetDirectoryPrefix; - KviQString::ensureLastCharIs(szDDirName,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szDDirName = szTargetDirectoryPrefix; + KviTQString::ensureLastCharIs(szDDirName,TQChar(KVI_PATH_SEPARATOR_CHAR)); szDDirName += szDir; if(!addDirectory(szSDirName,szDDirName,uAddFileFlags)) return false; @@ -320,8 +320,8 @@ bool KviPackageWriter::addDirectory(const QString &szLocalDirectoryName,const QS bool KviPackageWriter::packFile(KviFile * pFile,DataField * pDataField) { - QString szProgressText; - KviQString::sprintf(szProgressText,__tr2qs("Packaging file %Q"),&(pDataField->m_szFileLocalName)); + TQString szProgressText; + KviTQString::sprintf(szProgressText,__tr2qs("Packaging file %Q"),&(pDataField->m_szFileLocalName)); if(!updateProgress(m_iCurrentProgress,szProgressText)) return false; // aborted @@ -346,7 +346,7 @@ bool KviPackageWriter::packFile(KviFile * pFile,DataField * pDataField) if(!pFile->save(uFlags))return writeError(); - KviQCString szTargetFileName = KviQString::toUtf8(pDataField->m_szFileTargetName); + KviTQCString szTargetFileName = KviTQString::toUtf8(pDataField->m_szFileTargetName); // Path if(!pFile->save(szTargetFileName))return writeError(); @@ -429,9 +429,9 @@ bool KviPackageWriter::packFile(KviFile * pFile,DataField * pDataField) if((zstr.total_in % 2000000) == 0) { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),zstr.total_in,uSize); - QString szPrg = szProgressText + szTmp; + TQString szTmp; + KviTQString::sprintf(szTmp,TQString(" (%d of %d bytes)"),zstr.total_in,uSize); + TQString szPrg = szProgressText + szTmp; if(!updateProgress(m_iCurrentProgress,szPrg)) return false; // aborted } @@ -499,9 +499,9 @@ bool KviPackageWriter::packFile(KviFile * pFile,DataField * pDataField) iTotalFileSize += iReaded; if((iTotalFileSize % 1000000) == 0) { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),iTotalFileSize,uSize); - QString szPrg = szProgressText + szTmp; + TQString szTmp; + KviTQString::sprintf(szTmp,TQString(" (%d of %d bytes)"),iTotalFileSize,uSize); + TQString szPrg = szProgressText + szTmp; if(!updateProgress(m_iCurrentProgress,szPrg)) return false; // aborted } @@ -518,7 +518,7 @@ bool KviPackageWriter::packFile(KviFile * pFile,DataField * pDataField) return true; } -bool KviPackageWriter::pack(const QString &szFileName,kvi_u32_t uPackFlags) +bool KviPackageWriter::pack(const TQString &szFileName,kvi_u32_t uPackFlags) { m_iCurrentProgress = 0; if(!(uPackFlags & NoProgressDialog)) @@ -533,7 +533,7 @@ bool KviPackageWriter::pack(const QString &szFileName,kvi_u32_t uPackFlags) return bRet; } -bool KviPackageWriter::packInternal(const QString &szFileName,kvi_u32_t uPackFlags) +bool KviPackageWriter::packInternal(const TQString &szFileName,kvi_u32_t uPackFlags) { KviFile f(szFileName); @@ -572,8 +572,8 @@ bool KviPackageWriter::packInternal(const QString &szFileName,kvi_u32_t uPackFla return false; // aborted // InfoFields (string) - KviPointerHashTableIterator<QString,QString> it(*m_pStringInfoFields); - while(QString * s = it.current()) + KviPointerHashTableIterator<TQString,TQString> it(*m_pStringInfoFields); + while(TQString * s = it.current()) { if(!f.save(it.currentKey()))return writeError(); kvi_u32_t uType = KVI_PACKAGE_INFOFIELD_TYPE_STRING; @@ -583,8 +583,8 @@ bool KviPackageWriter::packInternal(const QString &szFileName,kvi_u32_t uPackFla } // InfoFields (binary) - KviPointerHashTableIterator<QString,QByteArray> it2(*m_pBinaryInfoFields); - while(QByteArray * b = it2.current()) + KviPointerHashTableIterator<TQString,TQByteArray> it2(*m_pBinaryInfoFields); + while(TQByteArray * b = it2.current()) { if(!f.save(it2.currentKey()))return writeError(); kvi_u32_t uType = KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER; @@ -646,7 +646,7 @@ KviPackageReader::~KviPackageReader() { } -bool KviPackageReader::readHeaderInternal(KviFile * pFile,const QString &szLocalFileName) +bool KviPackageReader::readHeaderInternal(KviFile * pFile,const TQString &szLocalFileName) { // read the PackageHeader @@ -686,7 +686,7 @@ bool KviPackageReader::readHeaderInternal(KviFile * pFile,const QString &szLocal kvi_u32_t uIdx = 0; while(uIdx < uCount) { - QString szKey; + TQString szKey; if(!pFile->load(szKey))return readError(); kvi_u32_t uFieldType; if(!pFile->load(uFieldType))return readError(); @@ -694,20 +694,20 @@ bool KviPackageReader::readHeaderInternal(KviFile * pFile,const QString &szLocal { case KVI_PACKAGE_INFOFIELD_TYPE_STRING: { - QString szValue; + TQString szValue; if(!pFile->load(szValue))return readError(); - m_pStringInfoFields->replace(szKey,new QString(szValue)); + m_pStringInfoFields->tqreplace(szKey,new TQString(szValue)); } break; case KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER: { - QByteArray * pbValue = new QByteArray(); + TQByteArray * pbValue = new TQByteArray(); if(!pFile->load(*pbValue)) { delete pbValue; return readError(); } - m_pBinaryInfoFields->replace(szKey,pbValue); + m_pBinaryInfoFields->tqreplace(szKey,pbValue); } break; default: @@ -721,7 +721,7 @@ bool KviPackageReader::readHeaderInternal(KviFile * pFile,const QString &szLocal } -bool KviPackageReader::readHeader(const QString &szLocalFileName) +bool KviPackageReader::readHeader(const TQString &szLocalFileName) { KviFile f(szLocalFileName); if(!f.openForReading()) @@ -733,7 +733,7 @@ bool KviPackageReader::readHeader(const QString &szLocalFileName) return readHeaderInternal(&f,szLocalFileName); } -bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) +bool KviPackageReader::unpackFile(KviFile * pFile,const TQString &szUnpackPath) { // Flags kvi_u32_t uFlags; @@ -748,24 +748,24 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) #endif // Path - QString szPath; + TQString szPath; if(!pFile->load(szPath))return readError(); - QString szFileName = szUnpackPath; - KviQString::ensureLastCharIs(szFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); + TQString szFileName = szUnpackPath; + KviTQString::ensureLastCharIs(szFileName,TQChar(KVI_PATH_SEPARATOR_CHAR)); szFileName += szPath; // no attacks please :) - szFileName.replace(QString("..\\"),QString("")); - szFileName.replace(QString("..//"),QString("")); + szFileName.tqreplace(TQString("..\\"),TQString("")); + szFileName.tqreplace(TQString("..//"),TQString("")); KviFileUtils::adjustFilePath(szFileName); - int idx = KviQString::findRev(szFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); + int idx = KviTQString::tqfindRev(szFileName,TQChar(KVI_PATH_SEPARATOR_CHAR)); if(idx != -1) { - QString szPrefixPath = szFileName.left(idx); + TQString szPrefixPath = szFileName.left(idx); if(!KviFileUtils::makeDir(szPrefixPath)) { setLastError(__tr2qs("Failed to create the target directory")); @@ -780,8 +780,8 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) return false; } - QString szProgressText; - KviQString::sprintf(szProgressText,__tr2qs("Unpacking file %Q"),&szFileName); + TQString szProgressText; + KviTQString::sprintf(szProgressText,__tr2qs("Unpacking file %Q"),&szFileName); if(!updateProgress(pFile->pos(),szProgressText)) return false; // aborted @@ -868,9 +868,9 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) if((zstr.total_in % 2000000) == 0) { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),zstr.total_in,uSize); - QString szPrg = szProgressText + szTmp; + TQString szTmp; + KviTQString::sprintf(szTmp,TQString(" (%d of %d bytes)"),zstr.total_in,uSize); + TQString szPrg = szProgressText + szTmp; if(!updateProgress(pFile->pos(),szPrg)) return false; // aborted } @@ -936,9 +936,9 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) if((iTotalFileSize % 3000000) == 0) { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),iTotalFileSize,uSize); - QString szPrg = szProgressText + szTmp; + TQString szTmp; + KviTQString::sprintf(szTmp,TQString(" (%d of %d bytes)"),iTotalFileSize,uSize); + TQString szPrg = szProgressText + szTmp; if(!updateProgress(pFile->pos(),szPrg)) return false; // aborted } @@ -958,22 +958,22 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) return true; } -bool KviPackageReader::getStringInfoField(const QString &szName,QString &szBuffer) +bool KviPackageReader::getStringInfoField(const TQString &szName,TQString &szBuffer) { - QString * pVal = m_pStringInfoFields->find(szName); + TQString * pVal = m_pStringInfoFields->tqfind(szName); if(!pVal)return false; szBuffer = *pVal; return true; } -bool KviPackageReader::unpack(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags) +bool KviPackageReader::unpack(const TQString &szLocalFileName,const TQString &szUnpackPath,kvi_u32_t uUnpackFlags) { bool bRet = unpackInternal(szLocalFileName,szUnpackPath,uUnpackFlags); hideProgressDialog(); return bRet; } -bool KviPackageReader::unpackInternal(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags) +bool KviPackageReader::unpackInternal(const TQString &szLocalFileName,const TQString &szUnpackPath,kvi_u32_t uUnpackFlags) { KviFile f(szLocalFileName); diff --git a/src/kvilib/file/kvi_packagefile.h b/src/kvilib/file/kvi_packagefile.h index 3e330554..c32329f1 100644 --- a/src/kvilib/file/kvi_packagefile.h +++ b/src/kvilib/file/kvi_packagefile.h @@ -27,14 +27,14 @@ #include "kvi_settings.h" #include "kvi_qstring.h" #include "kvi_pointerhashtable.h" -#include "kvi_qcstring.h" // QByteArray anyway -#include <qobject.h> +#include "kvi_qcstring.h" // TQByteArray anyway +#include <tqobject.h> #include "kvi_pointerlist.h" class KviFile; -class QProgressDialog; -class QLabel; -class QFileInfo; +class TQProgressDialog; +class TQLabel; +class TQFileInfo; // // This class is used for creating KVIrc package files. @@ -47,20 +47,20 @@ public: KviPackageIOEngine(); virtual ~KviPackageIOEngine(); protected: - QString m_szLastError; - KviPointerHashTable<QString,QString> * m_pStringInfoFields; - KviPointerHashTable<QString,QByteArray> * m_pBinaryInfoFields; - QProgressDialog * m_pProgressDialog; - QLabel * m_pProgressDialogLabel; + TQString m_szLastError; + KviPointerHashTable<TQString,TQString> * m_pStringInfoFields; + KviPointerHashTable<TQString,TQByteArray> * m_pBinaryInfoFields; + TQProgressDialog * m_pProgressDialog; + TQLabel * m_pProgressDialogLabel; public: - const QString & lastError(){ return m_szLastError; }; - void setLastError(const QString &szLastError){ m_szLastError = szLastError; }; - KviPointerHashTable<QString,QString> * stringInfoFields(){ return m_pStringInfoFields; }; - KviPointerHashTable<QString,QByteArray> * binaryInfoFields(){ return m_pBinaryInfoFields; }; + const TQString & lastError(){ return m_szLastError; }; + void setLastError(const TQString &szLastError){ m_szLastError = szLastError; }; + KviPointerHashTable<TQString,TQString> * stringInfoFields(){ return m_pStringInfoFields; }; + KviPointerHashTable<TQString,TQByteArray> * binaryInfoFields(){ return m_pBinaryInfoFields; }; protected: - void showProgressDialog(const QString &szCaption,int iTotalSteps); + void showProgressDialog(const TQString &szCaption,int iTotalSteps); void hideProgressDialog(); - bool updateProgress(int iProgress,const QString &szLabel); + bool updateProgress(int iProgress,const TQString &szLabel); bool writeError(); bool readError(); }; @@ -87,8 +87,8 @@ protected: kvi_u32_t m_uWrittenFieldLength; // data fields for the File DataFieldType bool m_bFileAllowCompression; - QString m_szFileLocalName; - QString m_szFileTargetName; + TQString m_szFileLocalName; + TQString m_szFileTargetName; }; KviPointerList<DataField> * m_pDataFields; @@ -101,22 +101,22 @@ public: NoCompression = 1, FollowSymLinks = 2 }; - bool addFile(const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags = 0); - bool addDirectory(const QString &szLocalDirectoryName,const QString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags = 0); + bool addFile(const TQString &szLocalFileName,const TQString &szTargetFileName,kvi_u32_t uAddFileFlags = 0); + bool addDirectory(const TQString &szLocalDirectoryName,const TQString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags = 0); // Adds an info field as a name=value pair - void addInfoField(const QString &szName,const QString &szValue); - void addInfoField(const QString &szName,QByteArray * pArray); + void addInfoField(const TQString &szName,const TQString &szValue); + void addInfoField(const TQString &szName,TQByteArray * pArray); // Attempts to pack everything and store it as the specified file. // There is no mandatory extension but you *should* use KVI_FILEEXTENSION_THEMEPACKAGE for themes // and KVI_FILEEXTENSION_ADDONPACKAGE for addons. See kvi_fileextension.h enum PackFlags { NoProgressDialog = 1 }; - bool pack(const QString &szFileName,kvi_u32_t uPackFlags = 0); + bool pack(const TQString &szFileName,kvi_u32_t uPackFlags = 0); private: - bool packInternal(const QString &szFileName,kvi_u32_t uPackFlags = 0); + bool packInternal(const TQString &szFileName,kvi_u32_t uPackFlags = 0); bool packFile(KviFile * pFile,DataField * pDataField); - bool addFileInternal(const QFileInfo * fi,const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags = 0); + bool addFileInternal(const TQFileInfo * fi,const TQString &szLocalFileName,const TQString &szTargetFileName,kvi_u32_t uAddFileFlags = 0); }; class KVILIB_API KviPackageReader : public KviPackageIOEngine @@ -125,16 +125,16 @@ public: KviPackageReader(); virtual ~KviPackageReader(); public: - bool readHeader(const QString &szLocalFileName); + bool readHeader(const TQString &szLocalFileName); enum UnpackFlags { NoProgressDialog = 1 }; - bool getStringInfoField(const QString &szName,QString &szBuffer); - bool unpack(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags = 0); + bool getStringInfoField(const TQString &szName,TQString &szBuffer); + bool unpack(const TQString &szLocalFileName,const TQString &szUnpackPath,kvi_u32_t uUnpackFlags = 0); private: - bool unpackInternal(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags = 0); - bool unpackFile(KviFile * pFile,const QString &szUnpackPath); - bool readHeaderInternal(KviFile * pFile,const QString &szLocalFileName); + bool unpackInternal(const TQString &szLocalFileName,const TQString &szUnpackPath,kvi_u32_t uUnpackFlags = 0); + bool unpackFile(KviFile * pFile,const TQString &szUnpackPath); + bool readHeaderInternal(KviFile * pFile,const TQString &szLocalFileName); }; diff --git a/src/kvilib/irc/kvi_avatar.cpp b/src/kvilib/irc/kvi_avatar.cpp index 1642560a..680e7978 100644 --- a/src/kvilib/irc/kvi_avatar.cpp +++ b/src/kvilib/irc/kvi_avatar.cpp @@ -27,7 +27,7 @@ #include "kvi_avatar.h" #include "kvi_qstring.h" -#include <qimage.h> +#include <tqimage.h> /* @@ -95,13 +95,13 @@ The "preferred" image size may grow with time, as the network transmission speed grows. */ -KviAvatar::KviAvatar(const QString &szLocalPath,const QString &szName,QPixmap * pix) +KviAvatar::KviAvatar(const TQString &szLocalPath,const TQString &szName,TQPixmap * pix) { m_pPixmap = pix; m_pScaledPixmap = 0; - if(m_pPixmap == 0)m_pPixmap = new QPixmap(32,32); // cool memory map :) + if(m_pPixmap == 0)m_pPixmap = new TQPixmap(32,32); // cool memory map :) - m_bRemote = KviQString::equalCIN("http://",szName,7); + m_bRemote = KviTQString::equalCIN("http://",szName,7); m_szLocalPath = szLocalPath; m_szName = szName; @@ -113,7 +113,7 @@ KviAvatar::~KviAvatar() if(m_pScaledPixmap)delete m_pScaledPixmap; } -QPixmap * KviAvatar::scaledPixmap(unsigned int w,unsigned int h) +TQPixmap * KviAvatar::scaledPixmap(unsigned int w,unsigned int h) { if(((unsigned int)(m_pPixmap->width())) == w) { @@ -154,11 +154,11 @@ QPixmap * KviAvatar::scaledPixmap(unsigned int w,unsigned int h) } #ifdef COMPILE_USE_QT4 - m_pScaledPixmap = new QPixmap(m_pPixmap->scaled(scaleW,scaleH)); + m_pScaledPixmap = new TQPixmap(m_pPixmap->scaled(scaleW,scaleH)); #else - QImage img = m_pPixmap->convertToImage(); + TQImage img = m_pPixmap->convertToImage(); - m_pScaledPixmap = new QPixmap(); + m_pScaledPixmap = new TQPixmap(); m_pScaledPixmap->convertFromImage(img.smoothScale(scaleW,scaleH)); #endif return m_pScaledPixmap; diff --git a/src/kvilib/irc/kvi_avatar.h b/src/kvilib/irc/kvi_avatar.h index ba8edbc5..fddecf4d 100644 --- a/src/kvilib/irc/kvi_avatar.h +++ b/src/kvilib/irc/kvi_avatar.h @@ -29,37 +29,37 @@ #include "kvi_heapobject.h" #include "kvi_settings.h" -#include <qpixmap.h> +#include <tqpixmap.h> class KVILIB_API KviAvatar : public KviHeapObject { public: - KviAvatar(const QString &szLocalPath,const QString &szName,QPixmap * pix); + KviAvatar(const TQString &szLocalPath,const TQString &szName,TQPixmap * pix); ~KviAvatar(); private: - QString m_szLocalPath; - QString m_szName; + TQString m_szLocalPath; + TQString m_szName; bool m_bRemote; - QPixmap * m_pPixmap; - QPixmap * m_pScaledPixmap; + TQPixmap * m_pPixmap; + TQPixmap * m_pScaledPixmap; unsigned int m_uLastScaleWidth; unsigned int m_uLastScaleHeight; public: - QPixmap * pixmap(){ return m_pPixmap; }; - QPixmap * scaledPixmap(unsigned int w,unsigned int h); + TQPixmap * pixmap(){ return m_pPixmap; }; + TQPixmap * scaledPixmap(unsigned int w,unsigned int h); bool isRemote(){ return m_bRemote; }; - const QString &localPath(){ return m_szLocalPath; }; - const QString &name(){ return m_szName; }; + const TQString &localPath(){ return m_szLocalPath; }; + const TQString &name(){ return m_szName; }; // string that uniquely identifies this avatar // for remote avatars that have name starting with http:// // the name is used. // for local avatars the localPath is used instead - const QString &identificationString(){ return m_bRemote ? m_szName : m_szLocalPath; }; + const TQString &identificationString(){ return m_bRemote ? m_szName : m_szLocalPath; }; // if name is http://xxxx @@ -76,7 +76,7 @@ public: // ex: /home/pragma/.kvirc/avatars/pragma.png // local path->name : strip leading path informations - // name->local path : replace : / and + // name->local path : tqreplace : / and }; diff --git a/src/kvilib/irc/kvi_avatarcache.cpp b/src/kvilib/irc/kvi_avatarcache.cpp index d24562ea..59c0ed61 100644 --- a/src/kvilib/irc/kvi_avatarcache.cpp +++ b/src/kvilib/irc/kvi_avatarcache.cpp @@ -66,7 +66,7 @@ void KviAvatarCache::done() KviAvatarCache::KviAvatarCache() { - m_pAvatarDict = new KviPointerHashTable<QString,KviAvatarCacheEntry>(CACHE_DICT_SIZE,false); + m_pAvatarDict = new KviPointerHashTable<TQString,KviAvatarCacheEntry>(CACHE_DICT_SIZE,false); m_pAvatarDict->setAutoDelete(true); } @@ -76,19 +76,19 @@ KviAvatarCache::~KviAvatarCache() } -void KviAvatarCache::replace(const QString &szIdString,const KviIrcMask &mask,const QString &szNetwork) +void KviAvatarCache::tqreplace(const TQString &szIdString,const KviIrcMask &tqmask,const TQString &szNetwork) { - QString szKey; + TQString szKey; - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); + tqmask.tqmask(szKey,KviIrcMask::NickCleanUserSmartNet); + szKey.append(TQChar('+')); szKey.append(szNetwork); KviAvatarCacheEntry * e = new KviAvatarCacheEntry; e->szIdString = szIdString; e->tLastAccess = kvi_unixTime(); - m_pAvatarDict->replace(szKey,e); + m_pAvatarDict->tqreplace(szKey,e); if(m_pAvatarDict->count() > MAX_AVATARS_IN_CACHE) { @@ -96,12 +96,12 @@ void KviAvatarCache::replace(const QString &szIdString,const KviIrcMask &mask,co } } -void KviAvatarCache::remove(const KviIrcMask &mask,const QString &szNetwork) +void KviAvatarCache::remove(const KviIrcMask &tqmask,const TQString &szNetwork) { - QString szKey; + TQString szKey; - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); + tqmask.tqmask(szKey,KviIrcMask::NickCleanUserSmartNet); + szKey.append(TQChar('+')); szKey.append(szNetwork); m_pAvatarDict->remove(szKey); @@ -109,21 +109,21 @@ void KviAvatarCache::remove(const KviIrcMask &mask,const QString &szNetwork) -const QString & KviAvatarCache::lookup(const KviIrcMask &mask,const QString &szNetwork) +const TQString & KviAvatarCache::lookup(const KviIrcMask &tqmask,const TQString &szNetwork) { - QString szKey; + TQString szKey; - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); + tqmask.tqmask(szKey,KviIrcMask::NickCleanUserSmartNet); + szKey.append(TQChar('+')); szKey.append(szNetwork); - KviAvatarCacheEntry * e = m_pAvatarDict->find(szKey); - if(!e)return KviQString::empty; + KviAvatarCacheEntry * e = m_pAvatarDict->tqfind(szKey); + if(!e)return KviTQString::empty; e->tLastAccess = kvi_unixTime(); return e->szIdString; } -void KviAvatarCache::load(const QString &szFileName) +void KviAvatarCache::load(const TQString &szFileName) { m_pAvatarDict->clear(); @@ -142,14 +142,14 @@ void KviAvatarCache::load(const QString &szFileName) kvi_time_t tLastAccess = cfg.readUIntEntry("LastAccess",0); if((tNow - tLastAccess) < MAX_UNACCESSED_TIME) { - QString szIdString = cfg.readQStringEntry("Avatar",""); + TQString szIdString = cfg.readTQStringEntry("Avatar",""); if(!szIdString.isEmpty()) { KviAvatarCacheEntry * e = new KviAvatarCacheEntry; e->tLastAccess = tLastAccess; e->szIdString = szIdString; - m_pAvatarDict->replace(it.currentKey(),e); + m_pAvatarDict->tqreplace(it.currentKey(),e); cnt++; if(cnt >= MAX_AVATARS_IN_CACHE)return; // done } @@ -158,12 +158,12 @@ void KviAvatarCache::load(const QString &szFileName) } } -void KviAvatarCache::save(const QString &szFileName) +void KviAvatarCache::save(const TQString &szFileName) { KviConfig cfg(szFileName,KviConfig::Write); // cfg.clear(); // not needed with KviConfig::Write - KviPointerHashTableIterator<QString,KviAvatarCacheEntry> it(*m_pAvatarDict); + KviPointerHashTableIterator<TQString,KviAvatarCacheEntry> it(*m_pAvatarDict); while(KviAvatarCacheEntry * e = it.current()) { @@ -180,11 +180,11 @@ void KviAvatarCache::save(const QString &szFileName) void KviAvatarCache::cleanup() { // first do a quick run deleting the avatars really too old - KviPointerHashTableIterator<QString,KviAvatarCacheEntry> it(*m_pAvatarDict); + KviPointerHashTableIterator<TQString,KviAvatarCacheEntry> it(*m_pAvatarDict); kvi_time_t tNow = kvi_unixTime(); - KviPointerList<QString> l; + KviPointerList<TQString> l; l.setAutoDelete(false); KviAvatarCacheEntry * e; @@ -193,12 +193,12 @@ void KviAvatarCache::cleanup() { if((tNow - e->tLastAccess) > MAX_UNACCESSED_TIME) { - l.append(new QString(it.currentKey())); + l.append(new TQString(it.currentKey())); } ++it; } - for(QString *s = l.first();s;s = l.next())m_pAvatarDict->remove(*s); + for(TQString *s = l.first();s;s = l.next())m_pAvatarDict->remove(*s); if(m_pAvatarDict->count() < CACHE_GUARD_LEVEL)return; diff --git a/src/kvilib/irc/kvi_avatarcache.h b/src/kvilib/irc/kvi_avatarcache.h index 7d715256..7f2ff822 100644 --- a/src/kvilib/irc/kvi_avatarcache.h +++ b/src/kvilib/irc/kvi_avatarcache.h @@ -34,7 +34,7 @@ typedef struct _KviAvatarCacheEntry { - QString szIdString; + TQString szIdString; kvi_time_t tLastAccess; } KviAvatarCacheEntry; @@ -46,7 +46,7 @@ protected: KviAvatarCache(); ~KviAvatarCache(); public: - KviPointerHashTable<QString,KviAvatarCacheEntry> * m_pAvatarDict; + KviPointerHashTable<TQString,KviAvatarCacheEntry> * m_pAvatarDict; protected: static KviAvatarCache * m_pAvatarCacheInstance; public: @@ -55,14 +55,14 @@ public: static KviAvatarCache * instance(){ return m_pAvatarCacheInstance; }; - void replace(const QString &szIdString,const KviIrcMask &mask,const QString &szNetwork); - void remove(const KviIrcMask &mask,const QString &szNetwork); - const QString & lookup(const KviIrcMask &mask,const QString &szNetwork); + void tqreplace(const TQString &szIdString,const KviIrcMask &tqmask,const TQString &szNetwork); + void remove(const KviIrcMask &tqmask,const TQString &szNetwork); + const TQString & lookup(const KviIrcMask &tqmask,const TQString &szNetwork); void cleanup(); - void load(const QString &szFileName); - void save(const QString &szFileName); + void load(const TQString &szFileName); + void save(const TQString &szFileName); }; diff --git a/src/kvilib/irc/kvi_ircmask.cpp b/src/kvilib/irc/kvi_ircmask.cpp index dbdc1b6c..4460cba6 100644 --- a/src/kvilib/irc/kvi_ircmask.cpp +++ b/src/kvilib/irc/kvi_ircmask.cpp @@ -29,18 +29,18 @@ #include "kvi_ircmask.h" /* - @doc: irc_masks + @doc: irc_tqmasks @title: - Irc masks + Irc tqmasks @type: generic @short: - Decription of the standard IRC masks + Decription of the standard IRC tqmasks @keyterms: - irc masks , nickname , username , hostname , wildcard + irc tqmasks , nickname , username , hostname , wildcard @body: - [big]Simple masks[/big][br] - An irc mask is a string in a special format that identifies an user on irc.[br] + [big]Simple tqmasks[/big][br] + An irc tqmask is a string in a special format that identifies an user on irc.[br] The standard basic format is:[br] [b]<nick>!<username>@<host>[/b][br] The <nick> part contains the nickname with that the user is widely known across the network.[br] @@ -60,7 +60,7 @@ +: i line with ident[br] =: i line with OTHER type ident[br] -: i line, no ident[br] - So finally you can find <username> strings like "~pragma" or "^pragma", where "pragma" + So finally you can tqfind <username> strings like "~pragma" or "^pragma", where "pragma" is the system username of the irc-user and ~ and ^ are prefixes.[br] The <host> part is the hostname of the remote user.[br] In most cases it is the human-readable format of the host name, but sometimes @@ -68,23 +68,23 @@ The IP address can be either in IPV4 format or in IPV6 format.[br] Some (weird from my point of view) servers hide certain parts of the IP address to prevent attacks to the user's machine.[br] - Here are some examples of full irc-masks:[br] + Here are some examples of full irc-tqmasks:[br] Pragma!^pragma@staff.kvirc.net[br] [jazz]!~jazz@jazz.myhome.com[br] luke!=skywalker@212.213.41.12[br] HAN!^solo@ff0f:a0a0:1011::ea80:1[br] Darth!vader@210.11.12.XXX[br] - The irc-masks are [b]case insensitive[/b].[br] + The irc-tqmasks are [b]case insensitive[/b].[br] [br] - [big]Wildcard masks[/big][br] - In some contexts the irc-masks can contain '*' and '?' wildcards.[br] - The wild masks are used to "match" an user within a set of them.[br] + [big]Wildcard tqmasks[/big][br] + In some contexts the irc-tqmasks can contain '*' and '?' wildcards.[br] + The wild tqmasks are used to "match" an user within a set of them.[br] '*' matches any sequence (eventually empty) of characters and '?' matches a single character.[br] Wildcards are allowed only in the <nick> , <user> and <host> part: so the - "wildest" mask possible is:[br] + "wildest" tqmask possible is:[br] [b]*!*@*[/b][br] that designates "any nickname, any username on any host".[br] - Here are some examples of wild masks:[br] + Here are some examples of wild tqmasks:[br] Pragma!*pragma@212.101.102.*: matches any user with nickname "Pragma" , username that ends with "pragma" and coming from any machine on the 212.101.102 network.[br] *!solo@*.starwars.org: matches any nick with username solo (no prefix!) coming from any machine in @@ -225,15 +225,15 @@ KviIrcMask::KviIrcMask() m_szNick = m_szWild; } -KviIrcMask::KviIrcMask(const QString &szMask) +KviIrcMask::KviIrcMask(const TQString &szMask) { - static QString szWild("*"); - const QChar * b = KviQString::nullTerminatedArray(szMask); + static TQString szWild("*"); + const TQChar * b = KviTQString::nullTerminatedArray(szMask); if(b) { - const QChar * p = b; - while(p->unicode() && (p->unicode() != '!'))p++; - if(p->unicode()) + const TQChar * p = b; + while(p->tqunicode() && (p->tqunicode() != '!'))p++; + if(p->tqunicode()) { if(p != b) { @@ -250,8 +250,8 @@ KviIrcMask::KviIrcMask(const QString &szMask) } p++; b = p; - while(p->unicode() && (p->unicode() != '@'))p++; - if(p->unicode()) + while(p->tqunicode() && (p->tqunicode() != '@'))p++; + if(p->tqunicode()) { if(p != b) { @@ -267,7 +267,7 @@ KviIrcMask::KviIrcMask(const QString &szMask) } p++; b=p; - while(p->unicode())p++; + while(p->tqunicode())p++; if(p != b) { m_szHost.setUnicode(b,p-b); @@ -282,27 +282,27 @@ KviIrcMask::KviIrcMask(const QString &szMask) } } -QString KviIrcMask::m_szWild("*"); +TQString KviIrcMask::m_szWild("*"); bool KviIrcMask::hasNumericHost() const { - const QChar * p = KviQString::nullTerminatedArray(m_szHost); + const TQChar * p = KviTQString::nullTerminatedArray(m_szHost); if(!p)return false; int nPoints = 0; int nDoublePoints = 0; unsigned short uc; - while((uc = p->unicode())) + while((uc = p->tqunicode())) { - if(uc == '.')nPoints++; // ipv6 masks can contain dots too! + if(uc == '.')nPoints++; // ipv6 tqmasks can contain dots too! else { if(uc == ':')nDoublePoints++; else { if((uc < '0') || (uc > '9')) { #ifdef COMPILE_USE_QT4 - uc = p->toUpper().unicode(); + uc = p->toUpper().tqunicode(); #else - uc = p->upper().unicode(); + uc = p->upper().tqunicode(); #endif if((uc < 'A') || (uc > 'F'))return false; } @@ -315,8 +315,8 @@ bool KviIrcMask::hasNumericHost() const /** -* Retuns in szMask the specified (if possible) mask of this user.<br> -* If the host or username are not known , the mask may contain less information +* Retuns in szMask the specified (if possible) tqmask of this user.<br> +* If the host or username are not known , the tqmask may contain less information * than requested.<br> * Mask types:<br> * 0 : nick!user@machine.host.top (nick!user@XXX.XXX.XXX.XXX) (default)<br> @@ -341,7 +341,7 @@ bool KviIrcMask::hasNumericHost() const * 19: *!~user@*.host.top (*!~user@XXX.XXX.*) * 20: nick!*user@*.host.top (nick!*user@XXX.XXX.*) * 21: *!*user@*.host.top (*!user@*XXX.XXX.*) -* smart versions of the masks 17-21 that try take care of masked ip addresses +* smart versions of the tqmasks 17-21 that try take care of tqmasked ip addresses * in the form xxx.xxx.INVALID-TOP-MASK * 22: nick!~user@*.host.top (nick!~user@XXX.XXX.*) * 23: nick!*@*.host.top (nick!*@XXX.XXX.*) @@ -349,7 +349,7 @@ bool KviIrcMask::hasNumericHost() const * 25: nick!*user@*.host.top (nick!*user@XXX.XXX.*) * 26: *!*user@*.host.top (*!user@*XXX.XXX.*) * If some data is missing , these types may change:<br> -* For example , if hostname is missing , the mask type 3 or 4 may be reduced to type 5 +* For example , if hostname is missing , the tqmask type 3 or 4 may be reduced to type 5 */ /* @@ -363,13 +363,13 @@ bool KviIrcMask::hasNumericHost() const ** - i line, no ident */ -static unsigned char maskTable[27][3] = { +static unsigned char tqmaskTable[27][3] = { { 0 , 0 , 0 }, //0 means normal block - { 0 , 0 , 2 }, //2 in the third field means type *.abc.host.top (or XXX.XXX.XXX.*) host mask + { 0 , 0 , 2 }, //2 in the third field means type *.abc.host.top (or XXX.XXX.XXX.*) host tqmask { 0 , 0 , 1 }, //2 in the second field means *user (strip prefixes) { 0 , 1 , 0 }, //1 means * - { 0 , 1 , 2 }, //3 in the third field means type *.host.top (or XXX.XXX.*) host mask - { 0 , 1 , 1 }, //4 in the third field is like 3 but tries to detect masked ip addresses too + { 0 , 1 , 2 }, //3 in the third field means type *.host.top (or XXX.XXX.*) host tqmask + { 0 , 1 , 1 }, //4 in the third field is like 3 but tries to detect tqmasked ip addresses too { 1 , 0 , 0 }, { 1 , 0 , 2 }, { 1 , 0 , 1 }, @@ -393,12 +393,12 @@ static unsigned char maskTable[27][3] = { { 1 , 2 , 4 } }; -void KviIrcMask::mask(QString &szMask,MaskType eMaskType) const +void KviIrcMask::tqmask(TQString &szMask,MaskType eMaskType) const { if((((int)eMaskType) > 26)||(((int)eMaskType) < 0))eMaskType = NickUserHost; - szMask = maskTable[((int)eMaskType)][0] ? m_szWild : m_szNick; + szMask = tqmaskTable[((int)eMaskType)][0] ? m_szWild : m_szNick; szMask.append("!"); - switch(maskTable[((int)eMaskType)][1]) + switch(tqmaskTable[((int)eMaskType)][1]) { case 0: szMask.append(m_szUser); @@ -408,20 +408,20 @@ void KviIrcMask::mask(QString &szMask,MaskType eMaskType) const break; default: if (m_szUser.length() > 0) { - if(m_szUser[0].unicode() != '*') + if(m_szUser[0].tqunicode() != '*') szMask.append(m_szWild); - if ((m_szUser[0].unicode() == '~') || - (m_szUser[0].unicode() == '^') || - (m_szUser[0].unicode() == '+') || - (m_szUser[0].unicode() == '-') || - (m_szUser[0].unicode() == '='))szMask.append(m_szUser.right(m_szUser.length() - 1)); + if ((m_szUser[0].tqunicode() == '~') || + (m_szUser[0].tqunicode() == '^') || + (m_szUser[0].tqunicode() == '+') || + (m_szUser[0].tqunicode() == '-') || + (m_szUser[0].tqunicode() == '='))szMask.append(m_szUser.right(m_szUser.length() - 1)); else szMask.append(m_szUser); } break; } szMask.append('@'); - switch(maskTable[((int)eMaskType)][2]) + switch(tqmaskTable[((int)eMaskType)][2]) { case 0: szMask.append(m_szHost); @@ -434,7 +434,7 @@ void KviIrcMask::mask(QString &szMask,MaskType eMaskType) const { if(hasNumericHost()) { - QString szHost(m_szHost.left(getIpDomainMaskLen())); + TQString szHost(m_szHost.left(getIpDomainMaskLen())); szMask.append(szHost); szMask.append(m_szWild); } else { @@ -450,7 +450,7 @@ void KviIrcMask::mask(QString &szMask,MaskType eMaskType) const { if(hasNumericHost()) { - QString szHost(m_szHost.left(getLargeIpDomainMaskLen())); + TQString szHost(m_szHost.left(getLargeIpDomainMaskLen())); szMask.append(szHost); szMask.append(m_szWild); } else { @@ -466,7 +466,7 @@ void KviIrcMask::mask(QString &szMask,MaskType eMaskType) const { if(hasNumericHost() || hasMaskedIp()) { - QString szHost(m_szHost.left(getLargeIpDomainMaskLen())); + TQString szHost(m_szHost.left(getLargeIpDomainMaskLen())); szMask.append(szHost); szMask.append(m_szWild); } else { @@ -532,7 +532,7 @@ bool KviIrcMask::matchesFixed(const char *szMask) const */ /* -bool KviIrcMask::matchedBy(const QString &szMask) const +bool KviIrcMask::matchedBy(const TQString &szMask) const { const char * ret1; const char * ret2; @@ -556,25 +556,25 @@ bool KviIrcMask::matchedBy(const QString &szMask) const } */ -bool KviIrcMask::matches(const KviIrcMask &mask) const +bool KviIrcMask::matches(const KviIrcMask &tqmask) const { - if(KviQString::matchWildExpressionsCI(m_szNick,mask.m_szNick)) + if(KviTQString::matchWildExpressionsCI(m_szNick,tqmask.m_szNick)) { - if(KviQString::matchWildExpressionsCI(m_szUser,mask.m_szUser)) + if(KviTQString::matchWildExpressionsCI(m_szUser,tqmask.m_szUser)) { - if(KviQString::matchWildExpressionsCI(m_szHost,mask.m_szHost))return true; + if(KviTQString::matchWildExpressionsCI(m_szHost,tqmask.m_szHost))return true; } } return false; } -bool KviIrcMask::matchesFixed(const KviIrcMask &mask) const +bool KviIrcMask::matchesFixed(const KviIrcMask &tqmask) const { - if(KviQString::matchStringCI(m_szNick,mask.m_szNick,0,1)) + if(KviTQString::matchStringCI(m_szNick,tqmask.m_szNick,0,1)) { - if(KviQString::matchStringCI(m_szUser,mask.m_szUser,0,1)) + if(KviTQString::matchStringCI(m_szUser,tqmask.m_szUser,0,1)) { - if(KviQString::matchStringCI(m_szHost,mask.m_szHost,0,1))return true; + if(KviTQString::matchStringCI(m_szHost,tqmask.m_szHost,0,1))return true; } } return false; @@ -601,26 +601,26 @@ bool KviIrcMask::matches(const char * nick,const char * user,const char * host) } */ -bool KviIrcMask::matchesFixed(const QString &nick,const QString &user,const QString &host) const +bool KviIrcMask::matchesFixed(const TQString &nick,const TQString &user,const TQString &host) const { - if(!KviQString::matchStringCI(m_szNick,nick,0,1))return false; - if(!KviQString::matchStringCI(m_szUser,user,0,1))return false; - if(!KviQString::matchStringCI(m_szHost,host,0,1))return false; + if(!KviTQString::matchStringCI(m_szNick,nick,0,1))return false; + if(!KviTQString::matchStringCI(m_szUser,user,0,1))return false; + if(!KviTQString::matchStringCI(m_szHost,host,0,1))return false; return true; } -//Internals for mask() +//Internals for tqmask() int KviIrcMask::getIpDomainMaskLen() const { int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; + const TQChar *p = m_szHost.tqunicode(); + const TQChar *b = p; p += len; if(b < p) { p--; - while((b < p) && (p->unicode() != '.') && (p->unicode() != ':'))p--; + while((b < p) && (p->tqunicode() != '.') && (p->tqunicode() != ':'))p--; } // 000.000.000.000 // p @@ -632,17 +632,17 @@ int KviIrcMask::getIpDomainMaskLen() const int KviIrcMask::getLargeIpDomainMaskLen() const { int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; + const TQChar *p = m_szHost.tqunicode(); + const TQChar *b = p; p += len; if(b < p) { p--; - while((b < p) && (p->unicode() != '.') && (p->unicode() != ':'))p--; + while((b < p) && (p->tqunicode() != '.') && (p->tqunicode() != ':'))p--; if(b < p) { p--; - while((b < p) && (p->unicode() != '.') && (p->unicode() != ':'))p--; + while((b < p) && (p->tqunicode() != '.') && (p->tqunicode() != ':'))p--; } } // 000.000.000.000 @@ -651,40 +651,40 @@ int KviIrcMask::getLargeIpDomainMaskLen() const return (p == b) ? 0 : ((p-b) + 1); } -QString KviIrcMask::getHostDomainMask() const +TQString KviIrcMask::getHostDomainMask() const { int len = m_szHost.length(); - const QChar *p=KviQString::nullTerminatedArray(m_szHost); - if(!p)return QString::null; - const QChar *b = p; - while(p->unicode() && p->unicode() != '.')p++; - QString ret(p,len - (p - b)); + const TQChar *p=KviTQString::nullTerminatedArray(m_szHost); + if(!p)return TQString(); + const TQChar *b = p; + while(p->tqunicode() && p->tqunicode() != '.')p++; + TQString ret(p,len - (p - b)); return ret; } -QString KviIrcMask::getLargeHostDomainMask() const +TQString KviIrcMask::getLargeHostDomainMask() const { int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; + const TQChar *p = m_szHost.tqunicode(); + const TQChar *b = p; p += len; if(b < p) { p--; - while((b < p) && (p->unicode() != '.'))p--; + while((b < p) && (p->tqunicode() != '.'))p--; if(b < p) { p--; - while((b < p) && (p->unicode() != '.'))p--; + while((b < p) && (p->tqunicode() != '.'))p--; } } // xyz.klm.abc.host.top // p - QString ret(p,len - (p - b)); + TQString ret(p,len - (p - b)); return ret; } @@ -692,25 +692,25 @@ QString KviIrcMask::getLargeHostDomainMask() const bool KviIrcMask::hasMaskedIp() const { int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; + const TQChar *p = m_szHost.tqunicode(); + const TQChar *b = p; if(len == 0)return false; //run to the end p += len; - const QChar *e = p; + const TQChar *e = p; p--; - while((b < p) && (p->unicode() != '.'))p--; + while((b < p) && (p->tqunicode() != '.'))p--; return ((e - p) > 4); // at the moment 4 should be enough : the largest top part is "name" } bool KviIrcMask::operator==(const KviIrcMask &user) { - if(KviQString::equalCI(m_szNick,user.m_szNick)) + if(KviTQString::equalCI(m_szNick,user.m_szNick)) { - if(KviQString::equalCI(m_szUser,user.m_szUser)) + if(KviTQString::equalCI(m_szUser,user.m_szUser)) { - if(KviQString::equalCI(m_szHost,user.m_szHost))return true; + if(KviTQString::equalCI(m_szHost,user.m_szHost))return true; } } return false; @@ -718,10 +718,10 @@ bool KviIrcMask::operator==(const KviIrcMask &user) bool KviIrcMask::hasWildNick() { - const QChar * aux = KviQString::nullTerminatedArray(m_szNick); + const TQChar * aux = KviTQString::nullTerminatedArray(m_szNick); if(!aux)return false; unsigned short uc; - while((uc = aux->unicode())) + while((uc = aux->tqunicode())) { if((uc == '*') || (uc == '?'))return true; aux++; @@ -732,26 +732,26 @@ bool KviIrcMask::hasWildNick() int KviIrcMask::nonWildChars() { int iCnt = 0; - const QChar * aux = KviQString::nullTerminatedArray(m_szNick); + const TQChar * aux = KviTQString::nullTerminatedArray(m_szNick); if(!aux)return 0; unsigned short uc; - while((uc = aux->unicode())) + while((uc = aux->tqunicode())) { if((uc != '*') && (uc != '?'))iCnt++; aux++; } - aux = KviQString::nullTerminatedArray(m_szUser); - while((uc = aux->unicode())) + aux = KviTQString::nullTerminatedArray(m_szUser); + while((uc = aux->tqunicode())) { if((uc != '*') && (uc != '?'))iCnt++; aux++; } - aux = KviQString::nullTerminatedArray(m_szHost); - while((uc = aux->unicode())) + aux = KviTQString::nullTerminatedArray(m_szHost); + while((uc = aux->tqunicode())) { if((uc != '*') && (uc != '?'))iCnt++; aux++; diff --git a/src/kvilib/irc/kvi_ircmask.h b/src/kvilib/irc/kvi_ircmask.h index 3c9ccf5d..18d6d70b 100644 --- a/src/kvilib/irc/kvi_ircmask.h +++ b/src/kvilib/irc/kvi_ircmask.h @@ -3,7 +3,7 @@ //============================================================================= // -// File : kvi_ircmask.h +// File : kvi_irctqmask.h // Creation date : Fri Jan 8 1999 19:50:35 by Szymon Stefanek // // This file is part of the KVirc irc client distribution @@ -33,7 +33,7 @@ #include "kvi_qstring.h" //============================================================================= -// Irc user mask abstraction +// Irc user tqmask abstraction //============================================================================= class KVILIB_API KviIrcMask : public KviHeapObject @@ -41,47 +41,47 @@ class KVILIB_API KviIrcMask : public KviHeapObject friend class KviIrcUserList; friend class KviIrcUserChanList; private: - QString m_szNick; - QString m_szUser; - QString m_szHost; - static QString m_szWild; + TQString m_szNick; + TQString m_szUser; + TQString m_szHost; + static TQString m_szWild; public: // Sets the nick for this user.<br> // If szNick is NULL or it points to an empty string the nick is set to "*".<br> - void setNick(const QString &szNick){ m_szNick = szNick.isEmpty() ? m_szWild : szNick; }; + void setNick(const TQString &szNick){ m_szNick = szNick.isEmpty() ? m_szWild : szNick; }; // Sets the username for this user.<br> // If szUsername is NULL or it points to an empty string the username is set to "*".<br> - void setUsername(const QString &szUser){ m_szUser = szUser.isEmpty() ? m_szWild : szUser; }; - void setUser(const QString &szUser){ m_szUser = szUser.isEmpty() ? m_szWild : szUser; }; + void setUsername(const TQString &szUser){ m_szUser = szUser.isEmpty() ? m_szWild : szUser; }; + void setUser(const TQString &szUser){ m_szUser = szUser.isEmpty() ? m_szWild : szUser; }; // Sets the host for this user.<br> // If szHost is NULL or it points to an empty string the host is set to "*".<br> - void setHost(const QString &szHost){ m_szHost = szHost.isEmpty() ? m_szWild : szHost; }; - // Sets the host , nick and username extracting it from an irc mask:<br> + void setHost(const TQString &szHost){ m_szHost = szHost.isEmpty() ? m_szWild : szHost; }; + // Sets the host , nick and username extracting it from an irc tqmask:<br> // nick!user@host<br> - // The mask is terminated by end-of string null character or a character equal to c in the string.<br> - // Returns the pointer to the end of the mask in the szMask string.(c or null-terminator)<br> - //const char * setMask(const QString &szMask,char c=' '); - // Sets the host , nick and username extracting it from an userhost mask:<br> + // The tqmask is terminated by end-of string null character or a character equal to c in the string.<br> + // Returns the pointer to the end of the tqmask in the szMask string.(c or null-terminator)<br> + //const char * setMask(const TQString &szMask,char c=' '); + // Sets the host , nick and username extracting it from an userhost tqmask:<br> // nick[*]=<+|->user@host<br> - // The mask is terminated by end-of string null char or a space character.<br> + // The tqmask is terminated by end-of string null char or a space character.<br> // Returns the pointer to the next non-space char in the szMask string or to the null-terminator<br> - // If there are no more masks avaiable. + // If there are no more tqmasks avaiable. // WARNING : the szMask pointer can NOT be NULL - //const char *setUserhostMask(const QString &szMask); + //const char *setUserhostMask(const TQString &szMask); // Returns the nick of this user.<br> // In the worst case you get a string == "*"<br> - const QString &nick() const { return m_szNick; }; + const TQString &nick() const { return m_szNick; }; // DEPRECATED! - const QString &username() const { return m_szUser; }; - const QString &user() const { return m_szUser; }; - const QString &host() const { return m_szHost; }; + const TQString &username() const { return m_szUser; }; + const TQString &user() const { return m_szUser; }; + const TQString &host() const { return m_szHost; }; bool hasUser() const { return !(m_szUser.isEmpty() || (m_szUser == m_szWild)); }; bool hasHost() const { return !(m_szHost.isEmpty() || (m_szHost == m_szWild)); }; bool hasNumericHost() const; - // Retuns in szMask the specified (if possible) mask of this user.<br> - // If the host or username are not known , the mask may contain less information + // Retuns in szMask the specified (if possible) tqmask of this user.<br> + // If the host or username are not known , the tqmask may contain less information // than requested.<br> enum MaskType @@ -108,7 +108,7 @@ public: UserLargeNet = 19, // 19 : *!~user@*.host.top (*!~user@XXX.XXX.*) NickCleanUserLargeNet = 20, // 20 : nick!*user@*.host.top (nick!*user@XXX.XXX.*) CleanUserLargeNet = 21, // 21 : *!*user@*.host.top (*!user@*XXX.XXX.*) - // smart versions of the masks 17-21 that try take care of masked ip addresses + // smart versions of the tqmasks 17-21 that try take care of tqmasked ip addresses // in the form xxx.xxx.INVALID-TOP-MASK NickUserSmartNet = 22, // 22 : nick!~user@*.host.top (nick!~user@XXX.XXX.*) NickSmartNet = 23, // 23 : nick!*@*.host.top (nick!*@XXX.XXX.*) @@ -117,7 +117,7 @@ public: CleanUserSmartNet = 26 // 26 : *!*user@*.host.top (*!user@*XXX.XXX.*) }; - void mask(QString &szMask,MaskType eMaskType = NickCleanUserHost) const; + void tqmask(TQString &szMask,MaskType eMaskType = NickCleanUserHost) const; bool hasWildNick(); // Wild external matches (this and external are wild) @@ -125,35 +125,35 @@ public: // bool matches(const char *szMask); // // passing 0 as one of params here means that it is a match by default // bool matches(const char *nick,const char *user,const char *host); - bool matches(const KviIrcMask &mask) const; + bool matches(const KviIrcMask &tqmask) const; // Fixed external matches (this is wild , external is fixed) - bool matchesFixed(const QString &nick,const QString &user,const QString &host) const; -// bool matchesFixed(const QString &szMask) const; - bool matchesFixed(const KviIrcMask &mask) const; + bool matchesFixed(const TQString &nick,const TQString &user,const TQString &host) const; +// bool matchesFixed(const TQString &szMask) const; + bool matchesFixed(const KviIrcMask &tqmask) const; // Fixed internal matches (this is fixed , external is wild) - //bool matchedBy(const QString &szMask) const; - bool matchedBy(const KviIrcMask &mask) const { return mask.matchesFixed(*this); }; + //bool matchedBy(const TQString &szMask) const; + bool matchedBy(const KviIrcMask &tqmask) const { return tqmask.matchesFixed(*this); }; int nonWildChars(); bool operator==(const KviIrcMask &user); public: - // Constructs an empty mask (*!*@*) + // Constructs an empty tqmask (*!*@*) KviIrcMask(); - // Constructs this KviIrcMask object from a string mask - KviIrcMask(const QString &szMask); + // Constructs this KviIrcMask object from a string tqmask + KviIrcMask(const TQString &szMask); // Carbon copy KviIrcMask(const KviIrcMask &ircUser) : m_szNick(ircUser.m_szNick), m_szUser(ircUser.m_szUser), m_szHost(ircUser.m_szHost) {}; - KviIrcMask(const QString &nick,const QString &user,const QString &host) + KviIrcMask(const TQString &nick,const TQString &user,const TQString &host) : m_szNick(nick), m_szUser(user), m_szHost(host) {}; private: int getIpDomainMaskLen() const; - QString getHostDomainMask() const; + TQString getHostDomainMask() const; int getLargeIpDomainMaskLen() const; - QString getLargeHostDomainMask() const; + TQString getLargeHostDomainMask() const; // this is just a GUESS and must be called AFTER making sure that it is NOT a plain numeric IP bool hasMaskedIp() const; }; diff --git a/src/kvilib/irc/kvi_ircserver.cpp b/src/kvilib/irc/kvi_ircserver.cpp index 5f03fb5e..8e1898fa 100644 --- a/src/kvilib/irc/kvi_ircserver.cpp +++ b/src/kvilib/irc/kvi_ircserver.cpp @@ -89,7 +89,7 @@ KviIrcServer::KviIrcServer(const KviIrcServer &serv) m_iProxy = serv.m_iProxy; m_szUserIdentityId = serv.m_szUserIdentityId; if(serv.m_pChannelList) - m_pChannelList = new QStringList(*(serv.m_pChannelList)); + m_pChannelList = new TQStringList(*(serv.m_pChannelList)); else m_pChannelList = 0; m_bAutoConnect = serv.m_bAutoConnect; } @@ -115,7 +115,7 @@ void KviIrcServer::operator=(const KviIrcServer &serv) m_iProxy = serv.m_iProxy; if(m_pChannelList)delete m_pChannelList; if(serv.m_pChannelList) - m_pChannelList = new QStringList(*(serv.m_pChannelList)); + m_pChannelList = new TQStringList(*(serv.m_pChannelList)); else m_pChannelList = 0; m_bAutoConnect = serv.m_bAutoConnect; } @@ -131,12 +131,12 @@ void KviIrcServer::generateUniqueId() { struct timeval tv; kvi_gettimeofday(&tv,0); - KviQString::sprintf(m_szId,"myserver%d%d%d",tv.tv_usec,rand() % 1000,rand() % 1000); + KviTQString::sprintf(m_szId,"myserver%d%d%d",tv.tv_usec,rand() % 1000,rand() % 1000); } -QString KviIrcServer::ircUri() +TQString KviIrcServer::ircUri() { - QString uri("irc"); + TQString uri("irc"); if(useSSL())uri += "s"; if(isIpV6())uri += "6"; uri += "://"; @@ -145,171 +145,171 @@ QString KviIrcServer::ircUri() if(m_uPort!=6667) { uri += ":"; - QString num; + TQString num; num.setNum(m_uPort); uri += num; } return uri; } -void KviIrcServer::setAutoJoinChannelList(QStringList * pNewChannelList) +void KviIrcServer::setAutoJoinChannelList(TQStringList * pNewChannelList) { if(m_pChannelList)delete m_pChannelList; m_pChannelList = pNewChannelList; } -bool KviIrcServer::load(KviConfig * cfg,const QString &prefix) +bool KviIrcServer::load(KviConfig * cfg,const TQString &prefix) { - QString tmp; - KviQString::sprintf(tmp,"%QHostname",&prefix); - m_szHostname = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QIp",&prefix); - m_szIp = cfg->readQStringEntry(tmp); + TQString tmp; + KviTQString::sprintf(tmp,"%TQHostname",&prefix); + m_szHostname = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQIp",&prefix); + m_szIp = cfg->readTQStringEntry(tmp); if(m_szHostname.isEmpty() && m_szIp.isEmpty())return false; - KviQString::sprintf(tmp,"%QDescription",&prefix); - m_szDescription = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QUser",&prefix); - m_szUser = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QPass",&prefix); - m_szPass = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QNick",&prefix); - m_szNick = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QRealName",&prefix); - m_szRealName = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QInitUmode",&prefix); - m_szInitUMode = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QAutoJoinChannels",&prefix); - QStringList l = cfg->readStringListEntry(tmp,QStringList()); - if(l.count() > 0)setAutoJoinChannelList(new QStringList(l)); - KviQString::sprintf(tmp,"%QAutoConnect",&prefix); + KviTQString::sprintf(tmp,"%TQDescription",&prefix); + m_szDescription = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQUser",&prefix); + m_szUser = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQPass",&prefix); + m_szPass = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQNick",&prefix); + m_szNick = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQRealName",&prefix); + m_szRealName = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQInitUmode",&prefix); + m_szInitUMode = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQAutoJoinChannels",&prefix); + TQStringList l = cfg->readStringListEntry(tmp,TQStringList()); + if(l.count() > 0)setAutoJoinChannelList(new TQStringList(l)); + KviTQString::sprintf(tmp,"%TQAutoConnect",&prefix); m_bAutoConnect = cfg->readBoolEntry(tmp,false); - KviQString::sprintf(tmp,"%QEncoding",&prefix); - m_szEncoding = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QOnConnectCommand",&prefix); - m_szOnConnectCommand = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QOnLoginCommand",&prefix); - m_szOnLoginCommand = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QLinkFilter",&prefix); - m_szLinkFilter = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QPort",&prefix); + KviTQString::sprintf(tmp,"%TQEncoding",&prefix); + m_szEncoding = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQOnConnectCommand",&prefix); + m_szOnConnectCommand = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQOnLoginCommand",&prefix); + m_szOnLoginCommand = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQLinkFilter",&prefix); + m_szLinkFilter = cfg->readTQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQPort",&prefix); m_uPort = cfg->readUIntEntry(tmp,6667); - KviQString::sprintf(tmp,"%QId",&prefix); - m_szId = cfg->readQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQId",&prefix); + m_szId = cfg->readTQStringEntry(tmp); if(m_szId.isEmpty())generateUniqueId(); - KviQString::sprintf(tmp,"%QIpV6",&prefix); + KviTQString::sprintf(tmp,"%TQIpV6",&prefix); setIpV6(cfg->readBoolEntry(tmp,false)); - KviQString::sprintf(tmp,"%QCacheIp",&prefix); + KviTQString::sprintf(tmp,"%TQCacheIp",&prefix); setCacheIp(cfg->readBoolEntry(tmp,false)); // true ? - KviQString::sprintf(tmp,"%QSSL",&prefix); + KviTQString::sprintf(tmp,"%TQSSL",&prefix); setUseSSL(cfg->readBoolEntry(tmp,false)); - KviQString::sprintf(tmp,"%QProxy",&prefix); + KviTQString::sprintf(tmp,"%TQProxy",&prefix); setProxy(cfg->readIntEntry(tmp,-2)); - KviQString::sprintf(tmp,"%QUserIdentityId",&prefix); - m_szUserIdentityId = cfg->readQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQUserIdentityId",&prefix); + m_szUserIdentityId = cfg->readTQStringEntry(tmp); return true; } -void KviIrcServer::save(KviConfig * cfg,const QString &prefix) +void KviIrcServer::save(KviConfig * cfg,const TQString &prefix) { - QString tmp; - KviQString::sprintf(tmp,"%QHostname",&prefix); + TQString tmp; + KviTQString::sprintf(tmp,"%TQHostname",&prefix); cfg->writeEntry(tmp,m_szHostname); - KviQString::sprintf(tmp,"%QId",&prefix); + KviTQString::sprintf(tmp,"%TQId",&prefix); cfg->writeEntry(tmp,m_szId); if(!m_szIp.isEmpty()) { - KviQString::sprintf(tmp,"%QIp",&prefix); + KviTQString::sprintf(tmp,"%TQIp",&prefix); cfg->writeEntry(tmp,m_szIp); } if(!m_szDescription.isEmpty()) { - KviQString::sprintf(tmp,"%QDescription",&prefix); + KviTQString::sprintf(tmp,"%TQDescription",&prefix); cfg->writeEntry(tmp,m_szDescription); } if(!m_szUser.isEmpty()) { - KviQString::sprintf(tmp,"%QUser",&prefix); + KviTQString::sprintf(tmp,"%TQUser",&prefix); cfg->writeEntry(tmp,m_szUser); } if(!m_szPass.isEmpty()) { - KviQString::sprintf(tmp,"%QPass",&prefix); + KviTQString::sprintf(tmp,"%TQPass",&prefix); cfg->writeEntry(tmp,m_szPass); } if(!m_szNick.isEmpty()) { - KviQString::sprintf(tmp,"%QNick",&prefix); + KviTQString::sprintf(tmp,"%TQNick",&prefix); cfg->writeEntry(tmp,m_szNick); } if(!m_szRealName.isEmpty()) { - KviQString::sprintf(tmp,"%QRealName",&prefix); + KviTQString::sprintf(tmp,"%TQRealName",&prefix); cfg->writeEntry(tmp,m_szRealName); } if(!m_szInitUMode.isEmpty()) { - KviQString::sprintf(tmp,"%QInitUMode",&prefix); + KviTQString::sprintf(tmp,"%TQInitUMode",&prefix); cfg->writeEntry(tmp,m_szInitUMode); } if(autoJoinChannelList()) { - KviQString::sprintf(tmp,"%QAutoJoinChannels",&prefix); + KviTQString::sprintf(tmp,"%TQAutoJoinChannels",&prefix); cfg->writeEntry(tmp,*(autoJoinChannelList())); } if(autoConnect()) // otherwise it defaults to false anyway { - KviQString::sprintf(tmp,"%QAutoConnect",&prefix); + KviTQString::sprintf(tmp,"%TQAutoConnect",&prefix); cfg->writeEntry(tmp,autoConnect()); } if(!m_szEncoding.isEmpty()) { - KviQString::sprintf(tmp,"%QEncoding",&prefix); + KviTQString::sprintf(tmp,"%TQEncoding",&prefix); cfg->writeEntry(tmp,m_szEncoding); } if(!m_szOnConnectCommand.isEmpty()) { - KviQString::sprintf(tmp,"%QOnConnectCommand",&prefix); + KviTQString::sprintf(tmp,"%TQOnConnectCommand",&prefix); cfg->writeEntry(tmp,m_szOnConnectCommand); } if(!m_szOnLoginCommand.isEmpty()) { - KviQString::sprintf(tmp,"%QOnLoginCommand",&prefix); + KviTQString::sprintf(tmp,"%TQOnLoginCommand",&prefix); cfg->writeEntry(tmp,m_szOnLoginCommand); } if(!m_szLinkFilter.isEmpty()) { - KviQString::sprintf(tmp,"%QLinkFilter",&prefix); + KviTQString::sprintf(tmp,"%TQLinkFilter",&prefix); cfg->writeEntry(tmp,m_szLinkFilter); } if(m_uPort != 6667) { - KviQString::sprintf(tmp,"%QPort",&prefix); + KviTQString::sprintf(tmp,"%TQPort",&prefix); cfg->writeEntry(tmp,m_uPort); } if(isIpV6()) { - KviQString::sprintf(tmp,"%QIpV6",&prefix); + KviTQString::sprintf(tmp,"%TQIpV6",&prefix); cfg->writeEntry(tmp,isIpV6()); } if(cacheIp()) { - KviQString::sprintf(tmp,"%QCacheIp",&prefix); + KviTQString::sprintf(tmp,"%TQCacheIp",&prefix); cfg->writeEntry(tmp,cacheIp()); } if(useSSL()) { - KviQString::sprintf(tmp,"%QSSL",&prefix); + KviTQString::sprintf(tmp,"%TQSSL",&prefix); cfg->writeEntry(tmp,useSSL()); } if(proxy()!=-2) { - KviQString::sprintf(tmp,"%QProxy",&prefix); + KviTQString::sprintf(tmp,"%TQProxy",&prefix); cfg->writeEntry(tmp,proxy()); } if(!m_szUserIdentityId.isEmpty()) { - KviQString::sprintf(tmp,"%QUserIdentityId",&prefix); + KviTQString::sprintf(tmp,"%TQUserIdentityId",&prefix); cfg->writeEntry(tmp,m_szUserIdentityId); } } @@ -323,13 +323,13 @@ KviIrcNetwork::KviIrcNetwork(const KviIrcNetwork &src) copyFrom(src); } -KviIrcNetwork::KviIrcNetwork(const QString &name) +KviIrcNetwork::KviIrcNetwork(const TQString &name) { m_szName = name; m_pChannelList = 0; m_pNickServRuleSet = 0; m_bAutoConnect = false; - // m_szEncoding = QString::null; // set by default + // m_szEncoding = TQString(); // set by default } KviIrcNetwork::~KviIrcNetwork() @@ -338,7 +338,7 @@ KviIrcNetwork::~KviIrcNetwork() if(m_pNickServRuleSet)delete m_pNickServRuleSet; } -void KviIrcNetwork::setAutoJoinChannelList(QStringList * pNewChannelList) +void KviIrcNetwork::setAutoJoinChannelList(TQStringList * pNewChannelList) { if(m_pChannelList)delete m_pChannelList; m_pChannelList = pNewChannelList; @@ -364,7 +364,7 @@ void KviIrcNetwork::copyFrom(const KviIrcNetwork &src) m_szOnConnectCommand = src.m_szOnConnectCommand; m_szOnLoginCommand = src.m_szOnLoginCommand; if(m_pChannelList)delete m_pChannelList; - if(src.m_pChannelList)m_pChannelList = new QStringList(*(src.m_pChannelList)); + if(src.m_pChannelList)m_pChannelList = new TQStringList(*(src.m_pChannelList)); else m_pChannelList = 0; if(m_pNickServRuleSet)delete m_pNickServRuleSet; if(src.m_pNickServRuleSet)m_pNickServRuleSet = new KviNickServRuleSet(*(src.m_pNickServRuleSet)); diff --git a/src/kvilib/irc/kvi_ircserver.h b/src/kvilib/irc/kvi_ircserver.h index 4c0ca54d..13876b3e 100644 --- a/src/kvilib/irc/kvi_ircserver.h +++ b/src/kvilib/irc/kvi_ircserver.h @@ -30,7 +30,7 @@ #include "kvi_qstring.h" #include "kvi_pointerlist.h" -#include <qstringlist.h> +#include <tqstringlist.h> class KviConfig; class KviNickServRuleSet; @@ -44,10 +44,10 @@ class KviIrcServer; class KVILIB_API KviIrcServerReconnectInfo { public: - QString m_szNick; - QString m_szAwayReason; - QString m_szJoinChannels; - QStringList m_szOpenQueryes; + TQString m_szNick; + TQString m_szAwayReason; + TQString m_szJoinChannels; + TQStringList m_szOpenQueryes; bool m_bIsAway; }; @@ -59,73 +59,73 @@ public: ~KviIrcServer(); public: KviIrcServerReconnectInfo *m_pReconnectInfo; - QString m_szHostname; // the server hostname (or ip eventually) - QString m_szIp; // the server's cached ip (if we're caching) - QString m_szDescription; // the server description + TQString m_szHostname; // the server hostname (or ip eventually) + TQString m_szIp; // the server's cached ip (if we're caching) + TQString m_szDescription; // the server description kvi_u32_t m_uPort; // the server's port unsigned short int m_uFlags; // flags // Extended data - QString m_szUserIdentityId; // The user identity to use for this server: if empty + TQString m_szUserIdentityId; // The user identity to use for this server: if empty // Then use the network identity instead - QString m_szUser; // special username - QString m_szPass; // special password - QString m_szNick; // special nickname - QString m_szRealName; // special real name - QString m_szInitUMode; // special user mode - QString m_szOnConnectCommand; // the command to run on connect - QString m_szOnLoginCommand; // the command to run after login - QString m_szLinkFilter; // the link filter object - QString m_szEncoding; // if empty, use network encoding - QStringList * m_pChannelList; // Channels to auto join + TQString m_szUser; // special username + TQString m_szPass; // special password + TQString m_szNick; // special nickname + TQString m_szRealName; // special real name + TQString m_szInitUMode; // special user mode + TQString m_szOnConnectCommand; // the command to run on connect + TQString m_szOnLoginCommand; // the command to run after login + TQString m_szLinkFilter; // the link filter object + TQString m_szEncoding; // if empty, use network encoding + TQStringList * m_pChannelList; // Channels to auto join bool m_bAutoConnect; // autoconnect - QString m_szId; // the server's may-be-unique id, may be auto-generated + TQString m_szId; // the server's may-be-unique id, may be auto-generated int m_iProxy; // proxy server's id public: int proxy() { return m_iProxy; }; KviProxy* proxyServer(KviProxyDataBase * pDb); kvi_u32_t port() const { return m_uPort; }; - const QString & ipAddress() const { return m_szIp; }; - const QString & password() const { return m_szPass; }; - const QString & nickName() const { return m_szNick; }; - const QString & initUMode() const { return m_szInitUMode; }; - const QString & hostName() const { return m_szHostname; }; - const QString & ip() const { return m_szIp; }; - const QString & onLoginCommand() const { return m_szOnLoginCommand; }; - const QString & onConnectCommand() const { return m_szOnConnectCommand; }; - const QString & userName() const { return m_szUser; }; - const QString & realName() const { return m_szRealName; }; - const QString & linkFilter() const { return m_szLinkFilter; }; - const QString & description() const { return m_szDescription; }; - const QString & encoding() const { return m_szEncoding; }; - const QString & id() const { return m_szId; }; - const QString & userIdentityId() const { return m_szUserIdentityId; }; + const TQString & ipAddress() const { return m_szIp; }; + const TQString & password() const { return m_szPass; }; + const TQString & nickName() const { return m_szNick; }; + const TQString & initUMode() const { return m_szInitUMode; }; + const TQString & hostName() const { return m_szHostname; }; + const TQString & ip() const { return m_szIp; }; + const TQString & onLoginCommand() const { return m_szOnLoginCommand; }; + const TQString & onConnectCommand() const { return m_szOnConnectCommand; }; + const TQString & userName() const { return m_szUser; }; + const TQString & realName() const { return m_szRealName; }; + const TQString & linkFilter() const { return m_szLinkFilter; }; + const TQString & description() const { return m_szDescription; }; + const TQString & encoding() const { return m_szEncoding; }; + const TQString & id() const { return m_szId; }; + const TQString & userIdentityId() const { return m_szUserIdentityId; }; bool autoConnect() const { return m_bAutoConnect; }; - QStringList* autoJoinChannelList(){ return m_pChannelList; }; + TQStringList* autoJoinChannelList(){ return m_pChannelList; }; bool isIpV6() const { return (m_uFlags & KVI_IRCSERVER_FLAG_IPV6); }; bool useSSL() const { return (m_uFlags & KVI_IRCSERVER_FLAG_SSL); }; bool cacheIp() const { return (m_uFlags & KVI_IRCSERVER_FLAG_CACHEIP); }; void setProxy(int p){ m_iProxy = p; }; - void setIpAddress(const QString &a){ m_szIp = a; }; + void setIpAddress(const TQString &a){ m_szIp = a; }; void setPort(kvi_u32_t p){ m_uPort = p; }; - void setHostName(const QString &n){ m_szHostname = n; }; - void setDescription(const QString &d){ m_szDescription = d; }; - void setUserName(const QString &u){ m_szUser = u; }; - void setPassword(const QString &p){ m_szPass = p; }; - void setNickName(const QString &n){ m_szNick = n; }; - void setRealName(const QString &r){ m_szRealName = r; }; - void setEncoding(const QString &e){ m_szEncoding = e; }; - void setInitUMode(const QString &u){ m_szInitUMode = u; }; - void setOnConnectCommand(const QString &cmd){ m_szOnConnectCommand = cmd; }; - void setOnLoginCommand(const QString &cmd){ m_szOnLoginCommand = cmd; }; - void setLinkFilter(const QString &f){ m_szLinkFilter = f; }; + void setHostName(const TQString &n){ m_szHostname = n; }; + void setDescription(const TQString &d){ m_szDescription = d; }; + void setUserName(const TQString &u){ m_szUser = u; }; + void setPassword(const TQString &p){ m_szPass = p; }; + void setNickName(const TQString &n){ m_szNick = n; }; + void setRealName(const TQString &r){ m_szRealName = r; }; + void setEncoding(const TQString &e){ m_szEncoding = e; }; + void setInitUMode(const TQString &u){ m_szInitUMode = u; }; + void setOnConnectCommand(const TQString &cmd){ m_szOnConnectCommand = cmd; }; + void setOnLoginCommand(const TQString &cmd){ m_szOnLoginCommand = cmd; }; + void setLinkFilter(const TQString &f){ m_szLinkFilter = f; }; // the channel list must be allocated with new! - void setAutoJoinChannelList(QStringList * pNewChannelList); + void setAutoJoinChannelList(TQStringList * pNewChannelList); void setAutoConnect(bool autoconnect) { m_bAutoConnect = autoconnect; }; - void setUserIdentityId(const QString &szUserIdentityId){ m_szUserIdentityId = szUserIdentityId; }; + void setUserIdentityId(const TQString &szUserIdentityId){ m_szUserIdentityId = szUserIdentityId; }; void setIpV6(bool bSet) { if(bSet)m_uFlags |= KVI_IRCSERVER_FLAG_IPV6; @@ -143,13 +143,13 @@ public: }; void operator =(const KviIrcServer &s); - bool load(KviConfig * cfg,const QString &prefix); - void save(KviConfig * cfg,const QString &prefix); + bool load(KviConfig * cfg,const TQString &prefix); + void save(KviConfig * cfg,const TQString &prefix); void generateUniqueId(); - void setId(const QString &szId){ m_szId = szId; if(m_szId.isEmpty())generateUniqueId(); }; + void setId(const TQString &szId){ m_szId = szId; if(m_szId.isEmpty())generateUniqueId(); }; - QString ircUri(); + TQString ircUri(); }; class KVILIB_API KviIrcNetwork : public KviHeapObject @@ -157,48 +157,48 @@ class KVILIB_API KviIrcNetwork : public KviHeapObject friend class KviIrcServerDataBase; public: KviIrcNetwork(const KviIrcNetwork &src); - KviIrcNetwork(const QString &name); + KviIrcNetwork(const TQString &name); ~KviIrcNetwork(); protected: - QString m_szName; - QString m_szDescription; - QString m_szEncoding; // if empty, use system default - QString m_szNickName; // preferred nick name - QString m_szUserName; // preferred user name - QString m_szRealName; // preferred real name - QString m_szOnConnectCommand; // the command to run on connect - QString m_szOnLoginCommand; // the command to run after login - QStringList * m_pChannelList; // Channels to auto join + TQString m_szName; + TQString m_szDescription; + TQString m_szEncoding; // if empty, use system default + TQString m_szNickName; // preferred nick name + TQString m_szUserName; // preferred user name + TQString m_szRealName; // preferred real name + TQString m_szOnConnectCommand; // the command to run on connect + TQString m_szOnLoginCommand; // the command to run after login + TQStringList * m_pChannelList; // Channels to auto join KviNickServRuleSet * m_pNickServRuleSet; // set of nick serv rules bool m_bAutoConnect; // autoconnect - QString m_szUserIdentityId; // The user identity to use for this server: if empty + TQString m_szUserIdentityId; // The user identity to use for this server: if empty // Then use the global primary identity public: - const QString & name() const { return m_szName; }; - const QString & encoding() const { return m_szEncoding; }; - const QString & description() const { return m_szDescription; }; - const QString & nickName() const { return m_szNickName; }; - const QString & realName() const { return m_szRealName; }; - const QString & userName() const { return m_szUserName; }; - const QString & onLoginCommand() const { return m_szOnLoginCommand; }; - const QString & onConnectCommand() const { return m_szOnConnectCommand; }; - const QString & userIdentityId() const { return m_szUserIdentityId; }; + const TQString & name() const { return m_szName; }; + const TQString & encoding() const { return m_szEncoding; }; + const TQString & description() const { return m_szDescription; }; + const TQString & nickName() const { return m_szNickName; }; + const TQString & realName() const { return m_szRealName; }; + const TQString & userName() const { return m_szUserName; }; + const TQString & onLoginCommand() const { return m_szOnLoginCommand; }; + const TQString & onConnectCommand() const { return m_szOnConnectCommand; }; + const TQString & userIdentityId() const { return m_szUserIdentityId; }; bool autoConnect() const { return m_bAutoConnect; }; - QStringList* autoJoinChannelList(){ return m_pChannelList; }; + TQStringList* autoJoinChannelList(){ return m_pChannelList; }; KviNickServRuleSet * nickServRuleSet(){ return m_pNickServRuleSet; }; void setNickServRuleSet(KviNickServRuleSet * s); void copyFrom(const KviIrcNetwork &d); - void setName(const QString &szName){ m_szName = szName; }; - void setEncoding(const QString &szEncoding){ m_szEncoding = szEncoding; }; - void setDescription(const QString &szDescription){ m_szDescription = szDescription; }; - void setOnConnectCommand(const QString &cmd){ m_szOnConnectCommand = cmd; }; - void setOnLoginCommand(const QString &cmd){ m_szOnLoginCommand = cmd; }; - void setNickName(const QString &n){ m_szNickName = n; }; - void setRealName(const QString &r){ m_szRealName = r; }; - void setUserName(const QString &u){ m_szUserName = u; }; - void setAutoJoinChannelList(QStringList * pNewChannelList); + void setName(const TQString &szName){ m_szName = szName; }; + void setEncoding(const TQString &szEncoding){ m_szEncoding = szEncoding; }; + void setDescription(const TQString &szDescription){ m_szDescription = szDescription; }; + void setOnConnectCommand(const TQString &cmd){ m_szOnConnectCommand = cmd; }; + void setOnLoginCommand(const TQString &cmd){ m_szOnLoginCommand = cmd; }; + void setNickName(const TQString &n){ m_szNickName = n; }; + void setRealName(const TQString &r){ m_szRealName = r; }; + void setUserName(const TQString &u){ m_szUserName = u; }; + void setAutoJoinChannelList(TQStringList * pNewChannelList); void setAutoConnect(bool bAutoConnect){ m_bAutoConnect = bAutoConnect; }; - void setUserIdentityId(const QString &szUserIdentityId){ m_szUserIdentityId = szUserIdentityId; }; + void setUserIdentityId(const TQString &szUserIdentityId){ m_szUserIdentityId = szUserIdentityId; }; }; diff --git a/src/kvilib/irc/kvi_ircserverdb.cpp b/src/kvilib/irc/kvi_ircserverdb.cpp index 88198b12..172da1f6 100644 --- a/src/kvilib/irc/kvi_ircserverdb.cpp +++ b/src/kvilib/irc/kvi_ircserverdb.cpp @@ -25,10 +25,10 @@ #define __KVILIB__ -#include <qapplication.h> -#include <qlayout.h> -#include <qmessagebox.h> -#include <qcheckbox.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqmessagebox.h> +#include <tqcheckbox.h> #include "kvi_ircserverdb.h" #include "kvi_config.h" @@ -59,7 +59,7 @@ KviIrcServer * KviIrcServerDataBaseRecord::findServer(const KviIrcServer * pServ { for(KviIrcServer *s=m_pServerList->first();s;s=m_pServerList->next()) { - if(KviQString::equalCI(s->m_szHostname,pServer->m_szHostname) && + if(KviTQString::equalCI(s->m_szHostname,pServer->m_szHostname) && (s->m_uPort == pServer->m_uPort) && (s->useSSL() == pServer->useSSL()) && (s->isIpV6() == pServer->isIpV6()))return s; @@ -69,7 +69,7 @@ KviIrcServer * KviIrcServerDataBaseRecord::findServer(const KviIrcServer * pServ void KviIrcServerDataBaseRecord::setCurrentServer(KviIrcServer *srv) { - if(m_pServerList->findRef(srv) != -1)m_pCurrentServer = srv; + if(m_pServerList->tqfindRef(srv) != -1)m_pCurrentServer = srv; } KviIrcServer * KviIrcServerDataBaseRecord::currentServer() @@ -90,7 +90,7 @@ KviIrcServer * KviIrcServerDataBaseRecord::currentServer() KviIrcServerDataBase::KviIrcServerDataBase() { - m_pRecords = new KviPointerHashTable<QString,KviIrcServerDataBaseRecord>(17,false); + m_pRecords = new KviPointerHashTable<TQString,KviIrcServerDataBaseRecord>(17,false); m_pRecords->setAutoDelete(true); m_pAutoConnectOnStartupServers = 0; m_pAutoConnectOnStartupNetworks = 0; @@ -126,19 +126,19 @@ void KviIrcServerDataBase::clear() KviIrcServerDataBaseRecord * KviIrcServerDataBase::insertNetwork(KviIrcNetwork *n) { KviIrcServerDataBaseRecord * r = new KviIrcServerDataBaseRecord(n); - m_pRecords->replace(n->name(),r); + m_pRecords->tqreplace(n->name(),r); return r; } -KviIrcServerDataBaseRecord * KviIrcServerDataBase::findRecord(const QString &szNetName) +KviIrcServerDataBaseRecord * KviIrcServerDataBase::findRecord(const TQString &szNetName) { - return m_pRecords->find(szNetName); + return m_pRecords->tqfind(szNetName); } -KviIrcNetwork * KviIrcServerDataBase::findNetwork(const QString &szName) +KviIrcNetwork * KviIrcServerDataBase::findNetwork(const TQString &szName) { - KviIrcServerDataBaseRecord * r = m_pRecords->find(szName); + KviIrcServerDataBaseRecord * r = m_pRecords->tqfind(szName); if(!r)return 0; return r->network(); } @@ -146,19 +146,19 @@ KviIrcNetwork * KviIrcServerDataBase::findNetwork(const QString &szName) KviIrcServerDataBaseRecord * KviIrcServerDataBase::currentRecord() { KviIrcServerDataBaseRecord * r = 0; - if(!m_szCurrentNetwork.isEmpty())r = m_pRecords->find(m_szCurrentNetwork); + if(!m_szCurrentNetwork.isEmpty())r = m_pRecords->tqfind(m_szCurrentNetwork); if(r)return r; - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); + KviPointerHashTableIterator<TQString,KviIrcServerDataBaseRecord> it(*m_pRecords); r = it.current(); if(!r)return 0; m_szCurrentNetwork = r->network()->name(); return r; } -void KviIrcServerDataBase::updateServerIp(KviIrcServer * pServer,const QString & ip) +void KviIrcServerDataBase::updateServerIp(KviIrcServer * pServer,const TQString & ip) { - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); + KviPointerHashTableIterator<TQString,KviIrcServerDataBaseRecord> it(*m_pRecords); while(KviIrcServerDataBaseRecord * r = it.current()) { KviIrcServer * srv = r->findServer(pServer); @@ -171,7 +171,7 @@ void KviIrcServerDataBase::updateServerIp(KviIrcServer * pServer,const QString & } } -bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const QString &szNetName,KviIrcServerDataBaseRecord * r,QString &szError) +bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const TQString &szNetName,KviIrcServerDataBaseRecord * r,TQString &szError) { m_szCurrentNetwork = szNetName; // find a round-robin server in that network @@ -185,11 +185,11 @@ bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const QString &szNetNa for(KviIrcServer * s = r->m_pServerList->first();s;s = r->m_pServerList->next()) { #ifdef COMPILE_USE_QT4 - if(s->m_szDescription.contains("random",Qt::CaseInsensitive) || - (s->m_szDescription.contains("round",Qt::CaseInsensitive) && s->m_szDescription.contains("robin",Qt::CaseInsensitive))) + if(s->m_szDescription.tqcontains("random",TQt::CaseInsensitive) || + (s->m_szDescription.tqcontains("round",TQt::CaseInsensitive) && s->m_szDescription.tqcontains("robin",TQt::CaseInsensitive))) #else - if(s->m_szDescription.contains("random",false) || - (s->m_szDescription.contains("round",false) && s->m_szDescription.contains("robin",false))) + if(s->m_szDescription.tqcontains("random",false) || + (s->m_szDescription.tqcontains("round",false) && s->m_szDescription.tqcontains("robin",false))) #endif { r->setCurrentServer(s); @@ -199,17 +199,17 @@ bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const QString &szNetNa // no explicit round robin... try some common names - QString tryAlso1,tryAlso2,tryAlso3; + TQString tryAlso1,tryAlso2,tryAlso3; - KviQString::sprintf(tryAlso1,"irc.%Q.org",&szNetName); - KviQString::sprintf(tryAlso2,"irc.%Q.net",&szNetName); - KviQString::sprintf(tryAlso3,"irc.%Q.com",&szNetName); + KviTQString::sprintf(tryAlso1,"irc.%Q.org",&szNetName); + KviTQString::sprintf(tryAlso2,"irc.%Q.net",&szNetName); + KviTQString::sprintf(tryAlso3,"irc.%Q.com",&szNetName); for(KviIrcServer * ss = r->m_pServerList->first();ss;ss = r->m_pServerList->next()) { - if(KviQString::equalCI(ss->m_szHostname,tryAlso1) || - KviQString::equalCI(ss->m_szHostname,tryAlso2) || - KviQString::equalCI(ss->m_szHostname,tryAlso3)) + if(KviTQString::equalCI(ss->m_szHostname,tryAlso1) || + KviTQString::equalCI(ss->m_szHostname,tryAlso2) || + KviTQString::equalCI(ss->m_szHostname,tryAlso3)) { r->setCurrentServer(ss); return true; @@ -221,36 +221,36 @@ bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const QString &szNetNa } -bool KviIrcServerDataBase::makeCurrentServer(KviIrcServerDefinition * d,QString &szError) +bool KviIrcServerDataBase::makeCurrentServer(KviIrcServerDefinition * d,TQString &szError) { KviIrcServer * pServer = 0; - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); + KviPointerHashTableIterator<TQString,KviIrcServerDataBaseRecord> it(*m_pRecords); KviIrcServerDataBaseRecord * r = 0; KviIrcServer * srv; - if(KviQString::equalCIN(d->szServer,"net:",4)) + if(KviTQString::equalCIN(d->szServer,"net:",4)) { // net:networkname form - QString szNet = d->szServer; + TQString szNet = d->szServer; szNet.remove(0,4); - KviIrcServerDataBaseRecord * r = m_pRecords->find(szNet); + KviIrcServerDataBaseRecord * r = m_pRecords->tqfind(szNet); if(r)return makeCurrentBestServerInNetwork(szNet,r,szError); szError = __tr2qs("The server specification seems to be in the net:<string> but the network couln't be found in the database"); return false; } - if(KviQString::equalCIN(d->szServer,"id:",3)) + if(KviTQString::equalCIN(d->szServer,"id:",3)) { // id:serverid form - QString szId = d->szServer; + TQString szId = d->szServer; szId.remove(0,3); while((r = it.current())) { for(srv = r->serverList()->first();srv && (!pServer);srv = r->serverList()->next()) { - if(KviQString::equalCI(srv->id(),szId)) + if(KviTQString::equalCI(srv->id(),szId)) { pServer = srv; goto search_finished; @@ -268,7 +268,7 @@ bool KviIrcServerDataBase::makeCurrentServer(KviIrcServerDefinition * d,QString { for(srv = r->serverList()->first();srv && (!pServer);srv = r->serverList()->next()) { - if(KviQString::equalCI(srv->hostName(),d->szServer)) + if(KviTQString::equalCI(srv->hostName(),d->szServer)) { if(d->bIpV6 == srv->isIpV6()) { @@ -283,7 +283,7 @@ bool KviIrcServerDataBase::makeCurrentServer(KviIrcServerDefinition * d,QString if(!d->szLinkFilter.isEmpty()) { // must match the link filter - if(KviQString::equalCI(d->szLinkFilter,srv->linkFilter())) + if(KviTQString::equalCI(d->szLinkFilter,srv->linkFilter())) { // link filter matches pServer = srv; @@ -300,7 +300,7 @@ bool KviIrcServerDataBase::makeCurrentServer(KviIrcServerDefinition * d,QString if(!d->szLinkFilter.isEmpty()) { // must match the link filter - if(KviQString::equalCI(d->szLinkFilter,srv->linkFilter())) + if(KviTQString::equalCI(d->szLinkFilter,srv->linkFilter())) { // link filter matches pServer = srv; @@ -344,13 +344,13 @@ search_finished: { // is it a valid hostname ? (must contain at least one dot) #ifdef COMPILE_USE_QT4 - if(!d->szServer.contains('.')) + if(!d->szServer.tqcontains('.')) #else - if(d->szServer.contains('.') < 1) + if(d->szServer.tqcontains('.') < 1) #endif { // assume it is a network name! - KviIrcServerDataBaseRecord * r = m_pRecords->find(d->szServer); + KviIrcServerDataBaseRecord * r = m_pRecords->tqfind(d->szServer); if(r)return makeCurrentBestServerInNetwork(d->szServer,r,szError); // else probably not a network name } @@ -358,11 +358,11 @@ search_finished: // a valid hostname or ip address , not found in list : add it and make it current - r = m_pRecords->find(__tr2qs("Standalone Servers")); + r = m_pRecords->tqfind(__tr2qs("Standalone Servers")); if(!r) { r = new KviIrcServerDataBaseRecord(new KviIrcNetwork(__tr2qs("Standalone Servers"))); - m_pRecords->replace(r->network()->name(),r); + m_pRecords->tqreplace(r->network()->name(),r); } KviIrcServer * s = new KviIrcServer(); @@ -397,11 +397,11 @@ search_finished: return true; } -void parseMircServerRecord(QString entry,QString& szNet, - QString& szDescription,QString& szHost,QString& szPort,bool& bSsl,kvi_u32_t& uPort) +void parseMircServerRecord(TQString entry,TQString& szNet, + TQString& szDescription,TQString& szHost,TQString& szPort,bool& bSsl,kvi_u32_t& uPort) { bSsl = false; - int idx = KviQString::find(entry,"SERVER:"); + int idx = KviTQString::tqfind(entry,"SERVER:"); if(idx != -1) { szDescription = entry.left(idx); @@ -409,7 +409,7 @@ void parseMircServerRecord(QString entry,QString& szNet, szDescription=szDescription.section(':',1,1); entry.remove(0,idx + 7); - idx = KviQString::find(entry,"GROUP:"); + idx = KviTQString::tqfind(entry,"GROUP:"); if(idx != -1) { szHost = entry.left(idx); @@ -431,35 +431,35 @@ void parseMircServerRecord(QString entry,QString& szNet, } } -void KviIrcServerDataBase::loadFromMircIni(const QString & filename, const QString & szMircIni, QStringList& recentServers) +void KviIrcServerDataBase::loadFromMircIni(const TQString & filename, const TQString & szMircIni, TQStringList& recentServers) { clear(); recentServers.clear(); - QString szDefaultServer; + TQString szDefaultServer; KviConfig mircCfg(szMircIni,KviConfig::Read,true); if(mircCfg.hasGroup("mirc")) { mircCfg.setGroup("mirc"); - szDefaultServer = mircCfg.readQStringEntry("host"); + szDefaultServer = mircCfg.readTQStringEntry("host"); } KviConfig cfg(filename,KviConfig::Read,true); int i = 0; - QString entry; - QString key; + TQString entry; + TQString key; if(cfg.hasGroup("recent")) { cfg.setGroup("recent"); do { - KviQString::sprintf(key,"n%d",i); + KviTQString::sprintf(key,"n%d",i); entry = cfg.readEntry(key); if(!entry.isEmpty()) { - QString szNet; - QString szDescription; - QString szHost; - QString szPort; + TQString szNet; + TQString szDescription; + TQString szHost; + TQString szPort; bool bSsl = false; kvi_u32_t uPort = 0; @@ -477,15 +477,15 @@ void KviIrcServerDataBase::loadFromMircIni(const QString & filename, const QStri { cfg.setGroup("servers"); do { - KviQString::sprintf(key,"n%d",i); + KviTQString::sprintf(key,"n%d",i); entry = cfg.readEntry(key); if(!entry.isEmpty()) { bool bDefault = false; - QString szNet; - QString szDescription; - QString szHost; - QString szPort; + TQString szNet; + TQString szDescription; + TQString szHost; + TQString szPort; bool bSsl = false; kvi_u32_t uPort = 0; // <net>:<description>SERVER:<server:port>GROUP:<group???> @@ -520,14 +520,14 @@ void KviIrcServerDataBase::loadFromMircIni(const QString & filename, const QStri } -void KviIrcServerDataBase::load(const QString & filename) +void KviIrcServerDataBase::load(const TQString & filename) { clear(); KviConfig cfg(filename,KviConfig::Read); KviConfigIterator it(*(cfg.dict())); - QString tmp; + TQString tmp; while(it.current()) { @@ -536,16 +536,16 @@ void KviIrcServerDataBase::load(const QString & filename) KviIrcNetwork * n = new KviIrcNetwork(it.currentKey()); KviIrcServerDataBaseRecord * r = insertNetwork(n); cfg.setGroup(it.currentKey()); - n->m_szEncoding = cfg.readQStringEntry("Encoding"); - n->m_szDescription = cfg.readQStringEntry("Description"); - n->m_szNickName = cfg.readQStringEntry("NickName"); - n->m_szRealName = cfg.readQStringEntry("RealName"); - n->m_szUserName = cfg.readQStringEntry("UserName"); - n->m_szOnConnectCommand = cfg.readQStringEntry("OnConnectCommand"); - n->m_szOnLoginCommand = cfg.readQStringEntry("OnLoginCommand"); - n->m_pNickServRuleSet = KviNickServRuleSet::load(&cfg,QString::null); + n->m_szEncoding = cfg.readTQStringEntry("Encoding"); + n->m_szDescription = cfg.readTQStringEntry("Description"); + n->m_szNickName = cfg.readTQStringEntry("NickName"); + n->m_szRealName = cfg.readTQStringEntry("RealName"); + n->m_szUserName = cfg.readTQStringEntry("UserName"); + n->m_szOnConnectCommand = cfg.readTQStringEntry("OnConnectCommand"); + n->m_szOnLoginCommand = cfg.readTQStringEntry("OnLoginCommand"); + n->m_pNickServRuleSet = KviNickServRuleSet::load(&cfg,TQString()); n->m_bAutoConnect = cfg.readBoolEntry("AutoConnect",false); - n->m_szUserIdentityId = cfg.readQStringEntry("UserIdentityId"); + n->m_szUserIdentityId = cfg.readTQStringEntry("UserIdentityId"); if(n->m_bAutoConnect) { if(!m_pAutoConnectOnStartupNetworks) @@ -555,8 +555,8 @@ void KviIrcServerDataBase::load(const QString & filename) } m_pAutoConnectOnStartupNetworks->append(r); } - QStringList l = cfg.readStringListEntry("AutoJoinChannels",QStringList()); - if(l.count() > 0)n->setAutoJoinChannelList(new QStringList(l)); + TQStringList l = cfg.readStringListEntry("AutoJoinChannels",TQStringList()); + if(l.count() > 0)n->setAutoJoinChannelList(new TQStringList(l)); if(cfg.readBoolEntry("Current",false))m_szCurrentNetwork = it.currentKey(); @@ -564,11 +564,11 @@ void KviIrcServerDataBase::load(const QString & filename) for(int i=0;i < nServers;i++) { KviIrcServer *s = new KviIrcServer(); - KviQString::sprintf(tmp,"%d_",i); + KviTQString::sprintf(tmp,"%d_",i); if(s->load(&cfg,tmp)) { r->m_pServerList->append(s); - KviQString::sprintf(tmp,"%d_Current",i); + KviTQString::sprintf(tmp,"%d_Current",i); if(cfg.readBoolEntry(tmp,false))r->m_pCurrentServer = s; if(s->autoConnect()) { @@ -587,15 +587,15 @@ void KviIrcServerDataBase::load(const QString & filename) } } -void KviIrcServerDataBase::save(const QString &filename) +void KviIrcServerDataBase::save(const TQString &filename) { KviConfig cfg(filename,KviConfig::Write); cfg.clear(); // clear any old entry - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); + KviPointerHashTableIterator<TQString,KviIrcServerDataBaseRecord> it(*m_pRecords); - QString tmp; + TQString tmp; while(KviIrcServerDataBaseRecord * r = it.current()) { @@ -618,7 +618,7 @@ void KviIrcServerDataBase::save(const QString &filename) cfg.writeEntry("OnConnectCommand",n->m_szOnConnectCommand); if(!n->m_szOnLoginCommand.isEmpty()) cfg.writeEntry("OnLoginCommand",n->m_szOnLoginCommand); - if(n->m_pNickServRuleSet)n->m_pNickServRuleSet->save(&cfg,QString::null); + if(n->m_pNickServRuleSet)n->m_pNickServRuleSet->save(&cfg,TQString()); if(n->autoJoinChannelList()) cfg.writeEntry("AutoJoinChannels",*(n->autoJoinChannelList())); if(n->m_szName == m_szCurrentNetwork)cfg.writeEntry("Current",true); @@ -627,12 +627,12 @@ void KviIrcServerDataBase::save(const QString &filename) int i=0; for(KviIrcServer *s = r->m_pServerList->first();s;s = r->m_pServerList->next()) { - KviQString::sprintf(tmp,"%d_",i); + KviTQString::sprintf(tmp,"%d_",i); s->save(&cfg,tmp); if(s == r->m_pCurrentServer) { - KviQString::sprintf(tmp,"%d_Current",i); + KviTQString::sprintf(tmp,"%d_Current",i); cfg.writeEntry(tmp,true); } diff --git a/src/kvilib/irc/kvi_ircserverdb.h b/src/kvilib/irc/kvi_ircserverdb.h index b5d55231..ad3b9529 100644 --- a/src/kvilib/irc/kvi_ircserverdb.h +++ b/src/kvilib/irc/kvi_ircserverdb.h @@ -32,15 +32,15 @@ typedef struct _KviIrcServerDefinition { - QString szServer; + TQString szServer; kvi_u32_t uPort; bool bPortIsValid; bool bIpV6; bool bSSL; - QString szLinkFilter; - QString szPass; - QString szNick; - QString szInitUMode; + TQString szLinkFilter; + TQString szPass; + TQString szNick; + TQString szInitUMode; } KviIrcServerDefinition; @@ -75,8 +75,8 @@ public: KviIrcServerDataBase(); ~KviIrcServerDataBase(); private: - KviPointerHashTable<QString,KviIrcServerDataBaseRecord> * m_pRecords; - QString m_szCurrentNetwork; + KviPointerHashTable<TQString,KviIrcServerDataBaseRecord> * m_pRecords; + TQString m_szCurrentNetwork; // This list is computed when the data are loaded from disk // during the startup and is used by KviApp to // start the connections. @@ -89,23 +89,23 @@ private: KviPointerList<KviIrcServerDataBaseRecord> * m_pAutoConnectOnStartupNetworks; public: void clear(); - KviPointerHashTable<QString,KviIrcServerDataBaseRecord> * recordDict(){ return m_pRecords; }; + KviPointerHashTable<TQString,KviIrcServerDataBaseRecord> * recordDict(){ return m_pRecords; }; KviPointerList<KviIrcServer> * autoConnectOnStartupServers(){ return m_pAutoConnectOnStartupServers; }; KviPointerList<KviIrcServerDataBaseRecord> * autoConnectOnStartupNetworks(){ return m_pAutoConnectOnStartupNetworks; }; void clearAutoConnectOnStartupServers(); void clearAutoConnectOnStartupNetworks(); - void setCurrentNetwork(const QString &szNetName){ m_szCurrentNetwork = szNetName; }; - const QString & currentNetworkName(){ return m_szCurrentNetwork; }; + void setCurrentNetwork(const TQString &szNetName){ m_szCurrentNetwork = szNetName; }; + const TQString & currentNetworkName(){ return m_szCurrentNetwork; }; KviIrcServerDataBaseRecord * currentRecord(); - KviIrcServerDataBaseRecord * findRecord(const QString &szNetName); - KviIrcNetwork * findNetwork(const QString &name); - void loadFromMircIni(const QString & filename, const QString & szMircIni, QStringList& recentServers); - void load(const QString & filename); - void save(const QString & filename); + KviIrcServerDataBaseRecord * findRecord(const TQString &szNetName); + KviIrcNetwork * findNetwork(const TQString &name); + void loadFromMircIni(const TQString & filename, const TQString & szMircIni, TQStringList& recentServers); + void load(const TQString & filename); + void save(const TQString & filename); KviIrcServerDataBaseRecord * insertNetwork(KviIrcNetwork * n); - void updateServerIp(KviIrcServer * pServer,const QString &ip); - bool makeCurrentServer(KviIrcServerDefinition * d,QString &szError); - bool makeCurrentBestServerInNetwork(const QString &szNetName,KviIrcServerDataBaseRecord * d,QString &szError); + void updateServerIp(KviIrcServer * pServer,const TQString &ip); + bool makeCurrentServer(KviIrcServerDefinition * d,TQString &szError); + bool makeCurrentBestServerInNetwork(const TQString &szNetName,KviIrcServerDataBaseRecord * d,TQString &szError); }; diff --git a/src/kvilib/irc/kvi_ircuserdb.cpp b/src/kvilib/irc/kvi_ircuserdb.cpp index 38b52522..bfc1c615 100644 --- a/src/kvilib/irc/kvi_ircuserdb.cpp +++ b/src/kvilib/irc/kvi_ircuserdb.cpp @@ -34,7 +34,7 @@ //static int cacheHit = 0; //static int cacheMiss = 0; -KviIrcUserEntry::KviIrcUserEntry(const QString &user,const QString &host) +KviIrcUserEntry::KviIrcUserEntry(const TQString &user,const TQString &host) { m_szUser = user; m_szHost = host; @@ -48,15 +48,15 @@ KviIrcUserEntry::KviIrcUserEntry(const QString &user,const QString &host) m_bUseCustomColor=false; } -void KviIrcUserEntry::setRealName(const QString &rn) +void KviIrcUserEntry::setRealName(const TQString &rn) { m_szRealName = rn; - m_szRealName = KviQString::trimmed(m_szRealName); + m_szRealName = KviTQString::trimmed(m_szRealName); if(m_szRealName.length()>=3) { - if( (m_szRealName[0].unicode()==KVI_TEXT_COLOR) && (m_szRealName[2].unicode()==KVI_TEXT_RESET) ) + if( (m_szRealName[0].tqunicode()==KVI_TEXT_COLOR) && (m_szRealName[2].tqunicode()==KVI_TEXT_RESET) ) { - switch(m_szRealName[1].unicode()) + switch(m_szRealName[1].tqunicode()) { case '1': // hum.. encoded as hidden color code eh ? publish is somewhere, so others might implement this... setGender(Male); @@ -92,7 +92,7 @@ KviAvatar * KviIrcUserEntry::forgetAvatar() } KviIrcUserDataBase::KviIrcUserDataBase() -: QObject() +: TQObject() { // we expect a maximum of ~4000 users (= ~16 KB array on a 32 bit machine) // ...after that we will loose in performance @@ -102,7 +102,7 @@ KviIrcUserDataBase::KviIrcUserDataBase() // the performance increase since kvirc versions < 3.0.0 // is really big anyway (there was a linear list instead of a hash!!!) - m_pDict = new KviPointerHashTable<QString,KviIrcUserEntry>(4001,false); + m_pDict = new KviPointerHashTable<TQString,KviIrcUserEntry>(4001,false); m_pDict->setAutoDelete(true); setupConnectionWithReguserDb(); } @@ -112,9 +112,9 @@ KviIrcUserDataBase::~KviIrcUserDataBase() delete m_pDict; } -bool KviIrcUserDataBase::haveCustomColor(const QString & nick) +bool KviIrcUserDataBase::haveCustomColor(const TQString & nick) { - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return false; if( u->m_szLastRegisteredMatchNick!=nick) registeredUser(nick); @@ -125,9 +125,9 @@ bool KviIrcUserDataBase::haveCustomColor(const QString & nick) return false; } -QColor* KviIrcUserDataBase::customColor(const QString & nick) +TQColor* KviIrcUserDataBase::customColor(const TQString & nick) { - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return 0; if( u->m_szLastRegisteredMatchNick!=nick) registeredUser(nick); @@ -140,10 +140,10 @@ QColor* KviIrcUserDataBase::customColor(const QString & nick) } -KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const QString & user,const QString & host) +KviRegisteredUser* KviIrcUserDataBase::registeredUser(const TQString & nick,const TQString & user,const TQString & host) { if(nick.isEmpty()) return 0; - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return g_pRegisteredUserDataBase->findMatchingUser(nick,user,host); KviRegisteredUser* pUser=0; @@ -171,7 +171,7 @@ KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const u->m_szRegisteredUserName=pUser->name(); u->m_bUseCustomColor=pUser->getBoolProperty("useCustomColor"); - QString szTmp=pUser->getProperty("customColor"); + TQString szTmp=pUser->getProperty("customColor"); KviStringConversion::fromString(szTmp,u->m_cachedColor); u->m_bNotFoundRegUserLoockup=false; //to be shure @@ -186,10 +186,10 @@ KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const return pUser; } -KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick) +KviRegisteredUser* KviIrcUserDataBase::registeredUser(const TQString & nick) { if(nick.isEmpty()) return 0; - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return 0; return registeredUser(nick,u->user(),u->host()); } @@ -197,13 +197,13 @@ KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick) void KviIrcUserDataBase::clear() { delete m_pDict; - m_pDict = new KviPointerHashTable<QString,KviIrcUserEntry>(4001,false); + m_pDict = new KviPointerHashTable<TQString,KviIrcUserEntry>(4001,false); m_pDict->setAutoDelete(true); } -KviIrcUserEntry * KviIrcUserDataBase::insertUser(const QString &nick,const QString &user,const QString &hostname) +KviIrcUserEntry * KviIrcUserDataBase::insertUser(const TQString &nick,const TQString &user,const TQString &hostname) { - KviIrcUserEntry * e = m_pDict->find(nick); + KviIrcUserEntry * e = m_pDict->tqfind(nick); if(e) { e->m_nRefs++; @@ -219,7 +219,7 @@ KviIrcUserEntry * KviIrcUserDataBase::insertUser(const QString &nick,const QStri return e; } -void KviIrcUserDataBase::removeUser(const QString &nick,KviIrcUserEntry * e) +void KviIrcUserDataBase::removeUser(const TQString &nick,KviIrcUserEntry * e) { e->m_nRefs--; if(e->m_nRefs == 0)m_pDict->remove(nick); @@ -227,17 +227,17 @@ void KviIrcUserDataBase::removeUser(const QString &nick,KviIrcUserEntry * e) void KviIrcUserDataBase::setupConnectionWithReguserDb() { - connect(g_pRegisteredUserDataBase,SIGNAL(userRemoved(const QString&)),this,SLOT(registeredUserRemoved(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(userChanged(const QString&)),this,SLOT(registeredUserChanged(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(userAdded(const QString&)),this,SLOT(registeredUserAdded(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(databaseCleared()),this,SLOT(registeredDatabaseCleared())); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(userRemoved(const TQString&)),this,TQT_SLOT(registeredUserRemoved(const TQString&))); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(userChanged(const TQString&)),this,TQT_SLOT(registeredUserChanged(const TQString&))); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(userAdded(const TQString&)),this,TQT_SLOT(registeredUserAdded(const TQString&))); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(databaseCleared()),this,TQT_SLOT(registeredDatabaseCleared())); } -void KviIrcUserDataBase::registeredUserRemoved(const QString& user) +void KviIrcUserDataBase::registeredUserRemoved(const TQString& user) { - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { if(it.current()->m_szRegisteredUserName==user) @@ -248,10 +248,10 @@ void KviIrcUserDataBase::registeredUserRemoved(const QString& user) } } -void KviIrcUserDataBase::registeredUserChanged(const QString& user) +void KviIrcUserDataBase::registeredUserChanged(const TQString& user) { //the same as above - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { if(it.current()->m_szRegisteredUserName==user) @@ -262,9 +262,9 @@ void KviIrcUserDataBase::registeredUserChanged(const QString& user) } } -void KviIrcUserDataBase::registeredUserAdded(const QString& user) +void KviIrcUserDataBase::registeredUserAdded(const TQString& user) { - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { if(it.current()->m_szRegisteredUserName.isEmpty()) @@ -276,7 +276,7 @@ void KviIrcUserDataBase::registeredUserAdded(const QString& user) void KviIrcUserDataBase::registeredDatabaseCleared() { - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { it.current()->m_szRegisteredUserName=""; diff --git a/src/kvilib/irc/kvi_ircuserdb.h b/src/kvilib/irc/kvi_ircuserdb.h index bdf7c51c..ec967331 100644 --- a/src/kvilib/irc/kvi_ircuserdb.h +++ b/src/kvilib/irc/kvi_ircuserdb.h @@ -39,7 +39,7 @@ class KVILIB_API KviIrcUserEntry { friend class KviIrcUserDataBase; public: - KviIrcUserEntry(const QString &user,const QString &host); + KviIrcUserEntry(const TQString &user,const TQString &host); ~KviIrcUserEntry(); enum Gender { @@ -49,11 +49,11 @@ public: }; protected: - QString m_szUser; - QString m_szHost; + TQString m_szUser; + TQString m_szHost; - QString m_szServer; - QString m_szRealName; + TQString m_szServer; + TQString m_szRealName; int m_iHops; Gender m_eGender; @@ -65,29 +65,29 @@ protected: bool m_bBot; bool m_bNotFoundRegUserLoockup; - QString m_szRegisteredUserName; - QString m_szLastRegisteredMatchNick; + TQString m_szRegisteredUserName; + TQString m_szLastRegisteredMatchNick; - QColor m_cachedColor; + TQColor m_cachedColor; bool m_bUseCustomColor; public: Gender gender() { return m_eGender; }; void setBot(bool bIsBot) { m_bBot = bIsBot; }; bool isBot() { return m_bBot; }; void setGender(Gender g) { m_eGender=g; }; - void setUser(const QString &user) { m_szUser = user; }; + void setUser(const TQString &user) { m_szUser = user; }; bool hasUser() { return (!m_szUser.isEmpty()); }; - void setHost(const QString &host) { m_szHost = host; }; + void setHost(const TQString &host) { m_szHost = host; }; bool hasHost() { return (!m_szHost.isEmpty()); }; - void setServer(const QString &serv) { m_szServer = serv; }; - void setRealName(const QString &rn); + void setServer(const TQString &serv) { m_szServer = serv; }; + void setRealName(const TQString &rn); void setHops(int hops) { m_iHops = hops; }; - const QString &user() { return m_szUser; }; - const QString &host() { return m_szHost; }; + const TQString &user() { return m_szUser; }; + const TQString &host() { return m_szHost; }; bool hasServer() { return (!m_szServer.isEmpty()); }; - const QString &server() { return m_szServer; }; + const TQString &server() { return m_szServer; }; bool hasRealName() { return (!m_szRealName.isEmpty()); }; - const QString &realName() { return m_szRealName; }; + const TQString &realName() { return m_szRealName; }; bool hasHops() { return m_iHops >= 0; }; int hops() { return m_iHops; }; KviAvatar * avatar() { return m_pAvatar; }; @@ -113,32 +113,33 @@ public: #define KVI_USERFLAG_MODEMASK KVI_USERFLAG_MASK -class KVILIB_API KviIrcUserDataBase : public QObject +class KVILIB_API KviIrcUserDataBase : public TQObject { Q_OBJECT + TQ_OBJECT public: KviIrcUserDataBase(); ~KviIrcUserDataBase(); private: - KviPointerHashTable<QString,KviIrcUserEntry> * m_pDict; + KviPointerHashTable<TQString,KviIrcUserEntry> * m_pDict; public: void clear(); - KviIrcUserEntry * insertUser(const QString &nick,const QString &user,const QString &hostname); - KviIrcUserEntry * find(const QString &nick){ return m_pDict->find(nick); }; - void removeUser(const QString &nick,KviIrcUserEntry * e); - KviPointerHashTable<QString,KviIrcUserEntry> * dict(){ return m_pDict; }; + KviIrcUserEntry * insertUser(const TQString &nick,const TQString &user,const TQString &hostname); + KviIrcUserEntry * tqfind(const TQString &nick){ return m_pDict->tqfind(nick); }; + void removeUser(const TQString &nick,KviIrcUserEntry * e); + KviPointerHashTable<TQString,KviIrcUserEntry> * dict(){ return m_pDict; }; - KviRegisteredUser* registeredUser(const QString & nick); - KviRegisteredUser* registeredUser(const QString & nick,const QString & user,const QString & host); + KviRegisteredUser* registeredUser(const TQString & nick); + KviRegisteredUser* registeredUser(const TQString & nick,const TQString & user,const TQString & host); - bool haveCustomColor(const QString & nick); - QColor* customColor(const QString & nick); + bool haveCustomColor(const TQString & nick); + TQColor* customColor(const TQString & nick); void setupConnectionWithReguserDb(); protected slots: - void registeredUserRemoved(const QString&); - void registeredUserChanged(const QString&); - void registeredUserAdded (const QString&); + void registeredUserRemoved(const TQString&); + void registeredUserChanged(const TQString&); + void registeredUserAdded (const TQString&); void registeredDatabaseCleared(); }; diff --git a/src/kvilib/irc/kvi_mirccntrl.cpp b/src/kvilib/irc/kvi_mirccntrl.cpp index fbf3c2d3..21b5258a 100644 --- a/src/kvilib/irc/kvi_mirccntrl.cpp +++ b/src/kvilib/irc/kvi_mirccntrl.cpp @@ -155,7 +155,7 @@ KVILIB_API const kvi_wchar_t * getColorBytesW(const kvi_wchar_t *data_ptr,unsign } } -KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int charIdx,unsigned char *byte_1,unsigned char *byte_2) +KVILIB_API unsigned int getUnicodeColorBytes(const TQString &szData,unsigned int charIdx,unsigned char *byte_1,unsigned char *byte_2) { // // Scans the szData for a mIrc color code XX,XX @@ -169,7 +169,7 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int return charIdx; } - unsigned short c = szData[(int)charIdx].unicode(); + unsigned short c = szData[(int)charIdx].tqunicode(); //First we can have a digit or a coma if(((c < '0') || (c > '9'))) @@ -189,7 +189,7 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int return charIdx; } - c = szData[(int)charIdx].unicode(); + c = szData[(int)charIdx].tqunicode(); if(((c < '0') || (c > '9')) && (c != ',')) { @@ -207,7 +207,7 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int (*byte_2)=KVI_NOCHANGE; return charIdx; } - c = szData[(int)charIdx].unicode(); + c = szData[(int)charIdx].tqunicode(); } if(c == ',') @@ -218,7 +218,7 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int (*byte_2)=KVI_NOCHANGE; return charIdx; } - c = szData[(int)charIdx].unicode(); + c = szData[(int)charIdx].tqunicode(); } else { (*byte_2)=KVI_NOCHANGE; return charIdx; @@ -227,7 +227,7 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int if((c < '0') || (c > '9')) { (*byte_2)=KVI_NOCHANGE; - if(szData[(int)(charIdx-1)].unicode()==',') + if(szData[(int)(charIdx-1)].tqunicode()==',') return charIdx-1; else return charIdx; @@ -237,7 +237,7 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int (*byte_2)=c-'0'; charIdx++; if(charIdx >= szData.length())return charIdx; - c = szData[(int)charIdx].unicode(); + c = szData[(int)charIdx].tqunicode(); if((c >= '0') && (c <='9')) { @@ -251,9 +251,9 @@ KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int namespace KviMircCntrl { - QString stripControlBytes(const QString &szData) + TQString stripControlBytes(const TQString &szData) { - QString ret; + TQString ret; int i = 0; int l = szData.length(); @@ -262,7 +262,7 @@ namespace KviMircCntrl unsigned char b2; while(i < l) { - switch(szData[i].unicode()) + switch(szData[i].tqunicode()) { case KVI_TEXT_UNDERLINE: case KVI_TEXT_BOLD: @@ -288,7 +288,7 @@ namespace KviMircCntrl i++; while(i < l) { - if(szData[i].unicode() == ' ')break; + if(szData[i].tqunicode() == ' ')break; else i++; } begin = i; diff --git a/src/kvilib/irc/kvi_mirccntrl.h b/src/kvilib/irc/kvi_mirccntrl.h index c3028568..b02165d0 100644 --- a/src/kvilib/irc/kvi_mirccntrl.h +++ b/src/kvilib/irc/kvi_mirccntrl.h @@ -91,9 +91,9 @@ // 006 ACK Acknowledge (Not so good, but can be used as last resource) // 007 BEL Bell ( Recognized as bell by terminals and IRCII ) (Used also by some IRC servers) // 008 BS Backspace (Should not be assigned: terminal control) -// 009 HT Horizontal tabulation (Should not be assigned: terminal control) +// 009 HT Qt::Horizontal tabulation (Should not be assigned: terminal control) // 010 LF Line feed (Should not be assigned: terminal control) -// 011 VT Vertical tabulation (Should not be assigned: terminal control) +// 011 VT Qt::Vertical tabulation (Should not be assigned: terminal control) // 012 FF Form feed (Should not be assigned: terminal control) // 013 CR Carriage return (Should not be assigned: terminal control) // 014 SO Shift out (Should not be assigned: terminal control) @@ -148,15 +148,15 @@ #ifndef _KVI_MIRCCNTRL_CPP_ extern KVILIB_API const char * getColorBytes(const char *data_ptr,unsigned char *byte_1,unsigned char *byte_2); extern KVILIB_API const kvi_wchar_t * getColorBytesW(const kvi_wchar_t *data_ptr,unsigned char *byte_1,unsigned char *byte_2); - extern KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int charIdx,unsigned char *byte_1,unsigned char *byte_2); - inline const QChar * getUnicodeColorBytes(const QChar *pData,unsigned char *byte_1,unsigned char *byte_2) - { return (QChar *)getColorBytesW((const kvi_wchar_t *)pData,byte_1,byte_2); }; + extern KVILIB_API unsigned int getUnicodeColorBytes(const TQString &szData,unsigned int charIdx,unsigned char *byte_1,unsigned char *byte_2); + inline const TQChar * getUnicodeColorBytes(const TQChar *pData,unsigned char *byte_1,unsigned char *byte_2) + { return (TQChar *)getColorBytesW((const kvi_wchar_t *)pData,byte_1,byte_2); }; #endif namespace KviMircCntrl { - KVILIB_API QString stripControlBytes(const QString &szData); + KVILIB_API TQString stripControlBytes(const TQString &szData); } diff --git a/src/kvilib/irc/kvi_nickserv.cpp b/src/kvilib/irc/kvi_nickserv.cpp index a1809f84..24a50e96 100644 --- a/src/kvilib/irc/kvi_nickserv.cpp +++ b/src/kvilib/irc/kvi_nickserv.cpp @@ -29,7 +29,7 @@ #include "kvi_config.h" #include "kvi_ircmask.h" -#include <qregexp.h> +#include <tqregexp.h> @@ -85,31 +85,31 @@ KviNickServRuleSet::~KviNickServRuleSet() if(m_pRules)delete m_pRules; } -void KviNickServRuleSet::save(KviConfig * cfg,const QString &prefix) +void KviNickServRuleSet::save(KviConfig * cfg,const TQString &prefix) { if(!m_pRules)return; // nothing to save if(m_pRules->isEmpty())return; // should never happen anyway - QString tmp; + TQString tmp; if(m_bEnabled) { - KviQString::sprintf(tmp,"%QNSEnabled",&prefix); + KviTQString::sprintf(tmp,"%TQNSEnabled",&prefix); cfg->writeEntry(tmp,m_bEnabled); } - KviQString::sprintf(tmp,"%QNSRules",&prefix); + KviTQString::sprintf(tmp,"%TQNSRules",&prefix); cfg->writeEntry(tmp,m_pRules->count()); int idx = 0; for(KviNickServRule * r = m_pRules->first();r;r = m_pRules->next()) { - KviQString::sprintf(tmp,"%QNSRule%d_",&prefix,idx); + KviTQString::sprintf(tmp,"%TQNSRule%d_",&prefix,idx); r->save(cfg,tmp); idx++; } } -KviNickServRuleSet * KviNickServRuleSet::load(KviConfig * cfg,const QString &prefix) +KviNickServRuleSet * KviNickServRuleSet::load(KviConfig * cfg,const TQString &prefix) { - QString tmp; - KviQString::sprintf(tmp,"%QNSRules",&prefix); + TQString tmp; + KviTQString::sprintf(tmp,"%TQNSRules",&prefix); unsigned int cnt = cfg->readUIntEntry(tmp,0); if(cnt == 0)return 0; KviNickServRuleSet * s = new KviNickServRuleSet(); @@ -118,26 +118,26 @@ KviNickServRuleSet * KviNickServRuleSet::load(KviConfig * cfg,const QString &pre return 0; } -void KviNickServRuleSet::load(const QString &szConfigFile) +void KviNickServRuleSet::load(const TQString &szConfigFile) { clear(); KviConfig cfg(szConfigFile,KviConfig::Read); - QString tmp; - KviQString::sprintf(tmp,"NSRules"); + TQString tmp; + KviTQString::sprintf(tmp,"NSRules"); unsigned int cnt = cfg.readUIntEntry(tmp,0); if(cnt == 0)return; - loadPrivate(&cfg,QString(""),cnt); + loadPrivate(&cfg,TQString(""),cnt); } -void KviNickServRuleSet::save(const QString &szConfigFile) +void KviNickServRuleSet::save(const TQString &szConfigFile) { KviConfig cfg(szConfigFile,KviConfig::Write); cfg.clear(); - save(&cfg,QString("")); + save(&cfg,TQString("")); } -bool KviNickServRuleSet::loadPrivate(KviConfig * cfg,const QString &prefix,unsigned int nEntries) +bool KviNickServRuleSet::loadPrivate(KviConfig * cfg,const TQString &prefix,unsigned int nEntries) { if(m_pRules)m_pRules->clear(); else { @@ -147,12 +147,12 @@ bool KviNickServRuleSet::loadPrivate(KviConfig * cfg,const QString &prefix,unsig if(nEntries != 0) { - QString tmp; - KviQString::sprintf(tmp,"%QNSEnabled",&prefix); + TQString tmp; + KviTQString::sprintf(tmp,"%TQNSEnabled",&prefix); m_bEnabled = cfg->readBoolEntry(tmp,false); for(unsigned int u=0;u<nEntries;u++) { - KviQString::sprintf(tmp,"%QNSRule%u_",&prefix,u); + KviTQString::sprintf(tmp,"%TQNSRule%u_",&prefix,u); KviNickServRule * r = new KviNickServRule(); if(!r->load(cfg,tmp))delete r; else m_pRules->append(r); @@ -195,26 +195,26 @@ KviNickServRuleSet * KviNickServRuleSet::createInstance() } -KviNickServRule * KviNickServRuleSet::matchRule(const QString &szNick,const KviIrcMask *nickServ,const QString &szMsg,const QString &szServer) +KviNickServRule * KviNickServRuleSet::matchRule(const TQString &szNick,const KviIrcMask *nickServ,const TQString &szMsg,const TQString &szServer) { if(!m_pRules)return 0; for(KviNickServRule *r = m_pRules->first();r;r = m_pRules->next()) { - if(!KviQString::matchStringCI(r->registeredNick(),szNick,false,true)) continue; + if(!KviTQString::matchStringCI(r->registeredNick(),szNick,false,true)) continue; if(!szServer.isEmpty()) { #ifdef COMPILE_USE_QT4 - QRegExp res(r->serverMask(),Qt::CaseInsensitive,QRegExp::Wildcard); + TQRegExp res(r->serverMask(),TQt::CaseInsensitive,TQRegExp::Wildcard); #else - QRegExp res(r->serverMask(),false,true); + TQRegExp res(r->serverMask(),false,true); #endif if(!res.exactMatch(szServer))continue; } if(!nickServ->matchedBy(KviIrcMask(r->nickServMask())))continue; #ifdef COMPILE_USE_QT4 - QRegExp re(r->messageRegexp(),Qt::CaseInsensitive,QRegExp::Wildcard); + TQRegExp re(r->messageRegexp(),TQt::CaseInsensitive,TQRegExp::Wildcard); #else - QRegExp re(r->messageRegexp(),false,true); + TQRegExp re(r->messageRegexp(),false,true); #endif if(re.exactMatch(szMsg))return r; } @@ -264,45 +264,45 @@ void KviNickServRule::copyFrom(const KviNickServRule &src) m_szServerMask = src.m_szServerMask; } -void KviNickServRule::save(KviConfig * cfg,const QString &prefix) +void KviNickServRule::save(KviConfig * cfg,const TQString &prefix) { - QString tmp; - KviQString::sprintf(tmp,"%QRegisteredNick",&prefix); + TQString tmp; + KviTQString::sprintf(tmp,"%TQRegisteredNick",&prefix); cfg->writeEntry(tmp,m_szRegisteredNick); - KviQString::sprintf(tmp,"%QNickServMask",&prefix); + KviTQString::sprintf(tmp,"%TQNickServMask",&prefix); cfg->writeEntry(tmp,m_szNickServMask); - KviQString::sprintf(tmp,"%QMessageRegexp",&prefix); + KviTQString::sprintf(tmp,"%TQMessageRegexp",&prefix); cfg->writeEntry(tmp,m_szMessageRegexp); - KviQString::sprintf(tmp,"%QIdentifyCommand",&prefix); + KviTQString::sprintf(tmp,"%TQIdentifyCommand",&prefix); cfg->writeEntry(tmp,m_szIdentifyCommand); - KviQString::sprintf(tmp,"%QServerMask",&prefix); + KviTQString::sprintf(tmp,"%TQServerMask",&prefix); cfg->writeEntry(tmp,m_szServerMask); } -bool KviNickServRule::load(KviConfig * cfg,const QString &prefix) +bool KviNickServRule::load(KviConfig * cfg,const TQString &prefix) { - QString tmp; - KviQString::sprintf(tmp,"%QRegisteredNick",&prefix); - m_szRegisteredNick = KviQString::trimmed(cfg->readQStringEntry(tmp)); + TQString tmp; + KviTQString::sprintf(tmp,"%TQRegisteredNick",&prefix); + m_szRegisteredNick = KviTQString::trimmed(cfg->readTQStringEntry(tmp)); if(m_szRegisteredNick.isEmpty())return false; - KviQString::sprintf(tmp,"%QNickServMask",&prefix); - m_szNickServMask = cfg->readQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQNickServMask",&prefix); + m_szNickServMask = cfg->readTQStringEntry(tmp); if(m_szNickServMask.isEmpty())return false; - KviQString::sprintf(tmp,"%QServerMask",&prefix); - m_szServerMask = cfg->readQStringEntry(tmp,QString::null); - KviQString::sprintf(tmp,"%QMessageRegexp",&prefix); - m_szMessageRegexp = cfg->readQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQServerMask",&prefix); + m_szServerMask = cfg->readTQStringEntry(tmp,TQString()); + KviTQString::sprintf(tmp,"%TQMessageRegexp",&prefix); + m_szMessageRegexp = cfg->readTQStringEntry(tmp); if(m_szMessageRegexp.isEmpty())return false; - KviQString::sprintf(tmp,"%QIdentifyCommand",&prefix); - m_szIdentifyCommand = cfg->readQStringEntry(tmp); + KviTQString::sprintf(tmp,"%TQIdentifyCommand",&prefix); + m_szIdentifyCommand = cfg->readTQStringEntry(tmp); return !m_szIdentifyCommand.isEmpty(); } -KviNickServRule * KviNickServRule::createInstance(const QString &szRegisteredNick, - const QString &szNickServMask, - const QString &szMessageRegexp, - const QString &szIdentifyCommand, - const QString &szServerMask) +KviNickServRule * KviNickServRule::createInstance(const TQString &szRegisteredNick, + const TQString &szNickServMask, + const TQString &szMessageRegexp, + const TQString &szIdentifyCommand, + const TQString &szServerMask) { return new KviNickServRule(szRegisteredNick,szNickServMask,szMessageRegexp,szIdentifyCommand,szServerMask); } diff --git a/src/kvilib/irc/kvi_nickserv.h b/src/kvilib/irc/kvi_nickserv.h index 105eed1c..f259f1f5 100644 --- a/src/kvilib/irc/kvi_nickserv.h +++ b/src/kvilib/irc/kvi_nickserv.h @@ -35,19 +35,19 @@ class KviIrcMask; class KVILIB_API KviNickServRule : public KviHeapObject { protected: - QString m_szRegisteredNick; // my registered nickname - QString m_szNickServMask; // the NickServ service mask - QString m_szMessageRegexp; // the NickServ message regexp - QString m_szIdentifyCommand; // the IDENTIFY command to send to server - QString m_szServerMask; // the mask that the server must match (not used in per-network rules) + TQString m_szRegisteredNick; // my registered nickname + TQString m_szNickServMask; // the NickServ service tqmask + TQString m_szMessageRegexp; // the NickServ message regexp + TQString m_szIdentifyCommand; // the IDENTIFY command to send to server + TQString m_szServerMask; // the tqmask that the server must match (not used in per-network rules) public: KviNickServRule() : KviHeapObject() {}; KviNickServRule( - const QString &szRegisteredNick, - const QString &szNickServMask, - const QString &szMessageRegexp, - const QString &szIdentifyCommand, - const QString &szServerMask = QString::null) + const TQString &szRegisteredNick, + const TQString &szNickServMask, + const TQString &szMessageRegexp, + const TQString &szIdentifyCommand, + const TQString &szServerMask = TQString()) : KviHeapObject(), m_szRegisteredNick(szRegisteredNick), m_szNickServMask(szNickServMask), @@ -56,27 +56,27 @@ public: m_szServerMask(szServerMask) {}; public: - const QString & registeredNick() const { return m_szRegisteredNick; }; - const QString & nickServMask() const { return m_szNickServMask; }; - const QString & messageRegexp() const { return m_szMessageRegexp; }; - const QString & identifyCommand() const { return m_szIdentifyCommand; }; - const QString & serverMask() const { return m_szServerMask; }; - void setRegisteredNick(const QString &szRegisteredNick){ m_szRegisteredNick = szRegisteredNick; }; - void setNickServMask(const QString &szNickServMask){ m_szNickServMask = szNickServMask; }; - void setMessageRegexp(const QString &szMessageRegexp){ m_szMessageRegexp = szMessageRegexp; }; - void setIdentifyCommand(const QString &szIdentifyCommand){ m_szIdentifyCommand = szIdentifyCommand; }; - void setServerMask(const QString &szServerMask){ m_szServerMask = szServerMask; }; + const TQString & registeredNick() const { return m_szRegisteredNick; }; + const TQString & nickServMask() const { return m_szNickServMask; }; + const TQString & messageRegexp() const { return m_szMessageRegexp; }; + const TQString & identifyCommand() const { return m_szIdentifyCommand; }; + const TQString & serverMask() const { return m_szServerMask; }; + void setRegisteredNick(const TQString &szRegisteredNick){ m_szRegisteredNick = szRegisteredNick; }; + void setNickServMask(const TQString &szNickServMask){ m_szNickServMask = szNickServMask; }; + void setMessageRegexp(const TQString &szMessageRegexp){ m_szMessageRegexp = szMessageRegexp; }; + void setIdentifyCommand(const TQString &szIdentifyCommand){ m_szIdentifyCommand = szIdentifyCommand; }; + void setServerMask(const TQString &szServerMask){ m_szServerMask = szServerMask; }; public: // avoid crashes under windows - static KviNickServRule * createInstance(const QString &szRegisteredNick, - const QString &szNickServMask, - const QString &szMessageRegexp, - const QString &szIdentifyCommand, - const QString &szServerMask = QString::null); + static KviNickServRule * createInstance(const TQString &szRegisteredNick, + const TQString &szNickServMask, + const TQString &szMessageRegexp, + const TQString &szIdentifyCommand, + const TQString &szServerMask = TQString()); - void save(KviConfig * cfg,const QString &prefix); + void save(KviConfig * cfg,const TQString &prefix); // returns false if the loaded data has no sense - bool load(KviConfig * cfg,const QString &prefix); + bool load(KviConfig * cfg,const TQString &prefix); void copyFrom(const KviNickServRule &src); }; @@ -87,7 +87,7 @@ public: KviNickServRuleSet(const KviNickServRuleSet &s); ~KviNickServRuleSet(); protected: - KviPointerList<KviNickServRule> * m_pRules; // FIXME: Replace with KviPointerHashTable<QString,KviPointerList> + KviPointerList<KviNickServRule> * m_pRules; // FIXME: Replace with KviPointerHashTable<TQString,KviPointerList> bool m_bEnabled; public: // avoid crashes under windows @@ -97,15 +97,15 @@ public: void setEnabled(bool bEnabled){ m_bEnabled = bEnabled; }; bool isEmpty(){ return m_pRules ? m_pRules->isEmpty() : true; }; void addRule(KviNickServRule * r); - KviNickServRule * matchRule(const QString &szNick,const KviIrcMask *nickServ,const QString &szMsg,const QString &szServer = QString::null); + KviNickServRule * matchRule(const TQString &szNick,const KviIrcMask *nickServ,const TQString &szMsg,const TQString &szServer = TQString()); void copyFrom(const KviNickServRuleSet &src); - void load(const QString &szConfigFile); - void save(const QString &szConfigFile); - void save(KviConfig * cfg,const QString &prefix); + void load(const TQString &szConfigFile); + void save(const TQString &szConfigFile); + void save(KviConfig * cfg,const TQString &prefix); KviPointerList<KviNickServRule> * rules(){ return m_pRules; }; - static KviNickServRuleSet * load(KviConfig * cfg,const QString &prefix); + static KviNickServRuleSet * load(KviConfig * cfg,const TQString &prefix); protected: - bool loadPrivate(KviConfig * cfg,const QString &prefix,unsigned int nEntries); + bool loadPrivate(KviConfig * cfg,const TQString &prefix,unsigned int nEntries); }; diff --git a/src/kvilib/irc/kvi_useridentity.cpp b/src/kvilib/irc/kvi_useridentity.cpp index d4791333..67887e9c 100644 --- a/src/kvilib/irc/kvi_useridentity.cpp +++ b/src/kvilib/irc/kvi_useridentity.cpp @@ -33,25 +33,25 @@ bool KviUserIdentity::load(KviConfig &cfg) { m_szId = cfg.group(); - m_szNickName = cfg.readQStringEntry("NickName"); - m_szAltNickName1 = cfg.readQStringEntry("AltNickName1"); - m_szAltNickName2 = cfg.readQStringEntry("AltNickName2"); - m_szAltNickName3 = cfg.readQStringEntry("AltNickName3"); - m_szUserName = cfg.readQStringEntry("UserName"); + m_szNickName = cfg.readTQStringEntry("NickName"); + m_szAltNickName1 = cfg.readTQStringEntry("AltNickName1"); + m_szAltNickName2 = cfg.readTQStringEntry("AltNickName2"); + m_szAltNickName3 = cfg.readTQStringEntry("AltNickName3"); + m_szUserName = cfg.readTQStringEntry("UserName"); // FIXME: At least scramble the pass ? - m_szPassword = cfg.readQStringEntry("Password"); + m_szPassword = cfg.readTQStringEntry("Password"); KviPixmap def; m_pixAvatar = cfg.readPixmapEntry("Avatar",def); - m_szPartMessage = cfg.readQStringEntry("PartMessage"); - m_szQuitMessage= cfg.readQStringEntry("QuitMessage"); - m_szAge = cfg.readQStringEntry("Age"); - m_szGender = cfg.readQStringEntry("Gender"); - m_szLocation = cfg.readQStringEntry("Location"); - m_szLanguages = cfg.readQStringEntry("Languages"); - m_szOtherInfo = cfg.readQStringEntry("OtherInfo"); - m_szUserMode = cfg.readQStringEntry("UserMode"); - m_szOnConnectCommand = cfg.readQStringEntry("OnConnectCommand"); - m_szOnLoginCommand = cfg.readQStringEntry("OnLoginCommand"); + m_szPartMessage = cfg.readTQStringEntry("PartMessage"); + m_szQuitMessage= cfg.readTQStringEntry("QuitMessage"); + m_szAge = cfg.readTQStringEntry("Age"); + m_szGender = cfg.readTQStringEntry("Gender"); + m_szLocation = cfg.readTQStringEntry("Location"); + m_szLanguages = cfg.readTQStringEntry("Languages"); + m_szOtherInfo = cfg.readTQStringEntry("OtherInfo"); + m_szUserMode = cfg.readTQStringEntry("UserMode"); + m_szOnConnectCommand = cfg.readTQStringEntry("OnConnectCommand"); + m_szOnLoginCommand = cfg.readTQStringEntry("OnLoginCommand"); return !(m_szId.isEmpty() || m_szNickName.isEmpty()); } @@ -121,7 +121,7 @@ KviUserIdentityManager * KviUserIdentityManager::m_pInstance = 0; KviUserIdentityManager::KviUserIdentityManager() : KviHeapObject() { - m_pIdentityDict = new KviPointerHashTable<QString,KviUserIdentity>(); + m_pIdentityDict = new KviPointerHashTable<TQString,KviUserIdentity>(); m_pIdentityDict->setAutoDelete(true); } @@ -148,13 +148,13 @@ const KviUserIdentity * KviUserIdentityManager::defaultIdentity() KviUserIdentity * ret; if(!m_szDefaultIdentity.isEmpty()) { - ret = m_pIdentityDict->find(m_szDefaultIdentity); + ret = m_pIdentityDict->tqfind(m_szDefaultIdentity); if(ret)return ret; } // the default identity is borken :/ // grab the first one - KviPointerHashTableIterator<QString,KviUserIdentity> it(*m_pIdentityDict); + KviPointerHashTableIterator<TQString,KviUserIdentity> it(*m_pIdentityDict); ret = it.current(); if(ret) { @@ -172,14 +172,14 @@ const KviUserIdentity * KviUserIdentityManager::defaultIdentity() ret->setUserName(KVI_DEFAULT_USERNAME); ret->setRealName(KVI_DEFAULT_REALNAME); ret->setPartMessage(KVI_DEFAULT_PART_MESSAGE); - ret->setQuitMessage(KVI_DEFAULT_QUIT_MESSAGE); + ret->setQuitMessage(KVI_DEFAULT_TQUIT_MESSAGE); - m_pIdentityDict->replace(ret->id(),ret); + m_pIdentityDict->tqreplace(ret->id(),ret); return ret; } -void KviUserIdentityManager::load(const QString &szFileName) +void KviUserIdentityManager::load(const TQString &szFileName) { m_pIdentityDict->clear(); @@ -187,18 +187,18 @@ void KviUserIdentityManager::load(const QString &szFileName) cfg.setGroup("KVIrc"); - m_szDefaultIdentity = cfg.readQStringEntry("DefaultIdentity",""); + m_szDefaultIdentity = cfg.readTQStringEntry("DefaultIdentity",""); KviConfigIterator it(*(cfg.dict())); while(KviConfigGroup * grp = it.current()) { - if(!KviQString::equalCI(it.currentKey(),"KVIrc")) + if(!KviTQString::equalCI(it.currentKey(),"KVIrc")) { cfg.setGroup(it.currentKey()); KviUserIdentity * id = new KviUserIdentity(); if(id->load(cfg)) - m_pIdentityDict->replace(id->id(),id); + m_pIdentityDict->tqreplace(id->id(),id); else delete id; } @@ -206,7 +206,7 @@ void KviUserIdentityManager::load(const QString &szFileName) } } -void KviUserIdentityManager::save(const QString &szFileName) +void KviUserIdentityManager::save(const TQString &szFileName) { KviConfig cfg(szFileName,KviConfig::Write); cfg.clear(); @@ -215,7 +215,7 @@ void KviUserIdentityManager::save(const QString &szFileName) cfg.writeEntry("DefaultIdentity",m_szDefaultIdentity); - KviPointerHashTableIterator<QString,KviUserIdentity> it(*m_pIdentityDict); + KviPointerHashTableIterator<TQString,KviUserIdentity> it(*m_pIdentityDict); while(KviUserIdentity * id = it.current()) { id->save(cfg); @@ -227,12 +227,12 @@ void KviUserIdentityManager::copyFrom(KviUserIdentityManager * pWorkingCopy) { m_pIdentityDict->clear(); m_szDefaultIdentity = pWorkingCopy->m_szDefaultIdentity; - KviPointerHashTableIterator<QString,KviUserIdentity> it(*(pWorkingCopy->m_pIdentityDict)); + KviPointerHashTableIterator<TQString,KviUserIdentity> it(*(pWorkingCopy->m_pIdentityDict)); while(KviUserIdentity * id = it.current()) { KviUserIdentity * pNew = new KviUserIdentity(); pNew->copyFrom(*id); - m_pIdentityDict->replace(pNew->id(),pNew); + m_pIdentityDict->tqreplace(pNew->id(),pNew); ++it; } } diff --git a/src/kvilib/irc/kvi_useridentity.h b/src/kvilib/irc/kvi_useridentity.h index c1018f1a..bcc5e1b4 100644 --- a/src/kvilib/irc/kvi_useridentity.h +++ b/src/kvilib/irc/kvi_useridentity.h @@ -42,71 +42,71 @@ public: { } protected: - QString m_szId; // the identity set name + TQString m_szId; // the identity set name - QString m_szNickName; + TQString m_szNickName; - QString m_szAltNickName1; - QString m_szAltNickName2; - QString m_szAltNickName3; + TQString m_szAltNickName1; + TQString m_szAltNickName2; + TQString m_szAltNickName3; - QString m_szUserName; - QString m_szRealName; - QString m_szPassword; + TQString m_szUserName; + TQString m_szRealName; + TQString m_szPassword; KviPixmap m_pixAvatar; - QString m_szPartMessage; - QString m_szQuitMessage; + TQString m_szPartMessage; + TQString m_szQuitMessage; - QString m_szAge; - QString m_szGender; - QString m_szLocation; - QString m_szLanguages; - QString m_szOtherInfo; + TQString m_szAge; + TQString m_szGender; + TQString m_szLocation; + TQString m_szLanguages; + TQString m_szOtherInfo; - QString m_szUserMode; + TQString m_szUserMode; - QString m_szOnConnectCommand; - QString m_szOnLoginCommand; + TQString m_szOnConnectCommand; + TQString m_szOnLoginCommand; public: - const QString & id() const { return m_szId; }; - const QString & nickName() const { return m_szNickName; }; - const QString & altNickName1() const { return m_szAltNickName1; }; - const QString & altNickName2() const { return m_szAltNickName2; }; - const QString & altNickName3() const { return m_szAltNickName3; }; - const QString & userName() const { return m_szUserName; }; - const QString & password() const { return m_szPassword; }; + const TQString & id() const { return m_szId; }; + const TQString & nickName() const { return m_szNickName; }; + const TQString & altNickName1() const { return m_szAltNickName1; }; + const TQString & altNickName2() const { return m_szAltNickName2; }; + const TQString & altNickName3() const { return m_szAltNickName3; }; + const TQString & userName() const { return m_szUserName; }; + const TQString & password() const { return m_szPassword; }; const KviPixmap & avatar() const { return m_pixAvatar; }; - const QString & partMessage() const { return m_szPartMessage; }; - const QString & quitMessage() const { return m_szQuitMessage; }; - const QString & age() const { return m_szAge; }; - const QString & gender() const { return m_szGender; }; - const QString & location() const { return m_szLocation; }; - const QString & languages() const { return m_szLanguages; }; - const QString & otherInfo() const { return m_szOtherInfo; }; - const QString & userMode() const { return m_szUserMode; }; - const QString & onConnectCommand() const { return m_szOnConnectCommand; }; - const QString & onLoginCommand() const { return m_szOnLoginCommand; }; - void setId(const QString &szId){ m_szId = szId; }; - void setNickName(const QString &szNickName){ m_szNickName = szNickName; }; - void setAltNickName1(const QString &szNickName){ m_szAltNickName1 = szNickName; }; - void setAltNickName2(const QString &szNickName){ m_szAltNickName2 = szNickName; }; - void setAltNickName3(const QString &szNickName){ m_szAltNickName3 = szNickName; }; - void setUserName(const QString &szUserName){ m_szUserName = szUserName; }; - void setRealName(const QString &szRealName){ m_szRealName = szRealName; }; - void setPassword(const QString &szPassword){ m_szPassword = szPassword; }; + const TQString & partMessage() const { return m_szPartMessage; }; + const TQString & quitMessage() const { return m_szQuitMessage; }; + const TQString & age() const { return m_szAge; }; + const TQString & gender() const { return m_szGender; }; + const TQString & location() const { return m_szLocation; }; + const TQString & languages() const { return m_szLanguages; }; + const TQString & otherInfo() const { return m_szOtherInfo; }; + const TQString & userMode() const { return m_szUserMode; }; + const TQString & onConnectCommand() const { return m_szOnConnectCommand; }; + const TQString & onLoginCommand() const { return m_szOnLoginCommand; }; + void setId(const TQString &szId){ m_szId = szId; }; + void setNickName(const TQString &szNickName){ m_szNickName = szNickName; }; + void setAltNickName1(const TQString &szNickName){ m_szAltNickName1 = szNickName; }; + void setAltNickName2(const TQString &szNickName){ m_szAltNickName2 = szNickName; }; + void setAltNickName3(const TQString &szNickName){ m_szAltNickName3 = szNickName; }; + void setUserName(const TQString &szUserName){ m_szUserName = szUserName; }; + void setRealName(const TQString &szRealName){ m_szRealName = szRealName; }; + void setPassword(const TQString &szPassword){ m_szPassword = szPassword; }; void setAvatar(const KviPixmap &pix){ m_pixAvatar = pix; }; - void setPartMessage(const QString &szMsg){ m_szPartMessage = szMsg; }; - void setQuitMessage(const QString &szMsg){ m_szQuitMessage = szMsg; }; - void setAge(const QString &szAge){ m_szAge = szAge; }; - void setGender(const QString &szGender){ m_szGender = szGender; }; - void setLocation(const QString &szLocation){ m_szLocation = szLocation; }; - void setLanguages(const QString &szLanguages){ m_szLanguages = szLanguages; }; - void setOtherInfo(const QString &szOtherInfo){ m_szOtherInfo = szOtherInfo; }; - void setUserMode(const QString &szUserMode){ m_szUserMode = szUserMode; }; - void setOnConnectCommand(const QString &szOnConnectCommand){ m_szOnConnectCommand = szOnConnectCommand; }; - void setOnLoginCommand(const QString &szOnLoginCommand){ m_szOnLoginCommand = szOnLoginCommand; }; + void setPartMessage(const TQString &szMsg){ m_szPartMessage = szMsg; }; + void setQuitMessage(const TQString &szMsg){ m_szQuitMessage = szMsg; }; + void setAge(const TQString &szAge){ m_szAge = szAge; }; + void setGender(const TQString &szGender){ m_szGender = szGender; }; + void setLocation(const TQString &szLocation){ m_szLocation = szLocation; }; + void setLanguages(const TQString &szLanguages){ m_szLanguages = szLanguages; }; + void setOtherInfo(const TQString &szOtherInfo){ m_szOtherInfo = szOtherInfo; }; + void setUserMode(const TQString &szUserMode){ m_szUserMode = szUserMode; }; + void setOnConnectCommand(const TQString &szOnConnectCommand){ m_szOnConnectCommand = szOnConnectCommand; }; + void setOnLoginCommand(const TQString &szOnLoginCommand){ m_szOnLoginCommand = szOnLoginCommand; }; protected: void copyFrom(const KviUserIdentity &src); bool save(KviConfig &cfg); @@ -120,26 +120,26 @@ protected: ~KviUserIdentityManager(); protected: static KviUserIdentityManager * m_pInstance; - KviPointerHashTable<QString,KviUserIdentity> * m_pIdentityDict; - QString m_szDefaultIdentity; + KviPointerHashTable<TQString,KviUserIdentity> * m_pIdentityDict; + TQString m_szDefaultIdentity; public: static void init(); static void done(); static KviUserIdentityManager * instance(){ return m_pInstance; }; - KviPointerHashTable<QString,KviUserIdentity> * identityDict(){ return m_pIdentityDict; }; - const KviUserIdentity * findIdentity(const QString &szId){ return m_pIdentityDict->find(szId); }; + KviPointerHashTable<TQString,KviUserIdentity> * identityDict(){ return m_pIdentityDict; }; + const KviUserIdentity * findIdentity(const TQString &szId){ return m_pIdentityDict->tqfind(szId); }; // NEVER NULL const KviUserIdentity * defaultIdentity(); - void setDefaultIdentity(const QString &szIdentityId){ m_szDefaultIdentity = szIdentityId; }; + void setDefaultIdentity(const TQString &szIdentityId){ m_szDefaultIdentity = szIdentityId; }; KviUserIdentityManager * createWorkingCopy(); void copyFrom(KviUserIdentityManager * pWorkingCopy); void releaseWorkingCopy(KviUserIdentityManager * pWorkingCopy); - void save(const QString &szFileName); - void load(const QString &szFileName); + void save(const TQString &szFileName); + void load(const TQString &szFileName); }; #endif //!_KVI_USERIDENTITY_H_ diff --git a/src/kvilib/irc/moc_kvi_ircuserdb.cpp b/src/kvilib/irc/moc_kvi_ircuserdb.cpp index 2b4d1482..92833beb 100644 --- a/src/kvilib/irc/moc_kvi_ircuserdb.cpp +++ b/src/kvilib/irc/moc_kvi_ircuserdb.cpp @@ -2,21 +2,21 @@ ** KviIrcUserDataBase meta object code from reading C++ file 'kvi_ircuserdb.h' ** ** Created: Sun Mar 23 20:56:18 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_ircuserdb.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviIrcUserDataBase::className() const @@ -24,96 +24,96 @@ const char *KviIrcUserDataBase::className() const return "KviIrcUserDataBase"; } -QMetaObject *KviIrcUserDataBase::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviIrcUserDataBase( "KviIrcUserDataBase", &KviIrcUserDataBase::staticMetaObject ); +TQMetaObject *KviIrcUserDataBase::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviIrcUserDataBase( "KviIrcUserDataBase", &KviIrcUserDataBase::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviIrcUserDataBase::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviIrcUserDataBase::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviIrcUserDataBase", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviIrcUserDataBase", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviIrcUserDataBase::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviIrcUserDataBase::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviIrcUserDataBase", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviIrcUserDataBase", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviIrcUserDataBase::staticMetaObject() +TQMetaObject* KviIrcUserDataBase::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUParameter param_slot_0[] = { - { 0, &static_QUType_QString, 0, QUParameter::In } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUParameter param_slot_0[] = { + { 0, &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod slot_0 = {"registeredUserRemoved", 1, param_slot_0 }; - static const QUParameter param_slot_1[] = { - { 0, &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod slot_0 = {"registeredUserRemoved", 1, param_slot_0 }; + static const TQUParameter param_slot_1[] = { + { 0, &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod slot_1 = {"registeredUserChanged", 1, param_slot_1 }; - static const QUParameter param_slot_2[] = { - { 0, &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod slot_1 = {"registeredUserChanged", 1, param_slot_1 }; + static const TQUParameter param_slot_2[] = { + { 0, &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod slot_2 = {"registeredUserAdded", 1, param_slot_2 }; - static const QUMethod slot_3 = {"registeredDatabaseCleared", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "registeredUserRemoved(const QString&)", &slot_0, QMetaData::Protected }, - { "registeredUserChanged(const QString&)", &slot_1, QMetaData::Protected }, - { "registeredUserAdded(const QString&)", &slot_2, QMetaData::Protected }, - { "registeredDatabaseCleared()", &slot_3, QMetaData::Protected } + static const TQUMethod slot_2 = {"registeredUserAdded", 1, param_slot_2 }; + static const TQUMethod slot_3 = {"registeredDatabaseCleared", 0, 0 }; + static const TQMetaData slot_tbl[] = { + { "registeredUserRemoved(const TQString&)", &slot_0, TQMetaData::Protected }, + { "registeredUserChanged(const TQString&)", &slot_1, TQMetaData::Protected }, + { "registeredUserAdded(const TQString&)", &slot_2, TQMetaData::Protected }, + { "registeredDatabaseCleared()", &slot_3, TQMetaData::Protected } }; - metaObj = QMetaObject::new_metaobject( - "KviIrcUserDataBase", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviIrcUserDataBase", tqparentObject, slot_tbl, 4, 0, 0, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviIrcUserDataBase.setMetaObject( metaObj ); return metaObj; } -void* KviIrcUserDataBase::qt_cast( const char* clname ) +void* KviIrcUserDataBase::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviIrcUserDataBase" ) ) return this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -bool KviIrcUserDataBase::qt_invoke( int _id, QUObject* _o ) +bool KviIrcUserDataBase::qt_invoke( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { - case 0: registeredUserRemoved((const QString&)static_QUType_QString.get(_o+1)); break; - case 1: registeredUserChanged((const QString&)static_QUType_QString.get(_o+1)); break; - case 2: registeredUserAdded((const QString&)static_QUType_QString.get(_o+1)); break; + case 0: registeredUserRemoved((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 1: registeredUserChanged((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 2: registeredUserAdded((const TQString&)static_TQUType_TQString.get(_o+1)); break; case 3: registeredDatabaseCleared(); break; default: - return QObject::qt_invoke( _id, _o ); + return TQObject::qt_invoke( _id, _o ); } return TRUE; } -bool KviIrcUserDataBase::qt_emit( int _id, QUObject* _o ) +bool KviIrcUserDataBase::qt_emit( int _id, TQUObject* _o ) { - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviIrcUserDataBase::qt_property( int id, int f, QVariant* v) +bool KviIrcUserDataBase::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviIrcUserDataBase::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviIrcUserDataBase::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/net/kvi_dns.cpp b/src/kvilib/net/kvi_dns.cpp index faa2e126..285c45e3 100644 --- a/src/kvilib/net/kvi_dns.cpp +++ b/src/kvilib/net/kvi_dns.cpp @@ -60,9 +60,9 @@ KviDnsResult::KviDnsResult() { m_iError = KviError_success; - m_pHostnameList = new KviPointerList<QString>; + m_pHostnameList = new KviPointerList<TQString>; m_pHostnameList->setAutoDelete(true); - m_pIpAddressList = new KviPointerList<QString>; + m_pIpAddressList = new KviPointerList<TQString>; m_pIpAddressList->setAutoDelete(true); } @@ -73,15 +73,15 @@ KviDnsResult::~KviDnsResult() delete m_pIpAddressList; } -void KviDnsResult::appendHostname(const QString &host) +void KviDnsResult::appendHostname(const TQString &host) { - m_pHostnameList->append(new QString(host)); + m_pHostnameList->append(new TQString(host)); } -void KviDnsResult::appendAddress(const QString &addr) +void KviDnsResult::appendAddress(const TQString &addr) { - m_pIpAddressList->append(new QString(addr)); + m_pIpAddressList->append(new TQString(addr)); } @@ -197,22 +197,22 @@ void KviDnsThread::run() } } else { dns->appendHostname(pHostEntry->h_name); - QString szIp; + TQString szIp; KviNetUtils::binaryIpToStringIp(* ((struct in_addr*)(pHostEntry->h_addr)),szIp); dns->appendAddress(szIp); int idx = 1; while(pHostEntry->h_addr_list[idx]) { - QString tmp; + TQString tmp; KviNetUtils::binaryIpToStringIp(* ((struct in_addr*)(pHostEntry->h_addr_list[idx])),tmp); if(tmp.hasData())dns->appendAddress(tmp); ++idx; } if(pHostEntry->h_aliases[0]) { - dns->appendHostname(QString::fromUtf8(pHostEntry->h_aliases[0])); - if(pHostEntry->h_aliases[1])dns->appendHostname(QString::fromUtf8(pHostEntry->h_aliases[1])); + dns->appendHostname(TQString::fromUtf8(pHostEntry->h_aliases[0])); + if(pHostEntry->h_aliases[1])dns->appendHostname(TQString::fromUtf8(pHostEntry->h_aliases[1])); } } @@ -293,12 +293,12 @@ void KviDnsThread::run() hints.ai_addr = 0; hints.ai_next = 0; - retVal = getaddrinfo(KviQString::toUtf8(m_szQuery).data(),0,&hints,&pRet); + retVal = getaddrinfo(KviTQString::toUtf8(m_szQuery).data(),0,&hints,&pRet); if(retVal != 0)dns->setError(translateDnsError(retVal)); else { - dns->appendHostname(pRet->ai_canonname ? QString::fromUtf8(pRet->ai_canonname) : m_szQuery); - QString szIp; + dns->appendHostname(pRet->ai_canonname ? TQString::fromUtf8(pRet->ai_canonname) : m_szQuery); + TQString szIp; #ifdef COMPILE_IPV6_SUPPORT if(pRet->ai_family == PF_INET6)KviNetUtils::binaryIpToStringIp_V6(((sockaddr_in6 *)(pRet->ai_addr))->sin6_addr,szIp); else { @@ -312,7 +312,7 @@ void KviDnsThread::run() pNext = pRet->ai_next; while(pNext) { - QString tmp; + TQString tmp; #ifdef COMPILE_IPV6_SUPPORT if(pNext->ai_family == PF_INET6)KviNetUtils::binaryIpToStringIp_V6(((sockaddr_in6 *)(pNext->ai_addr))->sin6_addr,tmp); else { @@ -326,7 +326,7 @@ void KviDnsThread::run() if(pNext->ai_canonname) { // FIXME: only of not equal to other names ? - dns->appendHostname(QString::fromUtf8(pNext->ai_canonname)); + dns->appendHostname(TQString::fromUtf8(pNext->ai_canonname)); } pNext = pNext->ai_next; @@ -350,7 +350,7 @@ void KviDnsThread::run() KviDns::KviDns() -: QObject() +: TQObject() { m_pSlaveThread = new KviDnsThread(this); m_pDnsResult = new KviDnsResult(); @@ -372,10 +372,10 @@ bool KviDns::isRunning() const return (m_state == Busy); }; -bool KviDns::lookup(const QString &query,QueryType type) +bool KviDns::lookup(const TQString &query,QueryType type) { if(m_state == Busy)return false; - m_pSlaveThread->setQuery(KviQString::trimmed(query),type); + m_pSlaveThread->setQuery(KviTQString::trimmed(query),type); bool bStarted = m_pSlaveThread->start(); m_state = bStarted ? Busy : Failure; return bStarted; @@ -393,12 +393,12 @@ KviDnsResult * KviDns::result() return m_pDnsResult; } -KviPointerList<QString> * KviDns::hostnameList() +KviPointerList<TQString> * KviDns::hostnameList() { return result()->hostnameList(); } -KviPointerList<QString> * KviDns::ipAddressList() +KviPointerList<TQString> * KviDns::ipAddressList() { return result()->ipAddressList(); } @@ -413,26 +413,26 @@ int KviDns::ipAddressCount() return result()->ipAddressList()->count(); } -const QString & KviDns::firstHostname() +const TQString & KviDns::firstHostname() { - QString * pStr = result()->hostnameList()->first(); + TQString * pStr = result()->hostnameList()->first(); if(pStr)return *pStr; - return KviQString::empty; + return KviTQString::empty; } -const QString & KviDns::firstIpAddress() +const TQString & KviDns::firstIpAddress() { - QString * pStr = result()->ipAddressList()->first(); + TQString * pStr = result()->ipAddressList()->first(); if(pStr)return *pStr; - return KviQString::empty; + return KviTQString::empty; } -const QString & KviDns::query() +const TQString & KviDns::query() { return result()->query(); } -bool KviDns::event(QEvent *e) +bool KviDns::event(TQEvent *e) { if(e->type() == KVI_THREAD_EVENT) { @@ -445,6 +445,6 @@ bool KviDns::event(QEvent *e) return true; } // else ops... unknown thread event ? } - return QObject::event(e); + return TQObject::event(e); } diff --git a/src/kvilib/net/kvi_dns.h b/src/kvilib/net/kvi_dns.h index 3f423c24..70dbf8c1 100644 --- a/src/kvilib/net/kvi_dns.h +++ b/src/kvilib/net/kvi_dns.h @@ -44,29 +44,30 @@ public: ~KviDnsResult(); protected: int m_iError; - KviPointerList<QString> * m_pHostnameList; - KviPointerList<QString> * m_pIpAddressList; - QString m_szQuery; + KviPointerList<TQString> * m_pHostnameList; + KviPointerList<TQString> * m_pIpAddressList; + TQString m_szQuery; public: int error(){ return m_iError; }; // never store nor delete these pointers! // (these are NEVER 0) - KviPointerList<QString> * hostnameList(){ return m_pHostnameList; }; - KviPointerList<QString> * ipAddressList(){ return m_pIpAddressList; }; - const QString &query(){ return m_szQuery; }; + KviPointerList<TQString> * hostnameList(){ return m_pHostnameList; }; + KviPointerList<TQString> * ipAddressList(){ return m_pIpAddressList; }; + const TQString &query(){ return m_szQuery; }; protected: void setError(int iError){ m_iError = iError; }; - void setQuery(const QString &query){ m_szQuery = query; }; - void appendHostname(const QString &host); - void appendAddress(const QString &addr); + void setQuery(const TQString &query){ m_szQuery = query; }; + void appendHostname(const TQString &host); + void appendAddress(const TQString &addr); }; -class KVILIB_API KviDns : public QObject, public KviHeapObject +class KVILIB_API KviDns : public TQObject, public KviHeapObject { Q_OBJECT - Q_PROPERTY(bool blockingDelete READ isRunning) + TQ_OBJECT + TQ_PROPERTY(bool blockingDelete READ isRunning) public: KviDns(); ~KviDns(); @@ -85,27 +86,27 @@ public: // // Lookup start - bool lookup(const QString &szQuery,QueryType type); + bool lookup(const TQString &szQuery,QueryType type); // Current object state State state(){ return m_state; }; // Results (return always non null-data..but valid results only if state() == Success or Failure) int error(); - const QString & firstHostname(); - const QString & firstIpAddress(); + const TQString & firstHostname(); + const TQString & firstIpAddress(); int hostnameCount(); int ipAddressCount(); - KviPointerList<QString> * hostnameList(); - KviPointerList<QString> * ipAddressList(); - const QString & query(); + KviPointerList<TQString> * hostnameList(); + KviPointerList<TQString> * ipAddressList(); + const TQString & query(); bool isRunning() const; // Auxiliary data store void setAuxData(void * pAuxData){ m_pAuxData = pAuxData; }; void * releaseAuxData(){ void * pData = m_pAuxData; m_pAuxData = 0; return pData; }; protected: - virtual bool event(QEvent *e); + virtual bool event(TQEvent *e); private: KviDnsResult * result(); signals: @@ -127,11 +128,11 @@ protected: KviDnsThread(KviDns * pDns); ~KviDnsThread(); protected: - QString m_szQuery; + TQString m_szQuery; KviDns::QueryType m_queryType; KviDns * m_pParentDns; public: - void setQuery(const QString &query,KviDns::QueryType type){ m_szQuery = query; m_queryType = type; }; + void setQuery(const TQString &query,KviDns::QueryType type){ m_szQuery = query; m_queryType = type; }; protected: virtual void run(); int translateDnsError(int iErr); diff --git a/src/kvilib/net/kvi_http.cpp b/src/kvilib/net/kvi_http.cpp index 2e94abbe..07a69658 100644 --- a/src/kvilib/net/kvi_http.cpp +++ b/src/kvilib/net/kvi_http.cpp @@ -25,8 +25,8 @@ #define __KVILIB__ -#include <qdir.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqtimer.h> //#include <zlib.h> #include "kvi_http.h" @@ -46,7 +46,7 @@ #define KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT (KVI_THREAD_USER_EVENT_BASE + 0xCAFF) KviHttpRequest::KviHttpRequest() -: QObject() +: TQObject() { m_pDns = 0; m_pThread = 0; @@ -55,24 +55,24 @@ KviHttpRequest::KviHttpRequest() m_bHeaderProcessed = false; m_pBuffer = new KviDataBuffer(); - resetStatus(); + resettqStatus(); resetData(); } KviHttpRequest::~KviHttpRequest() { - resetInternalStatus(); + resetInternaltqStatus(); delete m_pBuffer; } void KviHttpRequest::abort() { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Aborted"); emit terminated(false); } -void KviHttpRequest::resetInternalStatus() +void KviHttpRequest::resetInternaltqStatus() { if(m_pThread)delete m_pThread; if(m_pDns)delete m_pDns; @@ -91,7 +91,7 @@ void KviHttpRequest::resetInternalStatus() KviThreadManager::killPendingEvents(this); } -void KviHttpRequest::resetStatus() +void KviHttpRequest::resettqStatus() { m_szLastError = __tr2qs("No request"); m_uTotalSize = 0; @@ -114,12 +114,12 @@ void KviHttpRequest::resetData() void KviHttpRequest::reset() { - resetStatus(); + resettqStatus(); resetData(); - resetInternalStatus(); + resetInternaltqStatus(); } -bool KviHttpRequest::get(const KviUrl &u,ProcessingType p,const QString &szFileName) +bool KviHttpRequest::get(const KviUrl &u,ProcessingType p,const TQString &szFileName) { reset(); setUrl(u); @@ -131,8 +131,8 @@ bool KviHttpRequest::get(const KviUrl &u,ProcessingType p,const QString &szFileN bool KviHttpRequest::start() { // ensure that the file is closed - resetInternalStatus(); - resetStatus(); + resetInternaltqStatus(); + resettqStatus(); if(m_eProcessingType == StoreToFile) { @@ -148,7 +148,7 @@ bool KviHttpRequest::start() if(KviFile::exists(m_szFileName)) { // we check it - QFileInfo fi(m_szFileName); + TQFileInfo fi(m_szFileName); m_uContentOffset = fi.size(); } } @@ -156,22 +156,22 @@ bool KviHttpRequest::start() if(m_url.host().isEmpty()) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Invalid URL: Missing hostname"); return false; } if((!kvi_strEqualCI(m_url.protocol().ptr(),"http")) && (!kvi_strEqualCI(m_url.protocol().ptr(),"https"))) { - resetInternalStatus(); - m_szLastError=__tr2qs("Unsupported protocol %1").arg(m_url.protocol().ptr()); + resetInternaltqStatus(); + m_szLastError=__tr2qs("Unsupported protocol %1").tqarg(m_url.protocol().ptr()); return false; } if(kvi_isValidStringIp(m_url.host().ptr())) { m_szIp = m_url.host(); - QTimer::singleShot(10,this,SLOT(haveServerIp())); + TQTimer::singleShot(10,this,TQT_SLOT(haveServerIp())); return true; } @@ -181,20 +181,20 @@ bool KviHttpRequest::start() bool KviHttpRequest::startDnsLookup() { m_pDns = new KviDns(); - connect(m_pDns,SIGNAL(lookupDone(KviDns *)),this,SLOT(dnsLookupDone(KviDns *))); + connect(m_pDns,TQT_SIGNAL(lookupDone(KviDns *)),this,TQT_SLOT(dnsLookupDone(KviDns *))); if(!m_pDns->lookup(m_url.host().ptr(),KviDns::IpV4)) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Unable to start the DNS lookup"); return false; } - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Looking up host %s"),m_url.host().ptr()); + TQString tmp; + KviTQString::sprintf(tmp,__tr2qs("Looking up host %s"),m_url.host().ptr()); emit status(tmp); // FIXME - emit resolvingHost(QString(m_url.host().ptr())); + emit resolvingHost(TQString(m_url.host().ptr())); return true; } @@ -206,13 +206,13 @@ void KviHttpRequest::dnsLookupDone(KviDns *d) m_szIp = d->firstIpAddress(); delete m_pDns; m_pDns = 0; - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Host %s resolved to %Q"),m_url.host().ptr(),&m_szIp); + TQString tmp; + KviTQString::sprintf(tmp,__tr2qs("Host %s resolved to %Q"),m_url.host().ptr(),&m_szIp); emit status(tmp); haveServerIp(); } else { int iErr = d->error(); - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = KviError::getDescription(iErr); emit terminated(false); } @@ -223,8 +223,8 @@ void KviHttpRequest::haveServerIp() unsigned short uPort = m_url.port(); if(uPort == 0)uPort = 80; - QString tmp; - KviQString::sprintf(tmp,"%Q:%u",&m_szIp,uPort); + TQString tmp; + KviTQString::sprintf(tmp,"%Q:%u",&m_szIp,uPort); emit contactingHost(tmp); if(m_pThread)delete m_pThread; @@ -242,17 +242,17 @@ void KviHttpRequest::haveServerIp() if(!m_pThread->start()) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Unable to start the request slave thread"); emit terminated(false); return; } - KviQString::sprintf(tmp,__tr2qs("Contacting host %Q on port %u"),&m_szIp,uPort); + KviTQString::sprintf(tmp,__tr2qs("Contacting host %Q on port %u"),&m_szIp,uPort); emit status(tmp); } -bool KviHttpRequest::event(QEvent *e) +bool KviHttpRequest::event(TQEvent *e) { if(e->type() == KVI_THREAD_EVENT) { @@ -273,11 +273,11 @@ bool KviHttpRequest::event(QEvent *e) break; case KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT: { - QString * req = ((KviThreadDataEvent<QString> *)e)->getData(); + TQString * req = ((KviThreadDataEvent<TQString> *)e)->getData(); #ifdef COMPILE_USE_QT4 - QStringList sl = req->split("\r\n"); + TQStringList sl = req->split("\r\n"); #else - QStringList sl = QStringList::split("\r\n",*req); + TQStringList sl = TQStringList::split("\r\n",*req); #endif emit requestSent(sl); delete req; @@ -318,7 +318,7 @@ bool KviHttpRequest::event(QEvent *e) // nothing... just make gcc happy break; } - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Success"); emit terminated(true); return true; @@ -328,7 +328,7 @@ bool KviHttpRequest::event(QEvent *e) KviStr * err = ((KviThreadDataEvent<KviStr> *)e)->getData(); m_szLastError = __tr2qs_no_xgettext(err->ptr()); delete err; - resetInternalStatus(); + resetInternaltqStatus(); emit terminated(false); return true; } @@ -343,24 +343,24 @@ bool KviHttpRequest::event(QEvent *e) break; } } - return QObject::event(e); + return TQObject::event(e); } void KviHttpRequest::emitLines(KviDataBuffer * pDataBuffer) { - int idx = pDataBuffer->find((const unsigned char *)"\n",1); + int idx = pDataBuffer->tqfind((const unsigned char *)"\n",1); while(idx != -1) { KviStr tmp((const char *)(m_pBuffer->data()),idx); tmp.stripRight('\r'); pDataBuffer->remove(idx + 1); - idx = pDataBuffer->find((const unsigned char *)"\n",1); + idx = pDataBuffer->tqfind((const unsigned char *)"\n",1); emit data(tmp); } } // header += "Accept: "; -// QString acceptHeader = metaData("accept"); +// TQString acceptHeader = metaData("accept"); // if (!acceptHeader.isEmpty()) // header += acceptHeader; // else @@ -406,26 +406,26 @@ bool KviHttpRequest::openFile() case RenameIncoming: { int i=0; - QString tmp = m_szFileName; + TQString tmp = m_szFileName; do { i++; - m_szFileName = tmp + QString(".kvirnm-%1").arg(i); + m_szFileName = tmp + TQString(".kvirnm-%1").tqarg(i); } while(KviFile::exists(m_szFileName)); } break; case RenameExisting: { int i=0; - QString tmp; + TQString tmp; do { i++; - tmp = m_szFileName + QString(".kvirnm-%1").arg(i); + tmp = m_szFileName + TQString(".kvirnm-%1").tqarg(i); } while(KviFile::exists(tmp)); - QDir d; + TQDir d; if(!d.rename(m_szFileName,tmp)) { // fail :( - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Failed to rename the existing file, please rename manually and retry"); emit terminated(false); return false; @@ -443,8 +443,8 @@ bool KviHttpRequest::openFile() if(!m_pFile->openForWriting(bAppend)) { - resetInternalStatus(); - KviQString::sprintf(m_szLastError,__tr2qs("Can't open file \"%Q\" for writing"),&m_szFileName); + resetInternaltqStatus(); + KviTQString::sprintf(m_szLastError,__tr2qs("Can't open file \"%Q\" for writing"),&m_szFileName); emit terminated(false); return false; } @@ -473,7 +473,7 @@ bool KviHttpRequest::processHeader(KviStr &szHeader) bool bValid = false; - unsigned int uStatus = 0; + unsigned int utqStatus = 0; // check the response value if(kvi_strEqualCSN(szResponse.ptr(),"HTTP",4)) @@ -486,24 +486,24 @@ bool KviHttpRequest::processHeader(KviStr &szHeader) if(idx != -1)szNumber = szR.left(idx); else szNumber = szR; bool bOk; - uStatus = szNumber.toUInt(&bOk); + utqStatus = szNumber.toUInt(&bOk); if(bOk)bValid = true; } if(!bValid) { // the response is invalid ? - resetInternalStatus(); - m_szLastError=__tr2qs("Invalid HTTP response: %s").arg(szResponse.ptr()); + resetInternaltqStatus(); + m_szLastError=__tr2qs("Invalid HTTP response: %s").tqarg(szResponse.ptr()); emit terminated(false); return false; } - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Received HTTP response: %s"),szResponse.ptr()); + TQString tmp; + KviTQString::sprintf(tmp,__tr2qs("Received HTTP response: %s"),szResponse.ptr()); emit status(tmp); - emit receivedResponse(QString(szResponse.ptr())); + emit receivedResponse(TQString(szResponse.ptr())); KviPointerList<KviStr> hlist; hlist.setAutoDelete(true); @@ -531,12 +531,12 @@ bool KviHttpRequest::processHeader(KviStr &szHeader) KviStr szName = s->left(idx); s->cutLeft(idx + 1); s->stripWhiteSpace(); - hdr.replace(szName.ptr(),new KviStr(*s)); + hdr.tqreplace(szName.ptr(),new KviStr(*s)); //debug("FOUND HEADER (%s)=(%s)",szName.ptr(),s->ptr()); } } - KviStr * size = hdr.find("Content-length"); + KviStr * size = hdr.tqfind("Content-length"); if(size) { bool bOk; @@ -544,13 +544,13 @@ bool KviHttpRequest::processHeader(KviStr &szHeader) if(!bOk)m_uTotalSize = 0; } - KviStr * contentEncoding = hdr.find("Content-encoding"); + KviStr * contentEncoding = hdr.tqfind("Content-encoding"); if(contentEncoding) { m_bGzip = contentEncoding->equalsCI("gzip"); } - KviStr * transferEncoding = hdr.find("Transfer-Encoding"); + KviStr * transferEncoding = hdr.tqfind("Transfer-Encoding"); if(transferEncoding) { if(kvi_strEqualCI(transferEncoding->ptr(),"chunked")) @@ -608,14 +608,14 @@ bool KviHttpRequest::processHeader(KviStr &szHeader) // case 504: // Gateway timeout // case 505: // HTTP Version not supported - if((uStatus != 200) && (uStatus != 206)) + if((utqStatus != 200) && (utqStatus != 206)) { // this is not "OK" and not "Partial content" // Error , redirect or something confusing if(m_eProcessingType != HeadersOnly) { // this is an error then - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = szResponse.ptr(); emit terminated(false); return false; @@ -624,7 +624,7 @@ bool KviHttpRequest::processHeader(KviStr &szHeader) if((m_uMaxContentLength > 0) && (m_uTotalSize > ((unsigned int)m_uMaxContentLength))) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError=__tr2qs("Stream exceeding maximum length"); emit terminated(false); return false; @@ -651,13 +651,13 @@ void KviHttpRequest::processData(KviDataBuffer * data) // time to process the header m_pBuffer->append(*data); - int idx = m_pBuffer->find((const unsigned char *)"\r\n\r\n",4); + int idx = m_pBuffer->tqfind((const unsigned char *)"\r\n\r\n",4); if(idx == -1) { // header not complete if(m_pBuffer->size() > 4096) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Header too long: exceeded 4096 bytes"); emit terminated(false); } @@ -706,7 +706,7 @@ void KviHttpRequest::processData(KviDataBuffer * data) if(((m_uTotalSize > 0) && (m_uReceivedSize > m_uTotalSize)) || ((m_uMaxContentLength > 0) && (m_uReceivedSize > m_uMaxContentLength))) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError=__tr2qs("Stream exceeded expected length"); emit terminated(false); } @@ -721,7 +721,7 @@ void KviHttpRequest::processData(KviDataBuffer * data) // we're processing data in m_pBuffer here if(m_bChunkedTransferEncoding) { - // The transfer encoding is chunked: the buffer contains + // The transfer encoding is chunked: the buffer tqcontains // chunks of data with an initial header composed // of a hexadecimal length, an optional bullshit and a single CRLF // The transfer terminates when we read a last chunk of size 0 @@ -776,7 +776,7 @@ void KviHttpRequest::processData(KviDataBuffer * data) // We're looking for the beginning of a chunk now. // Note that we might be at the end of a previous chunk that has a CRLF terminator // we need to skip it. - int crlf = m_pBuffer->find((const unsigned char *)"\r\n",2); + int crlf = m_pBuffer->tqfind((const unsigned char *)"\r\n",2); if(crlf != -1) { if(crlf == 0) @@ -789,12 +789,12 @@ void KviHttpRequest::processData(KviDataBuffer * data) KviStr szHeader((const char *)(m_pBuffer->data()),crlf); szHeader.cutFromFirst(' '); // now szHeader should contain a hexadecimal chunk length... (why the hell it is hex and not decimal ????) - QString szHexHeader = szHeader.ptr(); + TQString szHexHeader = szHeader.ptr(); bool bOk; m_uRemainingChunkSize = szHexHeader.toLong(&bOk,16); if(!bOk) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Protocol error: invalid chunk size"); emit terminated(false); return; @@ -814,7 +814,7 @@ void KviHttpRequest::processData(KviDataBuffer * data) // chunk header not complete if(m_pBuffer->size() > 4096) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError = __tr2qs("Chunk header too long: exceeded 4096 bytes"); emit terminated(false); return; @@ -848,7 +848,7 @@ check_stream_length: if(((m_uTotalSize > 0) && (m_uReceivedSize > m_uTotalSize)) || ((m_uMaxContentLength > 0) && (m_uReceivedSize > m_uMaxContentLength))) { - resetInternalStatus(); + resetInternaltqStatus(); m_szLastError=__tr2qs("Stream exceeded expected length"); emit terminated(false); } @@ -872,13 +872,13 @@ check_stream_length: KviHttpRequestThread::KviHttpRequestThread( KviHttpRequest * r, - const QString &szHost, - const QString &szIp, + const TQString &szHost, + const TQString &szIp, unsigned short uPort, - const QString & szPath, + const TQString & szPath, unsigned int uContentOffset, RequestMethod m, - const QString &szPostData, + const TQString &szPostData, bool bUseSSL ) : KviSensitiveThread() { @@ -1403,7 +1403,7 @@ void KviHttpRequestThread::runInternal() "Connection: Close\r\n" \ "User-Agent: KVIrc-http-slave/1.0.0\r\n" \ "Accept: */*\r\n", - szMethod.ptr(),KviQString::toUtf8(m_szPath).data(),KviQString::toUtf8(m_szHost).data()); + szMethod.ptr(),KviTQString::toUtf8(m_szPath).data(),KviTQString::toUtf8(m_szHost).data()); if(m_uContentOffset > 0) szRequest.append(KviStr::Format,"Range: bytes=%u-\r\n",m_uContentOffset); @@ -1430,7 +1430,7 @@ void KviHttpRequestThread::runInternal() if(!sendBuffer(szRequest.ptr(),szRequest.len(),60))return; // now loop reading data - postEvent(m_pRequest,new KviThreadDataEvent<QString>(KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT,new QString(szRequest))); + postEvent(m_pRequest,new KviThreadDataEvent<TQString>(KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT,new TQString(szRequest))); for(;;) { diff --git a/src/kvilib/net/kvi_http.h b/src/kvilib/net/kvi_http.h index 1bd6a9d9..de4457d8 100644 --- a/src/kvilib/net/kvi_http.h +++ b/src/kvilib/net/kvi_http.h @@ -33,10 +33,10 @@ #include "kvi_inttypes.h" #include "kvi_url.h" -#include <qobject.h> +#include <tqobject.h> #include "kvi_pointerhashtable.h" #include "kvi_file.h" -#include <qstringlist.h> +#include <tqstringlist.h> class KviDns; class KviSSL; @@ -45,12 +45,13 @@ class KviHttpRequestThread; // // This class implements a HTTP protocol client. // It's able to send GET, POST and HEAD requests, -// download stuff to a file or to a qt SLOT(). +// download stuff to a file or to a qt TQT_SLOT(). // -class KVILIB_API KviHttpRequest : public QObject, public KviHeapObject +class KVILIB_API KviHttpRequest : public TQObject, public KviHeapObject { Q_OBJECT + TQ_OBJECT public: enum ProcessingType { @@ -73,19 +74,19 @@ public: protected: // data KviUrl m_url; - QString m_szFileName; + TQString m_szFileName; ProcessingType m_eProcessingType; ExistingFileAction m_eExistingFileAction; void * m_pPrivateData; unsigned int m_uMaxContentLength; unsigned int m_uContentOffset; - QString m_szPostData; + TQString m_szPostData; // status - QString m_szLastError; + TQString m_szLastError; unsigned int m_uTotalSize; unsigned int m_uReceivedSize; // internal status - QString m_szIp; + TQString m_szIp; KviDns * m_pDns; KviHttpRequestThread * m_pThread; KviDataBuffer * m_pBuffer; @@ -97,15 +98,15 @@ protected: KviFile * m_pFile; protected: bool startDnsLookup(); - virtual bool event(QEvent *e); + virtual bool event(TQEvent *e); void processData(KviDataBuffer * data); bool processHeader(KviStr &szHeader); bool openFile(); void emitLines(KviDataBuffer * pDataBuffer); - void resetStatus(); + void resettqStatus(); void resetData(); - void resetInternalStatus(); + void resetInternaltqStatus(); protected slots: void dnsLookupDone(KviDns *d); void haveServerIp(); @@ -113,7 +114,7 @@ public: const KviUrl & url(){ return m_url; }; ProcessingType processingType(){ return m_eProcessingType; }; ExistingFileAction existingFileAction(){ return m_eExistingFileAction; }; - const QString &fileName(){ return m_szFileName; }; + const TQString &fileName(){ return m_szFileName; }; void * privateData(){ return m_pPrivateData; }; unsigned int maxContentLength(){ return m_uMaxContentLength; }; unsigned int contentOffset(){ return m_uContentOffset; }; @@ -122,11 +123,11 @@ public: void reset(); - void setPostData(const QString &szPostData){ m_szPostData = szPostData; }; + void setPostData(const TQString &szPostData){ m_szPostData = szPostData; }; void setUrl(const KviUrl &u){ m_url = u; }; void setProcessingType(ProcessingType t){ m_eProcessingType = t; }; void setExistingFileAction(ExistingFileAction a){ m_eExistingFileAction = a; }; - void setFileName(const QString &szFileName){ m_szFileName = szFileName; }; + void setFileName(const TQString &szFileName){ m_szFileName = szFileName; }; void setPrivateData(void * ptr){ m_pPrivateData = ptr; }; void setMaxContentLength(int uMaxContentLength){ m_uMaxContentLength = uMaxContentLength; }; //0 means unlimited // this will work regardless of ExistingFileAction : even if the file doesn't exist @@ -135,25 +136,25 @@ public: bool start(); // this is a shortcut for reset()+setUrl()+setProcessingType()+setFileName()+start() - bool get(const KviUrl &u,ProcessingType p = WholeFile,const QString &szFileName = QString::null); + bool get(const KviUrl &u,ProcessingType p = WholeFile,const TQString &szFileName = TQString()); - const QString & lastError(){ return m_szLastError; }; + const TQString & lastError(){ return m_szLastError; }; void abort(); signals: - void resolvingHost(const QString &hostname); - void contactingHost(const QString &ipandport); + void resolvingHost(const TQString &hostname); + void contactingHost(const TQString &ipandport); void connectionEstabilished(); - void receivedResponse(const QString &response); + void receivedResponse(const TQString &response); void terminated(bool bSuccess); - void status(const QString &message); + void status(const TQString &message); void data(const KviStr &data); void binaryData(const KviDataBuffer &data); void header(KviPointerHashTable<const char *,KviStr> * hdr); - void requestSent(const QStringList &request); + void requestSent(const TQStringList &request); }; @@ -164,13 +165,13 @@ public: enum RequestMethod { Post, Get , Head }; protected: KviHttpRequestThread(KviHttpRequest * r, - const QString &szHost, - const QString &szIp, + const TQString &szHost, + const TQString &szIp, unsigned short uPort, - const QString &szPath, + const TQString &szPath, unsigned int uContentOffset, RequestMethod m, - const QString &szPostData = QString::null, + const TQString &szPostData = TQString(), bool bUseSSL = false); public: @@ -178,12 +179,12 @@ public: protected: KviHttpRequest * m_pRequest; - QString m_szHost; - QString m_szIp; - QString m_szPath; + TQString m_szHost; + TQString m_szIp; + TQString m_szPath; unsigned int m_uContentOffset; RequestMethod m_eRequestMethod; - QString m_szPostData; + TQString m_szPostData; unsigned short m_uPort; kvi_socket_t m_sock; diff --git a/src/kvilib/net/kvi_netutils.cpp b/src/kvilib/net/kvi_netutils.cpp index 0cdb8b02..3ff5d9b0 100644 --- a/src/kvilib/net/kvi_netutils.cpp +++ b/src/kvilib/net/kvi_netutils.cpp @@ -61,7 +61,7 @@ #include "kvi_netutils.h" #include "kvi_memmove.h" -#include <qstringlist.h> +#include <tqstringlist.h> #ifndef COMPILE_ON_WINDOWS @@ -318,7 +318,7 @@ bool kvi_stringIpToBinaryIp(const char *szIp,struct in_addr *address) -bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer) +bool kvi_binaryIpToStringIp(struct in_addr in,TQString &szBuffer) { @@ -346,7 +346,7 @@ bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer) -bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer) +bool kvi_binaryIpToStringIp(struct in_addr in,TQString &szBuffer) { @@ -886,7 +886,7 @@ bool kvi_isValidStringIp_V6(const char *szIp) -bool kvi_binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer) +bool kvi_binaryIpToStringIp_V6(struct in6_addr in,TQString &szBuffer) { @@ -952,12 +952,12 @@ namespace KviNetUtils { - bool stringIpToBinaryIp(const QString &szStringIp,struct in_addr * address) + bool stringIpToBinaryIp(const TQString &szStringIp,struct in_addr * address) { #ifndef HAVE_INET_ATON - QString szAddr = szStringIp.simplifyWhiteSpace(); - Q_UINT32 iAddr=0; - QStringList ipv4 = QStringList::split(".", szAddr, FALSE); + TQString szAddr = szStringIp.simplifyWhiteSpace(); + TQ_UINT32 iAddr=0; + TQStringList ipv4 = TQStringList::split(".", szAddr, FALSE); if (ipv4.count() == 4) { int i = 0; bool ok = TRUE; @@ -978,12 +978,12 @@ namespace KviNetUtils return FALSE; #else //HAVE_INET_ATON if(szStringIp.isEmpty())return false; - return (inet_aton(KviQString::toUtf8(szStringIp).data(),address) != 0); + return (inet_aton(KviTQString::toUtf8(szStringIp).data(),address) != 0); #endif //HAVE_INET_ATON } - bool isValidStringIp(const QString &szIp) + bool isValidStringIp(const TQString &szIp) { @@ -1001,17 +1001,17 @@ namespace KviNetUtils #ifdef COMPILE_IPV6_SUPPORT - bool stringIpToBinaryIp_V6(const QString &szStringIp,struct in6_addr * address) + bool stringIpToBinaryIp_V6(const TQString &szStringIp,struct in6_addr * address) { - return (inet_pton(AF_INET6,KviQString::toUtf8(szStringIp).data(),(void *)address) == 1); + return (inet_pton(AF_INET6,KviTQString::toUtf8(szStringIp).data(),(void *)address) == 1); } - bool isValidStringIp_V6(const QString &szIp) + bool isValidStringIp_V6(const TQString &szIp) { @@ -1023,7 +1023,7 @@ namespace KviNetUtils } - bool binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer) + bool binaryIpToStringIp_V6(struct in6_addr in,TQString &szBuffer) { char buf[46]; bool bRet = inet_ntop(AF_INET6,(void *)&in,buf,46); @@ -1036,7 +1036,7 @@ namespace KviNetUtils - bool binaryIpToStringIp(struct in_addr in,QString &szBuffer) + bool binaryIpToStringIp(struct in_addr in,TQString &szBuffer) { @@ -1052,7 +1052,7 @@ namespace KviNetUtils - bool isRoutableIpString(const QString &szIpString) + bool isRoutableIpString(const TQString &szIpString) { @@ -1100,7 +1100,7 @@ namespace KviNetUtils - bool getInterfaceAddress(const QString &szInterfaceName,QString &szBuffer) + bool getInterfaceAddress(const TQString &szInterfaceName,TQString &szBuffer) { @@ -1118,7 +1118,7 @@ namespace KviNetUtils - kvi_memmove(ifr.ifr_name,KviQString::toUtf8(szInterfaceName).data(),len + 1); + kvi_memmove(ifr.ifr_name,KviTQString::toUtf8(szInterfaceName).data(),len + 1); @@ -1158,7 +1158,7 @@ namespace KviNetUtils - void formatNetworkBandwidthString(QString &szBuffer,unsigned int uBytesPerSec) + void formatNetworkBandwidthString(TQString &szBuffer,unsigned int uBytesPerSec) { @@ -1170,7 +1170,7 @@ namespace KviNetUtils unsigned int uRem = ((uBytesPerSec % (1024 * 1024)) * 100) / (1024 * 1024); - KviQString::sprintf(szBuffer,"%u.%u%u MB/s",uMB,uRem / 10,uRem % 10); + KviTQString::sprintf(szBuffer,"%u.%u%u MB/s",uMB,uRem / 10,uRem % 10); return; @@ -1184,13 +1184,13 @@ namespace KviNetUtils unsigned int uRem = ((uBytesPerSec % 1024) * 100) / 1024; - KviQString::sprintf(szBuffer,"%u.%u%u KB/s",uKB,uRem / 10,uRem % 10); + KviTQString::sprintf(szBuffer,"%u.%u%u KB/s",uKB,uRem / 10,uRem % 10); return; } - KviQString::sprintf(szBuffer,"%u B/s",uBytesPerSec); + KviTQString::sprintf(szBuffer,"%u B/s",uBytesPerSec); } @@ -1202,15 +1202,15 @@ namespace KviNetUtils -bool kvi_getInterfaceAddress(const char * ifname,QString &buffer) +bool kvi_getInterfaceAddress(const char * ifname,TQString &buffer) { debug("kvi_getInterfaceAddress is deprecated: use KviNetUtils::getInterfaceAddress"); - QString szRet; + TQString szRet; - bool bRes = KviNetUtils::getInterfaceAddress(QString(ifname),szRet); + bool bRes = KviNetUtils::getInterfaceAddress(TQString(ifname),szRet); buffer = szRet; @@ -1268,7 +1268,7 @@ bool kvi_isRoutableIp(const char * ipaddr) -bool kvi_getLocalHostAddress(QString &buffer) +bool kvi_getLocalHostAddress(TQString &buffer) { @@ -1282,7 +1282,7 @@ bool kvi_getLocalHostAddress(QString &buffer) if(!h)return false; - QString tmp; + TQString tmp; int i=0; @@ -1466,7 +1466,7 @@ kvi_u32_t KviSockaddr::port() -bool KviSockaddr::getStringAddress(QString &szBuffer) +bool KviSockaddr::getStringAddress(TQString &szBuffer) { diff --git a/src/kvilib/net/kvi_netutils.h b/src/kvilib/net/kvi_netutils.h index b43326f0..99e4bff8 100644 --- a/src/kvilib/net/kvi_netutils.h +++ b/src/kvilib/net/kvi_netutils.h @@ -49,12 +49,12 @@ KVILIB_API extern bool kvi_isValidStringIp(const char * szIp); KVILIB_API extern bool kvi_stringIpToBinaryIp(const char * szIp,struct in_addr * address); -KVILIB_API extern bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer); +KVILIB_API extern bool kvi_binaryIpToStringIp(struct in_addr in,TQString &szBuffer); #ifdef COMPILE_IPV6_SUPPORT KVILIB_API extern bool kvi_isValidStringIp_V6(const char * szIp); KVILIB_API extern bool kvi_stringIpToBinaryIp_V6(const char * szIp,struct in6_addr * address); - KVILIB_API extern bool kvi_binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer); + KVILIB_API extern bool kvi_binaryIpToStringIp_V6(struct in6_addr in,TQString &szBuffer); #endif class KVILIB_API KviSockaddr @@ -70,34 +70,34 @@ public: size_t addressLength(); int addressFamily(); bool isIpV6(); - bool getStringAddress(QString &szBuffer); + bool getStringAddress(TQString &szBuffer); kvi_u32_t port(); }; KVILIB_API extern bool kvi_select(int fd,bool * bCanRead,bool * bCanWrite,int iUSecs = 0); -KVILIB_API extern bool kvi_getInterfaceAddress(const char * ifname,QString &buffer); +KVILIB_API extern bool kvi_getInterfaceAddress(const char * ifname,TQString &buffer); // Warning : NOT THREAD SAFE! -KVILIB_API extern bool kvi_getLocalHostAddress(QString &buffer); +KVILIB_API extern bool kvi_getLocalHostAddress(TQString &buffer); KVILIB_API extern bool kvi_isRoutableIp(const char * ipaddr); KVILIB_API extern bool kvi_isRoutableIpString(const char * ipstring); namespace KviNetUtils { - KVILIB_API bool stringIpToBinaryIp(const QString &szStringIp,struct in_addr * address); - KVILIB_API bool isValidStringIp(const QString &szStringIp); - KVILIB_API bool binaryIpToStringIp(struct in_addr in,QString &szBuffer); - KVILIB_API bool getInterfaceAddress(const QString &szInterfaceName,QString &szBuffer); + KVILIB_API bool stringIpToBinaryIp(const TQString &szStringIp,struct in_addr * address); + KVILIB_API bool isValidStringIp(const TQString &szStringIp); + KVILIB_API bool binaryIpToStringIp(struct in_addr in,TQString &szBuffer); + KVILIB_API bool getInterfaceAddress(const TQString &szInterfaceName,TQString &szBuffer); #ifdef COMPILE_IPV6_SUPPORT - KVILIB_API bool isValidStringIp_V6(const QString &szStringIp); - KVILIB_API bool stringIpToBinaryIp_V6(const QString &szStringIp,struct in6_addr * address); - KVILIB_API bool binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer); + KVILIB_API bool isValidStringIp_V6(const TQString &szStringIp); + KVILIB_API bool stringIpToBinaryIp_V6(const TQString &szStringIp,struct in6_addr * address); + KVILIB_API bool binaryIpToStringIp_V6(struct in6_addr in,TQString &szBuffer); #endif KVILIB_API bool isRoutableIp(const char * ipaddr); - KVILIB_API bool isRoutableIpString(const QString &szIpString); - KVILIB_API void formatNetworkBandwidthString(QString &szBuffer,unsigned int uBytesPerSec); + KVILIB_API bool isRoutableIpString(const TQString &szIpString); + KVILIB_API void formatNetworkBandwidthString(TQString &szBuffer,unsigned int uBytesPerSec); }; diff --git a/src/kvilib/net/kvi_socket.h b/src/kvilib/net/kvi_socket.h index 47d51510..66c336d9 100644 --- a/src/kvilib/net/kvi_socket.h +++ b/src/kvilib/net/kvi_socket.h @@ -62,7 +62,7 @@ #ifndef MSG_NOSIGNAL // At least solaris seems to not have it - #define MSG_NOSIGNAL 0 + #define MSG_NOTQT_SIGNAL 0 #endif //#include "kvi_socketcalls.h" diff --git a/src/kvilib/net/kvi_ssl.cpp b/src/kvilib/net/kvi_ssl.cpp index 6748e062..b6cb2c21 100644 --- a/src/kvilib/net/kvi_ssl.cpp +++ b/src/kvilib/net/kvi_ssl.cpp @@ -326,7 +326,7 @@ static int cb(char *buf, int size, int rwflag, void *u) int len = p->len(); if(len >= size)return 0; kvi_memmove(buf,p->ptr(),len + 1); -// debug("PASS REQYESTED: %s",p->ptr()); +// debug("PASS RETQYESTED: %s",p->ptr()); return len; } @@ -564,7 +564,7 @@ void KviSSLCertificate::splitX509String(KviPointerHashTable<const char *,KviStr> arr[i]->cutLeft(idx + 1); if(szTok.hasData() && arr[i]->hasData()) { - dict->replace(szTok.ptr(),new KviStr(arr[i]->ptr())); + dict->tqreplace(szTok.ptr(),new KviStr(arr[i]->ptr())); } } } @@ -577,7 +577,7 @@ void KviSSLCertificate::splitX509String(KviPointerHashTable<const char *,KviStr> const char * KviSSLCertificate::dictEntry(KviPointerHashTable<const char *,KviStr> * dict,const char * entry) { - KviStr * t = dict->find(entry); + KviStr * t = dict->tqfind(entry); if(!t)return __tr("Unknown"); return t->ptr(); } diff --git a/src/kvilib/net/kvi_url.cpp b/src/kvilib/net/kvi_url.cpp index f980729c..41a6e556 100644 --- a/src/kvilib/net/kvi_url.cpp +++ b/src/kvilib/net/kvi_url.cpp @@ -41,7 +41,7 @@ KviUrl::KviUrl(const char * szUrl) parse(); } -KviUrl::KviUrl(const QString &szUrl) +KviUrl::KviUrl(const TQString &szUrl) { m_szUrl = szUrl; parse(); diff --git a/src/kvilib/net/kvi_url.h b/src/kvilib/net/kvi_url.h index 89adeb9f..ab37b1bb 100644 --- a/src/kvilib/net/kvi_url.h +++ b/src/kvilib/net/kvi_url.h @@ -31,7 +31,7 @@ class KVILIB_API KviUrl : public KviHeapObject public: KviUrl(); KviUrl(const char * szUrl); - KviUrl(const QString &szUrl); + KviUrl(const TQString &szUrl); KviUrl(const KviUrl &u); ~KviUrl(); protected: diff --git a/src/kvilib/net/moc_kvi_dns.cpp b/src/kvilib/net/moc_kvi_dns.cpp index 5b8857a9..cb25e6c7 100644 --- a/src/kvilib/net/moc_kvi_dns.cpp +++ b/src/kvilib/net/moc_kvi_dns.cpp @@ -2,136 +2,136 @@ ** KviDns meta object code from reading C++ file 'kvi_dns.h' ** ** Created: Sun Mar 23 20:56:20 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_dns.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif -#include <qvariant.h> +#include <tqvariant.h> const char *KviDns::className() const { return "KviDns"; } -QMetaObject *KviDns::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviDns( "KviDns", &KviDns::staticMetaObject ); +TQMetaObject *KviDns::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviDns( "KviDns", &KviDns::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviDns::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviDns::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviDns", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviDns", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviDns::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviDns::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviDns", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviDns", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviDns::staticMetaObject() +TQMetaObject* KviDns::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUParameter param_signal_0[] = { - { 0, &static_QUType_ptr, "KviDns", QUParameter::In } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUParameter param_signal_0[] = { + { 0, &static_TQUType_ptr, "KviDns", TQUParameter::In } }; - static const QUMethod signal_0 = {"lookupDone", 1, param_signal_0 }; - static const QMetaData signal_tbl[] = { - { "lookupDone(KviDns*)", &signal_0, QMetaData::Private } + static const TQUMethod signal_0 = {"lookupDone", 1, param_signal_0 }; + static const TQMetaData signal_tbl[] = { + { "lookupDone(KviDns*)", &signal_0, TQMetaData::Private } }; -#ifndef QT_NO_PROPERTIES - static const QMetaProperty props_tbl[1] = { +#ifndef TQT_NO_PROPERTIES + static const TQMetaProperty props_tbl[1] = { { "bool","blockingDelete", 0x12000001, &KviDns::metaObj, 0, -1 } }; -#endif // QT_NO_PROPERTIES - metaObj = QMetaObject::new_metaobject( - "KviDns", parentObject, +#endif // TQT_NO_PROPERTIES + metaObj = TQMetaObject::new_metaobject( + "KviDns", tqparentObject, 0, 0, signal_tbl, 1, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES props_tbl, 1, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviDns.setMetaObject( metaObj ); return metaObj; } -void* KviDns::qt_cast( const char* clname ) +void* KviDns::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviDns" ) ) return this; if ( !qstrcmp( clname, "KviHeapObject" ) ) return (KviHeapObject*)this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -#include <qobjectdefs.h> -#include <qsignalslotimp.h> +#include <tqobjectdefs.h> +#include <tqtqsignalslotimp.h> -// SIGNAL lookupDone +// TQT_SIGNAL lookupDone void KviDns::lookupDone( KviDns* t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 0 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_ptr.set(o+1,t0); + TQUObject o[2]; + static_TQUType_ptr.set(o+1,t0); activate_signal( clist, o ); } -bool KviDns::qt_invoke( int _id, QUObject* _o ) +bool KviDns::qt_invoke( int _id, TQUObject* _o ) { - return QObject::qt_invoke(_id,_o); + return TQObject::qt_invoke(_id,_o); } -bool KviDns::qt_emit( int _id, QUObject* _o ) +bool KviDns::qt_emit( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { - case 0: lookupDone((KviDns*)static_QUType_ptr.get(_o+1)); break; + case 0: lookupDone((KviDns*)static_TQUType_ptr.get(_o+1)); break; default: - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } return TRUE; } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviDns::qt_property( int id, int f, QVariant* v) +bool KviDns::qt_property( int id, int f, TQVariant* v) { switch ( id - staticMetaObject()->propertyOffset() ) { case 0: switch( f ) { - case 1: *v = QVariant( this->isRunning(), 0 ); break; + case 1: *v = TQVariant( this->isRunning(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; default: - return QObject::qt_property( id, f, v ); + return TQObject::qt_property( id, f, v ); } return TRUE; } -bool KviDns::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviDns::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/net/moc_kvi_http.cpp b/src/kvilib/net/moc_kvi_http.cpp index 7ea9b591..632ce590 100644 --- a/src/kvilib/net/moc_kvi_http.cpp +++ b/src/kvilib/net/moc_kvi_http.cpp @@ -2,21 +2,21 @@ ** KviHttpRequest meta object code from reading C++ file 'kvi_http.h' ** ** Created: Sun Mar 23 20:56:22 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_http.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviHttpRequest::className() const @@ -24,240 +24,240 @@ const char *KviHttpRequest::className() const return "KviHttpRequest"; } -QMetaObject *KviHttpRequest::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviHttpRequest( "KviHttpRequest", &KviHttpRequest::staticMetaObject ); +TQMetaObject *KviHttpRequest::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviHttpRequest( "KviHttpRequest", &KviHttpRequest::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviHttpRequest::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviHttpRequest::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviHttpRequest", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviHttpRequest", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviHttpRequest::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviHttpRequest::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviHttpRequest", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviHttpRequest", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviHttpRequest::staticMetaObject() +TQMetaObject* KviHttpRequest::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUParameter param_slot_0[] = { - { "d", &static_QUType_ptr, "KviDns", QUParameter::In } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUParameter param_slot_0[] = { + { "d", &static_TQUType_ptr, "KviDns", TQUParameter::In } }; - static const QUMethod slot_0 = {"dnsLookupDone", 1, param_slot_0 }; - static const QUMethod slot_1 = {"haveServerIp", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "dnsLookupDone(KviDns*)", &slot_0, QMetaData::Protected }, - { "haveServerIp()", &slot_1, QMetaData::Protected } + static const TQUMethod slot_0 = {"dnsLookupDone", 1, param_slot_0 }; + static const TQUMethod slot_1 = {"haveServerIp", 0, 0 }; + static const TQMetaData slot_tbl[] = { + { "dnsLookupDone(KviDns*)", &slot_0, TQMetaData::Protected }, + { "haveServerIp()", &slot_1, TQMetaData::Protected } }; - static const QUParameter param_signal_0[] = { - { "hostname", &static_QUType_QString, 0, QUParameter::In } + static const TQUParameter param_signal_0[] = { + { "hostname", &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_0 = {"resolvingHost", 1, param_signal_0 }; - static const QUParameter param_signal_1[] = { - { "ipandport", &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod signal_0 = {"resolvingHost", 1, param_signal_0 }; + static const TQUParameter param_signal_1[] = { + { "ipandport", &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_1 = {"contactingHost", 1, param_signal_1 }; - static const QUMethod signal_2 = {"connectionEstabilished", 0, 0 }; - static const QUParameter param_signal_3[] = { - { "response", &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod signal_1 = {"contactingHost", 1, param_signal_1 }; + static const TQUMethod signal_2 = {"connectionEstabilished", 0, 0 }; + static const TQUParameter param_signal_3[] = { + { "response", &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_3 = {"receivedResponse", 1, param_signal_3 }; - static const QUParameter param_signal_4[] = { - { "bSuccess", &static_QUType_bool, 0, QUParameter::In } + static const TQUMethod signal_3 = {"receivedResponse", 1, param_signal_3 }; + static const TQUParameter param_signal_4[] = { + { "bSuccess", &static_TQUType_bool, 0, TQUParameter::In } }; - static const QUMethod signal_4 = {"terminated", 1, param_signal_4 }; - static const QUParameter param_signal_5[] = { - { "message", &static_QUType_QString, 0, QUParameter::In } + static const TQUMethod signal_4 = {"terminated", 1, param_signal_4 }; + static const TQUParameter param_signal_5[] = { + { "message", &static_TQUType_TQString, 0, TQUParameter::In } }; - static const QUMethod signal_5 = {"status", 1, param_signal_5 }; - static const QUParameter param_signal_6[] = { - { "data", &static_QUType_ptr, "KviStr", QUParameter::In } + static const TQUMethod signal_5 = {"status", 1, param_signal_5 }; + static const TQUParameter param_signal_6[] = { + { "data", &static_TQUType_ptr, "KviStr", TQUParameter::In } }; - static const QUMethod signal_6 = {"data", 1, param_signal_6 }; - static const QUParameter param_signal_7[] = { - { "data", &static_QUType_ptr, "KviDataBuffer", QUParameter::In } + static const TQUMethod signal_6 = {"data", 1, param_signal_6 }; + static const TQUParameter param_signal_7[] = { + { "data", &static_TQUType_ptr, "KviDataBuffer", TQUParameter::In } }; - static const QUMethod signal_7 = {"binaryData", 1, param_signal_7 }; - static const QUParameter param_signal_8[] = { - { "hdr", &static_QUType_ptr, "KviPointerHashTable<const char*,KviStr>", QUParameter::In } + static const TQUMethod signal_7 = {"binaryData", 1, param_signal_7 }; + static const TQUParameter param_signal_8[] = { + { "hdr", &static_TQUType_ptr, "KviPointerHashTable<const char*,KviStr>", TQUParameter::In } }; - static const QUMethod signal_8 = {"header", 1, param_signal_8 }; - static const QUParameter param_signal_9[] = { - { "request", &static_QUType_varptr, "\x04", QUParameter::In } + static const TQUMethod signal_8 = {"header", 1, param_signal_8 }; + static const TQUParameter param_signal_9[] = { + { "request", &static_TQUType_varptr, "\x04", TQUParameter::In } }; - static const QUMethod signal_9 = {"requestSent", 1, param_signal_9 }; - static const QMetaData signal_tbl[] = { - { "resolvingHost(const QString&)", &signal_0, QMetaData::Public }, - { "contactingHost(const QString&)", &signal_1, QMetaData::Public }, - { "connectionEstabilished()", &signal_2, QMetaData::Public }, - { "receivedResponse(const QString&)", &signal_3, QMetaData::Public }, - { "terminated(bool)", &signal_4, QMetaData::Public }, - { "status(const QString&)", &signal_5, QMetaData::Public }, - { "data(const KviStr&)", &signal_6, QMetaData::Public }, - { "binaryData(const KviDataBuffer&)", &signal_7, QMetaData::Public }, - { "header(KviPointerHashTable<const char*,KviStr>*)", &signal_8, QMetaData::Public }, - { "requestSent(const QStringList&)", &signal_9, QMetaData::Public } + static const TQUMethod signal_9 = {"requestSent", 1, param_signal_9 }; + static const TQMetaData signal_tbl[] = { + { "resolvingHost(const TQString&)", &signal_0, TQMetaData::Public }, + { "contactingHost(const TQString&)", &signal_1, TQMetaData::Public }, + { "connectionEstabilished()", &signal_2, TQMetaData::Public }, + { "receivedResponse(const TQString&)", &signal_3, TQMetaData::Public }, + { "terminated(bool)", &signal_4, TQMetaData::Public }, + { "status(const TQString&)", &signal_5, TQMetaData::Public }, + { "data(const KviStr&)", &signal_6, TQMetaData::Public }, + { "binaryData(const KviDataBuffer&)", &signal_7, TQMetaData::Public }, + { "header(KviPointerHashTable<const char*,KviStr>*)", &signal_8, TQMetaData::Public }, + { "requestSent(const TQStringList&)", &signal_9, TQMetaData::Public } }; - metaObj = QMetaObject::new_metaobject( - "KviHttpRequest", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviHttpRequest", tqparentObject, slot_tbl, 2, signal_tbl, 10, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviHttpRequest.setMetaObject( metaObj ); return metaObj; } -void* KviHttpRequest::qt_cast( const char* clname ) +void* KviHttpRequest::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviHttpRequest" ) ) return this; if ( !qstrcmp( clname, "KviHeapObject" ) ) return (KviHeapObject*)this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -// SIGNAL resolvingHost -void KviHttpRequest::resolvingHost( const QString& t0 ) +// TQT_SIGNAL resolvingHost +void KviHttpRequest::resolvingHost( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 0, t0 ); } -// SIGNAL contactingHost -void KviHttpRequest::contactingHost( const QString& t0 ) +// TQT_SIGNAL contactingHost +void KviHttpRequest::contactingHost( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 1, t0 ); } -// SIGNAL connectionEstabilished +// TQT_SIGNAL connectionEstabilished void KviHttpRequest::connectionEstabilished() { activate_signal( staticMetaObject()->signalOffset() + 2 ); } -// SIGNAL receivedResponse -void KviHttpRequest::receivedResponse( const QString& t0 ) +// TQT_SIGNAL receivedResponse +void KviHttpRequest::receivedResponse( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 3, t0 ); } -// SIGNAL terminated +// TQT_SIGNAL terminated void KviHttpRequest::terminated( bool t0 ) { activate_signal_bool( staticMetaObject()->signalOffset() + 4, t0 ); } -// SIGNAL status -void KviHttpRequest::status( const QString& t0 ) +// TQT_SIGNAL status +void KviHttpRequest::status( const TQString& t0 ) { activate_signal( staticMetaObject()->signalOffset() + 5, t0 ); } -#include <qobjectdefs.h> -#include <qsignalslotimp.h> +#include <tqobjectdefs.h> +#include <tqtqsignalslotimp.h> -// SIGNAL data +// TQT_SIGNAL data void KviHttpRequest::data( const KviStr& t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 6 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 6 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_ptr.set(o+1,&t0); + TQUObject o[2]; + static_TQUType_ptr.set(o+1,&t0); activate_signal( clist, o ); } -// SIGNAL binaryData +// TQT_SIGNAL binaryData void KviHttpRequest::binaryData( const KviDataBuffer& t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 7 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 7 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_ptr.set(o+1,&t0); + TQUObject o[2]; + static_TQUType_ptr.set(o+1,&t0); activate_signal( clist, o ); } -// SIGNAL header +// TQT_SIGNAL header void KviHttpRequest::header( KviPointerHashTable<const char*,KviStr>* t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 8 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 8 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_ptr.set(o+1,t0); + TQUObject o[2]; + static_TQUType_ptr.set(o+1,t0); activate_signal( clist, o ); } -// SIGNAL requestSent -void KviHttpRequest::requestSent( const QStringList& t0 ) +// TQT_SIGNAL requestSent +void KviHttpRequest::requestSent( const TQStringList& t0 ) { if ( signalsBlocked() ) return; - QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 9 ); + TQConnectionList *clist = tqreceivers( staticMetaObject()->signalOffset() + 9 ); if ( !clist ) return; - QUObject o[2]; - static_QUType_varptr.set(o+1,&t0); + TQUObject o[2]; + static_TQUType_varptr.set(o+1,&t0); activate_signal( clist, o ); } -bool KviHttpRequest::qt_invoke( int _id, QUObject* _o ) +bool KviHttpRequest::qt_invoke( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { - case 0: dnsLookupDone((KviDns*)static_QUType_ptr.get(_o+1)); break; + case 0: dnsLookupDone((KviDns*)static_TQUType_ptr.get(_o+1)); break; case 1: haveServerIp(); break; default: - return QObject::qt_invoke( _id, _o ); + return TQObject::qt_invoke( _id, _o ); } return TRUE; } -bool KviHttpRequest::qt_emit( int _id, QUObject* _o ) +bool KviHttpRequest::qt_emit( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { - case 0: resolvingHost((const QString&)static_QUType_QString.get(_o+1)); break; - case 1: contactingHost((const QString&)static_QUType_QString.get(_o+1)); break; + case 0: resolvingHost((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 1: contactingHost((const TQString&)static_TQUType_TQString.get(_o+1)); break; case 2: connectionEstabilished(); break; - case 3: receivedResponse((const QString&)static_QUType_QString.get(_o+1)); break; - case 4: terminated((bool)static_QUType_bool.get(_o+1)); break; - case 5: status((const QString&)static_QUType_QString.get(_o+1)); break; - case 6: data((const KviStr&)*((const KviStr*)static_QUType_ptr.get(_o+1))); break; - case 7: binaryData((const KviDataBuffer&)*((const KviDataBuffer*)static_QUType_ptr.get(_o+1))); break; - case 8: header((KviPointerHashTable<const char*,KviStr>*)static_QUType_ptr.get(_o+1)); break; - case 9: requestSent((const QStringList&)*((const QStringList*)static_QUType_ptr.get(_o+1))); break; + case 3: receivedResponse((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 4: terminated((bool)static_TQUType_bool.get(_o+1)); break; + case 5: status((const TQString&)static_TQUType_TQString.get(_o+1)); break; + case 6: data((const KviStr&)*((const KviStr*)static_TQUType_ptr.get(_o+1))); break; + case 7: binaryData((const KviDataBuffer&)*((const KviDataBuffer*)static_TQUType_ptr.get(_o+1))); break; + case 8: header((KviPointerHashTable<const char*,KviStr>*)static_TQUType_ptr.get(_o+1)); break; + case 9: requestSent((const TQStringList&)*((const TQStringList*)static_TQUType_ptr.get(_o+1))); break; default: - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } return TRUE; } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviHttpRequest::qt_property( int id, int f, QVariant* v) +bool KviHttpRequest::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviHttpRequest::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviHttpRequest::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/system/kvi_locale.cpp b/src/kvilib/system/kvi_locale.cpp index f49eabe4..296db7be 100644 --- a/src/kvilib/system/kvi_locale.cpp +++ b/src/kvilib/system/kvi_locale.cpp @@ -33,12 +33,12 @@ #define _KVI_LOCALE_CPP_ #include "kvi_locale.h" -#include <qglobal.h> //for debug() -#include <qtextcodec.h> -#include <qdir.h> +#include <tqglobal.h> //for debug() +#include <tqtextcodec.h> +#include <tqdir.h> #ifdef COMPILE_USE_QT4 - #include <qlocale.h> + #include <tqlocale.h> #endif #include "kvi_string.h" @@ -53,7 +53,7 @@ KVILIB_API KviMessageCatalogue * g_pMainCatalogue = 0; static KviStr g_szLang; static KviTranslator * g_pTranslator = 0; static KviPointerHashTable<const char *,KviMessageCatalogue> * g_pCatalogueDict = 0; -static QTextCodec * g_pUtf8TextCodec = 0; +static TQTextCodec * g_pUtf8TextCodec = 0; ///////////////////////////////////////////////////////////////////////////////////////////////////// @@ -271,27 +271,27 @@ static bool g_utf8_validate (const char *str, /////////////////////////////////////////////////////////////////////////////////////////////// -class KviSmartTextCodec : public QTextCodec +class KviSmartTextCodec : public TQTextCodec { protected: - KviQCString m_szName; - QTextCodec * m_pRecvCodec; - QTextCodec * m_pSendCodec; + KviTQCString m_szName; + TQTextCodec * m_pRecvCodec; + TQTextCodec * m_pSendCodec; public: KviSmartTextCodec(const char * szName,const char * szChildCodecName,bool bSendInUtf8) - : QTextCodec() + : TQTextCodec() { m_szName = szName; if(!g_pUtf8TextCodec) { - g_pUtf8TextCodec = QTextCodec::codecForName("UTF-8"); + g_pUtf8TextCodec = TQTextCodec::codecForName("UTF-8"); if(!g_pUtf8TextCodec) { debug("Can't find the global utf8 text codec!"); - g_pUtf8TextCodec = QTextCodec::codecForLocale(); // try anything else... + g_pUtf8TextCodec = TQTextCodec::codecForLocale(); // try anything else... } } - m_pRecvCodec = QTextCodec::codecForName(szChildCodecName); + m_pRecvCodec = TQTextCodec::codecForName(szChildCodecName); if(!m_pRecvCodec) { debug("Can't find the codec for name %s (composite codec creation)",szName); @@ -308,13 +308,13 @@ public: virtual int mibEnum () const { return 0; }; #ifdef COMPILE_USE_QT4 - virtual QByteArray name() const { return m_szName; }; + virtual TQByteArray name() const { return m_szName; }; protected: - virtual QByteArray convertFromUnicode(const QChar * input,int number,ConverterState * state) const + virtual TQByteArray convertFromUnicode(const TQChar * input,int number,ConverterState * state) const { return m_pSendCodec->fromUnicode(input,number,state); } - virtual QString convertToUnicode(const char * chars,int len,ConverterState * state) const + virtual TQString convertToUnicode(const char * chars,int len,ConverterState * state) const { if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len,state); return m_pRecvCodec->toUnicode(chars,len,state); @@ -323,43 +323,43 @@ protected: public: virtual const char * mimeName () const { return m_pRecvCodec->mimeName(); }; virtual const char * name () const { return m_szName.data(); }; - virtual QTextDecoder * makeDecoder () const { return m_pRecvCodec->makeDecoder(); }; - virtual QTextEncoder * makeEncoder () const { return m_pSendCodec->makeEncoder(); }; - QCString fromUnicode (const QString & uc) const { return m_pSendCodec->fromUnicode(uc); }; - virtual QCString fromUnicode (const QString & uc,int & lenInOut) const { return m_pSendCodec->fromUnicode(uc,lenInOut); }; - QString toUnicode(const char * chars) const + virtual TQTextDecoder * makeDecoder () const { return m_pRecvCodec->makeDecoder(); }; + virtual TQTextEncoder * makeEncoder () const { return m_pSendCodec->makeEncoder(); }; + TQCString fromUnicode (const TQString & uc) const { return m_pSendCodec->fromUnicode(uc); }; + virtual TQCString fromUnicode (const TQString & uc,int & lenInOut) const { return m_pSendCodec->fromUnicode(uc,lenInOut); }; + TQString toUnicode(const char * chars) const { if(g_utf8_validate(chars,-1,NULL))return g_pUtf8TextCodec->toUnicode(chars); return m_pRecvCodec->toUnicode(chars); }; - virtual QString toUnicode(const char * chars,int len) const + virtual TQString toUnicode(const char * chars,int len) const { if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len); return m_pRecvCodec->toUnicode(chars,len); }; - QString toUnicode(const QByteArray & a,int len) const + TQString toUnicode(const TQByteArray & a,int len) const { if(g_utf8_validate(a.data(),len,NULL))return g_pUtf8TextCodec->toUnicode(a,len); return m_pRecvCodec->toUnicode(a,len); }; - QString toUnicode(const QByteArray & a) const + TQString toUnicode(const TQByteArray & a) const { if(g_utf8_validate(a.data(),a.size(),NULL))return g_pUtf8TextCodec->toUnicode(a); return m_pRecvCodec->toUnicode(a); }; - QString toUnicode(const QCString & a,int len) const + TQString toUnicode(const TQCString & a,int len) const { if(g_utf8_validate(a.data(),len,NULL))return g_pUtf8TextCodec->toUnicode(a,len); return m_pRecvCodec->toUnicode(a,len); }; - QString toUnicode(const QCString & a) const + TQString toUnicode(const TQCString & a) const { if(g_utf8_validate(a.data(),-1,NULL))return g_pUtf8TextCodec->toUnicode(a); return m_pRecvCodec->toUnicode(a); }; - virtual bool canEncode(QChar ch) const { return m_pSendCodec->canEncode(ch); }; - virtual bool canEncode(const QString &s) const { return m_pSendCodec->canEncode(s); }; + virtual bool canEncode(TQChar ch) const { return m_pSendCodec->canEncode(ch); }; + virtual bool canEncode(const TQString &s) const { return m_pSendCodec->canEncode(s); }; virtual int heuristicContentMatch(const char * chars,int len) const { int iii = g_pUtf8TextCodec->heuristicContentMatch(chars,len); @@ -474,7 +474,7 @@ int kvi_getFirstBiggerPrime(int number) KviMessageCatalogue::KviMessageCatalogue() { //m_uEncoding = 0; - m_pTextCodec = QTextCodec::codecForLocale(); + m_pTextCodec = TQTextCodec::codecForLocale(); //m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(1123,true,false); // dictSize, case sensitive , don't copy keys m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(32,true,false); // dictSize, case sensitive , don't copy keys @@ -487,15 +487,15 @@ KviMessageCatalogue::~KviMessageCatalogue() delete m_pMessages; } -bool KviMessageCatalogue::load(const QString& name) +bool KviMessageCatalogue::load(const TQString& name) { - QString szCatalogueFile(name); + TQString szCatalogueFile(name); // Try to load the header KviFile f(szCatalogueFile); if(!f.openForReading()) { - debug("[KviLocale]: Failed to open the messages file %s: probably doesn't exist",KviQString::toUtf8(szCatalogueFile).data()); + debug("[KviLocale]: Failed to open the messages file %s: probably doesn't exist",KviTQString::toUtf8(szCatalogueFile).data()); return false; } @@ -503,7 +503,7 @@ bool KviMessageCatalogue::load(const QString& name) if(f.readBlock((char *)&hdr,sizeof(GnuMoFileHeader)) < (int)sizeof(GnuMoFileHeader)) { - debug("KviLocale: Failed to read header of %s",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Failed to read header of %s",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -514,10 +514,10 @@ bool KviMessageCatalogue::load(const QString& name) { if(hdr.magic == KVI_LOCALE_MAGIC_SWAPPED) { - debug("KviLocale: Swapped magic for file %s: swapping data too",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Swapped magic for file %s: swapping data too",KviTQString::toUtf8(szCatalogueFile).data()); bMustSwap = true; } else { - debug("KviLocale: Bad locale magic for file %s: not a *.mo file ?",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Bad locale magic for file %s: not a *.mo file ?",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -525,7 +525,7 @@ bool KviMessageCatalogue::load(const QString& name) if(KVI_SWAP_IF_NEEDED(bMustSwap,hdr.revision) != MO_REVISION_NUMBER) { - debug("KviLocale: Invalid *.mo file revision number for file %s",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Invalid *.mo file revision number for file %s",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -534,7 +534,7 @@ bool KviMessageCatalogue::load(const QString& name) if(numberOfStrings <= 0) { - debug("KviLocale: No translated messages found in file %s",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: No translated messages found in file %s",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -554,7 +554,7 @@ bool KviMessageCatalogue::load(const QString& name) // FIXME: maybe read it in blocks eh ? if(f.readBlock(buffer,fSize) < (int)fSize) { - debug("KviLocale: Error while reading the translation file %s",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Error while reading the translation file %s",KviTQString::toUtf8(szCatalogueFile).data()); kvi_free(buffer); f.close(); return false; @@ -563,7 +563,7 @@ bool KviMessageCatalogue::load(const QString& name) // Check for broken *.mo files if(fSize < (24 + (sizeof(GnuMoStringDescriptor) * numberOfStrings))) { - debug("KviLocale: Broken translation file %s (too small for all descriptors)",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Broken translation file %s (too small for all descriptors)",KviTQString::toUtf8(szCatalogueFile).data()); kvi_free(buffer); f.close(); return false; @@ -578,7 +578,7 @@ bool KviMessageCatalogue::load(const QString& name) if(fSize < (unsigned int)expectedFileSize) { - debug("KviLocale: Broken translation file %s (too small for all the message strings)",KviQString::toUtf8(szCatalogueFile).data()); + debug("KviLocale: Broken translation file %s (too small for all the message strings)",KviTQString::toUtf8(szCatalogueFile).data()); kvi_free(buffer); f.close(); return false; @@ -609,7 +609,7 @@ bool KviMessageCatalogue::load(const QString& name) KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].length)); // In some (or all?) *.mo files the first string - // is zero bytes long and the translated one contains + // is zero bytes long and the translated one tqcontains // informations about the translation if(e->m_szKey.len() == 0) { @@ -629,7 +629,7 @@ bool KviMessageCatalogue::load(const QString& name) // find out the text encoding , if possible if(szHeader.hasData()) { - // find "charset=*\n" + // tqfind "charset=*\n" int idx = szHeader.findFirstIdx("charset="); if(idx != -1) { @@ -641,7 +641,7 @@ bool KviMessageCatalogue::load(const QString& name) { debug("Can't find the codec for charset=%s",szHeader.ptr()); debug("Falling back to codecForLocale()"); - m_pTextCodec = QTextCodec::codecForLocale(); + m_pTextCodec = TQTextCodec::codecForLocale(); } } } @@ -650,7 +650,7 @@ bool KviMessageCatalogue::load(const QString& name) { debug("The message catalogue does not have a \"charset\" header"); debug("Assuming utf8"); // FIXME: or codecForLocale() ? - m_pTextCodec = QTextCodec::codecForName("UTF-8"); + m_pTextCodec = TQTextCodec::codecForName("UTF-8"); } return true; @@ -658,25 +658,25 @@ bool KviMessageCatalogue::load(const QString& name) const char * KviMessageCatalogue::translate(const char *text) { - KviTranslationEntry * aux = m_pMessages->find(text); + KviTranslationEntry * aux = m_pMessages->tqfind(text); if(aux)return aux->m_szEncodedTranslation.ptr(); return text; } -const QString & KviMessageCatalogue::translateToQString(const char *text) +const TQString & KviMessageCatalogue::translateToTQString(const char *text) { - KviTranslationEntry * aux = m_pMessages->find(text); + KviTranslationEntry * aux = m_pMessages->tqfind(text); if(aux) { - if(aux->m_pQTranslation)return *(aux->m_pQTranslation); - aux->m_pQTranslation = new QString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr())); - return *(aux->m_pQTranslation); + if(aux->m_pTQTranslation)return *(aux->m_pTQTranslation); + aux->m_pTQTranslation = new TQString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr())); + return *(aux->m_pTQTranslation); } // no translation is available: let's avoid continous string decoding aux = new KviTranslationEntry(text); m_pMessages->insert(aux->m_szKey.ptr(),aux); - aux->m_pQTranslation = new QString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr())); - return *(aux->m_pQTranslation); + aux->m_pTQTranslation = new TQString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr())); + return *(aux->m_pTQTranslation); } @@ -684,7 +684,7 @@ const QString & KviMessageCatalogue::translateToQString(const char *text) namespace KviLocale { -#ifndef QT_NO_BIG_CODECS +#ifndef TQT_NO_BIG_CODECS #define NUM_ENCODINGS 109 #else #define NUM_ENCODINGS 85 @@ -717,7 +717,7 @@ namespace KviLocale { "CP-1255" , 0 , 0 , "Hebrew, CP" }, { "CP-1254" , 0 , 0 , "Turkish, CP" }, { "TIS-620" , 0 , 0 , "Thai" }, -#ifndef QT_NO_BIG_CODECS +#ifndef TQT_NO_BIG_CODECS { "Big5" , 0 , 0 , "Chinese Traditional" }, { "Big5-HKSCS" , 0 , 0 , "Chinese Traditional, Hong Kong" }, { "GB18030" , 0 , 0 , "Chinese Simplified" }, @@ -757,7 +757,7 @@ namespace KviLocale { "CP-1255 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Hebrew, CP, O: Hebrew, CP" }, { "CP-1254 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Turkish, CP, O: Turkish, CP" }, { "TIS-620 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Thai, O: Thai" }, -#ifndef QT_NO_BIG_CODECS +#ifndef TQT_NO_BIG_CODECS { "Big5 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Traditional, O: Chinese Traditional" }, { "Big5-HKSCS [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Traditional, Hong Kong, O: Chinese Traditional, Hong Kong" }, { "GB18030 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Simplified, O: Chinese Simplified" }, @@ -802,7 +802,7 @@ namespace KviLocale { "UTF-8 [CP-1254]" , 1 , 1 , "I: 8-bit Unicode / Turkish, CP, O: 8-bit Unicode" }, { "UTF-8 [TIS-620]" , 1 , 1 , "I: 8-bit Unicode / Thai, O: 8-bit Unicode" }, -#ifndef QT_NO_BIG_CODECS +#ifndef TQT_NO_BIG_CODECS { "UTF-8 [Big5]" , 1 , 1 , "I: 8-bit Unicode / Chinese Traditional, O: 8-bit Unicode" }, { "UTF-8 [Big5-HKSCS]" , 1 , 1 , "I: 8-bit Unicode / Chinese Traditional, Hong Kong, O: 8-bit Unicode" }, @@ -831,14 +831,14 @@ namespace KviLocale return &(supported_encodings[iIdx]); } - QTextCodec * codecForName(const char * szName) + TQTextCodec * codecForName(const char * szName) { KviStr szTmp = szName; int idx = szTmp.findFirstIdx('['); if(idx != -1) { // composite codec: either UTF-8 [child codec] or child codec [UTF-8] - KviSmartTextCodec * c = g_pSmartCodecDict->find(szName); + KviSmartTextCodec * c = g_pSmartCodecDict->tqfind(szName); if(c)return c; @@ -855,13 +855,13 @@ namespace KviLocale } if(c->ok()) { - g_pSmartCodecDict->replace(szName,c); + g_pSmartCodecDict->tqreplace(szName,c); return c; } else { delete c; } } - return QTextCodec::codecForName(szName); + return TQTextCodec::codecForName(szName); } const KviStr & localeName() @@ -869,12 +869,12 @@ namespace KviLocale return g_szLang; } - bool loadCatalogue(const QString &name,const QString &szLocaleDir) + bool loadCatalogue(const TQString &name,const TQString &szLocaleDir) { //debug("Looking up catalogue %s",name); - if(g_pCatalogueDict->find(KviQString::toUtf8(name).data()))return true; // already loaded + if(g_pCatalogueDict->tqfind(KviTQString::toUtf8(name).data()))return true; // already loaded - QString szBuffer; + TQString szBuffer; if(findCatalogue(szBuffer,name,szLocaleDir)) { @@ -882,27 +882,27 @@ namespace KviLocale if(c->load(szBuffer)) { //debug("KviLocale: loaded catalogue %s",name); - g_pCatalogueDict->insert(KviQString::toUtf8(name).data(),c); + g_pCatalogueDict->insert(KviTQString::toUtf8(name).data(),c); return true; } } return false; } - bool unloadCatalogue(const QString &name) + bool unloadCatalogue(const TQString &name) { //debug("Unloading catalogue : %s",name); - return g_pCatalogueDict->remove(KviQString::toUtf8(name).data()); + return g_pCatalogueDict->remove(KviTQString::toUtf8(name).data()); } - bool findCatalogue(QString &szBuffer,const QString& name,const QString& szLocaleDir) + bool findCatalogue(TQString &szBuffer,const TQString& name,const TQString& szLocaleDir) { KviStr szLocale = g_szLang; - QString szLocDir = szLocaleDir; - KviQString::ensureLastCharIs(szLocDir,KVI_PATH_SEPARATOR_CHAR); + TQString szLocDir = szLocaleDir; + KviTQString::ensureLastCharIs(szLocDir,KVI_PATH_SEPARATOR_CHAR); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); + KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr()); if(KviFileUtils::fileExists(szBuffer))return true; @@ -912,7 +912,7 @@ namespace KviLocale // kill them szLocale.cutFromFirst('.'); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); + KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr()); if(KviFileUtils::fileExists(szBuffer))return true; } @@ -921,7 +921,7 @@ namespace KviLocale // things like @euro ? // kill them szLocale.cutFromFirst('@'); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); + KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr()); if(KviFileUtils::fileExists(szBuffer))return true; } @@ -930,13 +930,13 @@ namespace KviLocale // things like en_GB // kill them szLocale.cutFromFirst('_'); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); + KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr()); if(KviFileUtils::fileExists(szBuffer))return true; } // try the lower case version too szLocale.toLower(); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); + KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr()); if(KviFileUtils::fileExists(szBuffer))return true; return false; @@ -952,26 +952,26 @@ namespace KviLocale // translation map was sucesfully loaded // - void init(QApplication * app,const QString &localeDir) + void init(TQApplication * app,const TQString &localeDir) { // first of all try to find out the current locale g_szLang=""; #ifdef COMPILE_USE_QT4 - QString szLangFile=QString("%1/.kvirc_force_locale").arg(QDir::homePath()); + TQString szLangFile=TQString("%1/.kvirc_force_locale").tqarg(TQDir::homePath()); #else - QString szLangFile=QString("%1/.kvirc_force_locale").arg(QDir::homeDirPath()); + TQString szLangFile=TQString("%1/.kvirc_force_locale").tqarg(TQDir::homeDirPath()); #endif if(KviFileUtils::fileExists(szLangFile)) { - QString szTmp; + TQString szTmp; KviFileUtils::readFile(szLangFile,szTmp); g_szLang=szTmp; } if(g_szLang.isEmpty())g_szLang = kvi_getenv("KVIRC_LANG"); #ifdef COMPILE_USE_QT4 - if(g_szLang.isEmpty())g_szLang = QLocale::system().name(); + if(g_szLang.isEmpty())g_szLang = TQLocale::system().name(); #else - if(g_szLang.isEmpty())g_szLang = QTextCodec::locale(); + if(g_szLang.isEmpty())g_szLang = TQTextCodec::locale(); #endif if(g_szLang.isEmpty())g_szLang = kvi_getenv("LC_MESSAGES"); if(g_szLang.isEmpty())g_szLang = kvi_getenv("LANG"); @@ -986,17 +986,17 @@ namespace KviLocale // the smart codec dict g_pSmartCodecDict = new KviPointerHashTable<const char *,KviSmartTextCodec>; - // the Qt docs explicitly state that we shouldn't delete + // the TQt docs explicitly state that we shouldn't delete // the codecs by ourselves... g_pSmartCodecDict->setAutoDelete(false); if(g_szLang.hasData()) { - QString szBuffer; + TQString szBuffer; if(findCatalogue(szBuffer,"kvirc",localeDir)) { g_pMainCatalogue->load(szBuffer); - g_pTranslator = new KviTranslator(app,"kvirc_translator"); + g_pTranslator = new KviTranslator(TQT_TQOBJECT(app),"kvirc_translator"); app->installTranslator(g_pTranslator); } else { KviStr szTmp = g_szLang; @@ -1019,11 +1019,11 @@ namespace KviLocale } } - //g_pTextCodec = QTextCodec::codecForLocale(); - //if(!g_pTextCodec)g_pTextCodec = QTextCodec::codecForLocale(); + //g_pTextCodec = TQTextCodec::codecForLocale(); + //if(!g_pTextCodec)g_pTextCodec = TQTextCodec::codecForLocale(); } - void done(QApplication * app) + void done(TQApplication * app) { delete g_pMainCatalogue; delete g_pCatalogueDict; @@ -1039,9 +1039,9 @@ namespace KviLocale } } - KviMessageCatalogue * getLoadedCatalogue(const QString& name) + KviMessageCatalogue * getLoadedCatalogue(const TQString& name) { - return g_pCatalogueDict->find(KviQString::toUtf8(name).data()); + return g_pCatalogueDict->tqfind(KviTQString::toUtf8(name).data()); } @@ -1049,7 +1049,7 @@ namespace KviLocale { if(context) { - KviMessageCatalogue * c = g_pCatalogueDict->find(context); + KviMessageCatalogue * c = g_pCatalogueDict->tqfind(context); if(!c) { // FIXME: Should really try to load the catalogue here! @@ -1061,28 +1061,28 @@ namespace KviLocale return g_pMainCatalogue->translate(text); } - const QString & translateToQString(const char * text,const char * context) + const TQString & translateToTQString(const char * text,const char * context) { if(context) { - KviMessageCatalogue * c = g_pCatalogueDict->find(context); + KviMessageCatalogue * c = g_pCatalogueDict->tqfind(context); if(!c) { // FIXME: Should really try to load the catalogue here! c = new KviMessageCatalogue(); g_pCatalogueDict->insert(context,c); } - return c->translateToQString(text); + return c->translateToTQString(text); } - return g_pMainCatalogue->translateToQString(text); + return g_pMainCatalogue->translateToTQString(text); } }; -KviTranslator::KviTranslator(QObject * par,const char * nam) +KviTranslator::KviTranslator(TQObject * par,const char * nam) #ifdef COMPILE_USE_QT4 -: QTranslator(par) +: TQTranslator(par) #else -: QTranslator(par,nam) +: TQTranslator(par,nam) #endif { } @@ -1092,24 +1092,24 @@ KviTranslator::~KviTranslator() } #ifdef COMPILE_USE_QT4 -QString KviTranslator::translate(const char *context,const char * message,const char * comment) const +TQString KviTranslator::translate(const char *context,const char * message,const char * comment) const { // we ignore contexts and comments for qt translations - return g_pMainCatalogue->translateToQString(message); + return g_pMainCatalogue->translateToTQString(message); } #endif -QString KviTranslator::find(const char *context,const char * message) const +TQString KviTranslator::tqfind(const char *context,const char * message) const { // we ignore contexts for qt translations - return g_pMainCatalogue->translateToQString(message); + return g_pMainCatalogue->translateToTQString(message); } #ifndef COMPILE_USE_QT4 -QTranslatorMessage KviTranslator::findMessage(const char * context,const char * sourceText,const char * comment) const +TQTranslatorMessage KviTranslator::findMessage(const char * context,const char * sourceText,const char * comment) const { // we ignore contexts for qt translations - return QTranslatorMessage(context,sourceText,comment,g_pMainCatalogue->translateToQString(sourceText)); + return TQTranslatorMessage(context,sourceText,comment,g_pMainCatalogue->translateToTQString(sourceText)); } #endif @@ -1118,7 +1118,7 @@ QTranslatorMessage KviTranslator::findMessage(const char * context,const char * // a fake table that will force these translations // to be included in the *.pot file -static QString fake_translations_table[]= +static TQString fake_translations_table[]= { // global __tr2qs("OK"), diff --git a/src/kvilib/system/kvi_locale.h b/src/kvilib/system/kvi_locale.h index bc3ed8eb..27b666b7 100644 --- a/src/kvilib/system/kvi_locale.h +++ b/src/kvilib/system/kvi_locale.h @@ -31,9 +31,9 @@ #include "kvi_string.h" #include "kvi_pointerhashtable.h" -#include <qapplication.h> +#include <tqapplication.h> -class QTextCodec; +class TQTextCodec; class KviMessageCatalogue; namespace KviLocale @@ -49,16 +49,16 @@ namespace KviLocale // you MUST start iterating from 0 and terminate when // you get an entry with a NULL szName KVILIB_API EncodingDescription * encodingDescription(int iIdx); - KVILIB_API QTextCodec * codecForName(const char * szName); + KVILIB_API TQTextCodec * codecForName(const char * szName); KVILIB_API const KviStr & localeName(); - KVILIB_API bool findCatalogue(QString &szBuffer,const QString& name,const QString& szLocaleDir); - KVILIB_API bool loadCatalogue(const QString& name,const QString& szLocaleDir); - KVILIB_API KviMessageCatalogue * getLoadedCatalogue(const QString& name); - KVILIB_API bool unloadCatalogue(const QString& name); - KVILIB_API void init(QApplication * app,const QString& localeDir); - KVILIB_API void done(QApplication * app); + KVILIB_API bool findCatalogue(TQString &szBuffer,const TQString& name,const TQString& szLocaleDir); + KVILIB_API bool loadCatalogue(const TQString& name,const TQString& szLocaleDir); + KVILIB_API KviMessageCatalogue * getLoadedCatalogue(const TQString& name); + KVILIB_API bool unloadCatalogue(const TQString& name); + KVILIB_API void init(TQApplication * app,const TQString& localeDir); + KVILIB_API void done(TQApplication * app); KVILIB_API const char * translate(const char * text,const char * context); - KVILIB_API const QString & translateToQString(const char * text,const char * context); + KVILIB_API const TQString & translateToTQString(const char * text,const char * context); }; // not exported @@ -67,23 +67,23 @@ class KviTranslationEntry public: KviStr m_szKey; KviStr m_szEncodedTranslation; - QString * m_pQTranslation; + TQString * m_pTQTranslation; public: KviTranslationEntry(char * keyptr,int keylen,char * trptr,int trlen) : m_szKey(keyptr,keylen) , m_szEncodedTranslation(trptr,trlen) { - m_pQTranslation = 0; + m_pTQTranslation = 0; } KviTranslationEntry(const char * keyandtr) : m_szKey(keyandtr) , m_szEncodedTranslation(keyandtr) { - m_pQTranslation = 0; + m_pTQTranslation = 0; } ~KviTranslationEntry() { - if(m_pQTranslation)delete m_pQTranslation; + if(m_pTQTranslation)delete m_pTQTranslation; } }; @@ -96,11 +96,11 @@ public: protected: //KviPointerHashTable<const char *,KviTranslationEntry> * m_pMessages; KviPointerHashTable<const char *,KviTranslationEntry> * m_pMessages; - QTextCodec * m_pTextCodec; + TQTextCodec * m_pTextCodec; public: - bool load(const QString& name); + bool load(const TQString& name); const char * translate(const char * text); - const QString & translateToQString(const char * text); + const TQString & translateToTQString(const char * text); }; #ifndef _KVI_LOCALE_CPP_ @@ -111,34 +111,35 @@ public: #define __tr_no_lookup(__text__) __text__ #define __tr_no_xgettext(__text__) g_pMainCatalogue->translate(__text__) -#define __tr2qs(__text__) g_pMainCatalogue->translateToQString(__text__) -#define __tr2qs_no_xgettext(__text__) g_pMainCatalogue->translateToQString(__text__) +#define __tr2qs(__text__) g_pMainCatalogue->translateToTQString(__text__) +#define __tr2qs_no_xgettext(__text__) g_pMainCatalogue->translateToTQString(__text__) #define __tr_ctx(__text__,__context__) KviLocale::translate(__text__,__context__) #define __tr_no_lookup_ctx(__text__,__context__) __text__ #define __tr_no_xgettext_ctx(__text__,__context__) KviLocale::translate(__text__,__context__) -#define __tr2qs_ctx(__text__,__context__) KviLocale::translateToQString(__text__,__context__) -#define __tr2qs_ctx_no_xgettext(__text__,__context__) KviLocale::translateToQString(__text__,__context__) +#define __tr2qs_ctx(__text__,__context__) KviLocale::translateToTQString(__text__,__context__) +#define __tr2qs_ctx_no_xgettext(__text__,__context__) KviLocale::translateToTQString(__text__,__context__) #define __tr2qs_no_lookup(__text__) __text__ -#include <qtranslator.h> -#include <qstring.h> +#include <tqtranslator.h> +#include <tqstring.h> -class KVILIB_API KviTranslator : public QTranslator +class KVILIB_API KviTranslator : public TQTranslator { Q_OBJECT + TQ_OBJECT public: - KviTranslator(QObject * parent,const char * name); + KviTranslator(TQObject * tqparent,const char * name); ~KviTranslator(); public: #ifdef COMPILE_USE_QT4 - virtual QString translate(const char * context,const char * message,const char * comment) const; + virtual TQString translate(const char * context,const char * message,const char * comment) const; #endif // Deprecated in qt 4.x - virtual QString find(const char * context,const char * message) const; + virtual TQString tqfind(const char * context,const char * message) const; #ifndef COMPILE_USE_QT4 // Dead in qt 4.x - virtual QTranslatorMessage findMessage(const char * context,const char * sourceText,const char * comment = 0) const; + virtual TQTranslatorMessage findMessage(const char * context,const char * sourceText,const char * comment = 0) const; #endif }; diff --git a/src/kvilib/system/kvi_process.h b/src/kvilib/system/kvi_process.h index ea2275dc..649e40d7 100644 --- a/src/kvilib/system/kvi_process.h +++ b/src/kvilib/system/kvi_process.h @@ -27,11 +27,11 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #include <q3process.h> + #include <tq3process.h> #define KviProcess Q3Process #else - #include <qprocess.h> - #define KviProcess QProcess + #include <tqprocess.h> + #define KviProcess TQProcess #endif #endif //!_KVI_PROCESS_H_ diff --git a/src/kvilib/system/kvi_stdarg.h b/src/kvilib/system/kvi_stdarg.h index 15c5e078..659e7a70 100644 --- a/src/kvilib/system/kvi_stdarg.h +++ b/src/kvilib/system/kvi_stdarg.h @@ -34,7 +34,7 @@ // kvi_va_start_by_reference should be used when the last known argument // is a reference type and not a pointer // -// int SomeClass::sprintf(const QString &fmt,...) +// int SomeClass::sprintf(const TQString &fmt,...) // { // kvi_va_list list; // kvi_va_start_by_reference(list,fmt); diff --git a/src/kvilib/system/kvi_thread.cpp b/src/kvilib/system/kvi_thread.cpp index e9ec3ac5..b3cb7708 100644 --- a/src/kvilib/system/kvi_thread.cpp +++ b/src/kvilib/system/kvi_thread.cpp @@ -47,7 +47,7 @@ #include "kvi_error.h" -#include <qapplication.h> +#include <tqapplication.h> static void kvi_threadIgnoreSigalarm() @@ -58,7 +58,7 @@ static void kvi_threadIgnoreSigalarm() // Funky hack for some Solaris machines (maybe others ?) // For an obscure (at least to me) reason // when using threads ,some part of the system - // starts kidding us by sending a SIGALRM in apparently + // starts kidding us by sending a SIGALRM in aptqparently // "random" circumstances. (Xlib ?) (XServer ?) // The default action for SIGALRM is to exit the application. // Could not guess more about this stuff... @@ -152,7 +152,7 @@ static void kvi_threadInitialize() // the maximum length of the slave->master queue // over this length , the slave is forced to usleep() -#define KVI_THREAD_MAX_EVENT_QUEUE_LENGTH 50 +#define KVI_THREAD_MAX_EVENT_TQUEUE_LENGTH 50 static KviThreadManager * g_pThreadManager = 0; @@ -169,7 +169,7 @@ void KviThreadManager::globalDestroy() } KviThreadManager::KviThreadManager() -: QObject() +: TQObject() { if(g_pThreadManager)debug("Hey...what are ya doing ?"); @@ -189,21 +189,21 @@ KviThreadManager::KviThreadManager() if(pipe(m_fd) != 0) { - debug("Ops...thread manager pipe creation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); + debug("Ops...thread manager pipe creation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); } if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_SLAVE],F_SETFL,O_NONBLOCK) == -1) { - debug("Ops...thread manager slave pipe initialisation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); + debug("Ops...thread manager slave pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); } if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],F_SETFL,O_NONBLOCK) == -1) { - debug("Ops...thread manager master pipe initialisation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); + debug("Ops...thread manager master pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); } - m_pSn = new QSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],QSocketNotifier::Read); - connect(m_pSn,SIGNAL(activated(int)),this,SLOT(eventsPending(int))); + m_pSn = new TQSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],TQSocketNotifier::Read); + connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(eventsPending(int))); m_pSn->setEnabled(true); #endif } @@ -257,7 +257,7 @@ KviThreadManager::~KviThreadManager() // byez :) } -void KviThreadManager::killPendingEvents(QObject * receiver) +void KviThreadManager::killPendingEvents(TQObject * receiver) { #ifndef COMPILE_ON_WINDOWS if(!g_pThreadManager)return; @@ -265,7 +265,7 @@ void KviThreadManager::killPendingEvents(QObject * receiver) #endif } -void KviThreadManager::killPendingEventsByReceiver(QObject * receiver) +void KviThreadManager::killPendingEventsByReceiver(TQObject * receiver) { #ifndef COMPILE_ON_WINDOWS KviPointerList<KviThreadPendingEvent> l; @@ -298,10 +298,10 @@ void KviThreadManager::unregisterSlaveThread(KviThread *t) m_pMutex->unlock(); } -void KviThreadManager::postSlaveEvent(QObject *o,QEvent *e) +void KviThreadManager::postSlaveEvent(TQObject *o,TQEvent *e) { #ifdef COMPILE_ON_WINDOWS - QApplication::postEvent(o,e); // we believe this to be thread-safe + TQApplication::postEvent(o,e); // we believe this to be thread-safe #else KviThreadPendingEvent * ev = new KviThreadPendingEvent; ev->o = o; @@ -319,7 +319,7 @@ void KviThreadManager::postSlaveEvent(QObject *o,QEvent *e) // on the main application thread we also can't artificially process the events. // So the solution is to skip this algorithm when at least one // thread is in waiting state. - while((m_pEventQueue->count() > KVI_THREAD_MAX_EVENT_QUEUE_LENGTH) && (m_iWaitingThreads < 1)) + while((m_pEventQueue->count() > KVI_THREAD_MAX_EVENT_TQUEUE_LENGTH) && (m_iWaitingThreads < 1)) { // wait for the master to process the queue @@ -379,7 +379,7 @@ void KviThreadManager::eventsPending(int fd) m_pMutex->unlock(); // let the app process the event // DANGER ! - QApplication::postEvent(ev->o,ev->e); + TQApplication::postEvent(ev->o,ev->e); // jump out of the loop if we have been destroyed if(!g_pThreadManager)return; @@ -574,7 +574,7 @@ void KviThread::sleep(unsigned long sec) #endif } -void KviThread::postEvent(QObject * o,QEvent *e) +void KviThread::postEvent(TQObject * o,TQEvent *e) { // slave side g_pThreadManager->postSlaveEvent(o,e); diff --git a/src/kvilib/system/kvi_thread.h b/src/kvilib/system/kvi_thread.h index bd6dab3b..f024505f 100644 --- a/src/kvilib/system/kvi_thread.h +++ b/src/kvilib/system/kvi_thread.h @@ -26,11 +26,11 @@ #include "kvi_heapobject.h" #include "kvi_string.h" -#include <qnamespace.h> -#include <qobject.h> -#include <qsocketnotifier.h> +#include <tqnamespace.h> +#include <tqobject.h> +#include <tqsocketnotifier.h> #include "kvi_pointerlist.h" -#include <qevent.h> +#include <tqevent.h> // @@ -181,7 +181,7 @@ private: bool m_bRunning; bool m_bStartingUp; KviMutex * m_pRunningMutex; - KviPointerList<QEvent> * m_pLocalEventQueue; + KviPointerList<TQEvent> * m_pLocalEventQueue; public: // public KviThread interface // HANDLE WITH CARE @@ -215,14 +215,14 @@ protected: void exit(); // The tricky part: threadsafe event dispatching // Slave thread -> main thread objects - void postEvent(QObject *o,QEvent *e); + void postEvent(TQObject *o,TQEvent *e); private: void setRunning(bool bRunning); void setStartingUp(bool bStartingUp); }; -// QEvent::Type for Thread events -#define KVI_THREAD_EVENT (((int)QEvent::User) + 2000) +// TQEvent::Type for Thread events +#define KVI_THREAD_EVENT (((int)TQEvent::User) + 2000) // CONSTANTS FOR KviThreadEvent::eventId(); @@ -261,14 +261,14 @@ private: // #warning "Get rid of the m_szMessage member of KviThreadEvent : eventual data should be passed with a KviThreadDataEvent" // Base class for all thread events -class KVILIB_API KviThreadEvent : public QEvent, public KviHeapObject +class KVILIB_API KviThreadEvent : public TQEvent, public KviHeapObject { protected: int m_eventId; KviThread * m_pSender; public: KviThreadEvent(int evId,KviThread * sender = 0) - : QEvent((QEvent::Type)KVI_THREAD_EVENT) , m_eventId(evId) , m_pSender(sender) {}; + : TQEvent((TQEvent::Type)KVI_THREAD_EVENT) , m_eventId(evId) , m_pSender(sender) {}; virtual ~KviThreadEvent(){}; public: // This is the sender of the event @@ -329,25 +329,26 @@ protected: typedef struct _KviThreadPendingEvent { - QObject *o; - QEvent *e; + TQObject *o; + TQEvent *e; } KviThreadPendingEvent; -class KVILIB_API KviThreadManager : public QObject +class KVILIB_API KviThreadManager : public TQObject { friend class KviApp; friend class KviThread; Q_OBJECT + TQ_OBJECT protected: // These should be private...but we don't want anyone to complain // Treat as private plz. KviThreadManager(); ~KviThreadManager(); public: - static void killPendingEvents(QObject * receiver); + static void killPendingEvents(TQObject * receiver); private: #ifndef COMPILE_ON_WINDOWS - QSocketNotifier * m_pSn; + TQSocketNotifier * m_pSn; #endif KviMutex * m_pMutex; // This class performs only atomic operations KviPointerList<KviThread> * m_pThreadList; @@ -365,8 +366,8 @@ protected: void threadEnteredWaitState(); void threadLeftWaitState(); - void postSlaveEvent(QObject *o,QEvent *e); - void killPendingEventsByReceiver(QObject * receiver); + void postSlaveEvent(TQObject *o,TQEvent *e); + void killPendingEventsByReceiver(TQObject * receiver); // Public to KviApp only static void globalInit(); static void globalDestroy(); diff --git a/src/kvilib/system/kvi_time.cpp b/src/kvilib/system/kvi_time.cpp index f500b7d4..a61b3e76 100644 --- a/src/kvilib/system/kvi_time.cpp +++ b/src/kvilib/system/kvi_time.cpp @@ -93,11 +93,11 @@ namespace KviTimeUtils *uS = uSecs % 60; } - QString formatTimeInterval(unsigned int uSeconds,int iFlags) + TQString formatTimeInterval(unsigned int uSeconds,int iFlags) { unsigned int d,h,m,s; secondsToDaysHoursMinsSecs(uSeconds,&d,&h,&m,&s); - QString ret; + TQString ret; // the following tricks maybe will help translators a bit... if(iFlags & FillWithHypens) { @@ -108,25 +108,25 @@ namespace KviTimeUtils if(h > 0) { if(iFlags & NoLeadingZeroes) - KviQString::sprintf(ret,__tr2qs("%u h %u m %u s"),h,m,s); + KviTQString::sprintf(ret,__tr2qs("%u h %u m %u s"),h,m,s); else - KviQString::sprintf(ret,__tr2qs("%u h %u%u m %u%u s"),h,m / 10,m % 10,s / 10,s % 10); + KviTQString::sprintf(ret,__tr2qs("%u h %u%u m %u%u s"),h,m / 10,m % 10,s / 10,s % 10); } else { if(m > 0) { if(iFlags & NoLeadingZeroes) - KviQString::sprintf(ret,__tr2qs("%u m %u s"),m,s); + KviTQString::sprintf(ret,__tr2qs("%u m %u s"),m,s); else - KviQString::sprintf(ret,__tr2qs("%u m %u%u s"),m,s / 10,s % 10); + KviTQString::sprintf(ret,__tr2qs("%u m %u%u s"),m,s / 10,s % 10); } else { - KviQString::sprintf(ret,__tr2qs("%u s"),s); + KviTQString::sprintf(ret,__tr2qs("%u s"),s); } } } else { if(iFlags & NoLeadingZeroes) - KviQString::sprintf(ret,__tr2qs("%u d %u h %u m %u s"),d,h,m,s); + KviTQString::sprintf(ret,__tr2qs("%u d %u h %u m %u s"),d,h,m,s); else - KviQString::sprintf(ret,__tr2qs("%u d %u%u h %u%u m %u%u s"),d,h / 10,h % 10,m / 10,m % 10,s / 10,s % 10); + KviTQString::sprintf(ret,__tr2qs("%u d %u%u h %u%u m %u%u s"),d,h / 10,h % 10,m / 10,m % 10,s / 10,s % 10); } } return ret; diff --git a/src/kvilib/system/kvi_time.h b/src/kvilib/system/kvi_time.h index 309eec10..67997e30 100644 --- a/src/kvilib/system/kvi_time.h +++ b/src/kvilib/system/kvi_time.h @@ -26,7 +26,7 @@ //============================================================================= #include "kvi_settings.h" -#include <qstring.h> +#include <tqstring.h> #include <time.h> // for time() @@ -86,7 +86,7 @@ namespace KviTimeUtils NoLeadingZeroes = 2, // no leading zeroes are printed in hours and seconds FillWithHypens = 4 // uses only -- %d -- %h -- etc.. discards all other flags }; - KVILIB_API QString formatTimeInterval(unsigned int uSeconds,int iFlags = 0); + KVILIB_API TQString formatTimeInterval(unsigned int uSeconds,int iFlags = 0); }; #endif //_KVI_TIME_H_ diff --git a/src/kvilib/system/moc_kvi_locale.cpp b/src/kvilib/system/moc_kvi_locale.cpp index 52e2ae22..5d31d72a 100644 --- a/src/kvilib/system/moc_kvi_locale.cpp +++ b/src/kvilib/system/moc_kvi_locale.cpp @@ -2,21 +2,21 @@ ** KviTranslator meta object code from reading C++ file 'kvi_locale.h' ** ** Created: Sun Mar 23 20:56:24 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_locale.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviTranslator::className() const @@ -24,69 +24,69 @@ const char *KviTranslator::className() const return "KviTranslator"; } -QMetaObject *KviTranslator::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviTranslator( "KviTranslator", &KviTranslator::staticMetaObject ); +TQMetaObject *KviTranslator::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviTranslator( "KviTranslator", &KviTranslator::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviTranslator::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviTranslator::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviTranslator", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviTranslator", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviTranslator::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviTranslator::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviTranslator", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviTranslator", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviTranslator::staticMetaObject() +TQMetaObject* KviTranslator::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QTranslator::staticMetaObject(); - metaObj = QMetaObject::new_metaobject( - "KviTranslator", parentObject, + TQMetaObject* tqparentObject = TQTranslator::staticMetaObject(); + metaObj = TQMetaObject::new_metaobject( + "KviTranslator", tqparentObject, 0, 0, 0, 0, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviTranslator.setMetaObject( metaObj ); return metaObj; } -void* KviTranslator::qt_cast( const char* clname ) +void* KviTranslator::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviTranslator" ) ) return this; - return QTranslator::qt_cast( clname ); + return TQTranslator::tqqt_cast( clname ); } -bool KviTranslator::qt_invoke( int _id, QUObject* _o ) +bool KviTranslator::qt_invoke( int _id, TQUObject* _o ) { - return QTranslator::qt_invoke(_id,_o); + return TQTranslator::qt_invoke(_id,_o); } -bool KviTranslator::qt_emit( int _id, QUObject* _o ) +bool KviTranslator::qt_emit( int _id, TQUObject* _o ) { - return QTranslator::qt_emit(_id,_o); + return TQTranslator::qt_emit(_id,_o); } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviTranslator::qt_property( int id, int f, QVariant* v) +bool KviTranslator::qt_property( int id, int f, TQVariant* v) { - return QTranslator::qt_property( id, f, v); + return TQTranslator::qt_property( id, f, v); } -bool KviTranslator::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviTranslator::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/system/moc_kvi_thread.cpp b/src/kvilib/system/moc_kvi_thread.cpp index 556849a9..41a824a9 100644 --- a/src/kvilib/system/moc_kvi_thread.cpp +++ b/src/kvilib/system/moc_kvi_thread.cpp @@ -2,21 +2,21 @@ ** KviThreadManager meta object code from reading C++ file 'kvi_thread.h' ** ** Created: Sun Mar 23 20:56:25 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_thread.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviThreadManager::className() const @@ -24,81 +24,81 @@ const char *KviThreadManager::className() const return "KviThreadManager"; } -QMetaObject *KviThreadManager::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviThreadManager( "KviThreadManager", &KviThreadManager::staticMetaObject ); +TQMetaObject *KviThreadManager::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviThreadManager( "KviThreadManager", &KviThreadManager::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviThreadManager::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviThreadManager::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviThreadManager", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviThreadManager", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviThreadManager::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviThreadManager::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviThreadManager", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviThreadManager", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviThreadManager::staticMetaObject() +TQMetaObject* KviThreadManager::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QObject::staticMetaObject(); - static const QUParameter param_slot_0[] = { - { "fd", &static_QUType_int, 0, QUParameter::In } + TQMetaObject* tqparentObject = TQObject::staticMetaObject(); + static const TQUParameter param_slot_0[] = { + { "fd", &static_TQUType_int, 0, TQUParameter::In } }; - static const QUMethod slot_0 = {"eventsPending", 1, param_slot_0 }; - static const QMetaData slot_tbl[] = { - { "eventsPending(int)", &slot_0, QMetaData::Private } + static const TQUMethod slot_0 = {"eventsPending", 1, param_slot_0 }; + static const TQMetaData slot_tbl[] = { + { "eventsPending(int)", &slot_0, TQMetaData::Private } }; - metaObj = QMetaObject::new_metaobject( - "KviThreadManager", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviThreadManager", tqparentObject, slot_tbl, 1, 0, 0, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviThreadManager.setMetaObject( metaObj ); return metaObj; } -void* KviThreadManager::qt_cast( const char* clname ) +void* KviThreadManager::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviThreadManager" ) ) return this; - return QObject::qt_cast( clname ); + return TQObject::tqqt_cast( clname ); } -bool KviThreadManager::qt_invoke( int _id, QUObject* _o ) +bool KviThreadManager::qt_invoke( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { - case 0: eventsPending((int)static_QUType_int.get(_o+1)); break; + case 0: eventsPending((int)static_TQUType_int.get(_o+1)); break; default: - return QObject::qt_invoke( _id, _o ); + return TQObject::qt_invoke( _id, _o ); } return TRUE; } -bool KviThreadManager::qt_emit( int _id, QUObject* _o ) +bool KviThreadManager::qt_emit( int _id, TQUObject* _o ) { - return QObject::qt_emit(_id,_o); + return TQObject::qt_emit(_id,_o); } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviThreadManager::qt_property( int id, int f, QVariant* v) +bool KviThreadManager::qt_property( int id, int f, TQVariant* v) { - return QObject::qt_property( id, f, v); + return TQObject::qt_property( id, f, v); } -bool KviThreadManager::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviThreadManager::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES diff --git a/src/kvilib/tal/kvi_tal_application.cpp b/src/kvilib/tal/kvi_tal_application.cpp index 4d8bd0d5..b78e1567 100644 --- a/src/kvilib/tal/kvi_tal_application.cpp +++ b/src/kvilib/tal/kvi_tal_application.cpp @@ -56,7 +56,7 @@ #else KviTalApplication::KviTalApplication(int &argc,char ** argv) - : QApplication(argc,argv) + : TQApplication(argc,argv) { } diff --git a/src/kvilib/tal/kvi_tal_application_kde.h b/src/kvilib/tal/kvi_tal_application_kde.h index 05d6e87f..c3149e3d 100644 --- a/src/kvilib/tal/kvi_tal_application_kde.h +++ b/src/kvilib/tal/kvi_tal_application_kde.h @@ -29,6 +29,7 @@ class KVILIB_API KviTalApplication : public KApplication { Q_OBJECT + TQ_OBJECT public: KviTalApplication(int &argc,char ** argv); ~KviTalApplication(); diff --git a/src/kvilib/tal/kvi_tal_application_qt.h b/src/kvilib/tal/kvi_tal_application_qt.h index 953608fe..96ff1dbb 100644 --- a/src/kvilib/tal/kvi_tal_application_qt.h +++ b/src/kvilib/tal/kvi_tal_application_qt.h @@ -1,5 +1,5 @@ -#ifndef _KVI_TAL_APPLICATION_QT_H_ -#define _KVI_TAL_APPLICATION_QT_H_ +#ifndef _KVI_TAL_APPLICATION_TQT_H_ +#define _KVI_TAL_APPLICATION_TQT_H_ // // File : kvi_tal_application_qt.h @@ -23,15 +23,16 @@ // Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qapplication.h> +#include <tqapplication.h> -class KVILIB_API KviTalApplication : public QApplication +class KVILIB_API KviTalApplication : public TQApplication { Q_OBJECT + TQ_OBJECT public: KviTalApplication(int &argc,char ** argv); ~KviTalApplication(); }; -#endif // _KVI_TAL_APPLICATION_QT_H_ +#endif // _KVI_TAL_APPLICATION_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_filedialog.cpp b/src/kvilib/tal/kvi_tal_filedialog.cpp index b345fd0b..5760a90c 100644 --- a/src/kvilib/tal/kvi_tal_filedialog.cpp +++ b/src/kvilib/tal/kvi_tal_filedialog.cpp @@ -29,10 +29,10 @@ #ifdef COMPILE_USE_QT4 - #include <qdir.h> + #include <tqdir.h> - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : QFileDialog(parent,"",dirName,filter) + KviTalFileDialog::KviTalFileDialog(const TQString &dirName,const TQString &filter,TQWidget *tqparent,const char *name,bool modal) + : TQFileDialog(tqparent,"",dirName,filter) { setModal(modal); } @@ -46,29 +46,29 @@ switch(m) { case AnyFile: - QFileDialog::setFileMode(QFileDialog::AnyFile); + TQFileDialog::setFileMode(TQFileDialog::AnyFile); break; case ExistingFile: - QFileDialog::setFileMode(QFileDialog::ExistingFile); + TQFileDialog::setFileMode(TQFileDialog::ExistingFile); break; case ExistingFiles: - QFileDialog::setFileMode(QFileDialog::ExistingFiles); + TQFileDialog::setFileMode(TQFileDialog::ExistingFiles); break; case Directory: - QFileDialog::setFileMode(QFileDialog::Directory); + TQFileDialog::setFileMode(TQFileDialog::Directory); break; case DirectoryOnly: - QFileDialog::setFileMode(QFileDialog::DirectoryOnly); + TQFileDialog::setFileMode(TQFileDialog::DirectoryOnly); break; default: - QFileDialog::setFileMode(QFileDialog::AnyFile); + TQFileDialog::setFileMode(TQFileDialog::AnyFile); break; } } - void KviTalFileDialog::setDirectory(const QString &szDirectory) + void KviTalFileDialog::setDirectory(const TQString &szDirectory) { - QFileDialog::setDirectory(szDirectory); + TQFileDialog::setDirectory(szDirectory); } @@ -78,8 +78,8 @@ #ifdef COMPILE_KDE_SUPPORT - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : KFileDialog(dirName,filter,parent,name,modal) + KviTalFileDialog::KviTalFileDialog(const TQString &dirName,const TQString &filter,TQWidget *tqparent,const char *name,bool modal) + : KFileDialog(dirName,filter,tqparent,name,modal) { clearWFlags(WDestructiveClose); } @@ -117,7 +117,7 @@ } } - void KviTalFileDialog::setDirectory(const QString &szDirectory) + void KviTalFileDialog::setDirectory(const TQString &szDirectory) { setURL(szDirectory); } @@ -127,10 +127,10 @@ #else - #include <qdir.h> + #include <tqdir.h> - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : QFileDialog(dirName,filter,parent,name,modal) + KviTalFileDialog::KviTalFileDialog(const TQString &dirName,const TQString &filter,TQWidget *tqparent,const char *name,bool modal) + : TQFileDialog(dirName,filter,tqparent,name,modal) { clearWFlags(WDestructiveClose); } @@ -144,29 +144,29 @@ switch(m) { case AnyFile: - setMode(QFileDialog::AnyFile); + setMode(TQFileDialog::AnyFile); break; case ExistingFile: - setMode(QFileDialog::ExistingFile); + setMode(TQFileDialog::ExistingFile); break; case ExistingFiles: - setMode(QFileDialog::ExistingFiles); + setMode(TQFileDialog::ExistingFiles); break; case Directory: - setMode(QFileDialog::Directory); + setMode(TQFileDialog::Directory); break; case DirectoryOnly: - setMode(QFileDialog::DirectoryOnly); + setMode(TQFileDialog::DirectoryOnly); break; default: - setMode(QFileDialog::AnyFile); + setMode(TQFileDialog::AnyFile); break; } } - void KviTalFileDialog::setDirectory(const QString &szDirectory) + void KviTalFileDialog::setDirectory(const TQString &szDirectory) { - setDir(QDir(szDirectory)); + setDir(TQDir(szDirectory)); } diff --git a/src/kvilib/tal/kvi_tal_filedialog_kde.h b/src/kvilib/tal/kvi_tal_filedialog_kde.h index 0f04a80c..5285aa16 100644 --- a/src/kvilib/tal/kvi_tal_filedialog_kde.h +++ b/src/kvilib/tal/kvi_tal_filedialog_kde.h @@ -24,26 +24,27 @@ // #include <kfiledialog.h> -#include <qfiledialog.h> +#include <tqfiledialog.h> class KVILIB_API KviTalFileDialog : public KFileDialog { Q_OBJECT + TQ_OBJECT public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); + KviTalFileDialog(const TQString &dirName,const TQString &filter = TQString(),TQWidget *tqparent = 0,const char *name = 0,bool modal = FALSE); ~KviTalFileDialog(); public: enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); + void setDirectory(const TQString &szDirectory); - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) + static TQString getExistingDirectoryPath(const TQString &dir = TQString(),const TQString &caption = TQString(),TQWidget *tqparent = 0) { - // QFileDialog allows making new directories...kfiledialog not :/ - return QFileDialog::getExistingDirectory(dir,parent,0,caption); - //return getExistingDirectory(dir,parent,caption); + // TQFileDialog allows making new directories...kfiledialog not :/ + return TQFileDialog::getExistingDirectory(dir,tqparent,0,caption); + //return getExistingDirectory(dir,tqparent,caption); }; }; diff --git a/src/kvilib/tal/kvi_tal_filedialog_qt.h b/src/kvilib/tal/kvi_tal_filedialog_qt.h index 14a24854..0eebfc61 100644 --- a/src/kvilib/tal/kvi_tal_filedialog_qt.h +++ b/src/kvilib/tal/kvi_tal_filedialog_qt.h @@ -1,5 +1,5 @@ -#ifndef _KVI_TAL_FILEDIALOG_QT_H_ -#define _KVI_TAL_FILEDIALOG_QT_H_ +#ifndef _KVI_TAL_FILEDIALOG_TQT_H_ +#define _KVI_TAL_FILEDIALOG_TQT_H_ // // File : kvi_tal_filedialog_qt.h @@ -23,22 +23,23 @@ // Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qfiledialog.h> +#include <tqfiledialog.h> -class KVILIB_API KviTalFileDialog : public QFileDialog +class KVILIB_API KviTalFileDialog : public TQFileDialog { Q_OBJECT + TQ_OBJECT public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); + KviTalFileDialog(const TQString &dirName,const TQString &filter = TQString(),TQWidget *tqparent = 0,const char *name = 0,bool modal = FALSE); ~KviTalFileDialog(); public: enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); + void setDirectory(const TQString &szDirectory); - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { return getExistingDirectory(dir,parent,0 /* name */,caption); }; + static TQString getExistingDirectoryPath(const TQString &dir = TQString(),const TQString &caption = TQString(),TQWidget *tqparent = 0) + { return getExistingDirectory(dir,tqparent,0 /* name */,caption); }; }; -#endif // _KVI_TAL_FILEDIALOG_QT_H_ +#endif // _KVI_TAL_FILEDIALOG_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_filedialog_qt4.h b/src/kvilib/tal/kvi_tal_filedialog_qt4.h index eb5f7ab6..18bb420e 100644 --- a/src/kvilib/tal/kvi_tal_filedialog_qt4.h +++ b/src/kvilib/tal/kvi_tal_filedialog_qt4.h @@ -25,22 +25,23 @@ // //============================================================================= -#include <qfiledialog.h> +#include <tqfiledialog.h> -class KVILIB_API KviTalFileDialog : public QFileDialog +class KVILIB_API KviTalFileDialog : public TQFileDialog { Q_OBJECT + TQ_OBJECT public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); + KviTalFileDialog(const TQString &dirName,const TQString &filter = TQString(),TQWidget *tqparent = 0,const char *name = 0,bool modal = FALSE); ~KviTalFileDialog(); public: enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); + void setDirectory(const TQString &szDirectory); - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { return getExistingDirectory(parent,caption,dir); }; + static TQString getExistingDirectoryPath(const TQString &dir = TQString(),const TQString &caption = TQString(),TQWidget *tqparent = 0) + { return getExistingDirectory(tqparent,caption,dir); }; }; -#endif // _KVI_TAL_FILEDIALOG_QT_H_ +#endif // _KVI_TAL_FILEDIALOG_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_grid_qt3.h b/src/kvilib/tal/kvi_tal_grid_qt3.h index fd77d15c..80ab6387 100644 --- a/src/kvilib/tal/kvi_tal_grid_qt3.h +++ b/src/kvilib/tal/kvi_tal_grid_qt3.h @@ -25,14 +25,15 @@ // //============================================================================= -#include <qgrid.h> +#include <tqgrid.h> -class KVILIB_API KviTalGrid : public QGrid +class KVILIB_API KviTalGrid : public TQGrid { Q_OBJECT + TQ_OBJECT public: - KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) - : QGrid(n,orient,pParent) {}; + KviTalGrid(int n,Qt::Orientation orient,TQWidget * pParent = 0) + : TQGrid(n,orient,pParent) {}; ~KviTalGrid() {}; }; diff --git a/src/kvilib/tal/kvi_tal_grid_qt4.h b/src/kvilib/tal/kvi_tal_grid_qt4.h index 57612b3c..c117ec17 100644 --- a/src/kvilib/tal/kvi_tal_grid_qt4.h +++ b/src/kvilib/tal/kvi_tal_grid_qt4.h @@ -27,13 +27,14 @@ #include "kvi_settings.h" -#include <q3grid.h> +#include <tq3grid.h> class KVILIB_API KviTalGrid : public Q3Grid { Q_OBJECT + TQ_OBJECT public: - KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) + KviTalGrid(int n,Qt::Orientation orient,TQWidget * pParent = 0) : Q3Grid(n,orient,pParent) {}; ~KviTalGrid() {}; }; diff --git a/src/kvilib/tal/kvi_tal_groupbox_qt3.h b/src/kvilib/tal/kvi_tal_groupbox_qt3.h index be3340a3..12369208 100644 --- a/src/kvilib/tal/kvi_tal_groupbox_qt3.h +++ b/src/kvilib/tal/kvi_tal_groupbox_qt3.h @@ -25,20 +25,21 @@ // //============================================================================= -#include <qgroupbox.h> +#include <tqgroupbox.h> -class KVILIB_API KviTalGroupBox : public QGroupBox +class KVILIB_API KviTalGroupBox : public TQGroupBox { Q_OBJECT + TQ_OBJECT public: - KviTalGroupBox(QWidget * parent = 0) - : QGroupBox(parent) {}; - KviTalGroupBox(const QString & title,QWidget * parent = 0) - : QGroupBox(title,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,QWidget * parent = 0) - : QGroupBox(strips,orientation,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,const QString & title,QWidget * parent = 0) - : QGroupBox(strips,orientation,title,parent) {}; + KviTalGroupBox(TQWidget * tqparent = 0) + : TQGroupBox(tqparent) {}; + KviTalGroupBox(const TQString & title,TQWidget * tqparent = 0) + : TQGroupBox(title,tqparent) {}; + KviTalGroupBox(int strips,Qt::Orientation orientation,TQWidget * tqparent = 0) + : TQGroupBox(strips,orientation,tqparent) {}; + KviTalGroupBox(int strips,Qt::Orientation orientation,const TQString & title,TQWidget * tqparent = 0) + : TQGroupBox(strips,orientation,title,tqparent) {}; ~KviTalGroupBox() {}; }; diff --git a/src/kvilib/tal/kvi_tal_groupbox_qt4.h b/src/kvilib/tal/kvi_tal_groupbox_qt4.h index c8917385..1b34de14 100644 --- a/src/kvilib/tal/kvi_tal_groupbox_qt4.h +++ b/src/kvilib/tal/kvi_tal_groupbox_qt4.h @@ -25,20 +25,21 @@ // //============================================================================= -#include <q3groupbox.h> +#include <tq3groupbox.h> class KVILIB_API KviTalGroupBox : public Q3GroupBox { Q_OBJECT + TQ_OBJECT public: - KviTalGroupBox(QWidget * parent = 0) - : Q3GroupBox(parent) {}; - KviTalGroupBox(const QString & title,QWidget * parent = 0) - : Q3GroupBox(title,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,QWidget * parent = 0) - : Q3GroupBox(strips,orientation,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,const QString & title,QWidget * parent = 0) - : Q3GroupBox(strips,orientation,title,parent) {}; + KviTalGroupBox(TQWidget * tqparent = 0) + : Q3GroupBox(tqparent) {}; + KviTalGroupBox(const TQString & title,TQWidget * tqparent = 0) + : Q3GroupBox(title,tqparent) {}; + KviTalGroupBox(int strips,Qt::Orientation orientation,TQWidget * tqparent = 0) + : Q3GroupBox(strips,orientation,tqparent) {}; + KviTalGroupBox(int strips,Qt::Orientation orientation,const TQString & title,TQWidget * tqparent = 0) + : Q3GroupBox(strips,orientation,title,tqparent) {}; ~KviTalGroupBox() {}; }; diff --git a/src/kvilib/tal/kvi_tal_hbox_qt3.h b/src/kvilib/tal/kvi_tal_hbox_qt3.h index 992ca03a..79d25b32 100644 --- a/src/kvilib/tal/kvi_tal_hbox_qt3.h +++ b/src/kvilib/tal/kvi_tal_hbox_qt3.h @@ -27,14 +27,15 @@ #include "kvi_settings.h" -#include <qhbox.h> +#include <tqhbox.h> -class KVILIB_API KviTalHBox : public QHBox +class KVILIB_API KviTalHBox : public TQHBox { Q_OBJECT + TQ_OBJECT public: - KviTalHBox(QWidget * pParent) - : QHBox(pParent) {}; + KviTalHBox(TQWidget * pParent) + : TQHBox(pParent) {}; virtual ~KviTalHBox() {}; }; diff --git a/src/kvilib/tal/kvi_tal_hbox_qt4.h b/src/kvilib/tal/kvi_tal_hbox_qt4.h index 384910c2..3ac5f426 100644 --- a/src/kvilib/tal/kvi_tal_hbox_qt4.h +++ b/src/kvilib/tal/kvi_tal_hbox_qt4.h @@ -27,13 +27,14 @@ #include "kvi_settings.h" -#include <q3hbox.h> +#include <tq3hbox.h> class KVILIB_API KviTalHBox : public Q3HBox { Q_OBJECT + TQ_OBJECT public: - KviTalHBox(QWidget * pParent,char* name=0) + KviTalHBox(TQWidget * pParent,char* name=0) : Q3HBox(pParent,name) {}; virtual ~KviTalHBox() {}; }; diff --git a/src/kvilib/tal/kvi_tal_iconview.cpp b/src/kvilib/tal/kvi_tal_iconview.cpp index 2f63388c..45b640fd 100644 --- a/src/kvilib/tal/kvi_tal_iconview.cpp +++ b/src/kvilib/tal/kvi_tal_iconview.cpp @@ -27,23 +27,23 @@ #ifdef COMPILE_USE_QT4 - KviTalIconView::KviTalIconView(QWidget * pParent,Qt::WFlags f) + KviTalIconView::KviTalIconView(TQWidget * pParent,TQt::WFlags f) : Q3IconView(pParent,0,f) { - connect(this,SIGNAL(selectionChanged(Q3IconViewItem *)),this,SLOT(redirect_selectionChanged(Q3IconViewItem *))); - connect(this,SIGNAL(currentChanged(Q3IconViewItem *)),this,SLOT(redirect_currentChanged(Q3IconViewItem *))); - connect(this,SIGNAL(clicked(Q3IconViewItem *)),this,SLOT(redirect_clicked(Q3IconViewItem *))); - connect(this,SIGNAL(clicked(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_clicked(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(pressed(Q3IconViewItem *)),this,SLOT(redirect_pressed(Q3IconViewItem *))); - connect(this,SIGNAL(pressed(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_pressed(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(Q3IconViewItem *)),this,SLOT(redirect_doubleClicked(Q3IconViewItem *))); - connect(this,SIGNAL(returnPressed(Q3IconViewItem *)),this,SLOT(redirect_returnPressed(Q3IconViewItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonClicked(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonPressed(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(onItem(Q3IconViewItem *)),this,SLOT(redirect_onItem(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(selectionChanged(Q3IconViewItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(currentChanged(Q3IconViewItem *)),this,TQT_SLOT(redirect_currentChanged(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(clicked(Q3IconViewItem *)),this,TQT_SLOT(redirect_clicked(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(clicked(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(pressed(Q3IconViewItem *)),this,TQT_SLOT(redirect_pressed(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(pressed(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(doubleClicked(Q3IconViewItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(returnPressed(Q3IconViewItem *)),this,TQT_SLOT(redirect_returnPressed(Q3IconViewItem *))); + connect(this,TQT_SIGNAL(rightButtonClicked(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(rightButtonPressed(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(contextMenuRequested(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(Q3IconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(onItem(Q3IconViewItem *)),this,TQT_SLOT(redirect_onItem(Q3IconViewItem *))); } void KviTalIconView::redirect_selectionChanged(Q3IconViewItem * pItem) @@ -61,7 +61,7 @@ emit clicked((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_clicked(Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_clicked(Q3IconViewItem * pItem,const TQPoint &pnt) { emit clicked((KviTalIconViewItem *)pItem,pnt); } @@ -71,7 +71,7 @@ emit pressed((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_pressed(Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_pressed(Q3IconViewItem * pItem,const TQPoint &pnt) { emit pressed((KviTalIconViewItem *)pItem,pnt); } @@ -86,27 +86,27 @@ emit returnPressed((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_rightButtonClicked(Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_rightButtonClicked(Q3IconViewItem * pItem,const TQPoint &pnt) { emit rightButtonClicked((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_rightButtonPressed(Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_rightButtonPressed(Q3IconViewItem * pItem,const TQPoint &pnt) { emit rightButtonPressed((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt) { emit mouseButtonClicked(iButton,(KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt) { emit mouseButtonPressed(iButton,(KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_contextMenuRequested(Q3IconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_contextMenuRequested(Q3IconViewItem * pItem,const TQPoint &pnt) { emit contextMenuRequested((KviTalIconViewItem *)pItem,pnt); } @@ -120,91 +120,91 @@ #include "kvi_tal_iconview_qt4.moc" #else - KviTalIconView::KviTalIconView(QWidget * pParent,Qt::WFlags f) - : QIconView(pParent,0,f) + KviTalIconView::KviTalIconView(TQWidget * pParent,TQt::WFlags f) + : TQIconView(pParent,0,f) { - connect(this,SIGNAL(selectionChanged(QIconViewItem *)),this,SLOT(redirect_selectionChanged(QIconViewItem *))); - connect(this,SIGNAL(currentChanged(QIconViewItem *)),this,SLOT(redirect_currentChanged(QIconViewItem *))); - connect(this,SIGNAL(clicked(QIconViewItem *)),this,SLOT(redirect_clicked(QIconViewItem *))); - connect(this,SIGNAL(clicked(QIconViewItem *,const QPoint &)),this,SLOT(redirect_clicked(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(pressed(QIconViewItem *)),this,SLOT(redirect_pressed(QIconViewItem *))); - connect(this,SIGNAL(pressed(QIconViewItem *,const QPoint &)),this,SLOT(redirect_pressed(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(QIconViewItem *)),this,SLOT(redirect_doubleClicked(QIconViewItem *))); - connect(this,SIGNAL(returnPressed(QIconViewItem *)),this,SLOT(redirect_returnPressed(QIconViewItem *))); - connect(this,SIGNAL(rightButtonClicked(QIconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonClicked(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(QIconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonPressed(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,QIconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,QIconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(QIconViewItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(onItem(QIconViewItem *)),this,SLOT(redirect_onItem(QIconViewItem *))); + connect(this,TQT_SIGNAL(selectionChanged(TQIconViewItem *)),this,TQT_SLOT(redirect_selectionChanged(TQIconViewItem *))); + connect(this,TQT_SIGNAL(currentChanged(TQIconViewItem *)),this,TQT_SLOT(redirect_currentChanged(TQIconViewItem *))); + connect(this,TQT_SIGNAL(clicked(TQIconViewItem *)),this,TQT_SLOT(redirect_clicked(TQIconViewItem *))); + connect(this,TQT_SIGNAL(clicked(TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(pressed(TQIconViewItem *)),this,TQT_SLOT(redirect_pressed(TQIconViewItem *))); + connect(this,TQT_SIGNAL(pressed(TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(doubleClicked(TQIconViewItem *)),this,TQT_SLOT(redirect_doubleClicked(TQIconViewItem *))); + connect(this,TQT_SIGNAL(returnPressed(TQIconViewItem *)),this,TQT_SLOT(redirect_returnPressed(TQIconViewItem *))); + connect(this,TQT_SIGNAL(rightButtonClicked(TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(rightButtonPressed(TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonClicked(int,TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonPressed(int,TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(contextMenuRequested(TQIconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(TQIconViewItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(onItem(TQIconViewItem *)),this,TQT_SLOT(redirect_onItem(TQIconViewItem *))); } - void KviTalIconView::redirect_selectionChanged(QIconViewItem * pItem) + void KviTalIconView::redirect_selectionChanged(TQIconViewItem * pItem) { emit selectionChanged((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_currentChanged(QIconViewItem * pItem) + void KviTalIconView::redirect_currentChanged(TQIconViewItem * pItem) { emit currentChanged((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_clicked(QIconViewItem * pItem) + void KviTalIconView::redirect_clicked(TQIconViewItem * pItem) { emit clicked((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_clicked(QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_clicked(TQIconViewItem * pItem,const TQPoint &pnt) { emit clicked((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_pressed(QIconViewItem * pItem) + void KviTalIconView::redirect_pressed(TQIconViewItem * pItem) { emit pressed((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_pressed(QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_pressed(TQIconViewItem * pItem,const TQPoint &pnt) { emit pressed((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_doubleClicked(QIconViewItem * pItem) + void KviTalIconView::redirect_doubleClicked(TQIconViewItem * pItem) { emit doubleClicked((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_returnPressed(QIconViewItem * pItem) + void KviTalIconView::redirect_returnPressed(TQIconViewItem * pItem) { emit returnPressed((KviTalIconViewItem *)pItem); } - void KviTalIconView::redirect_rightButtonClicked(QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_rightButtonClicked(TQIconViewItem * pItem,const TQPoint &pnt) { emit rightButtonClicked((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_rightButtonPressed(QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_rightButtonPressed(TQIconViewItem * pItem,const TQPoint &pnt) { emit rightButtonPressed((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_mouseButtonClicked(int iButton,QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_mouseButtonClicked(int iButton,TQIconViewItem * pItem,const TQPoint &pnt) { emit mouseButtonClicked(iButton,(KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_mouseButtonPressed(int iButton,QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_mouseButtonPressed(int iButton,TQIconViewItem * pItem,const TQPoint &pnt) { emit mouseButtonPressed(iButton,(KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_contextMenuRequested(QIconViewItem * pItem,const QPoint &pnt) + void KviTalIconView::redirect_contextMenuRequested(TQIconViewItem * pItem,const TQPoint &pnt) { emit contextMenuRequested((KviTalIconViewItem *)pItem,pnt); } - void KviTalIconView::redirect_onItem(QIconViewItem * pItem) + void KviTalIconView::redirect_onItem(TQIconViewItem * pItem) { emit onItem((KviTalIconViewItem *)pItem); } diff --git a/src/kvilib/tal/kvi_tal_iconview_qt3.h b/src/kvilib/tal/kvi_tal_iconview_qt3.h index 7cfec586..73d367c6 100644 --- a/src/kvilib/tal/kvi_tal_iconview_qt3.h +++ b/src/kvilib/tal/kvi_tal_iconview_qt3.h @@ -28,72 +28,73 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <qiconview.h> +#include <tqiconview.h> class KviTalIconViewItem; -class KVILIB_API KviTalIconView : public QIconView +class KVILIB_API KviTalIconView : public TQIconView { Q_OBJECT + TQ_OBJECT public: - KviTalIconView(QWidget * pParent,Qt::WFlags f = 0); + KviTalIconView(TQWidget * pParent,TQt::WFlags f = 0); virtual ~KviTalIconView() {}; signals: void selectionChanged(KviTalIconViewItem * pItem); void currentChanged(KviTalIconViewItem * pItem); void clicked(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem,const QPoint &pnt); + void clicked(KviTalIconViewItem * pItem,const TQPoint &pnt); void pressed(KviTalIconViewItem * pItem); - void pressed(KviTalIconViewItem * pItem,const QPoint &pnt); + void pressed(KviTalIconViewItem * pItem,const TQPoint &pnt); void doubleClicked(KviTalIconViewItem * pItem); void returnPressed(KviTalIconViewItem * pItem); - void rightButtonClicked(KviTalIconViewItem * pItem,const QPoint &pnt); - void rightButtonPressed(KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void contextMenuRequested(KviTalIconViewItem * pItem,const QPoint &pnt); + void rightButtonClicked(KviTalIconViewItem * pItem,const TQPoint &pnt); + void rightButtonPressed(KviTalIconViewItem * pItem,const TQPoint &pnt); + void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt); + void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt); + void contextMenuRequested(KviTalIconViewItem * pItem,const TQPoint &pnt); void onItem(KviTalIconViewItem * pItem); protected slots: - void redirect_selectionChanged(QIconViewItem * pItem); - void redirect_currentChanged(QIconViewItem * pItem); - void redirect_clicked(QIconViewItem * pItem); - void redirect_clicked(QIconViewItem * pItem,const QPoint &pnt); - void redirect_pressed(QIconViewItem * pItem); - void redirect_pressed(QIconViewItem * pItem,const QPoint &pnt); - void redirect_doubleClicked(QIconViewItem * pItem); - void redirect_returnPressed(QIconViewItem * pItem); - void redirect_rightButtonClicked(QIconViewItem * pItem,const QPoint &pnt); - void redirect_rightButtonPressed(QIconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonClicked(int iButton,QIconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonPressed(int iButton,QIconViewItem * pItem,const QPoint &pnt); - void redirect_contextMenuRequested(QIconViewItem * pItem,const QPoint &pnt); - void redirect_onItem(QIconViewItem * pItem); + void redirect_selectionChanged(TQIconViewItem * pItem); + void redirect_currentChanged(TQIconViewItem * pItem); + void redirect_clicked(TQIconViewItem * pItem); + void redirect_clicked(TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_pressed(TQIconViewItem * pItem); + void redirect_pressed(TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_doubleClicked(TQIconViewItem * pItem); + void redirect_returnPressed(TQIconViewItem * pItem); + void redirect_rightButtonClicked(TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_rightButtonPressed(TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_mouseButtonClicked(int iButton,TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_mouseButtonPressed(int iButton,TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_contextMenuRequested(TQIconViewItem * pItem,const TQPoint &pnt); + void redirect_onItem(TQIconViewItem * pItem); public: - KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)QIconView::firstItem(); }; - KviTalIconViewItem * lastItem() const { return (KviTalIconViewItem *)QIconView::lastItem(); }; - KviTalIconViewItem * currentItem() const { return (KviTalIconViewItem *)QIconView::currentItem(); }; + KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)TQIconView::firstItem(); }; + KviTalIconViewItem * lastItem() const { return (KviTalIconViewItem *)TQIconView::lastItem(); }; + KviTalIconViewItem * currentItem() const { return (KviTalIconViewItem *)TQIconView::currentItem(); }; }; -class KVILIB_API KviTalIconViewItem : public QIconViewItem +class KVILIB_API KviTalIconViewItem : public TQIconViewItem { public: - KviTalIconViewItem(KviTalIconView * parent) - : QIconViewItem(parent) {}; - KviTalIconViewItem(KviTalIconView * parent,KviTalIconViewItem * after) - : QIconViewItem(parent,after) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text) - : QIconViewItem(parent,text) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text) - : QIconViewItem(parent,after,text) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text, const QPixmap & icon) - : QIconViewItem(parent,text,icon) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text, const QPixmap & icon) - : QIconViewItem(parent,after,text,icon) {}; + KviTalIconViewItem(KviTalIconView * tqparent) + : TQIconViewItem(tqparent) {}; + KviTalIconViewItem(KviTalIconView * tqparent,KviTalIconViewItem * after) + : TQIconViewItem(tqparent,after) {}; + KviTalIconViewItem(KviTalIconView * tqparent, const TQString & text) + : TQIconViewItem(tqparent,text) {}; + KviTalIconViewItem(KviTalIconView * tqparent, KviTalIconViewItem * after, const TQString & text) + : TQIconViewItem(tqparent,after,text) {}; + KviTalIconViewItem(KviTalIconView * tqparent, const TQString & text, const TQPixmap & icon) + : TQIconViewItem(tqparent,text,icon) {}; + KviTalIconViewItem(KviTalIconView * tqparent, KviTalIconViewItem * after, const TQString & text, const TQPixmap & icon) + : TQIconViewItem(tqparent,after,text,icon) {}; public: - KviTalIconView * iconView() const { return (KviTalIconView *)QIconViewItem::iconView(); }; - KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)QIconViewItem::prevItem(); }; - KviTalIconViewItem * nextItem() const { return (KviTalIconViewItem *)QIconViewItem::nextItem(); }; + KviTalIconView * iconView() const { return (KviTalIconView *)TQIconViewItem::iconView(); }; + KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)TQIconViewItem::prevItem(); }; + KviTalIconViewItem * nextItem() const { return (KviTalIconViewItem *)TQIconViewItem::nextItem(); }; }; diff --git a/src/kvilib/tal/kvi_tal_iconview_qt4.h b/src/kvilib/tal/kvi_tal_iconview_qt4.h index 899acaac..99554341 100644 --- a/src/kvilib/tal/kvi_tal_iconview_qt4.h +++ b/src/kvilib/tal/kvi_tal_iconview_qt4.h @@ -28,45 +28,46 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <q3iconview.h> +#include <tq3iconview.h> class KviTalIconViewItem; class KVILIB_API KviTalIconView : public Q3IconView { Q_OBJECT + TQ_OBJECT public: - KviTalIconView(QWidget * pParent,Qt::WFlags f = 0); + KviTalIconView(TQWidget * pParent,TQt::WFlags f = 0); virtual ~KviTalIconView() {}; signals: void selectionChanged(KviTalIconViewItem * pItem); void currentChanged(KviTalIconViewItem * pItem); void clicked(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem,const QPoint &pnt); + void clicked(KviTalIconViewItem * pItem,const TQPoint &pnt); void pressed(KviTalIconViewItem * pItem); - void pressed(KviTalIconViewItem * pItem,const QPoint &pnt); + void pressed(KviTalIconViewItem * pItem,const TQPoint &pnt); void doubleClicked(KviTalIconViewItem * pItem); void returnPressed(KviTalIconViewItem * pItem); - void rightButtonClicked(KviTalIconViewItem * pItem,const QPoint &pnt); - void rightButtonPressed(KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void contextMenuRequested(KviTalIconViewItem * pItem,const QPoint &pnt); + void rightButtonClicked(KviTalIconViewItem * pItem,const TQPoint &pnt); + void rightButtonPressed(KviTalIconViewItem * pItem,const TQPoint &pnt); + void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt); + void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt); + void contextMenuRequested(KviTalIconViewItem * pItem,const TQPoint &pnt); void onItem(KviTalIconViewItem * pItem); protected slots: void redirect_selectionChanged(Q3IconViewItem * pItem); void redirect_currentChanged(Q3IconViewItem * pItem); void redirect_clicked(Q3IconViewItem * pItem); - void redirect_clicked(Q3IconViewItem * pItem,const QPoint &pnt); + void redirect_clicked(Q3IconViewItem * pItem,const TQPoint &pnt); void redirect_pressed(Q3IconViewItem * pItem); - void redirect_pressed(Q3IconViewItem * pItem,const QPoint &pnt); + void redirect_pressed(Q3IconViewItem * pItem,const TQPoint &pnt); void redirect_doubleClicked(Q3IconViewItem * pItem); void redirect_returnPressed(Q3IconViewItem * pItem); - void redirect_rightButtonClicked(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_rightButtonPressed(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_contextMenuRequested(Q3IconViewItem * pItem,const QPoint &pnt); + void redirect_rightButtonClicked(Q3IconViewItem * pItem,const TQPoint &pnt); + void redirect_rightButtonPressed(Q3IconViewItem * pItem,const TQPoint &pnt); + void redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt); + void redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt); + void redirect_contextMenuRequested(Q3IconViewItem * pItem,const TQPoint &pnt); void redirect_onItem(Q3IconViewItem * pItem); public: KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)Q3IconView::firstItem(); }; @@ -77,18 +78,18 @@ public: class KVILIB_API KviTalIconViewItem : public Q3IconViewItem { public: - KviTalIconViewItem(KviTalIconView * parent) - : Q3IconViewItem(parent) {}; - KviTalIconViewItem(KviTalIconView * parent,KviTalIconViewItem * after) - : Q3IconViewItem(parent,after) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text) - : Q3IconViewItem(parent,text) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text) - : Q3IconViewItem(parent,after,text) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text, const QPixmap & icon) - : Q3IconViewItem(parent,text,icon) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text, const QPixmap & icon) - : Q3IconViewItem(parent,after,text,icon) {}; + KviTalIconViewItem(KviTalIconView * tqparent) + : Q3IconViewItem(tqparent) {}; + KviTalIconViewItem(KviTalIconView * tqparent,KviTalIconViewItem * after) + : Q3IconViewItem(tqparent,after) {}; + KviTalIconViewItem(KviTalIconView * tqparent, const TQString & text) + : Q3IconViewItem(tqparent,text) {}; + KviTalIconViewItem(KviTalIconView * tqparent, KviTalIconViewItem * after, const TQString & text) + : Q3IconViewItem(tqparent,after,text) {}; + KviTalIconViewItem(KviTalIconView * tqparent, const TQString & text, const TQPixmap & icon) + : Q3IconViewItem(tqparent,text,icon) {}; + KviTalIconViewItem(KviTalIconView * tqparent, KviTalIconViewItem * after, const TQString & text, const TQPixmap & icon) + : Q3IconViewItem(tqparent,after,text,icon) {}; public: KviTalIconView * iconView() const { return (KviTalIconView *)Q3IconViewItem::iconView(); }; KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)Q3IconViewItem::prevItem(); }; diff --git a/src/kvilib/tal/kvi_tal_listbox.cpp b/src/kvilib/tal/kvi_tal_listbox.cpp index f5fcc087..e96cc012 100644 --- a/src/kvilib/tal/kvi_tal_listbox.cpp +++ b/src/kvilib/tal/kvi_tal_listbox.cpp @@ -26,29 +26,29 @@ #include "kvi_tal_listbox.h" #ifdef COMPILE_USE_QT4 - #include <qpainter.h> - #include <qstyle.h> - #include <qapplication.h> + #include <tqpainter.h> + #include <tqstyle.h> + #include <tqapplication.h> - KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) + KviTalListBox::KviTalListBox(TQWidget * pParent,TQt::WFlags f) : Q3ListBox(pParent,0,f) { - connect(this,SIGNAL(highlighted(Q3ListBoxItem *)),this,SLOT(redirect_highlighted(Q3ListBoxItem *))); - connect(this,SIGNAL(selected(Q3ListBoxItem *)),this,SLOT(redirect_selected(Q3ListBoxItem *))); - connect(this,SIGNAL(selectionChanged(Q3ListBoxItem *)),this,SLOT(redirect_selectionChanged(Q3ListBoxItem *))); - connect(this,SIGNAL(currentChanged(Q3ListBoxItem *)),this,SLOT(redirect_currentChanged(Q3ListBoxItem *))); - connect(this,SIGNAL(clicked(Q3ListBoxItem *)),this,SLOT(redirect_clicked(Q3ListBoxItem *))); - connect(this,SIGNAL(clicked(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(pressed(Q3ListBoxItem *)),this,SLOT(redirect_pressed(Q3ListBoxItem *))); - connect(this,SIGNAL(pressed(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(Q3ListBoxItem *)),this,SLOT(redirect_doubleClicked(Q3ListBoxItem *))); - connect(this,SIGNAL(returnPressed(Q3ListBoxItem *)),this,SLOT(redirect_returnPressed(Q3ListBoxItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(onItem(Q3ListBoxItem *)),this,SLOT(redirect_onItem(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(highlighted(Q3ListBoxItem *)),this,TQT_SLOT(redirect_highlighted(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(selected(Q3ListBoxItem *)),this,TQT_SLOT(redirect_selected(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(selectionChanged(Q3ListBoxItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(currentChanged(Q3ListBoxItem *)),this,TQT_SLOT(redirect_currentChanged(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(clicked(Q3ListBoxItem *)),this,TQT_SLOT(redirect_clicked(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(clicked(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(Q3ListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(pressed(Q3ListBoxItem *)),this,TQT_SLOT(redirect_pressed(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(pressed(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(Q3ListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(doubleClicked(Q3ListBoxItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(returnPressed(Q3ListBoxItem *)),this,TQT_SLOT(redirect_returnPressed(Q3ListBoxItem *))); + connect(this,TQT_SIGNAL(rightButtonClicked(Q3ListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const TQPoint &))); + connect(this,TQT_SIGNAL(rightButtonPressed(Q3ListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(contextMenuRequested(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(onItem(Q3ListBoxItem *)),this,TQT_SLOT(redirect_onItem(Q3ListBoxItem *))); } void KviTalListBox::redirect_highlighted(Q3ListBoxItem *item) @@ -76,7 +76,7 @@ emit clicked((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt) + void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const TQPoint & pnt) { emit clicked((KviTalListBoxItem *)item,pnt); } @@ -86,7 +86,7 @@ emit pressed((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt) + void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const TQPoint & pnt) { emit pressed((KviTalListBoxItem *)item,pnt); } @@ -101,27 +101,27 @@ emit returnPressed((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const QPoint &pnt) + void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const TQPoint &pnt) { emit rightButtonClicked((KviTalListBoxItem *)item,pnt); } - void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const QPoint &pnt) + void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const TQPoint &pnt) { emit rightButtonPressed((KviTalListBoxItem *)item,pnt); } - void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos) + void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const TQPoint & pos) { emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); } - void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos) + void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const TQPoint & pos) { emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); } - void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos) + void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const TQPoint & pos) { emit contextMenuRequested((KviTalListBoxItem *)item,pos); } @@ -131,19 +131,19 @@ emit onItem((KviTalListBoxItem *)i); } - KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const QString &text) + KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const TQString &text) :KviTalListBoxItem(listbox) { setText(text); } - KviTalListBoxText::KviTalListBoxText(const QString &text) + KviTalListBoxText::KviTalListBoxText(const TQString &text) :KviTalListBoxItem() { setText(text); } - KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after) + KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const TQString &text, KviTalListBoxItem *after) : KviTalListBoxItem(listbox, after) { setText(text); @@ -153,10 +153,10 @@ { } - void KviTalListBoxText::paint(QPainter *painter) + void KviTalListBoxText::paint(TQPainter *painter) { int itemHeight = height(listBox()); - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); painter->drawText(3, yPos, text()); } @@ -164,13 +164,13 @@ int KviTalListBoxText::height(const KviTalListBox* lb) const { int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return qMax(h, QApplication::globalStrut().height()); + return qMax(h, TQApplication::globalStrut().height()); } int KviTalListBoxText::width(const KviTalListBox* lb) const { int w = lb ? lb->fontMetrics().width(text()) + 6 : 0; - return qMax(w, QApplication::globalStrut().width()); + return qMax(w, TQApplication::globalStrut().width()); } int KviTalListBoxText::rtti() const @@ -178,19 +178,19 @@ return RTTI; } - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap) + KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pixmap) : KviTalListBoxItem(listbox) { pm = pixmap; } - KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap &pixmap) + KviTalListBoxPixmap::KviTalListBoxPixmap(const TQPixmap &pixmap) : KviTalListBoxItem() { pm = pixmap; } - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after) + KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pixmap, KviTalListBoxItem *after) : KviTalListBoxItem(listbox, after) { pm = pixmap; @@ -200,21 +200,21 @@ { } - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pix, const QString& text) + KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pix, const TQString& text) : KviTalListBoxItem(listbox) { pm = pix; setText(text); } - KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap & pix, const QString& text) + KviTalListBoxPixmap::KviTalListBoxPixmap(const TQPixmap & pix, const TQString& text) : KviTalListBoxItem() { pm = pix; setText(text); } - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString& text, + KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, const TQString& text, KviTalListBoxItem *after) : KviTalListBoxItem(listbox, after) { @@ -222,19 +222,19 @@ setText(text); } - void KviTalListBoxPixmap::paint(QPainter *painter) + void KviTalListBoxPixmap::paint(TQPainter *painter) { int itemHeight = height(listBox()); int yPos; - const QPixmap *pm = pixmap(); + const TQPixmap *pm = pixmap(); if (pm && ! pm->isNull()) { yPos = (itemHeight - pm->height()) / 2; painter->drawPixmap(3, yPos, *pm); } if (!text().isEmpty()) { - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); painter->drawText(pm->width() + 5, yPos, text()); } @@ -247,15 +247,15 @@ h = pm.height(); else h = qMax(pm.height(), lb->fontMetrics().lineSpacing() + 2); - return qMax(h, QApplication::globalStrut().height()); + return qMax(h, TQApplication::globalStrut().height()); } int KviTalListBoxPixmap::width(const KviTalListBox* lb) const { if (text().isEmpty()) - return qMax(pm.width() + 6, QApplication::globalStrut().width()); + return qMax(pm.width() + 6, TQApplication::globalStrut().width()); return qMax(pm.width() + lb->fontMetrics().width(text()) + 6, - QApplication::globalStrut().width()); + TQApplication::globalStrut().width()); } int KviTalListBoxPixmap::rtti() const @@ -266,125 +266,125 @@ #include "kvi_tal_listbox_qt4.moc" #else - #include <qpainter.h> - #include <qstyle.h> - #include <qapplication.h> - - - KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) - : QListBox(pParent,0,f) - { - connect(this,SIGNAL(highlighted(QListBoxItem *)),this,SLOT(redirect_highlighted(QListBoxItem *))); - connect(this,SIGNAL(selected(QListBoxItem *)),this,SLOT(redirect_selected(QListBoxItem *))); - connect(this,SIGNAL(selectionChanged(QListBoxItem *)),this,SLOT(redirect_selectionChanged(QListBoxItem *))); - connect(this,SIGNAL(currentChanged(QListBoxItem *)),this,SLOT(redirect_currentChanged(QListBoxItem *))); - connect(this,SIGNAL(clicked(QListBoxItem *)),this,SLOT(redirect_clicked(QListBoxItem *))); - connect(this,SIGNAL(clicked(QListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(pressed(QListBoxItem *)),this,SLOT(redirect_pressed(QListBoxItem *))); - connect(this,SIGNAL(pressed(QListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(QListBoxItem *)),this,SLOT(redirect_doubleClicked(QListBoxItem *))); - connect(this,SIGNAL(returnPressed(QListBoxItem *)),this,SLOT(redirect_returnPressed(QListBoxItem *))); - connect(this,SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(QListBoxItem *, const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(QListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(QListBoxItem *, const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,QListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,QListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(QListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(onItem(QListBoxItem *)),this,SLOT(redirect_onItem(QListBoxItem *))); - } - - void KviTalListBox::redirect_highlighted(QListBoxItem *item) + #include <tqpainter.h> + #include <tqstyle.h> + #include <tqapplication.h> + + + KviTalListBox::KviTalListBox(TQWidget * pParent,TQt::WFlags f) + : TQListBox(pParent,0,f) + { + connect(this,TQT_SIGNAL(highlighted(TQListBoxItem *)),this,TQT_SLOT(redirect_highlighted(TQListBoxItem *))); + connect(this,TQT_SIGNAL(selected(TQListBoxItem *)),this,TQT_SLOT(redirect_selected(TQListBoxItem *))); + connect(this,TQT_SIGNAL(selectionChanged(TQListBoxItem *)),this,TQT_SLOT(redirect_selectionChanged(TQListBoxItem *))); + connect(this,TQT_SIGNAL(currentChanged(TQListBoxItem *)),this,TQT_SLOT(redirect_currentChanged(TQListBoxItem *))); + connect(this,TQT_SIGNAL(clicked(TQListBoxItem *)),this,TQT_SLOT(redirect_clicked(TQListBoxItem *))); + connect(this,TQT_SIGNAL(clicked(TQListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(TQListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(pressed(TQListBoxItem *)),this,TQT_SLOT(redirect_pressed(TQListBoxItem *))); + connect(this,TQT_SIGNAL(pressed(TQListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(TQListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(doubleClicked(TQListBoxItem *)),this,TQT_SLOT(redirect_doubleClicked(TQListBoxItem *))); + connect(this,TQT_SIGNAL(returnPressed(TQListBoxItem *)),this,TQT_SLOT(redirect_returnPressed(TQListBoxItem *))); + connect(this,TQT_SIGNAL(rightButtonClicked(TQListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(TQListBoxItem *, const TQPoint &))); + connect(this,TQT_SIGNAL(rightButtonPressed(TQListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(TQListBoxItem *, const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonPressed(int,TQListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,TQListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(mouseButtonClicked(int,TQListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,TQListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(contextMenuRequested(TQListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(TQListBoxItem *,const TQPoint &))); + connect(this,TQT_SIGNAL(onItem(TQListBoxItem *)),this,TQT_SLOT(redirect_onItem(TQListBoxItem *))); + } + + void KviTalListBox::redirect_highlighted(TQListBoxItem *item) { emit highlighted((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_selected(QListBoxItem *item) + void KviTalListBox::redirect_selected(TQListBoxItem *item) { emit selected((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_selectionChanged(QListBoxItem * item) + void KviTalListBox::redirect_selectionChanged(TQListBoxItem * item) { emit selectionChanged((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_currentChanged(QListBoxItem * item) + void KviTalListBox::redirect_currentChanged(TQListBoxItem * item) { emit currentChanged((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_clicked(QListBoxItem * item) + void KviTalListBox::redirect_clicked(TQListBoxItem * item) { emit clicked((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_clicked(QListBoxItem * item,const QPoint & pnt) + void KviTalListBox::redirect_clicked(TQListBoxItem * item,const TQPoint & pnt) { emit clicked((KviTalListBoxItem *)item,pnt); } - void KviTalListBox::redirect_pressed(QListBoxItem * item) + void KviTalListBox::redirect_pressed(TQListBoxItem * item) { emit pressed((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_pressed(QListBoxItem * item,const QPoint & pnt) + void KviTalListBox::redirect_pressed(TQListBoxItem * item,const TQPoint & pnt) { emit pressed((KviTalListBoxItem *)item,pnt); } - void KviTalListBox::redirect_doubleClicked(QListBoxItem * item) + void KviTalListBox::redirect_doubleClicked(TQListBoxItem * item) { emit doubleClicked((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_returnPressed(QListBoxItem * item) + void KviTalListBox::redirect_returnPressed(TQListBoxItem * item) { emit returnPressed((KviTalListBoxItem *)item); } - void KviTalListBox::redirect_rightButtonClicked(QListBoxItem * item, const QPoint &pnt) + void KviTalListBox::redirect_rightButtonClicked(TQListBoxItem * item, const TQPoint &pnt) { emit rightButtonClicked((KviTalListBoxItem *)item,pnt); } - void KviTalListBox::redirect_rightButtonPressed(QListBoxItem * item, const QPoint &pnt) + void KviTalListBox::redirect_rightButtonPressed(TQListBoxItem * item, const TQPoint &pnt) { emit rightButtonPressed((KviTalListBoxItem *)item,pnt); } - void KviTalListBox::redirect_mouseButtonPressed(int button,QListBoxItem * item,const QPoint & pos) + void KviTalListBox::redirect_mouseButtonPressed(int button,TQListBoxItem * item,const TQPoint & pos) { emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); } - void KviTalListBox::redirect_mouseButtonClicked(int button,QListBoxItem * item,const QPoint & pos) + void KviTalListBox::redirect_mouseButtonClicked(int button,TQListBoxItem * item,const TQPoint & pos) { emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); } - void KviTalListBox::redirect_contextMenuRequested(QListBoxItem * item,const QPoint & pos) + void KviTalListBox::redirect_contextMenuRequested(TQListBoxItem * item,const TQPoint & pos) { emit contextMenuRequested((KviTalListBoxItem *)item,pos); } - void KviTalListBox::redirect_onItem(QListBoxItem * i) + void KviTalListBox::redirect_onItem(TQListBoxItem * i) { emit onItem((KviTalListBoxItem *)i); } - KviTalListBoxText::KviTalListBoxText( KviTalListBox *listbox, const QString &text ) + KviTalListBoxText::KviTalListBoxText( KviTalListBox *listbox, const TQString &text ) :KviTalListBoxItem( listbox ) { setText( text ); } - KviTalListBoxText::KviTalListBoxText( const QString &text ) + KviTalListBoxText::KviTalListBoxText( const TQString &text ) :KviTalListBoxItem() { setText( text ); } - KviTalListBoxText::KviTalListBoxText( KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after ) + KviTalListBoxText::KviTalListBoxText( KviTalListBox* listbox, const TQString &text, KviTalListBoxItem *after ) : KviTalListBoxItem( listbox, after ) { setText( text ); @@ -394,10 +394,10 @@ { } - void KviTalListBoxText::paint( QPainter *painter ) + void KviTalListBoxText::paint( TQPainter *painter ) { int itemHeight = height( listBox() ); - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); painter->drawText( 3, yPos, text() ); } @@ -405,13 +405,13 @@ int KviTalListBoxText::height( const KviTalListBox* lb ) const { int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return QMAX( h, QApplication::globalStrut().height() ); + return TQMAX( h, TQApplication::globalStrut().height() ); } int KviTalListBoxText::width( const KviTalListBox* lb ) const { int w = lb ? lb->fontMetrics().width( text() ) + 6 : 0; - return QMAX( w, QApplication::globalStrut().width() ); + return TQMAX( w, TQApplication::globalStrut().width() ); } int KviTalListBoxText::RTTI = 1; @@ -421,19 +421,19 @@ return RTTI; } - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pixmap ) + KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap &pixmap ) : KviTalListBoxItem( listbox ) { pm = pixmap; } - KviTalListBoxPixmap::KviTalListBoxPixmap( const QPixmap &pixmap ) + KviTalListBoxPixmap::KviTalListBoxPixmap( const TQPixmap &pixmap ) : KviTalListBoxItem() { pm = pixmap; } - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after ) + KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap &pixmap, KviTalListBoxItem *after ) : KviTalListBoxItem( listbox, after ) { pm = pixmap; @@ -443,21 +443,21 @@ { } - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pix, const QString& text) + KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap &pix, const TQString& text) : KviTalListBoxItem( listbox ) { pm = pix; setText( text ); } - KviTalListBoxPixmap::KviTalListBoxPixmap( const QPixmap & pix, const QString& text) + KviTalListBoxPixmap::KviTalListBoxPixmap( const TQPixmap & pix, const TQString& text) : KviTalListBoxItem() { pm = pix; setText( text ); } - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, const QString& text, + KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & pix, const TQString& text, KviTalListBoxItem *after ) : KviTalListBoxItem( listbox, after ) { @@ -465,19 +465,19 @@ setText( text ); } - void KviTalListBoxPixmap::paint( QPainter *painter ) + void KviTalListBoxPixmap::paint( TQPainter *painter ) { int itemHeight = height( listBox() ); int yPos; - const QPixmap *pm = pixmap(); + const TQPixmap *pm = pixmap(); if ( pm && ! pm->isNull() ) { yPos = ( itemHeight - pm->height() ) / 2; painter->drawPixmap( 3, yPos, *pm); } if ( !text().isEmpty() ) { - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); painter->drawText( pm->width() + 5, yPos, text() ); } @@ -489,16 +489,16 @@ if ( text().isEmpty() ) h = pm.height(); else - h = QMAX( pm.height(), lb->fontMetrics().lineSpacing() + 2 ); - return QMAX( h, QApplication::globalStrut().height() ); + h = TQMAX( pm.height(), lb->fontMetrics().lineSpacing() + 2 ); + return TQMAX( h, TQApplication::globalStrut().height() ); } int KviTalListBoxPixmap::width( const KviTalListBox* lb ) const { if ( text().isEmpty() ) - return QMAX( pm.width() + 6, QApplication::globalStrut().width() ); - return QMAX( pm.width() + lb->fontMetrics().width( text() ) + 6, - QApplication::globalStrut().width() ); + return TQMAX( pm.width() + 6, TQApplication::globalStrut().width() ); + return TQMAX( pm.width() + lb->fontMetrics().width( text() ) + 6, + TQApplication::globalStrut().width() ); } int KviTalListBoxPixmap::RTTI = 2; diff --git a/src/kvilib/tal/kvi_tal_listbox.h b/src/kvilib/tal/kvi_tal_listbox.h index 18594539..4cddaeac 100644 --- a/src/kvilib/tal/kvi_tal_listbox.h +++ b/src/kvilib/tal/kvi_tal_listbox.h @@ -29,13 +29,13 @@ // // This is the only reasonable CROSS-QT3-QT4-COMPATIBLE implementation -// of QListBox I've been able to find. -// Note that using macros for the items will NOT work since moc +// of TQListBox I've been able to find. +// Note that using macros for the items will NOT work since tqmoc // doesn't expand them. Note also that KviTalListBoxText must -// be fully reimplemented and not be inherited from QListBoxText +// be fully reimplemented and not be inherited from TQListBoxText // to build up a consistent item object hierarchy. To complete -// the obscenity, we need TWO COMPLETE implementations: one for Qt3 -// and one for Qt4... bleah :D +// the obscenity, we need TWO COMPLETE implementations: one for TQt3 +// and one for TQt4... bleah :D // // The code for KviTalListBoxText is adapted from qlistbox.h/cpp // present in qt 3.3.6 AND in qt 4.1.2. diff --git a/src/kvilib/tal/kvi_tal_listbox_qt3.h b/src/kvilib/tal/kvi_tal_listbox_qt3.h index d65b7929..dcc3c0d9 100644 --- a/src/kvilib/tal/kvi_tal_listbox_qt3.h +++ b/src/kvilib/tal/kvi_tal_listbox_qt3.h @@ -27,82 +27,83 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <qlistbox.h> +#include <tqlistbox.h> class KviTalListBoxItem; -class KVILIB_API KviTalListBox : public QListBox +class KVILIB_API KviTalListBox : public TQListBox { Q_OBJECT + TQ_OBJECT public: - KviTalListBox(QWidget * pParent,Qt::WFlags f = 0); + KviTalListBox(TQWidget * pParent,TQt::WFlags f = 0); virtual ~KviTalListBox() {}; public: - KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)QListBox::firstItem(); }; - KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)QListBox::selectedItem(); }; - KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)QListBox::item(iIndex); }; + KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)TQListBox::firstItem(); }; + KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)TQListBox::selectedItem(); }; + KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)TQListBox::item(iIndex); }; signals: void highlighted(KviTalListBoxItem *); void selected(KviTalListBoxItem *); void selectionChanged(KviTalListBoxItem * item); void currentChanged(KviTalListBoxItem * item); void clicked(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item,const QPoint & pnt); + void clicked(KviTalListBoxItem * item,const TQPoint & pnt); void pressed(KviTalListBoxItem * item); - void pressed(KviTalListBoxItem * item,const QPoint & pnt); + void pressed(KviTalListBoxItem * item,const TQPoint & pnt); void doubleClicked(KviTalListBoxItem * item); void returnPressed(KviTalListBoxItem * item); - void rightButtonClicked(KviTalListBoxItem *, const QPoint &); - void rightButtonPressed(KviTalListBoxItem *, const QPoint &); - void mouseButtonPressed(int button,KviTalListBoxItem * item,const QPoint & pos); - void mouseButtonClicked(int button,KviTalListBoxItem * item,const QPoint & pos); - void contextMenuRequested(KviTalListBoxItem * item,const QPoint & pos); + void rightButtonClicked(KviTalListBoxItem *, const TQPoint &); + void rightButtonPressed(KviTalListBoxItem *, const TQPoint &); + void mouseButtonPressed(int button,KviTalListBoxItem * item,const TQPoint & pos); + void mouseButtonClicked(int button,KviTalListBoxItem * item,const TQPoint & pos); + void contextMenuRequested(KviTalListBoxItem * item,const TQPoint & pos); void onItem(KviTalListBoxItem * i); protected slots: - void redirect_highlighted(QListBoxItem *item); - void redirect_selected(QListBoxItem *item); - void redirect_selectionChanged(QListBoxItem * item); - void redirect_currentChanged(QListBoxItem * item); - void redirect_clicked(QListBoxItem * item); - void redirect_clicked(QListBoxItem * item,const QPoint & pnt); - void redirect_pressed(QListBoxItem * item); - void redirect_pressed(QListBoxItem * item,const QPoint & pnt); - void redirect_doubleClicked(QListBoxItem * item); - void redirect_returnPressed(QListBoxItem * item); - void redirect_rightButtonClicked(QListBoxItem * item, const QPoint &pnt); - void redirect_rightButtonPressed(QListBoxItem * item, const QPoint &pnt); - void redirect_mouseButtonPressed(int button,QListBoxItem * item,const QPoint & pos); - void redirect_mouseButtonClicked(int button,QListBoxItem * item,const QPoint & pos); - void redirect_contextMenuRequested(QListBoxItem * item,const QPoint & pos); - void redirect_onItem(QListBoxItem * i); + void redirect_highlighted(TQListBoxItem *item); + void redirect_selected(TQListBoxItem *item); + void redirect_selectionChanged(TQListBoxItem * item); + void redirect_currentChanged(TQListBoxItem * item); + void redirect_clicked(TQListBoxItem * item); + void redirect_clicked(TQListBoxItem * item,const TQPoint & pnt); + void redirect_pressed(TQListBoxItem * item); + void redirect_pressed(TQListBoxItem * item,const TQPoint & pnt); + void redirect_doubleClicked(TQListBoxItem * item); + void redirect_returnPressed(TQListBoxItem * item); + void redirect_rightButtonClicked(TQListBoxItem * item, const TQPoint &pnt); + void redirect_rightButtonPressed(TQListBoxItem * item, const TQPoint &pnt); + void redirect_mouseButtonPressed(int button,TQListBoxItem * item,const TQPoint & pos); + void redirect_mouseButtonClicked(int button,TQListBoxItem * item,const TQPoint & pos); + void redirect_contextMenuRequested(TQListBoxItem * item,const TQPoint & pos); + void redirect_onItem(TQListBoxItem * i); }; -class KVILIB_API KviTalListBoxItem : public QListBoxItem +class KVILIB_API KviTalListBoxItem : public TQListBoxItem { public: KviTalListBoxItem() - : QListBoxItem() {}; + : TQListBoxItem() {}; KviTalListBoxItem(KviTalListBox * pParent) - : QListBoxItem(pParent) {}; + : TQListBoxItem(pParent) {}; KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter) - : QListBoxItem(pParent,pAfter) {}; + : TQListBoxItem(pParent,pAfter) {}; virtual ~KviTalListBoxItem() {}; public: - KviTalListBoxItem * next() const { return (KviTalListBoxItem *)QListBoxItem::next(); }; - KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)QListBoxItem::prev(); }; - KviTalListBox * listBox() const { return (KviTalListBox *)QListBoxItem::listBox(); }; + KviTalListBoxItem * next() const { return (KviTalListBoxItem *)TQListBoxItem::next(); }; + KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)TQListBoxItem::prev(); }; + KviTalListBox * listBox() const { return (KviTalListBox *)TQListBoxItem::listBox(); }; virtual int height(const KviTalListBox *) const { return 0; }; - int height(const QListBox *lb) const { return height((KviTalListBox *)lb); }; + int height(const TQListBox *lb) const { return height((KviTalListBox *)lb); }; virtual int width(const KviTalListBox *) const { return 0; }; - int width(const QListBox *lb) const { return width((KviTalListBox *)lb); }; + int width(const TQListBox *lb) const { return width((KviTalListBox *)lb); }; }; class KVILIB_API KviTalListBoxText : public KviTalListBoxItem { public: - KviTalListBoxText( KviTalListBox* listbox, const QString & text=QString::null ); - KviTalListBoxText( const QString & text=QString::null ); - KviTalListBoxText( KviTalListBox* listbox, const QString & text, KviTalListBoxItem *after ); + KviTalListBoxText( KviTalListBox* listbox, const TQString & text=TQString() ); + KviTalListBoxText( const TQString & text=TQString() ); + KviTalListBoxText( KviTalListBox* listbox, const TQString & text, KviTalListBoxItem *after ); ~KviTalListBoxText(); int height( const KviTalListBox * ) const; @@ -112,10 +113,10 @@ public: static int RTTI; protected: - virtual void paint( QPainter * ); + virtual void paint( TQPainter * ); private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) KviTalListBoxText( const KviTalListBoxText & ); KviTalListBoxText &operator=( const KviTalListBoxText & ); #endif @@ -125,15 +126,15 @@ private: // Disabled copy constructor and operator= class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem { public: - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & ); - KviTalListBoxPixmap( const QPixmap & ); - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, KviTalListBoxItem *after ); - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &, const QString& ); - KviTalListBoxPixmap( const QPixmap &, const QString& ); - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, const QString&, KviTalListBoxItem *after ); + KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & ); + KviTalListBoxPixmap( const TQPixmap & ); + KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & pix, KviTalListBoxItem *after ); + KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap &, const TQString& ); + KviTalListBoxPixmap( const TQPixmap &, const TQString& ); + KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & pix, const TQString&, KviTalListBoxItem *after ); ~KviTalListBoxPixmap(); - const QPixmap *pixmap() const { return ± } + const TQPixmap *pixmap() const { return ± } int height( const KviTalListBox * ) const; int width( const KviTalListBox * ) const; @@ -142,12 +143,12 @@ public: static int RTTI; protected: - virtual void paint( QPainter * ); + virtual void paint( TQPainter * ); private: - QPixmap pm; + TQPixmap pm; private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) +#if defined(TQ_DISABLE_COPY) KviTalListBoxPixmap( const KviTalListBoxPixmap & ); KviTalListBoxPixmap &operator=( const KviTalListBoxPixmap & ); #endif diff --git a/src/kvilib/tal/kvi_tal_listbox_qt4.h b/src/kvilib/tal/kvi_tal_listbox_qt4.h index dcb92f4d..4222fc1c 100644 --- a/src/kvilib/tal/kvi_tal_listbox_qt4.h +++ b/src/kvilib/tal/kvi_tal_listbox_qt4.h @@ -27,7 +27,7 @@ #include "kvi_settings.h" -#include <q3listbox.h> +#include <tq3listbox.h> class KviTalListBoxItem; @@ -35,8 +35,9 @@ class KviTalListBoxItem; class KVILIB_API KviTalListBox : public Q3ListBox { Q_OBJECT + TQ_OBJECT public: - KviTalListBox(QWidget * pParent,Qt::WFlags f = 0); + KviTalListBox(TQWidget * pParent,TQt::WFlags f = 0); virtual ~KviTalListBox() {}; public: KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)Q3ListBox::firstItem(); }; @@ -48,16 +49,16 @@ signals: void selectionChanged(KviTalListBoxItem * item); void currentChanged(KviTalListBoxItem * item); void clicked(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item,const QPoint & pnt); + void clicked(KviTalListBoxItem * item,const TQPoint & pnt); void pressed(KviTalListBoxItem * item); - void pressed(KviTalListBoxItem * item,const QPoint & pnt); + void pressed(KviTalListBoxItem * item,const TQPoint & pnt); void doubleClicked(KviTalListBoxItem * item); void returnPressed(KviTalListBoxItem * item); - void rightButtonClicked(KviTalListBoxItem *, const QPoint &); - void rightButtonPressed(KviTalListBoxItem *, const QPoint &); - void mouseButtonPressed(int button,KviTalListBoxItem * item,const QPoint & pos); - void mouseButtonClicked(int button,KviTalListBoxItem * item,const QPoint & pos); - void contextMenuRequested(KviTalListBoxItem * item,const QPoint & pos); + void rightButtonClicked(KviTalListBoxItem *, const TQPoint &); + void rightButtonPressed(KviTalListBoxItem *, const TQPoint &); + void mouseButtonPressed(int button,KviTalListBoxItem * item,const TQPoint & pos); + void mouseButtonClicked(int button,KviTalListBoxItem * item,const TQPoint & pos); + void contextMenuRequested(KviTalListBoxItem * item,const TQPoint & pos); void onItem(KviTalListBoxItem * i); protected slots: void redirect_highlighted(Q3ListBoxItem *); @@ -65,16 +66,16 @@ protected slots: void redirect_selectionChanged(Q3ListBoxItem * item); void redirect_currentChanged(Q3ListBoxItem * item); void redirect_clicked(Q3ListBoxItem * item); - void redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt); + void redirect_clicked(Q3ListBoxItem * item,const TQPoint & pnt); void redirect_pressed(Q3ListBoxItem * item); - void redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt); + void redirect_pressed(Q3ListBoxItem * item,const TQPoint & pnt); void redirect_doubleClicked(Q3ListBoxItem * item); void redirect_returnPressed(Q3ListBoxItem *); - void redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &); - void redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &); - void redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos); - void redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos); - void redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos); + void redirect_rightButtonClicked(Q3ListBoxItem *, const TQPoint &); + void redirect_rightButtonPressed(Q3ListBoxItem *, const TQPoint &); + void redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const TQPoint & pos); + void redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const TQPoint & pos); + void redirect_contextMenuRequested(Q3ListBoxItem * item,const TQPoint & pos); void redirect_onItem(Q3ListBoxItem * i); }; @@ -102,9 +103,9 @@ public: class KVILIB_API KviTalListBoxText : public KviTalListBoxItem { public: - KviTalListBoxText(KviTalListBox* listbox, const QString & text=QString()); - KviTalListBoxText(const QString & text=QString()); - KviTalListBoxText(KviTalListBox* listbox, const QString & text, KviTalListBoxItem *after); + KviTalListBoxText(KviTalListBox* listbox, const TQString & text=TQString()); + KviTalListBoxText(const TQString & text=TQString()); + KviTalListBoxText(KviTalListBox* listbox, const TQString & text, KviTalListBoxItem *after); ~KviTalListBoxText(); int height(const KviTalListBox *) const; @@ -114,25 +115,25 @@ public: enum { RTTI = 1 }; protected: - virtual void paint(QPainter *); + virtual void paint(TQPainter *); private: - Q_DISABLE_COPY(KviTalListBoxText) + TQ_DISABLE_COPY(KviTalListBoxText) }; class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem { public: - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &); - KviTalListBoxPixmap(const QPixmap &); - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, KviTalListBoxItem *after); - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &, const QString&); - KviTalListBoxPixmap(const QPixmap &, const QString&); - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString&, KviTalListBoxItem *after); + KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &); + KviTalListBoxPixmap(const TQPixmap &); + KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, KviTalListBoxItem *after); + KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &, const TQString&); + KviTalListBoxPixmap(const TQPixmap &, const TQString&); + KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, const TQString&, KviTalListBoxItem *after); ~KviTalListBoxPixmap(); - const QPixmap *pixmap() const { return ± } + const TQPixmap *pixmap() const { return ± } int height(const KviTalListBox *) const; int width(const KviTalListBox *) const; @@ -141,12 +142,12 @@ public: enum { RTTI = 2 }; protected: - virtual void paint(QPainter *); + virtual void paint(TQPainter *); private: - Q_DISABLE_COPY(KviTalListBoxPixmap) + TQ_DISABLE_COPY(KviTalListBoxPixmap) - QPixmap pm; + TQPixmap pm; }; #endif // _KVI_TAL_LISTBOX_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_listview.cpp b/src/kvilib/tal/kvi_tal_listview.cpp index 01b253b3..6181d804 100644 --- a/src/kvilib/tal/kvi_tal_listview.cpp +++ b/src/kvilib/tal/kvi_tal_listview.cpp @@ -29,21 +29,21 @@ #ifdef COMPILE_USE_QT4 - #include <qpainter.h> - #include <qstyle.h> - #include <q3header.h> - #include <qapplication.h> - #include <qhash.h> - #include <qstyleoption.h> - #include <qaccessible.h> + #include <tqpainter.h> + #include <tqstyle.h> + #include <tq3header.h> + #include <tqapplication.h> + #include <tqhash.h> + #include <tqstyleoption.h> + #include <tqaccessible.h> - static QStyleOptionQ3ListView getStyleOption(const Q3ListView *lv, const Q3ListViewItem *item) + static TQStyleOptionQ3ListView getStyleOption(const Q3ListView *lv, const Q3ListViewItem *item) { - QStyleOptionQ3ListView opt; + TQStyleOptionQ3ListView opt; opt.init(lv); - opt.subControls = QStyle::SC_None; - opt.activeSubControls = QStyle::SC_None; - QWidget *vp = lv->viewport(); + opt.subControls = TQStyle::SC_None; + opt.activeSubControls = TQStyle::SC_None; + TQWidget *vp = lv->viewport(); opt.viewportPalette = vp->palette(); opt.viewportBGRole = vp->backgroundRole(); opt.itemMargin = lv->itemMargin(); @@ -52,26 +52,26 @@ opt.rootIsDecorated = lv->rootIsDecorated(); bool firstItem = true; while (item) { - QStyleOptionQ3ListViewItem lvi; + TQStyleOptionQ3ListViewItem lvi; lvi.height = item->height(); lvi.totalHeight = item->totalHeight(); lvi.itemY = item->itemPos(); lvi.childCount = item->childCount(); - lvi.features = QStyleOptionQ3ListViewItem::None; - lvi.state = QStyle::State_None; + lvi.features = TQStyleOptionQ3ListViewItem::None; + lvi.state = TQStyle::State_None; if (item->isEnabled()) - lvi.state |= QStyle::State_Enabled; + lvi.state |= TQStyle::State_Enabled; if (item->isOpen()) - lvi.state |= QStyle::State_Open; + lvi.state |= TQStyle::State_Open; if (item->isExpandable()) - lvi.features |= QStyleOptionQ3ListViewItem::Expandable; + lvi.features |= TQStyleOptionQ3ListViewItem::Expandable; if (item->multiLinesEnabled()) - lvi.features |= QStyleOptionQ3ListViewItem::MultiLine; + lvi.features |= TQStyleOptionQ3ListViewItem::MultiLine; if (item->isVisible()) - lvi.features |= QStyleOptionQ3ListViewItem::Visible; - if (item->parent() && item->parent()->rtti() == 1 - && static_cast<Q3CheckListItem *>(item->parent())->type() == Q3CheckListItem::Controller) - lvi.features |= QStyleOptionQ3ListViewItem::ParentControl; + lvi.features |= TQStyleOptionQ3ListViewItem::Visible; + if (item->tqparent() && item->tqparent()->rtti() == 1 + && static_cast<Q3CheckListItem *>(item->tqparent())->type() == Q3CheckListItem::Controller) + lvi.features |= TQStyleOptionQ3ListViewItem::ParentControl; opt.items.append(lvi); if (!firstItem) { item = item->nextSibling(); @@ -83,27 +83,27 @@ return opt; } - KviTalListView::KviTalListView(QWidget * pParent) + KviTalListView::KviTalListView(TQWidget * pParent) : Q3ListView(pParent) { - connect(this,SIGNAL(selectionChanged(Q3ListViewItem *)),this,SLOT(redirect_selectionChanged(Q3ListViewItem *))); - connect(this,SIGNAL(currentChanged(Q3ListViewItem *)),this,SLOT(redirect_currentChanged(Q3ListViewItem *))); - connect(this,SIGNAL(clicked(Q3ListViewItem *)),this,SLOT(redirect_clicked(Q3ListViewItem *))); - connect(this,SIGNAL(clicked(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_clicked(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(pressed(Q3ListViewItem *)),this,SLOT(redirect_pressed(Q3ListViewItem *))); - connect(this,SIGNAL(pressed(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_pressed(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(doubleClicked(Q3ListViewItem *)),this,SLOT(redirect_doubleClicked(Q3ListViewItem *))); - connect(this,SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_doubleClicked(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(returnPressed(Q3ListViewItem *)),this,SLOT(redirect_returnPressed(Q3ListViewItem *))); - connect(this,SIGNAL(spacePressed(Q3ListViewItem *)),this,SLOT(redirect_spacePressed(Q3ListViewItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonClicked(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(rightButtonPressed(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonPressed(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonClicked(int,Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonPressed(int,Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(contextMenuRequested(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_contextMenuRequested(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(onItem(Q3ListViewItem *)),this,SLOT(redirect_onItem(Q3ListViewItem *))); - connect(this,SIGNAL(expanded(Q3ListViewItem *)),this,SLOT(redirect_expanded(Q3ListViewItem *))); - connect(this,SIGNAL(collapsed(Q3ListViewItem *)),this,SLOT(redirect_collapsed(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(selectionChanged(Q3ListViewItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(currentChanged(Q3ListViewItem *)),this,TQT_SLOT(redirect_currentChanged(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(clicked(Q3ListViewItem *)),this,TQT_SLOT(redirect_clicked(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(clicked(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_clicked(Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(pressed(Q3ListViewItem *)),this,TQT_SLOT(redirect_pressed(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(pressed(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_pressed(Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(doubleClicked(Q3ListViewItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(doubleClicked(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_doubleClicked(Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(returnPressed(Q3ListViewItem *)),this,TQT_SLOT(redirect_returnPressed(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(spacePressed(Q3ListViewItem *)),this,TQT_SLOT(redirect_spacePressed(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(rightButtonClicked(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_rightButtonClicked(Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(rightButtonPressed(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_rightButtonPressed(Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(contextMenuRequested(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_contextMenuRequested(Q3ListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(onItem(Q3ListViewItem *)),this,TQT_SLOT(redirect_onItem(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(expanded(Q3ListViewItem *)),this,TQT_SLOT(redirect_expanded(Q3ListViewItem *))); + connect(this,TQT_SIGNAL(collapsed(Q3ListViewItem *)),this,TQT_SLOT(redirect_collapsed(Q3ListViewItem *))); } void KviTalListView::redirect_selectionChanged(Q3ListViewItem * pItem) @@ -121,7 +121,7 @@ emit clicked((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_clicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_clicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit clicked((KviTalListViewItem *)pItem,pnt,uColumn); } @@ -131,7 +131,7 @@ emit pressed((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_pressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_pressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit pressed((KviTalListViewItem *)pItem,pnt,uColumn); } @@ -141,7 +141,7 @@ emit doubleClicked((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_doubleClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_doubleClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit doubleClicked((KviTalListViewItem *)pItem,pnt,uColumn); } @@ -156,27 +156,27 @@ emit spacePressed((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_rightButtonClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_rightButtonClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit rightButtonClicked((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_rightButtonPressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_rightButtonPressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit rightButtonPressed((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit mouseButtonClicked(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit mouseButtonPressed(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_contextMenuRequested(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_contextMenuRequested(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit contextMenuRequested((KviTalListViewItem *)pItem,pnt,uColumn); } @@ -206,43 +206,43 @@ KviTalCheckListItem *exclusive; KviTalCheckListItem::ToggleState currentState; - QHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState> statesDict; + TQHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState> statesDict; bool tristate; }; - KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *parent, const QString &text, + KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *tqparent, const TQString &text, Type tt) - : KviTalListViewItem(parent, text, QString()) + : KviTalListViewItem(tqparent, text, TQString()) { myType = tt; init(); if (myType == RadioButton) { - if (parent->type() != RadioButtonController) + if (tqparent->type() != RadioButtonController) qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " "child of a controller"); else - d->exclusive = parent; + d->exclusive = tqparent; } } - KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after, - const QString &text, Type tt) - : KviTalListViewItem(parent, after, text) + KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *tqparent, KviTalListViewItem *after, + const TQString &text, Type tt) + : KviTalListViewItem(tqparent, after, text) { myType = tt; init(); if (myType == RadioButton) { - if (parent->type() != RadioButtonController) + if (tqparent->type() != RadioButtonController) qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " "child of a controller"); else - d->exclusive = parent; + d->exclusive = tqparent; } } - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, + KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *tqparent, const TQString &text, Type tt) - : KviTalListViewItem(parent, text, QString()) + : KviTalListViewItem(tqparent, text, TQString()) { myType = tt; if (myType == RadioButton) { @@ -252,9 +252,9 @@ init(); } - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after, - const QString &text, Type tt) - : KviTalListViewItem(parent, after, text) + KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *tqparent, KviTalListViewItem *after, + const TQString &text, Type tt) + : KviTalListViewItem(tqparent, after, text) { myType = tt; if (myType == RadioButton) { @@ -264,9 +264,9 @@ init(); } - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, const QString &text, + KviTalCheckListItem::KviTalCheckListItem(KviTalListView *tqparent, const TQString &text, Type tt) - : KviTalListViewItem(parent, text) + : KviTalListViewItem(tqparent, text) { myType = tt; if (tt == RadioButton) @@ -275,9 +275,9 @@ init(); } - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after, - const QString &text, Type tt) - : KviTalListViewItem(parent, after, text) + KviTalCheckListItem::KviTalCheckListItem(KviTalListView *tqparent, KviTalListViewItem *after, + const TQString &text, Type tt) + : KviTalListViewItem(tqparent, after, text) { myType = tt; if (tt == RadioButton) @@ -291,18 +291,18 @@ return RTTI; } - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, const QString &text, - const QPixmap & p) - : KviTalListViewItem(parent, text) + KviTalCheckListItem::KviTalCheckListItem(KviTalListView *tqparent, const TQString &text, + const TQPixmap & p) + : KviTalListViewItem(tqparent, text) { myType = RadioButtonController; setPixmap(0, p); init(); } - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, - const QPixmap & p) - : KviTalListViewItem(parent, text) + KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *tqparent, const TQString &text, + const TQPixmap & p) + : KviTalListViewItem(tqparent, text) { myType = RadioButtonController; setPixmap(0, p); @@ -324,7 +324,7 @@ && d->exclusive && d->exclusive->d && d->exclusive->d->exclusive == this) d->exclusive->turnOffChild(); - d->exclusive = 0; // so the children won't try to access us. + d->exclusive = 0; // so the tqchildren won't try to access us. delete d; d = 0; } @@ -373,9 +373,9 @@ if (myType == CheckBox) { setCurrentState(s); stateChange(state()); - if (update && parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); + if (update && tqparent() && tqparent()->rtti() == 1 + && ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController) + ((KviTalCheckListItem*)tqparent())->updateController(update, store); } else if (myType == CheckBoxController) { if (s == NoChange && childCount()) { restoreState(this); @@ -397,18 +397,18 @@ ToggleState oldState = internalState(); updateController(false, false); if (oldState != internalState() && - parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); + tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController) + ((KviTalCheckListItem*)tqparent())->updateController(update, store); updateController(update, store); } else { - // if there are no children we simply set the CheckBoxController and update its parent + // if there are no tqchildren we simply set the CheckBoxController and update its tqparent setCurrentState(s); stateChange(state()); - if (parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); + if (tqparent() && tqparent()->rtti() == 1 + && ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController) + ((KviTalCheckListItem*)tqparent())->updateController(update, store); } } else { setCurrentState(s); @@ -430,7 +430,7 @@ } stateChange(state()); } - repaint(); + tqrepaint(); } void KviTalCheckListItem::setCurrentState(ToggleState s) @@ -442,9 +442,9 @@ else on = false; - //#ifndef QT_NO_ACCESSIBILITY + //#ifndef TQT_NO_ACCESSIBILITY // if (old != d->currentState && listView()) - // QAccessible::updateAccessibility(listView()->viewport(), indexOfItem(this), QAccessible::StateChanged); + // TQAccessible::updateAccessibility(listView()->viewport(), indexOfItem(this), TQAccessible::StateChanged); //#else // Q_UNUSED(old); //#endif @@ -458,7 +458,7 @@ KviTalCheckListItem::ToggleState KviTalCheckListItem::storedState(KviTalCheckListItem *key) const { - QHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState>::Iterator it = d->statesDict.find(key); + TQHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState>::Iterator it = d->statesDict.tqfind(key); if (it != d->statesDict.end()) return it.value(); else @@ -478,28 +478,28 @@ if (lv && !lv->isEnabled() || !isEnabled()) return; - QPoint pos; - int boxsize = lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv); + TQPoint pos; + int boxsize = lv->tqstyle()->tqpixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv); if (activatedPos(pos)) { - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; + bool tqparentControl = false; + if (tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*) tqparent())->type() == RadioButtonController) + tqparentControl = true; - int x = parentControl ? 0 : 3; + int x = tqparentControl ? 0 : 3; int align = lv->columnAlignment(0); int marg = lv->itemMargin(); int y = 0; - if (align & Qt::AlignVCenter) + if (align & TQt::AlignVCenter) y = ((height() - boxsize) / 2) + marg; else y = (lv->fontMetrics().height() + 2 + marg - boxsize) / 2; - QRect r(x, y, boxsize-3, boxsize-3); + TQRect r(x, y, boxsize-3, boxsize-3); // columns might have been swapped r.moveBy(lv->header()->sectionPos(0), 0); - if (!r.contains(pos)) + if (!r.tqcontains(pos)) return; } if ((myType == CheckBox) || (myType == CheckBoxController)) { @@ -551,13 +551,13 @@ case CheckBox: setCurrentState(storedState(key)); stateChange(state()); - repaint(); + tqrepaint(); break; case CheckBoxController: { KviTalListViewItem *item = firstChild(); int childCount = 0; while (item) { - // recursively calling restoreState for children of type CheckBox and CheckBoxController + // recursively calling restoreState for tqchildren of type CheckBox and CheckBoxController if (item->rtti() == 1 && (((KviTalCheckListItem*)item)->type() == CheckBox || ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { @@ -572,7 +572,7 @@ else updateController(false); } else { - // if there are no children we retrieve the CheckBoxController state directly. + // if there are no tqchildren we retrieve the CheckBoxController state directly. setState(storedState(key), true, false); } } @@ -588,10 +588,10 @@ return; KviTalCheckListItem *controller = 0; - // checks if this CheckBoxController has another CheckBoxController as parent - if (parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - controller = (KviTalCheckListItem*)parent(); + // checks if this CheckBoxController has another CheckBoxController as tqparent + if (tqparent() && tqparent()->rtti() == 1 + && ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController) + controller = (KviTalCheckListItem*)tqparent(); ToggleState theState = Off; bool first = true; @@ -622,7 +622,7 @@ if (update && controller) { controller->updateController(update, store); } - repaint(); + tqrepaint(); } } @@ -642,7 +642,7 @@ } item = item->nextSibling(); } - // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController children. + // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController tqchildren. setStoredState(internalState() , key); } @@ -652,13 +652,13 @@ int h = height(); KviTalListView *lv = listView(); if (lv) - h = qMax(lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv), + h = qMax(lv->tqstyle()->tqpixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv), h); - h = qMax(h, QApplication::globalStrut().height()); + h = qMax(h, TQApplication::globalStrut().height()); setHeight(h); } - int KviTalCheckListItem::width(const QFontMetrics& fm, const KviTalListView* lv, int column) const + int KviTalCheckListItem::width(const TQFontMetrics& fm, const KviTalListView* lv, int column) const { int r = KviTalListViewItem::width(fm, lv, column); if (column == 0) { @@ -666,13 +666,13 @@ if (myType == RadioButtonController && pixmap(0)) { // r += 0; } else { - r += lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv) + 4; + r += lv->tqstyle()->tqpixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv) + 4; } } - return qMax(r, QApplication::globalStrut().width()); + return qMax(r, TQApplication::globalStrut().width()); } - void KviTalCheckListItem::paintCell(QPainter * p, const QColorGroup & cg, + void KviTalCheckListItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align) { if (!p) @@ -682,11 +682,11 @@ if (!lv) return; - const QPalette::ColorRole crole = lv->foregroundRole(); + const TQPalette::ColorRole crole = lv->foregroundRole(); if (cg.brush(crole) != lv->palette().brush(crole)) p->fillRect(0, 0, width, height(), cg.brush(crole)); else - lv->paintEmptyArea(p, QRect(0, 0, width, height())); + lv->paintEmptyArea(p, TQRect(0, 0, width, height())); if (column != 0) { // The rest is text, or for subclasses to change. @@ -694,77 +694,77 @@ return; } - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; + bool tqparentControl = false; + if (tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*) tqparent())->type() == RadioButtonController) + tqparentControl = true; - QFontMetrics fm(lv->fontMetrics()); - int boxsize = lv->style()->pixelMetric(myType == RadioButtonController ? QStyle::PM_CheckListControllerSize : - QStyle::PM_CheckListButtonSize, 0, lv); + TQFontMetrics fm(lv->fontMetrics()); + int boxsize = lv->tqstyle()->tqpixelMetric(myType == RadioButtonController ? TQStyle::PM_CheckListControllerSize : + TQStyle::PM_CheckListButtonSize, 0, lv); int marg = lv->itemMargin(); int r = marg; // Draw controller / checkbox / radiobutton --------------------- - QStyle::State styleflags = QStyle::State_None; + TQStyle::State styleflags = TQStyle::State_None; if (internalState() == On) { - styleflags |= QStyle::State_On; + styleflags |= TQStyle::State_On; } else if (internalState() == NoChange) { if (myType == CheckBoxController && !isTristate()) - styleflags |= QStyle::State_Off; + styleflags |= TQStyle::State_Off; else - styleflags |= QStyle::State_NoChange; + styleflags |= TQStyle::State_NoChange; } else { - styleflags |= QStyle::State_Off; + styleflags |= TQStyle::State_Off; } if (isSelected()) - styleflags |= QStyle::State_Selected; + styleflags |= TQStyle::State_Selected; if (isEnabled() && lv->isEnabled()) - styleflags |= QStyle::State_Enabled; + styleflags |= TQStyle::State_Enabled; if (lv->window()->isActiveWindow()) - styleflags |= QStyle::State_Active; + styleflags |= TQStyle::State_Active; if (myType == RadioButtonController) { int x = 0; - if(!parentControl) + if(!tqparentControl) x += 3; if (!pixmap(0)) { - QStyleOptionQ3ListView opt = getStyleOption(lv, this); + TQStyleOptionQ3ListView opt = getStyleOption(lv, this); opt.rect.setRect(x, 0, boxsize, fm.height() + 2 + marg); opt.palette = cg; opt.state = styleflags; - lv->style()->drawPrimitive(QStyle::PE_Q3CheckListController, &opt, p, lv); + lv->tqstyle()->drawPrimitive(TQStyle::PE_Q3CheckListController, &opt, p, lv); r += boxsize + 4; } } else { Q_ASSERT(lv); //### int x = 0; int y = 0; - if (!parentControl) + if (!tqparentControl) x += 3; - if (align & Qt::AlignVCenter) + if (align & TQt::AlignVCenter) y = ((height() - boxsize) / 2) + marg; else y = (fm.height() + 2 + marg - boxsize) / 2; - QStyleOptionQ3ListView opt = getStyleOption(lv, this); + TQStyleOptionQ3ListView opt = getStyleOption(lv, this); opt.rect.setRect(x, y, boxsize, fm.height() + 2 + marg); opt.palette = cg; opt.state = styleflags; - lv->style()->drawPrimitive((myType == CheckBox || myType == CheckBoxController) - ? QStyle::PE_Q3CheckListIndicator - : QStyle::PE_Q3CheckListExclusiveIndicator, &opt, p, lv); + lv->tqstyle()->drawPrimitive((myType == CheckBox || myType == CheckBoxController) + ? TQStyle::PE_Q3CheckListIndicator + : TQStyle::PE_Q3CheckListExclusiveIndicator, &opt, p, lv); r += boxsize + 4; } // Draw text ---------------------------------------------------- p->translate(r, 0); - p->setPen(QPen(cg.text())); + p->setPen(TQPen(cg.text())); KviTalListViewItem::paintCell(p, cg, column, width - r, align); } - void KviTalCheckListItem::paintFocus(QPainter *p, const QColorGroup & cg, - const QRect & r) + void KviTalCheckListItem::paintFocus(TQPainter *p, const TQColorGroup & cg, + const TQRect & r) { bool intersect = true; KviTalListView *lv = listView(); @@ -772,19 +772,19 @@ int xdepth = lv->treeStepSize() * (depth() + (lv->rootIsDecorated() ? 1 : 0)) + lv->itemMargin(); int p = lv->header()->cellPos(lv->header()->mapToActual(0)); xdepth += p; - intersect = r.intersects(QRect(p, r.y(), xdepth - p + 1, r.height())); + intersect = r.intersects(TQRect(p, r.y(), xdepth - p + 1, r.height())); } - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; + bool tqparentControl = false; + if (tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*) tqparent())->type() == RadioButtonController) + tqparentControl = true; if (myType != RadioButtonController && intersect && (lv->rootIsDecorated() || myType == RadioButton || - (myType == CheckBox && parentControl))) { - QRect rect; - int boxsize = lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv); - if (lv->columnAlignment(0) == Qt::AlignCenter) { - QFontMetrics fm(lv->font()); + (myType == CheckBox && tqparentControl))) { + TQRect rect; + int boxsize = lv->tqstyle()->tqpixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv); + if (lv->columnAlignment(0) == TQt::AlignCenter) { + TQFontMetrics fm(lv->font()); int bx = (lv->columnWidth(0) - (boxsize + fm.width(text())))/2 + boxsize; if (bx < 0) bx = 0; rect.setRect(r.x() + bx + 5, r.y(), r.width() - bx - 5, @@ -801,120 +801,120 @@ #include "kvi_tal_listview_qt4.moc" #else - #include <qpainter.h> - #include <qstyle.h> - #include <qheader.h> - #include <qapplication.h> + #include <tqpainter.h> + #include <tqstyle.h> + #include <tqheader.h> + #include <tqapplication.h> - KviTalListView::KviTalListView(QWidget * pParent) - : QListView(pParent) - { - connect(this,SIGNAL(selectionChanged(QListViewItem *)),this,SLOT(redirect_selectionChanged(QListViewItem *))); - connect(this,SIGNAL(currentChanged(QListViewItem *)),this,SLOT(redirect_currentChanged(QListViewItem *))); - connect(this,SIGNAL(clicked(QListViewItem *)),this,SLOT(redirect_clicked(QListViewItem *))); - connect(this,SIGNAL(clicked(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_clicked(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(pressed(QListViewItem *)),this,SLOT(redirect_pressed(QListViewItem *))); - connect(this,SIGNAL(pressed(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_pressed(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(doubleClicked(QListViewItem *)),this,SLOT(redirect_doubleClicked(QListViewItem *))); - connect(this,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_doubleClicked(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(returnPressed(QListViewItem *)),this,SLOT(redirect_returnPressed(QListViewItem *))); - connect(this,SIGNAL(spacePressed(QListViewItem *)),this,SLOT(redirect_spacePressed(QListViewItem *))); - connect(this,SIGNAL(rightButtonClicked(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonClicked(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonPressed(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonClicked(int,QListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonClicked(int,QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonPressed(int,QListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonPressed(int,QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(contextMenuRequested(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_contextMenuRequested(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(onItem(QListViewItem *)),this,SLOT(redirect_onItem(QListViewItem *))); - connect(this,SIGNAL(expanded(QListViewItem *)),this,SLOT(redirect_expanded(QListViewItem *))); - connect(this,SIGNAL(collapsed(QListViewItem *)),this,SLOT(redirect_collapsed(QListViewItem *))); + KviTalListView::KviTalListView(TQWidget * pParent) + : TQListView(pParent) + { + connect(this,TQT_SIGNAL(selectionChanged(TQListViewItem *)),this,TQT_SLOT(redirect_selectionChanged(TQListViewItem *))); + connect(this,TQT_SIGNAL(currentChanged(TQListViewItem *)),this,TQT_SLOT(redirect_currentChanged(TQListViewItem *))); + connect(this,TQT_SIGNAL(clicked(TQListViewItem *)),this,TQT_SLOT(redirect_clicked(TQListViewItem *))); + connect(this,TQT_SIGNAL(clicked(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_clicked(TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(pressed(TQListViewItem *)),this,TQT_SLOT(redirect_pressed(TQListViewItem *))); + connect(this,TQT_SIGNAL(pressed(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_pressed(TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(doubleClicked(TQListViewItem *)),this,TQT_SLOT(redirect_doubleClicked(TQListViewItem *))); + connect(this,TQT_SIGNAL(doubleClicked(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_doubleClicked(TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(returnPressed(TQListViewItem *)),this,TQT_SLOT(redirect_returnPressed(TQListViewItem *))); + connect(this,TQT_SIGNAL(spacePressed(TQListViewItem *)),this,TQT_SLOT(redirect_spacePressed(TQListViewItem *))); + connect(this,TQT_SIGNAL(rightButtonClicked(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_rightButtonClicked(TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(rightButtonPressed(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_rightButtonPressed(TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(mouseButtonClicked(int,TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_mouseButtonClicked(int,TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(mouseButtonPressed(int,TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_mouseButtonPressed(int,TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(contextMenuRequested(TQListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_contextMenuRequested(TQListViewItem *,const TQPoint &,int))); + connect(this,TQT_SIGNAL(onItem(TQListViewItem *)),this,TQT_SLOT(redirect_onItem(TQListViewItem *))); + connect(this,TQT_SIGNAL(expanded(TQListViewItem *)),this,TQT_SLOT(redirect_expanded(TQListViewItem *))); + connect(this,TQT_SIGNAL(collapsed(TQListViewItem *)),this,TQT_SLOT(redirect_collapsed(TQListViewItem *))); } - void KviTalListView::redirect_selectionChanged(QListViewItem * pItem) + void KviTalListView::redirect_selectionChanged(TQListViewItem * pItem) { emit selectionChanged((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_currentChanged(QListViewItem * pItem) + void KviTalListView::redirect_currentChanged(TQListViewItem * pItem) { emit currentChanged((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_clicked(QListViewItem * pItem) + void KviTalListView::redirect_clicked(TQListViewItem * pItem) { emit clicked((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_clicked(QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_clicked(TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit clicked((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_pressed(QListViewItem * pItem) + void KviTalListView::redirect_pressed(TQListViewItem * pItem) { emit pressed((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_pressed(QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_pressed(TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit pressed((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_doubleClicked(QListViewItem * pItem) + void KviTalListView::redirect_doubleClicked(TQListViewItem * pItem) { emit doubleClicked((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_doubleClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_doubleClicked(TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit doubleClicked((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_returnPressed(QListViewItem * pItem) + void KviTalListView::redirect_returnPressed(TQListViewItem * pItem) { emit returnPressed((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_spacePressed(QListViewItem * pItem) + void KviTalListView::redirect_spacePressed(TQListViewItem * pItem) { emit spacePressed((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_rightButtonClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_rightButtonClicked(TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit rightButtonClicked((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_rightButtonPressed(QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_rightButtonPressed(TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit rightButtonPressed((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_mouseButtonClicked(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_mouseButtonClicked(int iButton,TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit mouseButtonClicked(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_mouseButtonPressed(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_mouseButtonPressed(int iButton,TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit mouseButtonPressed(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_contextMenuRequested(QListViewItem * pItem,const QPoint &pnt,int uColumn) + void KviTalListView::redirect_contextMenuRequested(TQListViewItem * pItem,const TQPoint &pnt,int uColumn) { emit contextMenuRequested((KviTalListViewItem *)pItem,pnt,uColumn); } - void KviTalListView::redirect_onItem(QListViewItem * pItem) + void KviTalListView::redirect_onItem(TQListViewItem * pItem) { emit onItem((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_expanded(QListViewItem * pItem) + void KviTalListView::redirect_expanded(TQListViewItem * pItem) { emit expanded((KviTalListViewItem *)pItem); } - void KviTalListView::redirect_collapsed(QListViewItem * pItem) + void KviTalListView::redirect_collapsed(TQListViewItem * pItem) { emit collapsed((KviTalListViewItem *)pItem); } @@ -935,39 +935,39 @@ // ### obscenity is warranted. - KviTalCheckListItem::KviTalCheckListItem( KviTalCheckListItem *parent, const QString &text, + KviTalCheckListItem::KviTalCheckListItem( KviTalCheckListItem *tqparent, const TQString &text, Type tt ) - : KviTalListViewItem( parent, text, QString::null ) + : KviTalListViewItem( tqparent, text, TQString() ) { myType = tt; init(); if ( myType == RadioButton ) { - if ( parent->type() != RadioButtonController ) + if ( tqparent->type() != RadioButtonController ) qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " "child of a controller" ); else - d->exclusive = parent; + d->exclusive = tqparent; } } - KviTalCheckListItem::KviTalCheckListItem( KviTalCheckListItem *parent, KviTalListViewItem *after, - const QString &text, Type tt ) - : KviTalListViewItem( parent, after, text ) + KviTalCheckListItem::KviTalCheckListItem( KviTalCheckListItem *tqparent, KviTalListViewItem *after, + const TQString &text, Type tt ) + : KviTalListViewItem( tqparent, after, text ) { myType = tt; init(); if ( myType == RadioButton ) { - if ( parent->type() != RadioButtonController ) + if ( tqparent->type() != RadioButtonController ) qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " "child of a controller" ); else - d->exclusive = parent; + d->exclusive = tqparent; } } - KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *parent, const QString &text, + KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *tqparent, const TQString &text, Type tt ) - : KviTalListViewItem( parent, text, QString::null ) + : KviTalListViewItem( tqparent, text, TQString() ) { myType = tt; if ( myType == RadioButton ) { @@ -977,9 +977,9 @@ init(); } - KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *parent, KviTalListViewItem *after, - const QString &text, Type tt ) - : KviTalListViewItem( parent, after, text ) + KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *tqparent, KviTalListViewItem *after, + const TQString &text, Type tt ) + : KviTalListViewItem( tqparent, after, text ) { myType = tt; if ( myType == RadioButton ) { @@ -989,9 +989,9 @@ init(); } - KviTalCheckListItem::KviTalCheckListItem( KviTalListView *parent, const QString &text, + KviTalCheckListItem::KviTalCheckListItem( KviTalListView *tqparent, const TQString &text, Type tt ) - : KviTalListViewItem( parent, text ) + : KviTalListViewItem( tqparent, text ) { myType = tt; if ( tt == RadioButton ) @@ -1000,9 +1000,9 @@ init(); } - KviTalCheckListItem::KviTalCheckListItem( KviTalListView *parent, KviTalListViewItem *after, - const QString &text, Type tt ) - : KviTalListViewItem( parent, after, text ) + KviTalCheckListItem::KviTalCheckListItem( KviTalListView *tqparent, KviTalListViewItem *after, + const TQString &text, Type tt ) + : KviTalListViewItem( tqparent, after, text ) { myType = tt; if ( tt == RadioButton ) @@ -1019,18 +1019,18 @@ return RTTI; } - KviTalCheckListItem::KviTalCheckListItem( KviTalListView *parent, const QString &text, - const QPixmap & p ) - : KviTalListViewItem( parent, text ) + KviTalCheckListItem::KviTalCheckListItem( KviTalListView *tqparent, const TQString &text, + const TQPixmap & p ) + : KviTalListViewItem( tqparent, text ) { myType = RadioButtonController; setPixmap( 0, p ); init(); } - KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *parent, const QString &text, - const QPixmap & p ) - : KviTalListViewItem( parent, text ) + KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *tqparent, const TQString &text, + const TQPixmap & p ) + : KviTalListViewItem( tqparent, text ) { myType = RadioButtonController; setPixmap( 0, p ); @@ -1056,7 +1056,7 @@ && d->exclusive && d->exclusive->d && d->exclusive->d->exclusive == this ) d->exclusive->turnOffChild(); - d->exclusive = 0; // so the children won't try to access us. + d->exclusive = 0; // so the tqchildren won't try to access us. if ( d->statesDict ) delete d->statesDict; delete d; @@ -1107,9 +1107,9 @@ if ( myType == CheckBox ) { setCurrentState( s ); stateChange( state() ); - if ( update && parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - ((KviTalCheckListItem*)parent())->updateController( update, store ); + if ( update && tqparent() && tqparent()->rtti() == 1 + && ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController ) + ((KviTalCheckListItem*)tqparent())->updateController( update, store ); } else if ( myType == CheckBoxController ) { if ( s == NoChange && childCount()) { restoreState( (void*) this ); @@ -1131,18 +1131,18 @@ ToggleState oldState = internalState(); updateController( FALSE, FALSE ); if ( oldState != internalState() && - parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - ((KviTalCheckListItem*)parent())->updateController( update, store ); + tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController ) + ((KviTalCheckListItem*)tqparent())->updateController( update, store ); updateController( update, store ); } else { - // if there are no children we simply set the CheckBoxController and update its parent + // if there are no tqchildren we simply set the CheckBoxController and update its tqparent setCurrentState( s ); stateChange( state() ); - if ( parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - ((KviTalCheckListItem*)parent())->updateController( update, store ); + if ( tqparent() && tqparent()->rtti() == 1 + && ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController ) + ((KviTalCheckListItem*)tqparent())->updateController( update, store ); } } else { setCurrentState( s ); @@ -1164,7 +1164,7 @@ } stateChange( state() ); } - repaint(); + tqrepaint(); } void KviTalCheckListItem::setCurrentState( ToggleState s ) @@ -1176,9 +1176,9 @@ else on = FALSE; - #if defined(QT_ACCESSIBILITY_SUPPORT) + #if defined(TQT_ACCESSIBILITY_SUPPORT) if ( old != d->currentState && listView() ) - QAccessible::updateAccessibility( listView()->viewport(), indexOfItem( this ), QAccessible::StateChanged ); + TQAccessible::updateAccessibility( listView()->viewport(), indexOfItem( this ), TQAccessible::StateChanged ); #else Q_UNUSED( old ); #endif @@ -1187,7 +1187,7 @@ void KviTalCheckListItem::setStoredState( ToggleState newState, void *key ) { if ( myType == CheckBox || myType == CheckBoxController ) - d->statesDict->replace( key, new ToggleState(newState) ); + d->statesDict->tqreplace( key, new ToggleState(newState) ); } KviTalCheckListItem::ToggleState KviTalCheckListItem::storedState( void *key ) const @@ -1195,7 +1195,7 @@ if ( !d->statesDict ) return Off; - ToggleState *foundState = d->statesDict->find( key ); + ToggleState *foundState = d->statesDict->tqfind( key ); if ( foundState ) return ToggleState( *foundState ); else @@ -1215,15 +1215,15 @@ if ( lv && !lv->isEnabled() || !isEnabled() ) return; - QPoint pos; - int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv); + TQPoint pos; + int boxsize = lv->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, lv); if ( activatedPos( pos ) ) { - bool parentControl = FALSE; - if ( parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController ) - parentControl = TRUE; + bool tqparentControl = FALSE; + if ( tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*) tqparent())->type() == RadioButtonController ) + tqparentControl = TRUE; - int x = parentControl ? 0 : 3; + int x = tqparentControl ? 0 : 3; int align = lv->columnAlignment( 0 ); int marg = lv->itemMargin(); int y = 0; @@ -1233,10 +1233,10 @@ else y = (lv->fontMetrics().height() + 2 + marg - boxsize) / 2; - QRect r( x, y, boxsize-3, boxsize-3 ); + TQRect r( x, y, boxsize-3, boxsize-3 ); // columns might have been swapped r.moveBy( lv->header()->sectionPos( 0 ), 0 ); - if ( !r.contains( pos ) ) + if ( !r.tqcontains( pos ) ) return; } if ( ( myType == CheckBox ) || ( myType == CheckBoxController) ) { @@ -1287,13 +1287,13 @@ case CheckBox: setCurrentState( storedState( key ) ); stateChange( state() ); - repaint(); + tqrepaint(); break; case CheckBoxController: { KviTalListViewItem *item = firstChild(); int childCount = 0; while ( item ) { - // recursively calling restoreState for children of type CheckBox and CheckBoxController + // recursively calling restoreState for tqchildren of type CheckBox and CheckBoxController if ( item->rtti() == 1 && ( ((KviTalCheckListItem*)item)->type() == CheckBox || ((KviTalCheckListItem*)item)->type() == CheckBoxController ) ) { @@ -1308,7 +1308,7 @@ else updateController( FALSE ); } else { - // if there are no children we retrieve the CheckBoxController state directly. + // if there are no tqchildren we retrieve the CheckBoxController state directly. setState( storedState( key ), TRUE, FALSE ); } } @@ -1324,10 +1324,10 @@ return; KviTalCheckListItem *controller = 0; - // checks if this CheckBoxController has another CheckBoxController as parent - if ( parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - controller = (KviTalCheckListItem*)parent(); + // checks if this CheckBoxController has another CheckBoxController as tqparent + if ( tqparent() && tqparent()->rtti() == 1 + && ((KviTalCheckListItem*)tqparent())->type() == CheckBoxController ) + controller = (KviTalCheckListItem*)tqparent(); ToggleState theState = Off; bool first = TRUE; @@ -1358,7 +1358,7 @@ if ( update && controller ) { controller->updateController( update, store ); } - repaint(); + tqrepaint(); } } @@ -1378,7 +1378,7 @@ } item = item->nextSibling(); } - // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController children. + // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController tqchildren. setStoredState( internalState() , key ); } @@ -1388,13 +1388,13 @@ int h = height(); KviTalListView *lv = listView(); if ( lv ) - h = QMAX( lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv), + h = TQMAX( lv->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, lv), h ); - h = QMAX( h, QApplication::globalStrut().height() ); + h = TQMAX( h, TQApplication::globalStrut().height() ); setHeight( h ); } - int KviTalCheckListItem::width( const QFontMetrics& fm, const KviTalListView* lv, int column) const + int KviTalCheckListItem::width( const TQFontMetrics& fm, const KviTalListView* lv, int column) const { int r = KviTalListViewItem::width( fm, lv, column ); if ( column == 0 ) { @@ -1402,13 +1402,13 @@ if ( myType == RadioButtonController && pixmap( 0 ) ) { // r += 0; } else { - r += lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv) + 4; + r += lv->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, lv) + 4; } } - return QMAX( r, QApplication::globalStrut().width() ); + return TQMAX( r, TQApplication::globalStrut().width() ); } - void KviTalCheckListItem::paintCell( QPainter * p, const QColorGroup & cg, + void KviTalCheckListItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { if ( !p ) @@ -1419,11 +1419,11 @@ return; const BackgroundMode bgmode = lv->viewport()->backgroundMode(); - const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode ); - if ( cg.brush( crole ) != lv->colorGroup().brush( crole ) ) + const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode ); + if ( cg.brush( crole ) != lv->tqcolorGroup().brush( crole ) ) p->fillRect( 0, 0, width, height(), cg.brush( crole ) ); else - lv->paintEmptyArea( p, QRect( 0, 0, width, height() ) ); + lv->paintEmptyArea( p, TQRect( 0, 0, width, height() ) ); if ( column != 0 ) { // The rest is text, or for subclasses to change. @@ -1431,50 +1431,50 @@ return; } - bool parentControl = FALSE; - if ( parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController ) - parentControl = TRUE; + bool tqparentControl = FALSE; + if ( tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*) tqparent())->type() == RadioButtonController ) + tqparentControl = TRUE; - QFontMetrics fm( lv->fontMetrics() ); - int boxsize = lv->style().pixelMetric( myType == RadioButtonController ? QStyle::PM_CheckListControllerSize : - QStyle::PM_CheckListButtonSize, lv); + TQFontMetrics fm( lv->fontMetrics() ); + int boxsize = lv->tqstyle().tqpixelMetric( myType == RadioButtonController ? TQStyle::PM_CheckListControllerSize : + TQStyle::PM_CheckListButtonSize, lv); int marg = lv->itemMargin(); int r = marg; // Draw controller / checkbox / radiobutton --------------------- - int styleflags = QStyle::Style_Default; + int styleflags = TQStyle::Style_Default; if ( internalState() == On ) { - styleflags |= QStyle::Style_On; + styleflags |= TQStyle::Style_On; } else if ( internalState() == NoChange ) { if ( myType == CheckBoxController && !isTristate() ) - styleflags |= QStyle::Style_Off; + styleflags |= TQStyle::Style_Off; else - styleflags |= QStyle::Style_NoChange; + styleflags |= TQStyle::Style_NoChange; } else { - styleflags |= QStyle::Style_Off; + styleflags |= TQStyle::Style_Off; } if ( isSelected() ) - styleflags |= QStyle::Style_Selected; + styleflags |= TQStyle::Style_Selected; if ( isEnabled() && lv->isEnabled() ) - styleflags |= QStyle::Style_Enabled; + styleflags |= TQStyle::Style_Enabled; if ( myType == RadioButtonController ) { int x = 0; - if(!parentControl) + if(!tqparentControl) x += 3; if ( !pixmap( 0 ) ) { - lv->style().drawPrimitive(QStyle::PE_CheckListController, p, - QRect(x, 0, boxsize, + lv->tqstyle().tqdrawPrimitive(TQStyle::PE_CheckListController, p, + TQRect(x, 0, boxsize, fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); + cg, styleflags, TQStyleOption(this)); r += boxsize + 4; } } else { Q_ASSERT( lv ); //### int x = 0; int y = 0; - if ( !parentControl ) + if ( !tqparentControl ) x += 3; if ( align & AlignVCenter ) y = ( ( height() - boxsize ) / 2 ) + marg; @@ -1482,26 +1482,26 @@ y = (fm.height() + 2 + marg - boxsize) / 2; if ( ( myType == CheckBox ) || ( myType == CheckBoxController ) ) { - lv->style().drawPrimitive(QStyle::PE_CheckListIndicator, p, - QRect(x, y, boxsize, + lv->tqstyle().tqdrawPrimitive(TQStyle::PE_CheckListIndicator, p, + TQRect(x, y, boxsize, fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); + cg, styleflags, TQStyleOption(this)); } else { //radio button look - lv->style().drawPrimitive(QStyle::PE_CheckListExclusiveIndicator, - p, QRect(x, y, boxsize, + lv->tqstyle().tqdrawPrimitive(TQStyle::PE_CheckListExclusiveIndicator, + p, TQRect(x, y, boxsize, fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); + cg, styleflags, TQStyleOption(this)); } r += boxsize + 4; } // Draw text ---------------------------------------------------- p->translate( r, 0 ); - p->setPen( QPen( cg.text() ) ); + p->setPen( TQPen( cg.text() ) ); KviTalListViewItem::paintCell( p, cg, column, width - r, align ); } - void KviTalCheckListItem::paintFocus( QPainter *p, const QColorGroup & cg,const QRect & r ) + void KviTalCheckListItem::paintFocus( TQPainter *p, const TQColorGroup & cg,const TQRect & r ) { bool intersect = TRUE; KviTalListView *lv = listView(); @@ -1509,19 +1509,19 @@ int xdepth = lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin(); int p = lv->header()->cellPos( lv->header()->mapToActual( 0 ) ); xdepth += p; - intersect = r.intersects( QRect( p, r.y(), xdepth - p + 1, r.height() ) ); + intersect = r.intersects( TQRect( p, r.y(), xdepth - p + 1, r.height() ) ); } - bool parentControl = FALSE; - if ( parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController ) - parentControl = TRUE; + bool tqparentControl = FALSE; + if ( tqparent() && tqparent()->rtti() == 1 && + ((KviTalCheckListItem*) tqparent())->type() == RadioButtonController ) + tqparentControl = TRUE; if ( myType != RadioButtonController && intersect && (lv->rootIsDecorated() || myType == RadioButton || - (myType == CheckBox && parentControl) ) ) { - QRect rect; - int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv); + (myType == CheckBox && tqparentControl) ) ) { + TQRect rect; + int boxsize = lv->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, lv); if ( lv->columnAlignment(0) == AlignCenter ) { - QFontMetrics fm( lv->font() ); + TQFontMetrics fm( lv->font() ); int bx = (lv->columnWidth(0) - (boxsize + fm.width(text())))/2 + boxsize; if ( bx < 0 ) bx = 0; rect.setRect( r.x() + bx + 5, r.y(), r.width() - bx - 5, diff --git a/src/kvilib/tal/kvi_tal_listview.h b/src/kvilib/tal/kvi_tal_listview.h index 9b95e2f8..0bf48740 100644 --- a/src/kvilib/tal/kvi_tal_listview.h +++ b/src/kvilib/tal/kvi_tal_listview.h @@ -28,13 +28,13 @@ // // This is the only reasonable CROSS-QT3-QT4-COMPATIBLE implementation -// of QListView I've been able to find. -// Note that using macros for the items will NOT work since moc +// of TQListView I've been able to find. +// Note that using macros for the items will NOT work since tqmoc // doesn't expand them. Note also that KviTalCheckListItem must -// be fully reimplemented and not be inherited from QCheckListItem +// be fully reimplemented and not be inherited from TQCheckListItem // to build up a consistent item object hierarchy. To complete -// the obscenity, we need TWO COMPLETE implementations: one for Qt3 -// and one for Qt4... bleah :D +// the obscenity, we need TWO COMPLETE implementations: one for TQt3 +// and one for TQt4... bleah :D // // The code for KviTalCheckListItem is adapted from qlistview.h/cpp // present in qt 3.3.6 AND in qt 4.1.2. diff --git a/src/kvilib/tal/kvi_tal_listview_qt3.h b/src/kvilib/tal/kvi_tal_listview_qt3.h index 4fe4a766..75b062a4 100644 --- a/src/kvilib/tal/kvi_tal_listview_qt3.h +++ b/src/kvilib/tal/kvi_tal_listview_qt3.h @@ -29,93 +29,94 @@ #include "kvi_qstring.h" -#include <qlistview.h> +#include <tqlistview.h> class KviTalListViewItem; -class KVILIB_API KviTalListView : public QListView +class KVILIB_API KviTalListView : public TQListView { friend class KviTalCheckListItem; Q_OBJECT + TQ_OBJECT public: - KviTalListView(QWidget * pParent); + KviTalListView(TQWidget * pParent); virtual ~KviTalListView() {}; public: - // Shadow the internal Qt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)QListView::firstChild(); }; - KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)QListView::lastItem(); }; - KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)QListView::selectedItem(); }; - KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)QListView::currentItem(); }; - KviTalListViewItem * itemAt(const QPoint &pnt) const { return (KviTalListViewItem *)QListView::itemAt(pnt); }; + // Shadow the internal TQt methods + KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)TQListView::firstChild(); }; + KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)TQListView::lastItem(); }; + KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)TQListView::selectedItem(); }; + KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)TQListView::currentItem(); }; + KviTalListViewItem * itemAt(const TQPoint &pnt) const { return (KviTalListViewItem *)TQListView::itemAt(pnt); }; signals: void selectionChanged(KviTalListViewItem * pItem); void currentChanged(KviTalListViewItem * pItem); void clicked(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void clicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void pressed(KviTalListViewItem * pItem); - void pressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void pressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void doubleClicked(KviTalListViewItem * pItem); - void doubleClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void doubleClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void returnPressed(KviTalListViewItem * pItem); void spacePressed(KviTalListViewItem * pItem); - void rightButtonClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void rightButtonPressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void contextMenuRequested(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void rightButtonClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void rightButtonPressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void contextMenuRequested(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void onItem(KviTalListViewItem * pItem); void expanded(KviTalListViewItem * pItem); void collapsed(KviTalListViewItem * pItem); protected slots: - void redirect_selectionChanged(QListViewItem * pItem); - void redirect_currentChanged(QListViewItem * pItem); - void redirect_clicked(QListViewItem * pItem); - void redirect_clicked(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_pressed(QListViewItem * pItem); - void redirect_pressed(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_doubleClicked(QListViewItem * pItem); - void redirect_doubleClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_returnPressed(QListViewItem * pItem); - void redirect_spacePressed(QListViewItem * pItem); - void redirect_rightButtonClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_rightButtonPressed(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonClicked(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonPressed(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_contextMenuRequested(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_onItem(QListViewItem * pItem); - void redirect_expanded(QListViewItem * pItem); - void redirect_collapsed(QListViewItem * pItem); + void redirect_selectionChanged(TQListViewItem * pItem); + void redirect_currentChanged(TQListViewItem * pItem); + void redirect_clicked(TQListViewItem * pItem); + void redirect_clicked(TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_pressed(TQListViewItem * pItem); + void redirect_pressed(TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_doubleClicked(TQListViewItem * pItem); + void redirect_doubleClicked(TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_returnPressed(TQListViewItem * pItem); + void redirect_spacePressed(TQListViewItem * pItem); + void redirect_rightButtonClicked(TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_rightButtonPressed(TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_mouseButtonClicked(int iButton,TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_mouseButtonPressed(int iButton,TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_contextMenuRequested(TQListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_onItem(TQListViewItem * pItem); + void redirect_expanded(TQListViewItem * pItem); + void redirect_collapsed(TQListViewItem * pItem); }; -class KVILIB_API KviTalListViewItem : public QListViewItem +class KVILIB_API KviTalListViewItem : public TQListViewItem { public: KviTalListViewItem(KviTalListView * pParent) - : QListViewItem(pParent) {}; + : TQListViewItem(pParent) {}; KviTalListViewItem(KviTalListViewItem * pParent) - : QListViewItem(pParent) {}; + : TQListViewItem(pParent) {}; KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter) - : QListViewItem(pParent,pAfter) {}; + : TQListViewItem(pParent,pAfter) {}; KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter) - : QListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListView * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) - : QListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) - : QListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListViewItem * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) - : QListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) - : QListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {}; + : TQListViewItem(pParent,pAfter) {}; + KviTalListViewItem(KviTalListView * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty) + : TQListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; + KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty) + : TQListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; + KviTalListViewItem(KviTalListViewItem * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty) + : TQListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {}; + KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty) + : TQListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {}; virtual ~KviTalListViewItem() {}; public: - // Shadow the internal Qt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)QListViewItem::firstChild(); }; - KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)QListViewItem::nextSibling(); }; - KviTalListViewItem * parent() const { return (KviTalListViewItem *)QListViewItem::parent(); }; - KviTalListView * listView() const { return (KviTalListView *)QListViewItem::listView(); }; - KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)QListViewItem::itemAbove(); }; - KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)QListViewItem::itemBelow(); }; + // Shadow the internal TQt methods + KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)TQListViewItem::firstChild(); }; + KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)TQListViewItem::nextSibling(); }; + KviTalListViewItem * tqparent() const { return (KviTalListViewItem *)TQListViewItem::tqparent(); }; + KviTalListView * listView() const { return (KviTalListView *)TQListViewItem::listView(); }; + KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)TQListViewItem::itemAbove(); }; + KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)TQListViewItem::itemBelow(); }; }; struct KviTalCheckListItemPrivate; @@ -132,27 +133,27 @@ public: }; enum ToggleState { Off, NoChange, On }; - KviTalCheckListItem(KviTalCheckListItem *parent, const QString &text,Type = RadioButtonController); - KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after,const QString &text, Type = RadioButtonController); - KviTalCheckListItem( KviTalListViewItem *parent, const QString &text,Type = RadioButtonController ); - KviTalCheckListItem( KviTalListViewItem *parent, KviTalListViewItem *after,const QString &text, Type = RadioButtonController ); - KviTalCheckListItem( KviTalListView *parent, const QString &text,Type = RadioButtonController ); - KviTalCheckListItem( KviTalListView *parent, KviTalListViewItem *after,const QString &text, Type = RadioButtonController ); - KviTalCheckListItem( KviTalListViewItem *parent, const QString &text,const QPixmap & ); - KviTalCheckListItem( KviTalListView *parent, const QString &text,const QPixmap & ); + KviTalCheckListItem(KviTalCheckListItem *tqparent, const TQString &text,Type = RadioButtonController); + KviTalCheckListItem(KviTalCheckListItem *tqparent, KviTalListViewItem *after,const TQString &text, Type = RadioButtonController); + KviTalCheckListItem( KviTalListViewItem *tqparent, const TQString &text,Type = RadioButtonController ); + KviTalCheckListItem( KviTalListViewItem *tqparent, KviTalListViewItem *after,const TQString &text, Type = RadioButtonController ); + KviTalCheckListItem( KviTalListView *tqparent, const TQString &text,Type = RadioButtonController ); + KviTalCheckListItem( KviTalListView *tqparent, KviTalListViewItem *after,const TQString &text, Type = RadioButtonController ); + KviTalCheckListItem( KviTalListViewItem *tqparent, const TQString &text,const TQPixmap & ); + KviTalCheckListItem( KviTalListView *tqparent, const TQString &text,const TQPixmap & ); ~KviTalCheckListItem(); - void paintCell( QPainter *,const QColorGroup & cg,int column, int width, int alignment ); - virtual void paintFocus( QPainter *, const QColorGroup & cg, - const QRect & r ); - int width( const QFontMetrics&, const KviTalListView*, int column) const; + void paintCell( TQPainter *,const TQColorGroup & cg,int column, int width, int tqalignment ); + virtual void paintFocus( TQPainter *, const TQColorGroup & cg, + const TQRect & r ); + int width( const TQFontMetrics&, const KviTalListView*, int column) const; void setup(); virtual void setOn( bool ); // ### should be replaced by setChecked in ver4 bool isOn() const { return on; } Type type() const { return myType; } - QString text() const { return KviTalListViewItem::text( 0 ); } - QString text( int n ) const { return KviTalListViewItem::text( n ); } + TQString text() const { return KviTalListViewItem::text( 0 ); } + TQString text( int n ) const { return KviTalListViewItem::text( n ); } void setTristate( bool ); bool isTristate() const; @@ -185,6 +186,6 @@ private: }; -#define KviTalListViewItemIterator QListViewItemIterator +#define KviTalListViewItemIterator TQListViewItemIterator #endif // _KVI_TAL_LISTVIEW_QT3_H_ diff --git a/src/kvilib/tal/kvi_tal_listview_qt4.h b/src/kvilib/tal/kvi_tal_listview_qt4.h index e6ccc829..d6f2bba6 100644 --- a/src/kvilib/tal/kvi_tal_listview_qt4.h +++ b/src/kvilib/tal/kvi_tal_listview_qt4.h @@ -29,7 +29,7 @@ #include "kvi_qstring.h" -#include <q3listview.h> +#include <tq3listview.h> class KviTalListViewItem; @@ -38,32 +38,33 @@ class KVILIB_API KviTalListView : public Q3ListView { friend class KviTalCheckListItem; Q_OBJECT + TQ_OBJECT public: - KviTalListView(QWidget * pParent); + KviTalListView(TQWidget * pParent); virtual ~KviTalListView() {}; public: - // Shadow the internal Qt methods + // Shadow the internal TQt methods KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListView::firstChild(); }; KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)Q3ListView::lastItem(); }; KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)Q3ListView::selectedItem(); }; KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)Q3ListView::currentItem(); }; - KviTalListViewItem * itemAt(const QPoint &pnt) const { return (KviTalListViewItem *)Q3ListView::itemAt(pnt); }; + KviTalListViewItem * itemAt(const TQPoint &pnt) const { return (KviTalListViewItem *)Q3ListView::itemAt(pnt); }; signals: void selectionChanged(KviTalListViewItem * pItem); void currentChanged(KviTalListViewItem * pItem); void clicked(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void clicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void pressed(KviTalListViewItem * pItem); - void pressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void pressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void doubleClicked(KviTalListViewItem * pItem); - void doubleClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void doubleClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void returnPressed(KviTalListViewItem * pItem); void spacePressed(KviTalListViewItem * pItem); - void rightButtonClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void rightButtonPressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void contextMenuRequested(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); + void rightButtonClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void rightButtonPressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); + void contextMenuRequested(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); void onItem(KviTalListViewItem * pItem); void expanded(KviTalListViewItem * pItem); void collapsed(KviTalListViewItem * pItem); @@ -71,18 +72,18 @@ protected slots: void redirect_selectionChanged(Q3ListViewItem * pItem); void redirect_currentChanged(Q3ListViewItem * pItem); void redirect_clicked(Q3ListViewItem * pItem); - void redirect_clicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); + void redirect_clicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); void redirect_pressed(Q3ListViewItem * pItem); - void redirect_pressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); + void redirect_pressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); void redirect_doubleClicked(Q3ListViewItem * pItem); - void redirect_doubleClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); + void redirect_doubleClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); void redirect_returnPressed(Q3ListViewItem * pItem); void redirect_spacePressed(Q3ListViewItem * pItem); - void redirect_rightButtonClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_rightButtonPressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_contextMenuRequested(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); + void redirect_rightButtonClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_rightButtonPressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); + void redirect_contextMenuRequested(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); void redirect_onItem(Q3ListViewItem * pItem); void redirect_expanded(Q3ListViewItem * pItem); void redirect_collapsed(Q3ListViewItem * pItem); @@ -101,19 +102,19 @@ public: : Q3ListViewItem(pParent,pAfter) {}; KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter) : Q3ListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListView * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) + KviTalListViewItem(KviTalListView * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty) : Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) + KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty) : Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListViewItem * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) + KviTalListViewItem(KviTalListViewItem * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty) : Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) + KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty) : Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {}; public: - // Shadow the internal Qt methods + // Shadow the internal TQt methods KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListViewItem::firstChild(); }; KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)Q3ListViewItem::nextSibling(); }; - KviTalListViewItem * parent() const { return (KviTalListViewItem *)Q3ListViewItem::parent(); }; + KviTalListViewItem * tqparent() const { return (KviTalListViewItem *)Q3ListViewItem::tqparent(); }; KviTalListView * listView() const { return (KviTalListView *)Q3ListViewItem::listView(); }; KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)Q3ListViewItem::itemAbove(); }; KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)Q3ListViewItem::itemBelow(); }; @@ -132,36 +133,36 @@ public: enum ToggleState { Off, NoChange, On }; - KviTalCheckListItem(KviTalCheckListItem *parent, const QString &text, + KviTalCheckListItem(KviTalCheckListItem *tqparent, const TQString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after, - const QString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, + KviTalCheckListItem(KviTalCheckListItem *tqparent, KviTalListViewItem *after, + const TQString &text, Type = RadioButtonController); + KviTalCheckListItem(KviTalListViewItem *tqparent, const TQString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after, - const QString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListView *parent, const QString &text, + KviTalCheckListItem(KviTalListViewItem *tqparent, KviTalListViewItem *after, + const TQString &text, Type = RadioButtonController); + KviTalCheckListItem(KviTalListView *tqparent, const TQString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after, - const QString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, - const QPixmap &); - KviTalCheckListItem(KviTalListView *parent, const QString &text, - const QPixmap &); + KviTalCheckListItem(KviTalListView *tqparent, KviTalListViewItem *after, + const TQString &text, Type = RadioButtonController); + KviTalCheckListItem(KviTalListViewItem *tqparent, const TQString &text, + const TQPixmap &); + KviTalCheckListItem(KviTalListView *tqparent, const TQString &text, + const TQPixmap &); ~KviTalCheckListItem(); - void paintCell(QPainter *, const QColorGroup & cg, - int column, int width, int alignment); - virtual void paintFocus(QPainter *, const QColorGroup &cg, - const QRect & r); - int width(const QFontMetrics&, const KviTalListView*, int column) const; + void paintCell(TQPainter *, const TQColorGroup & cg, + int column, int width, int tqalignment); + virtual void paintFocus(TQPainter *, const TQColorGroup &cg, + const TQRect & r); + int width(const TQFontMetrics&, const KviTalListView*, int column) const; void setup(); virtual void setOn(bool); bool isOn() const { return on; } Type type() const { return myType; } - QString text() const { return KviTalListViewItem::text(0); } - QString text(int n) const { return KviTalListViewItem::text(n); } + TQString text() const { return KviTalListViewItem::text(0); } + TQString text(int n) const { return KviTalListViewItem::text(n); } void setTristate(bool); bool isTristate() const; diff --git a/src/kvilib/tal/kvi_tal_mainwindow.cpp b/src/kvilib/tal/kvi_tal_mainwindow.cpp index c2e52b2d..ff2e7b17 100644 --- a/src/kvilib/tal/kvi_tal_mainwindow.cpp +++ b/src/kvilib/tal/kvi_tal_mainwindow.cpp @@ -27,7 +27,7 @@ #ifdef COMPILE_KDE_SUPPORT - KviTalMainWindow::KviTalMainWindow(QWidget * par,const char * nam) + KviTalMainWindow::KviTalMainWindow(TQWidget * par,const char * nam) : KMainWindow(par,nam) { } @@ -37,8 +37,8 @@ #else #ifdef COMPILE_USE_QT4 - KviTalMainWindow::KviTalMainWindow(QWidget * par,const char * nam) - : QMainWindow(par,nam) + KviTalMainWindow::KviTalMainWindow(TQWidget * par,const char * nam) + : TQMainWindow(par,nam) { } @@ -49,13 +49,13 @@ void KviTalMainWindow::setUsesBigPixmaps(bool b) { - if(b)setIconSize(QSize(48,48)); - else setIconSize(QSize(24,24)); + if(b)setIconSize(TQSize(48,48)); + else setIconSize(TQSize(24,24)); } #include "kvi_tal_mainwindow_qt4.moc" #else - KviTalMainWindow::KviTalMainWindow(QWidget * par,const char * nam) - : QMainWindow(par,nam) + KviTalMainWindow::KviTalMainWindow(TQWidget * par,const char * nam) + : TQMainWindow(par,nam) { } #include "kvi_tal_mainwindow_qt3.moc" diff --git a/src/kvilib/tal/kvi_tal_mainwindow_kde.h b/src/kvilib/tal/kvi_tal_mainwindow_kde.h index 9f38aede..1edcba85 100644 --- a/src/kvilib/tal/kvi_tal_mainwindow_kde.h +++ b/src/kvilib/tal/kvi_tal_mainwindow_kde.h @@ -28,8 +28,9 @@ class KVILIB_API KviTalMainWindow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - KviTalMainWindow(QWidget * par,const char * nam); + KviTalMainWindow(TQWidget * par,const char * nam); ~KviTalMainWindow(); }; diff --git a/src/kvilib/tal/kvi_tal_mainwindow_qt3.h b/src/kvilib/tal/kvi_tal_mainwindow_qt3.h index d328774f..34dc9cb9 100644 --- a/src/kvilib/tal/kvi_tal_mainwindow_qt3.h +++ b/src/kvilib/tal/kvi_tal_mainwindow_qt3.h @@ -1,5 +1,5 @@ -#ifndef _KVI_TAL_MAINWINDOW_QT_H_ -#define _KVI_TAL_MAINWINDOW_QT_H_ +#ifndef _KVI_TAL_MAINWINDOW_TQT_H_ +#define _KVI_TAL_MAINWINDOW_TQT_H_ // // File : kvi_tal_mainwindow_qt.h @@ -23,14 +23,15 @@ // Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qmainwindow.h> +#include <tqmainwindow.h> -class KVILIB_API KviTalMainWindow : public QMainWindow +class KVILIB_API KviTalMainWindow : public TQMainWindow { Q_OBJECT + TQ_OBJECT public: - KviTalMainWindow(QWidget * par,const char * nam); + KviTalMainWindow(TQWidget * par,const char * nam); ~KviTalMainWindow(); }; -#endif // _KVI_TAL_MAINWINDOW_QT_H_ +#endif // _KVI_TAL_MAINWINDOW_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_mainwindow_qt4.h b/src/kvilib/tal/kvi_tal_mainwindow_qt4.h index b6c2c1be..9669cb27 100644 --- a/src/kvilib/tal/kvi_tal_mainwindow_qt4.h +++ b/src/kvilib/tal/kvi_tal_mainwindow_qt4.h @@ -1,5 +1,5 @@ -#ifndef _KVI_TAL_MAINWINDOW_QT_H_ -#define _KVI_TAL_MAINWINDOW_QT_H_ +#ifndef _KVI_TAL_MAINWINDOW_TQT_H_ +#define _KVI_TAL_MAINWINDOW_TQT_H_ // // File : kvi_tal_mainwindow_qt.h @@ -23,17 +23,18 @@ // Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qmainwindow.h> +#include <tqmainwindow.h> -class KVILIB_API KviTalMainWindow : public QMainWindow +class KVILIB_API KviTalMainWindow : public TQMainWindow { Q_OBJECT + TQ_OBJECT public: - KviTalMainWindow(QWidget * par,const char * nam); + KviTalMainWindow(TQWidget * par,const char * nam); ~KviTalMainWindow(); public: bool usesBigPixmaps(); void setUsesBigPixmaps(bool b); }; -#endif // _KVI_TAL_MAINWINDOW_QT_H_ +#endif // _KVI_TAL_MAINWINDOW_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_menubar.cpp b/src/kvilib/tal/kvi_tal_menubar.cpp index 0fbb28be..4db85f74 100644 --- a/src/kvilib/tal/kvi_tal_menubar.cpp +++ b/src/kvilib/tal/kvi_tal_menubar.cpp @@ -27,7 +27,7 @@ #ifdef COMPILE_KDE_SUPPORT - KviTalMenuBar::KviTalMenuBar(QWidget * par,const char * nam) + KviTalMenuBar::KviTalMenuBar(TQWidget * par,const char * nam) : KMenuBar(par,nam) { } @@ -40,11 +40,11 @@ #else - KviTalMenuBar::KviTalMenuBar(QWidget * par,const char * nam) + KviTalMenuBar::KviTalMenuBar(TQWidget * par,const char * nam) #ifdef COMPILE_USE_QT4 - : QMenuBar(par) + : TQMenuBar(par) #else - : QMenuBar(par,nam) + : TQMenuBar(par,nam) #endif { } diff --git a/src/kvilib/tal/kvi_tal_menubar_kde.h b/src/kvilib/tal/kvi_tal_menubar_kde.h index e345d221..2889d9ee 100644 --- a/src/kvilib/tal/kvi_tal_menubar_kde.h +++ b/src/kvilib/tal/kvi_tal_menubar_kde.h @@ -27,8 +27,9 @@ class KVILIB_API KviTalMenuBar : public KMenuBar { Q_OBJECT + TQ_OBJECT public: - KviTalMenuBar(QWidget * par,const char * nam); + KviTalMenuBar(TQWidget * par,const char * nam); ~KviTalMenuBar(); }; diff --git a/src/kvilib/tal/kvi_tal_menubar_qt.h b/src/kvilib/tal/kvi_tal_menubar_qt.h index c42dab7f..da030b8a 100644 --- a/src/kvilib/tal/kvi_tal_menubar_qt.h +++ b/src/kvilib/tal/kvi_tal_menubar_qt.h @@ -1,5 +1,5 @@ -#ifndef _KVI_TAL_MENUBAR_QT_H_ -#define _KVI_TAL_MENUBAR_QT_H_ +#ifndef _KVI_TAL_MENUBAR_TQT_H_ +#define _KVI_TAL_MENUBAR_TQT_H_ // // File : kvi_tal_menubar_qt.h // Creation date : Sun Aug 12 06:35:24 2001 GMT by Szymon Stefanek @@ -22,14 +22,15 @@ // Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qmenubar.h> +#include <tqmenubar.h> -class KVILIB_API KviTalMenuBar : public QMenuBar +class KVILIB_API KviTalMenuBar : public TQMenuBar { Q_OBJECT + TQ_OBJECT public: - KviTalMenuBar(QWidget * par,const char * nam); + KviTalMenuBar(TQWidget * par,const char * nam); ~KviTalMenuBar(); }; -#endif //_KVI_TAL_MENUBAR_QT_H_ +#endif //_KVI_TAL_MENUBAR_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_popupmenu_qt3.h b/src/kvilib/tal/kvi_tal_popupmenu_qt3.h index 3340945b..755a9ef6 100644 --- a/src/kvilib/tal/kvi_tal_popupmenu_qt3.h +++ b/src/kvilib/tal/kvi_tal_popupmenu_qt3.h @@ -28,14 +28,15 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <qpopupmenu.h> +#include <tqpopupmenu.h> -class KVILIB_API KviTalPopupMenu : public QPopupMenu +class KVILIB_API KviTalPopupMenu : public TQPopupMenu { Q_OBJECT + TQ_OBJECT public: - KviTalPopupMenu(QWidget * pParent=0,const QString &szName = KviQString::empty) - : QPopupMenu(pParent,KviQString::toUtf8(szName).data()) {}; + KviTalPopupMenu(TQWidget * pParent=0,const TQString &szName = KviTQString::empty) + : TQPopupMenu(pParent,KviTQString::toUtf8(szName).data()) {}; virtual ~KviTalPopupMenu() {}; }; diff --git a/src/kvilib/tal/kvi_tal_popupmenu_qt4.h b/src/kvilib/tal/kvi_tal_popupmenu_qt4.h index 58da15ef..79e5e5f3 100644 --- a/src/kvilib/tal/kvi_tal_popupmenu_qt4.h +++ b/src/kvilib/tal/kvi_tal_popupmenu_qt4.h @@ -28,56 +28,57 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <q3popupmenu.h> -#include <qwidgetaction.h> +#include <tq3popupmenu.h> +#include <tqwidgetaction.h> class KVILIB_API KviTalPopupMenu : public Q3PopupMenu { Q_OBJECT + TQ_OBJECT public: - KviTalPopupMenu(QWidget * pParent=0,const QString &szName = KviQString::empty) + KviTalPopupMenu(TQWidget * pParent=0,const TQString &szName = KviTQString::empty) : Q3PopupMenu(pParent) { setName(szName); }; virtual ~KviTalPopupMenu() {}; - int insertItem(const QString &szText) + int insertItem(const TQString &szText) { return Q3PopupMenu::insertItem(szText); } - int insertItem(const QPixmap &pix,const QString &szText) + int insertItem(const TQPixmap &pix,const TQString &szText) { - return Q3PopupMenu::insertItem(QIcon(pix),szText,-1,-1); + return Q3PopupMenu::insertItem(TQIcon(pix),szText,-1,-1); } - int insertItem(const QString &szText,int id) + int insertItem(const TQString &szText,int id) { return Q3PopupMenu::insertItem(szText,id); } - int insertItem(const QPixmap &pix,const QString &szText,int id) + int insertItem(const TQPixmap &pix,const TQString &szText,int id) { - return Q3PopupMenu::insertItem(QIcon(pix),szText,id,-1); + return Q3PopupMenu::insertItem(TQIcon(pix),szText,id,-1); } - int insertItem(const QString &szText,const QObject * pReceiver,const char * szSlot) + int insertItem(const TQString &szText,const TQObject * pReceiver,const char * szSlot) { return Q3PopupMenu::insertItem(szText,pReceiver,szSlot); } - int insertItem(const QPixmap &pix,const QString &szText,const QObject * pReceiver,const char * szSlot) + int insertItem(const TQPixmap &pix,const TQString &szText,const TQObject * pReceiver,const char * szSlot) { - return Q3PopupMenu::insertItem(QIcon(pix),szText,pReceiver,szSlot); + return Q3PopupMenu::insertItem(TQIcon(pix),szText,pReceiver,szSlot); } - int insertItem(const QPixmap &pix,const QString &szText,QMenu *pMenu) + int insertItem(const TQPixmap &pix,const TQString &szText,TQMenu *pMenu) { - return Q3PopupMenu::insertItem(QIcon(pix),szText,pMenu,-1,-1); + return Q3PopupMenu::insertItem(TQIcon(pix),szText,pMenu,-1,-1); } - int insertItem(const QString &szText,QMenu *pMenu) + int insertItem(const TQString &szText,TQMenu *pMenu) { return Q3PopupMenu::insertItem(szText,pMenu,-1,-1); } - int insertItem(QWidget * pWidget) + int insertItem(TQWidget * pWidget) { - // needs Qt 4.2 - QWidgetAction * pAct = new QWidgetAction(this); + // needs TQt 4.2 + TQWidgetAction * pAct = new TQWidgetAction(this); pAct->setDefaultWidget(pWidget); addAction(pAct); return 0; diff --git a/src/kvilib/tal/kvi_tal_scrollview_qt3.h b/src/kvilib/tal/kvi_tal_scrollview_qt3.h index da6141e1..9cf783cd 100644 --- a/src/kvilib/tal/kvi_tal_scrollview_qt3.h +++ b/src/kvilib/tal/kvi_tal_scrollview_qt3.h @@ -27,14 +27,15 @@ #include "kvi_settings.h" -#include <qscrollview.h> +#include <tqscrollview.h> -class KVILIB_API KviTalScrollView : public QScrollView +class KVILIB_API KviTalScrollView : public TQScrollView { Q_OBJECT + TQ_OBJECT public: - KviTalScrollView(QWidget * pParent) - : QScrollView(pParent) {}; + KviTalScrollView(TQWidget * pParent) + : TQScrollView(pParent) {}; virtual ~KviTalScrollView() {}; }; diff --git a/src/kvilib/tal/kvi_tal_scrollview_qt4.h b/src/kvilib/tal/kvi_tal_scrollview_qt4.h index c82f5723..b9106e4e 100644 --- a/src/kvilib/tal/kvi_tal_scrollview_qt4.h +++ b/src/kvilib/tal/kvi_tal_scrollview_qt4.h @@ -27,13 +27,14 @@ #include "kvi_settings.h" -#include <q3scrollview.h> +#include <tq3scrollview.h> class KVILIB_API KviTalScrollView : public Q3ScrollView { Q_OBJECT + TQ_OBJECT public: - KviTalScrollView(QWidget * pParent) + KviTalScrollView(TQWidget * pParent) : Q3ScrollView(pParent) {}; virtual ~KviTalScrollView() {}; }; diff --git a/src/kvilib/tal/kvi_tal_tabdialog_qt3.h b/src/kvilib/tal/kvi_tal_tabdialog_qt3.h index 061053a3..2ff4794d 100644 --- a/src/kvilib/tal/kvi_tal_tabdialog_qt3.h +++ b/src/kvilib/tal/kvi_tal_tabdialog_qt3.h @@ -25,14 +25,15 @@ // //============================================================================= -#include <qtabdialog.h> +#include <tqtabdialog.h> -class KVILIB_API KviTalTabDialog : public QTabDialog +class KVILIB_API KviTalTabDialog : public TQTabDialog { Q_OBJECT + TQ_OBJECT public: - KviTalTabDialog(QWidget * pParent = 0,const char * name = 0,bool bModal = false) - : QTabDialog(pParent,name,bModal) {}; + KviTalTabDialog(TQWidget * pParent = 0,const char * name = 0,bool bModal = false) + : TQTabDialog(pParent,name,bModal) {}; ~KviTalTabDialog() {}; }; diff --git a/src/kvilib/tal/kvi_tal_tabdialog_qt4.h b/src/kvilib/tal/kvi_tal_tabdialog_qt4.h index c9e3eb0b..dc773cad 100644 --- a/src/kvilib/tal/kvi_tal_tabdialog_qt4.h +++ b/src/kvilib/tal/kvi_tal_tabdialog_qt4.h @@ -25,13 +25,14 @@ // //============================================================================= -#include <q3tabdialog.h> +#include <tq3tabdialog.h> class KVILIB_API KviTalTabDialog : public Q3TabDialog { Q_OBJECT + TQ_OBJECT public: - KviTalTabDialog(QWidget * pParent = 0,const char * name = 0,bool bModal = false) + KviTalTabDialog(TQWidget * pParent = 0,const char * name = 0,bool bModal = false) : Q3TabDialog(pParent,name,bModal) {}; ~KviTalTabDialog() {}; }; diff --git a/src/kvilib/tal/kvi_tal_textedit_qt3.h b/src/kvilib/tal/kvi_tal_textedit_qt3.h index b698f483..68e86ce7 100644 --- a/src/kvilib/tal/kvi_tal_textedit_qt3.h +++ b/src/kvilib/tal/kvi_tal_textedit_qt3.h @@ -25,14 +25,15 @@ // //============================================================================= -#include <qtextedit.h> +#include <tqtextedit.h> -class KVILIB_API KviTalTextEdit : public QTextEdit +class KVILIB_API KviTalTextEdit : public TQTextEdit { Q_OBJECT + TQ_OBJECT public: - KviTalTextEdit(QWidget * pParent = 0,const char * name = 0) - : QTextEdit(pParent,name) {}; + KviTalTextEdit(TQWidget * pParent = 0,const char * name = 0) + : TQTextEdit(pParent,name) {}; ~KviTalTextEdit() {}; }; diff --git a/src/kvilib/tal/kvi_tal_textedit_qt4.h b/src/kvilib/tal/kvi_tal_textedit_qt4.h index a3403d7c..574cda96 100644 --- a/src/kvilib/tal/kvi_tal_textedit_qt4.h +++ b/src/kvilib/tal/kvi_tal_textedit_qt4.h @@ -25,13 +25,14 @@ // //============================================================================= -#include <q3textedit.h> +#include <tq3textedit.h> class KVILIB_API KviTalTextEdit : public Q3TextEdit { Q_OBJECT + TQ_OBJECT public: - KviTalTextEdit(QWidget * pParent = 0,const char * name = 0) + KviTalTextEdit(TQWidget * pParent = 0,const char * name = 0) : Q3TextEdit(pParent,name) {}; ~KviTalTextEdit() {}; }; diff --git a/src/kvilib/tal/kvi_tal_toolbar.cpp b/src/kvilib/tal/kvi_tal_toolbar.cpp index f54dc973..80ac44aa 100644 --- a/src/kvilib/tal/kvi_tal_toolbar.cpp +++ b/src/kvilib/tal/kvi_tal_toolbar.cpp @@ -27,7 +27,7 @@ #ifdef COMPILE_KDE_SUPPORT - KviTalToolBar::KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) + KviTalToolBar::KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) : KToolBar(w,dock,bNewLine,nam) { setLabel(label); @@ -43,32 +43,32 @@ #ifdef COMPILE_USE_QT4 - KviTalToolBar::KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) + KviTalToolBar::KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) //: Q3ToolBar(label,w,dock,bNewLine,nam) - : QToolBar(label,w) + : TQToolBar(label,w) { - //setFrameStyle(QFrame::NoFrame); + //setFrameStyle(TQFrame::NoFrame); setObjectName(nam); - if(!layout()) - this->setLayout(new QBoxLayout(QBoxLayout::LeftToRight)); + if(!tqlayout()) + this->setLayout(new TQBoxLayout(TQBoxLayout::LeftToRight)); w->addToolBar(dock,this); } - KviTalToolBar::KviTalToolBar(QMainWindow *w,const char * name) - : QToolBar(w) + KviTalToolBar::KviTalToolBar(TQMainWindow *w,const char * name) + : TQToolBar(w) { - //setFrameStyle(QFrame::NoFrame); + //setFrameStyle(TQFrame::NoFrame); setObjectName(name); - if(!layout()) - this->setLayout(new QBoxLayout(QBoxLayout::LeftToRight)); + if(!tqlayout()) + this->setLayout(new TQBoxLayout(TQBoxLayout::LeftToRight)); w->addToolBar(this); } - QBoxLayout * KviTalToolBar::boxLayout() + TQBoxLayout * KviTalToolBar::boxLayout() { - return (QBoxLayout*)this->layout(); + return (TQBoxLayout*)this->tqlayout(); } - void KviTalToolBar::setBoxLayout(QBoxLayout * l) + void KviTalToolBar::setBoxLayout(TQBoxLayout * l) { this->setLayout(l); } @@ -80,19 +80,19 @@ void KviTalToolBar::setUsesBigPixmaps(bool b) { - if(b)setIconSize(QSize(48,48)); - else setIconSize(QSize(22,22)); + if(b)setIconSize(TQSize(48,48)); + else setIconSize(TQSize(22,22)); } #include "kvi_tal_toolbar_qt4.moc" #else - KviTalToolBar::KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) - : QToolBar(label,w,dock,bNewLine,nam) + KviTalToolBar::KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) + : TQToolBar(label,w,dock,bNewLine,nam) { } - KviTalToolBar::KviTalToolBar(QMainWindow *w,const char * name) - : QToolBar(w,name) + KviTalToolBar::KviTalToolBar(TQMainWindow *w,const char * name) + : TQToolBar(w,name) { } diff --git a/src/kvilib/tal/kvi_tal_toolbar_kde.h b/src/kvilib/tal/kvi_tal_toolbar_kde.h index f6415f26..3da32998 100644 --- a/src/kvilib/tal/kvi_tal_toolbar_kde.h +++ b/src/kvilib/tal/kvi_tal_toolbar_kde.h @@ -29,8 +29,9 @@ class KVILIB_API KviTalToolBar : public KToolBar { Q_OBJECT + TQ_OBJECT public: - KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); + KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock = TQT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); ~KviTalToolBar(); }; diff --git a/src/kvilib/tal/kvi_tal_toolbar_qt3.h b/src/kvilib/tal/kvi_tal_toolbar_qt3.h index a9b15b52..83d0dc70 100644 --- a/src/kvilib/tal/kvi_tal_toolbar_qt3.h +++ b/src/kvilib/tal/kvi_tal_toolbar_qt3.h @@ -1,5 +1,5 @@ -#ifndef _KVI_TAL_TOOLBAR_QT_H_ -#define _KVI_TAL_TOOLBAR_QT_H_ +#ifndef _KVI_TAL_TOOLBAR_TQT_H_ +#define _KVI_TAL_TOOLBAR_TQT_H_ // // File : kvi_tal_toolbar_qt.h // Creation date : Mon Aug 13 05:05:50 2001 GMT by Szymon Stefanek @@ -22,18 +22,19 @@ // Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include <qtoolbar.h> -#include <qmainwindow.h> +#include <tqtoolbar.h> +#include <tqmainwindow.h> #include "kvi_tal_toolbardocktype.h" -class KVILIB_API KviTalToolBar : public QToolBar +class KVILIB_API KviTalToolBar : public TQToolBar { Q_OBJECT + TQ_OBJECT public: - KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - KviTalToolBar(QMainWindow *w,const char * name=0); + KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock = TQT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); + KviTalToolBar(TQMainWindow *w,const char * name=0); ~KviTalToolBar(); }; -#endif //_KVI_TAL_TOOLBAR_QT_H_ +#endif //_KVI_TAL_TOOLBAR_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_toolbar_qt4.h b/src/kvilib/tal/kvi_tal_toolbar_qt4.h index 753d5a5c..50ef3637 100644 --- a/src/kvilib/tal/kvi_tal_toolbar_qt4.h +++ b/src/kvilib/tal/kvi_tal_toolbar_qt4.h @@ -25,23 +25,24 @@ #include "kvi_settings.h" #include "kvi_tal_toolbardocktype.h" -#include <QToolBar> -#include <QMainWindow> -#include <QBoxLayout> +#include <TQToolBar> +#include <TQMainWindow> +#include <TQBoxLayout> -class KVILIB_API KviTalToolBar : public QToolBar +class KVILIB_API KviTalToolBar : public TQToolBar { Q_OBJECT + TQ_OBJECT public: - KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - KviTalToolBar(QMainWindow *w,const char * name=0); + KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock = TQT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); + KviTalToolBar(TQMainWindow *w,const char * name=0); ~KviTalToolBar(); public: - QBoxLayout * boxLayout(); - void setBoxLayout(QBoxLayout *l); + TQBoxLayout * boxLayout(); + void setBoxLayout(TQBoxLayout *l); bool usesBigPixmaps(); void setUsesBigPixmaps(bool b); }; -#endif //_KVI_TAL_TOOLBAR_QT_H_ +#endif //_KVI_TAL_TOOLBAR_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_toolbardocktype.h b/src/kvilib/tal/kvi_tal_toolbardocktype.h index a7c9697a..0295f7d4 100644 --- a/src/kvilib/tal/kvi_tal_toolbardocktype.h +++ b/src/kvilib/tal/kvi_tal_toolbardocktype.h @@ -26,46 +26,35 @@ //#define COMPILE_USE_QT4 #ifdef COMPILE_USE_QT4 /* - #define QT_TOOLBARDOCK_TYPE Qt::Dock - #define QT_DOCK_TOP Qt::DockTop - #define QT_DOCK_LEFT Qt::DockLeft - #define QT_DOCK_RIGHT Qt::DockRight - #define QT_DOCK_BOTTOM Qt::DockBottom - #define QT_DOCK_MINIMIZED Qt::DockMinimized - #define QT_DOCK_TORNOFF Qt::DockTornOff - #define QT_DOCK_UNMANAGED Qt::DockUnmanaged + #define TQT_TOOLBARDOCK_TYPE TQt::Dock + #define TQT_DOCK_TOP TQt::DockTop + #define TQT_DOCK_LEFT TQt::DockLeft + #define TQT_DOCK_RIGHT TQt::DockRight + #define TQT_DOCK_BOTTOM TQt::DockBottom + #define TQT_DOCK_MINIMIZED TQt::DockMinimized + #define TQT_DOCK_TORNOFF TQt::DockTornOff + #define TQT_DOCK_UNMANAGED TQt::DockUnmanaged */ - // We will need these when we'll use the real QToolBar in Qt 4.x - #define QT_TOOLBARDOCK_TYPE Qt::ToolBarArea - #define QT_DOCK_TOP Qt::TopToolBarArea - #define QT_DOCK_LEFT Qt::LeftToolBarArea - #define QT_DOCK_RIGHT Qt::RightToolBarArea - #define QT_DOCK_BOTTOM Qt::BottomToolBarArea + // We will need these when we'll use the real TQToolBar in TQt 4.x + #define TQT_TOOLBARDOCK_TYPE TQt::ToolBarArea + #define TQT_DOCK_TOP TQt::TopToolBarArea + #define TQT_DOCK_LEFT TQt::LeftToolBarArea + #define TQT_DOCK_RIGHT TQt::RightToolBarArea + #define TQT_DOCK_BOTTOM TQt::BottomToolBarArea // THESE ARE UNSUPPORTED UNDER QT4! - #define QT_DOCK_MINIMIZED Qt::TopToolBarArea - #define QT_DOCK_TORNOFF Qt::TopToolBarArea - #define QT_DOCK_UNMANAGED Qt::TopToolBarArea + #define TQT_DOCK_MINIMIZED TQt::TopToolBarArea + #define TQT_DOCK_TORNOFF TQt::TopToolBarArea + #define TQT_DOCK_UNMANAGED TQt::TopToolBarArea #else - #if QT_VERSION >= 300 - #define QT_TOOLBARDOCK_TYPE Qt::Dock - #define QT_DOCK_TOP Qt::DockTop - #define QT_DOCK_LEFT Qt::DockLeft - #define QT_DOCK_RIGHT Qt::DockRight - #define QT_DOCK_BOTTOM Qt::DockBottom - #define QT_DOCK_MINIMIZED Qt::DockMinimized - #define QT_DOCK_TORNOFF Qt::DockTornOff - #define QT_DOCK_UNMANAGED Qt::DockUnmanaged - #else - #define QT_TOOLBARDOCK_TYPE QMainWindow::ToolBarDock - #define QT_DOCK_TOP QMainWindow::Top - #define QT_DOCK_LEFT QMainWindow::Left - #define QT_DOCK_RIGHT QMainWindow::Right - #define QT_DOCK_BOTTOM QMainWindow::Bottom - #define QT_DOCK_MINIMIZED QMainWindow::Minimized - #define QT_DOCK_TORNOFF QMainWindow::TornOff - #define QT_DOCK_UNMANAGED QMainWindow::Unmanaged - #endif + #define TQT_TOOLBARDOCK_TYPE TQt::Dock + #define TQT_DOCK_TOP TQt::DockTop + #define TQT_DOCK_LEFT TQt::DockLeft + #define TQT_DOCK_RIGHT TQt::DockRight + #define TQT_DOCK_BOTTOM TQt::DockBottom + #define TQT_DOCK_MINIMIZED TQt::DockMinimized + #define TQT_DOCK_TORNOFF TQt::DockTornOff + #define TQT_DOCK_UNMANAGED TQt::DockUnmanaged #endif #endif //_KVI_TAL_TOOLBARDOCKTYPE_H_ diff --git a/src/kvilib/tal/kvi_tal_tooltip.cpp b/src/kvilib/tal/kvi_tal_tooltip.cpp index 3bd384d2..90d09631 100644 --- a/src/kvilib/tal/kvi_tal_tooltip.cpp +++ b/src/kvilib/tal/kvi_tal_tooltip.cpp @@ -25,10 +25,10 @@ #define __KVILIB__ #include "kvi_tal_tooltip.h" -#include <qevent.h> +#include <tqevent.h> -KviTalToolTipHelper::KviTalToolTipHelper(KviTalToolTip * pToolTip,QWidget * pWidget) -: QObject(pWidget) +KviTalToolTipHelper::KviTalToolTipHelper(KviTalToolTip * pToolTip,TQWidget * pWidget) +: TQObject(pWidget) { #ifdef COMPILE_USE_QT4 m_pToolTip = pToolTip; @@ -54,13 +54,13 @@ void KviTalToolTipHelper::toolTipDying() #endif } -bool KviTalToolTipHelper::eventFilter(QObject * pObject,QEvent * pEvent) +bool KviTalToolTipHelper::eventFilter(TQObject * pObject,TQEvent * pEvent) { #ifdef COMPILE_USE_QT4 - if((pEvent->type() == QEvent::ToolTip) && m_pToolTip) + if((pEvent->type() == TQEvent::ToolTip) && m_pToolTip) { - debug("TOOL TIP EVENT WITH POSITION %d,%d",((QHelpEvent *)pEvent)->pos().x(),((QHelpEvent *)pEvent)->pos().y()); - m_pToolTip->maybeTip(((QHelpEvent *)pEvent)->pos()); + debug("TOOL TIP EVENT WITH POSITION %d,%d",((TQHelpEvent *)pEvent)->pos().x(),((TQHelpEvent *)pEvent)->pos().y()); + m_pToolTip->maybeTip(((TQHelpEvent *)pEvent)->pos()); return true; } #endif @@ -68,9 +68,9 @@ bool KviTalToolTipHelper::eventFilter(QObject * pObject,QEvent * pEvent) } -KviTalToolTip::KviTalToolTip(QWidget * pParent) +KviTalToolTip::KviTalToolTip(TQWidget * pParent) #ifndef COMPILE_USE_QT4 -: QToolTip(pParent) +: TQToolTip(pParent) #endif { #ifdef COMPILE_USE_QT4 @@ -98,26 +98,26 @@ void KviTalToolTip::helperDying() #endif #ifdef COMPILE_USE_QT4 -void KviTalToolTip::add(QWidget * widget,const QString & text) +void KviTalToolTip::add(TQWidget * widget,const TQString & text) { - QToolTip::add(widget,text); + TQToolTip::add(widget,text); } -void KviTalToolTip::remove(QWidget * widget) +void KviTalToolTip::remove(TQWidget * widget) { - QToolTip::remove(widget); + TQToolTip::remove(widget); } -void KviTalToolTip::tip(const QRect & rect,const QString & text) +void KviTalToolTip::tip(const TQRect & rect,const TQString & text) { debug("TOOL TIP AT %d,%d",rect.topLeft().x(),rect.topLeft().y()); - QToolTip::showText(m_pParent->mapToGlobal(rect.topLeft()),text); + TQToolTip::showText(m_pParent->mapToGlobal(rect.topLeft()),text); } #endif -void KviTalToolTip::maybeTip(const QPoint & p) +void KviTalToolTip::maybeTip(const TQPoint & p) { - // does nothing here.. and in Qt 4.x will even fail to work + // does nothing here.. and in TQt 4.x will even fail to work } #ifndef COMPILE_ON_WINDOWS diff --git a/src/kvilib/tal/kvi_tal_tooltip.h b/src/kvilib/tal/kvi_tal_tooltip.h index 91811c3c..3c5cfb2a 100644 --- a/src/kvilib/tal/kvi_tal_tooltip.h +++ b/src/kvilib/tal/kvi_tal_tooltip.h @@ -27,50 +27,51 @@ #include "kvi_settings.h" -#include <qtooltip.h> -#include <qobject.h> +#include <tqtooltip.h> +#include <tqobject.h> class KviTalToolTip; -// This is useful only with Qt4, but we put it here anyway -// to have both a consistent API and make moc happy -class KviTalToolTipHelper : public QObject +// This is useful only with TQt4, but we put it here anyway +// to have both a consistent API and make tqmoc happy +class KviTalToolTipHelper : public TQObject { friend class KviTalToolTip; Q_OBJECT + TQ_OBJECT public: - KviTalToolTipHelper(KviTalToolTip * pToolTip,QWidget * pWidget); + KviTalToolTipHelper(KviTalToolTip * pToolTip,TQWidget * pWidget); ~KviTalToolTipHelper(); protected: KviTalToolTip * m_pToolTip; protected: - virtual bool eventFilter(QObject * pObject,QEvent * pEvent); + virtual bool eventFilter(TQObject * pObject,TQEvent * pEvent); void toolTipDying(); }; class KVILIB_API KviTalToolTip #ifndef COMPILE_USE_QT4 - : public QToolTip + : public TQToolTip #endif { friend class KviTalToolTipHelper; public: - KviTalToolTip(QWidget * pParent); + KviTalToolTip(TQWidget * pParent); virtual ~KviTalToolTip(); protected: #ifdef COMPILE_USE_QT4 KviTalToolTipHelper * m_pHelper; - QWidget * m_pParent; + TQWidget * m_pParent; #endif public: #ifdef COMPILE_USE_QT4 - static void add(QWidget * widget,const QString & text); - static void remove(QWidget * widget); - virtual void tip(const QRect & rect,const QString & text); + static void add(TQWidget * widget,const TQString & text); + static void remove(TQWidget * widget); + virtual void tip(const TQRect & rect,const TQString & text); #endif protected: - virtual void maybeTip(const QPoint & p); + virtual void maybeTip(const TQPoint & p); #ifdef COMPILE_USE_QT4 void helperDying(); #endif diff --git a/src/kvilib/tal/kvi_tal_vbox_qt3.h b/src/kvilib/tal/kvi_tal_vbox_qt3.h index 440a2436..d7f6ae40 100644 --- a/src/kvilib/tal/kvi_tal_vbox_qt3.h +++ b/src/kvilib/tal/kvi_tal_vbox_qt3.h @@ -27,14 +27,15 @@ #include "kvi_settings.h" -#include <qvbox.h> +#include <tqvbox.h> -class KVILIB_API KviTalVBox : public QVBox +class KVILIB_API KviTalVBox : public TQVBox { Q_OBJECT + TQ_OBJECT public: - KviTalVBox(QWidget * pParent) - : QVBox(pParent) {}; + KviTalVBox(TQWidget * pParent) + : TQVBox(pParent) {}; virtual ~KviTalVBox() {}; }; diff --git a/src/kvilib/tal/kvi_tal_vbox_qt4.h b/src/kvilib/tal/kvi_tal_vbox_qt4.h index 86de700d..715d09c0 100644 --- a/src/kvilib/tal/kvi_tal_vbox_qt4.h +++ b/src/kvilib/tal/kvi_tal_vbox_qt4.h @@ -27,13 +27,14 @@ #include "kvi_settings.h" -#include <q3vbox.h> +#include <tq3vbox.h> class KVILIB_API KviTalVBox : public Q3VBox { Q_OBJECT + TQ_OBJECT public: - KviTalVBox(QWidget * pParent) + KviTalVBox(TQWidget * pParent) : Q3VBox(pParent) {}; virtual ~KviTalVBox() {}; }; diff --git a/src/kvilib/tal/kvi_tal_widgetstack_qt3.h b/src/kvilib/tal/kvi_tal_widgetstack_qt3.h index cc0eb969..3fd50684 100644 --- a/src/kvilib/tal/kvi_tal_widgetstack_qt3.h +++ b/src/kvilib/tal/kvi_tal_widgetstack_qt3.h @@ -27,15 +27,16 @@ #include "kvi_settings.h" -#include <qwidgetstack.h> +#include <tqwidgetstack.h> -class KVILIB_API KviTalWidgetStack : public QWidgetStack +class KVILIB_API KviTalWidgetStack : public TQWidgetStack { Q_OBJECT + TQ_OBJECT public: - KviTalWidgetStack(QWidget * pParent) - : QWidgetStack(pParent) {}; + KviTalWidgetStack(TQWidget * pParent) + : TQWidgetStack(pParent) {}; virtual ~KviTalWidgetStack() {}; }; diff --git a/src/kvilib/tal/kvi_tal_widgetstack_qt4.h b/src/kvilib/tal/kvi_tal_widgetstack_qt4.h index 6d0cc53f..02037393 100644 --- a/src/kvilib/tal/kvi_tal_widgetstack_qt4.h +++ b/src/kvilib/tal/kvi_tal_widgetstack_qt4.h @@ -27,14 +27,15 @@ #include "kvi_settings.h" -//#include <qstackedwidget.h> -#include <q3widgetstack.h> +//#include <tqstackedwidget.h> +#include <tq3widgetstack.h> class KVILIB_API KviTalWidgetStack : public Q3WidgetStack { Q_OBJECT + TQ_OBJECT public: - KviTalWidgetStack(QWidget * pParent) + KviTalWidgetStack(TQWidget * pParent) : Q3WidgetStack(pParent) {}; virtual ~KviTalWidgetStack() {}; }; diff --git a/src/kvilib/tal/kvi_tal_windowstate.h b/src/kvilib/tal/kvi_tal_windowstate.h index 9510ba4a..bbd7c925 100644 --- a/src/kvilib/tal/kvi_tal_windowstate.h +++ b/src/kvilib/tal/kvi_tal_windowstate.h @@ -28,15 +28,15 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #define QT_WINDOWSTATE_FLAGS Qt::WindowState + #define TQT_WINDOWSTATE_FLAGS TQt::WindowState - #define QT_WINDOWSTATE_MAXIMIZED Qt::WindowMaximized - #define QT_WINDOWSTATE_MINIMIZED Qt::WindowMinimized + #define TQT_WINDOWSTATE_MAXIMIZED TQt::WindowMaximized + #define TQT_WINDOWSTATE_MINIMIZED TQt::WindowMinimized #else - #define QT_WINDOWSTATE_FLAGS Qt::WidgetState + #define TQT_WINDOWSTATE_FLAGS TQt::WidgetState - #define QT_WINDOWSTATE_MAXIMIZED Qt::WState_Maximized - #define QT_WINDOWSTATE_MINIMIZED Qt::WState_Minimized + #define TQT_WINDOWSTATE_MAXIMIZED TQt::WState_Maximized + #define TQT_WINDOWSTATE_MINIMIZED TQt::WState_Minimized #endif #endif // _KVI_TAL_WINDOWSTATE_H_ diff --git a/src/kvilib/tal/kvi_tal_wizard.cpp b/src/kvilib/tal/kvi_tal_wizard.cpp index 6f5f39da..53b7c03f 100644 --- a/src/kvilib/tal/kvi_tal_wizard.cpp +++ b/src/kvilib/tal/kvi_tal_wizard.cpp @@ -29,21 +29,21 @@ #include "kvi_locale.h" #ifdef COMPILE_USE_QT4 - #include <QShowEvent> - #include <QLabel> - #include <QPushButton> - #include <QGridLayout> - #include <QFrame> - #include <QStackedWidget> - #include <QPalette> + #include <TQShowEvent> + #include <TQLabel> + #include <TQPushButton> + #include <TQGridLayout> + #include <TQFrame> + #include <TQStackedWidget> + #include <TQPalette> #else - #include <qlabel.h> - #include <qpushbutton.h> - #include <qlayout.h> - #include <qevent.h> - #include <qframe.h> - #include <qwidgetstack.h> - #include <qpalette.h> + #include <tqlabel.h> + #include <tqpushbutton.h> + #include <tqlayout.h> + #include <tqevent.h> + #include <tqframe.h> + #include <tqwidgetstack.h> + #include <tqpalette.h> #endif @@ -59,8 +59,8 @@ public: EnableFinish = 16 }; public: - QWidget * pWidget; - QString szTitle; + TQWidget * pWidget; + TQString szTitle; bool bEnabled; int iEnableFlags; int iVisibleIndex; @@ -72,23 +72,23 @@ public: KviPointerList<KviTalWizardPageData> * pPageList; int iEnabledPageCount; KviTalWizardPageData * pCurrentPage; - QGridLayout * pLayout; - QLabel * pTitleLabel; - QLabel * pStepsLabel; - QPushButton * pBackButton; - QPushButton * pCancelButton; - QPushButton * pHelpButton; - QPushButton * pNextButton; - QWidget * pNextSpacer; - QPushButton * pFinishButton; - QWidget * pFinishSpacer; + TQGridLayout * pLayout; + TQLabel * pTitleLabel; + TQLabel * pStepsLabel; + TQPushButton * pBackButton; + TQPushButton * pCancelButton; + TQPushButton * pHelpButton; + TQPushButton * pNextButton; + TQWidget * pNextSpacer; + TQPushButton * pFinishButton; + TQWidget * pFinishSpacer; #ifdef COMPILE_USE_QT4 - QStackedWidget * pWidgetStack; + TQStackedWidget * pWidgetStack; #else - QWidgetStack * pWidgetStack; + TQWidgetStack * pWidgetStack; #endif public: - KviTalWizardPageData * findPage(QWidget * pWidget) + KviTalWizardPageData * findPage(TQWidget * pWidget) { for(KviTalWizardPageData * pData = pPageList->first();pData;pData = pPageList->next()) { @@ -120,7 +120,7 @@ public: return NULL; } - KviTalWizardPageData * findNextEnabledPage(QWidget * pReference) + KviTalWizardPageData * findNextEnabledPage(TQWidget * pReference) { if(!pReference) return findFirstEnabledPage(); @@ -135,7 +135,7 @@ public: return NULL; } - KviTalWizardPageData * findPrevEnabledPage(QWidget * pReference) + KviTalWizardPageData * findPrevEnabledPage(TQWidget * pReference) { if(!pReference) return findLastEnabledPage(); @@ -166,33 +166,33 @@ public: }; -KviTalWizard::KviTalWizard(QWidget * pParent) -: QDialog(pParent) +KviTalWizard::KviTalWizard(TQWidget * pParent) +: TQDialog(pParent) { m_p = new KviTalWizardPrivate; m_p->pPageList = new KviPointerList<KviTalWizardPageData>; m_p->pPageList->setAutoDelete(true); m_p->pCurrentPage = NULL; m_p->iEnabledPageCount = 0; - m_p->pLayout = new QGridLayout(this); + m_p->pLayout = new TQGridLayout(this); - m_p->pTitleLabel = new QLabel(this); + m_p->pTitleLabel = new TQLabel(this); #ifdef COMPILE_USE_QT4 m_p->pLayout->addWidget(m_p->pTitleLabel,0,0,1,3); #else m_p->pLayout->addMultiCellWidget(m_p->pTitleLabel,0,0,0,3); #endif - m_p->pStepsLabel = new QLabel(this); + m_p->pStepsLabel = new TQLabel(this); m_p->pStepsLabel->setMinimumWidth(80); - m_p->pStepsLabel->setAlignment(Qt::AlignRight); + m_p->pStepsLabel->tqsetAlignment(TQt::AlignRight); #ifdef COMPILE_USE_QT4 m_p->pLayout->addWidget(m_p->pStepsLabel,0,4,1,3); #else m_p->pLayout->addMultiCellWidget(m_p->pStepsLabel,0,0,4,6); #endif - QFrame * f1 = new QFrame(this); - f1->setFrameStyle(QFrame::Sunken | QFrame::HLine); + TQFrame * f1 = new TQFrame(this); + f1->setFrameStyle(TQFrame::Sunken | TQFrame::HLine); #ifdef COMPILE_USE_QT4 m_p->pLayout->addWidget(f1,1,0,1,7); #else @@ -200,15 +200,15 @@ KviTalWizard::KviTalWizard(QWidget * pParent) #endif #ifdef COMPILE_USE_QT4 - m_p->pWidgetStack = new QStackedWidget(this); + m_p->pWidgetStack = new TQStackedWidget(this); m_p->pLayout->addWidget(m_p->pWidgetStack,2,0,1,7); #else - m_p->pWidgetStack = new QWidgetStack(this); + m_p->pWidgetStack = new TQWidgetStack(this); m_p->pLayout->addMultiCellWidget(m_p->pWidgetStack,2,2,0,6); #endif - QFrame * f2 = new QFrame(this); - f2->setFrameStyle(QFrame::Sunken | QFrame::HLine); + TQFrame * f2 = new TQFrame(this); + f2->setFrameStyle(TQFrame::Sunken | TQFrame::HLine); #ifdef COMPILE_USE_QT4 m_p->pLayout->addWidget(f2,3,0,1,7); #else @@ -226,66 +226,66 @@ KviTalWizard::KviTalWizard(QWidget * pParent) pButtonBox->setSpacing(0); - m_p->pCancelButton = new QPushButton(__tr("Cancel"),pButtonBox); + m_p->pCancelButton = new TQPushButton(__tr("Cancel"),pButtonBox); m_p->pCancelButton->setMinimumWidth(80); - QObject::connect( + TQObject::connect( m_p->pCancelButton, - SIGNAL(clicked()), + TQT_SIGNAL(clicked()), this, - SLOT(cancelButtonClicked()) + TQT_SLOT(cancelButtonClicked()) ); - QWidget * pSpacer = new QWidget(pButtonBox); + TQWidget * pSpacer = new TQWidget(pButtonBox); pSpacer->setFixedWidth(4); - m_p->pHelpButton = new QPushButton(__tr("Help"),pButtonBox); + m_p->pHelpButton = new TQPushButton(__tr("Help"),pButtonBox); m_p->pHelpButton->setMinimumWidth(80); - QObject::connect( + TQObject::connect( m_p->pHelpButton, - SIGNAL(clicked()), + TQT_SIGNAL(clicked()), this, - SLOT(helpButtonClicked()) + TQT_SLOT(helpButtonClicked()) ); - QWidget * pLargeSpacer = new QWidget(pButtonBox); + TQWidget * pLargeSpacer = new TQWidget(pButtonBox); pLargeSpacer->setMinimumWidth(50); pButtonBox->setStretchFactor(pLargeSpacer,100); - QString szText = "< "; + TQString szText = "< "; szText += __tr("Back"); - m_p->pBackButton = new QPushButton(szText,pButtonBox); + m_p->pBackButton = new TQPushButton(szText,pButtonBox); m_p->pBackButton->setMinimumWidth(80); - QObject::connect( + TQObject::connect( m_p->pBackButton, - SIGNAL(clicked()), + TQT_SIGNAL(clicked()), this, - SLOT(backButtonClicked()) + TQT_SLOT(backButtonClicked()) ); - m_p->pNextSpacer = new QWidget(pButtonBox); + m_p->pNextSpacer = new TQWidget(pButtonBox); m_p->pNextSpacer->setFixedWidth(4); szText = __tr("Next"); szText += " >"; - m_p->pNextButton = new QPushButton(szText,pButtonBox); + m_p->pNextButton = new TQPushButton(szText,pButtonBox); m_p->pNextButton->setMinimumWidth(80); - QObject::connect( + TQObject::connect( m_p->pNextButton, - SIGNAL(clicked()), + TQT_SIGNAL(clicked()), this, - SLOT(nextButtonClicked()) + TQT_SLOT(nextButtonClicked()) ); - m_p->pFinishSpacer = new QWidget(pButtonBox); + m_p->pFinishSpacer = new TQWidget(pButtonBox); m_p->pFinishSpacer->setFixedWidth(4); - m_p->pFinishButton = new QPushButton(__tr("Finish"),pButtonBox); + m_p->pFinishButton = new TQPushButton(__tr("Finish"),pButtonBox); m_p->pFinishButton->setMinimumWidth(80); - QObject::connect( + TQObject::connect( m_p->pFinishButton, - SIGNAL(clicked()), + TQT_SIGNAL(clicked()), this, - SLOT(finishButtonClicked()) + TQT_SLOT(finishButtonClicked()) ); m_p->pLayout->setMargin(8); @@ -300,7 +300,7 @@ KviTalWizard::~KviTalWizard() delete m_p; } -void KviTalWizard::insertPage(QWidget * pWidget,const QString &szTitle,int iIndex) +void KviTalWizard::insertPage(TQWidget * pWidget,const TQString &szTitle,int iIndex) { KviTalWizardPageData * pPageData = m_p->findPage(pWidget); if(!pPageData) @@ -327,12 +327,12 @@ void KviTalWizard::insertPage(QWidget * pWidget,const QString &szTitle,int iInde } -void KviTalWizard::addPage(QWidget * pWidget,const QString &szTitle) +void KviTalWizard::addPage(TQWidget * pWidget,const TQString &szTitle) { insertPage(pWidget,szTitle,-1); } -bool KviTalWizard::setPageEnabled(QWidget * pWidget,bool bEnabled) +bool KviTalWizard::setPageEnabled(TQWidget * pWidget,bool bEnabled) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -343,7 +343,7 @@ bool KviTalWizard::setPageEnabled(QWidget * pWidget,bool bEnabled) return true; } -bool KviTalWizard::setPageTitle(QWidget * pWidget,const QString &szTitle) +bool KviTalWizard::setPageTitle(TQWidget * pWidget,const TQString &szTitle) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -352,7 +352,7 @@ bool KviTalWizard::setPageTitle(QWidget * pWidget,const QString &szTitle) return true; } -bool KviTalWizard::setCurrentPage(QWidget * pWidget) +bool KviTalWizard::setCurrentPage(TQWidget * pWidget) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -361,7 +361,7 @@ bool KviTalWizard::setCurrentPage(QWidget * pWidget) return true; } -QWidget * KviTalWizard::currentPage() +TQWidget * KviTalWizard::currentPage() { if(!m_p->pCurrentPage) return NULL; @@ -378,8 +378,8 @@ void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) bool bHelpEnabled = false; bool bFinishEnabled = false; - QString szTitle; - QString szSteps; + TQString szTitle; + TQString szSteps; if(pData) { @@ -396,15 +396,15 @@ void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) szTitle = "<b>"; szTitle += pData->szTitle; szTitle += "</b>"; - QPalette pal = m_p->pStepsLabel->palette(); + TQPalette pal = m_p->pStepsLabel->palette(); #ifdef COMPILE_USE_QT4 - QColor clrWin = pal.color(QPalette::Normal,QPalette::Window); - QColor clrTxt = pal.color(QPalette::Normal,QPalette::WindowText); + TQColor clrWin = pal.color(TQPalette::Normal,TQPalette::Window); + TQColor clrTxt = pal.color(TQPalette::Normal,TQPalette::WindowText); #else - QColor clrWin = pal.color(QPalette::Normal,QColorGroup::Foreground); - QColor clrTxt = pal.color(QPalette::Normal,QColorGroup::Background); + TQColor clrWin = pal.color(TQPalette::Normal,TQColorGroup::Foreground); + TQColor clrTxt = pal.color(TQPalette::Normal,TQColorGroup::Background); #endif - QColor clrMid = qRgb( + TQColor clrMid = tqRgb( (clrWin.red() + clrTxt.red()) / 2, (clrWin.green() + clrTxt.green()) / 2, (clrWin.blue() + clrTxt.blue()) / 2 @@ -413,7 +413,7 @@ void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) szSteps = "<nobr><font color=\""; szSteps += clrMid.name(); szSteps += "\"><b>["; - szSteps += QString("Step %1 of %2").arg(pData->iVisibleIndex).arg(m_p->iEnabledPageCount); + szSteps += TQString("Step %1 of %2").tqarg(pData->iVisibleIndex).tqarg(m_p->iEnabledPageCount); szSteps += "]</b></font></nobr>"; } @@ -447,7 +447,7 @@ void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) } } -void KviTalWizard::showEvent(QShowEvent * e) +void KviTalWizard::showEvent(TQShowEvent * e) { if(!(m_p->pCurrentPage)) { @@ -456,10 +456,10 @@ void KviTalWizard::showEvent(QShowEvent * e) if(pData) setCurrentPage(pData->pWidget); } - QDialog::showEvent(e); + TQDialog::showEvent(e); } -void KviTalWizard::closeEvent(QCloseEvent * e) +void KviTalWizard::closeEvent(TQCloseEvent * e) { e->ignore(); cancelButtonClicked(); @@ -492,7 +492,7 @@ void KviTalWizard::finishButtonClicked() accept(); } -void KviTalWizard::setHelpEnabled(QWidget * pWidget,bool bEnabled) +void KviTalWizard::setHelpEnabled(TQWidget * pWidget,bool bEnabled) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -505,7 +505,7 @@ void KviTalWizard::setHelpEnabled(QWidget * pWidget,bool bEnabled) setCurrentPage(pData); } -void KviTalWizard::setCancelEnabled(QWidget * pWidget,bool bEnabled) +void KviTalWizard::setCancelEnabled(TQWidget * pWidget,bool bEnabled) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -518,7 +518,7 @@ void KviTalWizard::setCancelEnabled(QWidget * pWidget,bool bEnabled) setCurrentPage(pData); } -void KviTalWizard::setFinishEnabled(QWidget * pWidget,bool bEnabled) +void KviTalWizard::setFinishEnabled(TQWidget * pWidget,bool bEnabled) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -531,7 +531,7 @@ void KviTalWizard::setFinishEnabled(QWidget * pWidget,bool bEnabled) setCurrentPage(pData); } -void KviTalWizard::setNextEnabled(QWidget * pWidget,bool bEnabled) +void KviTalWizard::setNextEnabled(TQWidget * pWidget,bool bEnabled) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -544,7 +544,7 @@ void KviTalWizard::setNextEnabled(QWidget * pWidget,bool bEnabled) setCurrentPage(pData); } -void KviTalWizard::setBackEnabled(QWidget * pWidget,bool bEnabled) +void KviTalWizard::setBackEnabled(TQWidget * pWidget,bool bEnabled) { KviTalWizardPageData * pData = m_p->findPage(pWidget); if(!pData) @@ -557,27 +557,27 @@ void KviTalWizard::setBackEnabled(QWidget * pWidget,bool bEnabled) setCurrentPage(pData); } -QPushButton * KviTalWizard::cancelButton() +TQPushButton * KviTalWizard::cancelButton() { return m_p->pCancelButton; } -QPushButton * KviTalWizard::helpButton() +TQPushButton * KviTalWizard::helpButton() { return m_p->pHelpButton; } -QPushButton * KviTalWizard::finishButton() +TQPushButton * KviTalWizard::finishButton() { return m_p->pFinishButton; } -QPushButton * KviTalWizard::nextButton() +TQPushButton * KviTalWizard::nextButton() { return m_p->pNextButton; } -QPushButton * KviTalWizard::backButton() +TQPushButton * KviTalWizard::backButton() { return m_p->pBackButton; } diff --git a/src/kvilib/tal/kvi_tal_wizard.h b/src/kvilib/tal/kvi_tal_wizard.h index f84e3555..80e0afcf 100644 --- a/src/kvilib/tal/kvi_tal_wizard.h +++ b/src/kvilib/tal/kvi_tal_wizard.h @@ -28,13 +28,13 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #include <QDialog> + #include <TQDialog> #else - #include <qdialog.h> + #include <tqdialog.h> #endif -class QShowEvent; -class QPushButton; +class TQShowEvent; +class TQPushButton; class KviTalWizardPrivate; class KviTalWizardPageData; @@ -43,11 +43,12 @@ class KviTalWizardPageData; /// /// \brief Provides a wizard-style dialog with steps /// -class KVILIB_API KviTalWizard : public QDialog +class KVILIB_API KviTalWizard : public TQDialog { Q_OBJECT + TQ_OBJECT public: - KviTalWizard(QWidget * pParent); + KviTalWizard(TQWidget * pParent); ~KviTalWizard(); protected: KviTalWizardPrivate * m_p; @@ -58,14 +59,14 @@ public: /// Adding a page a second time is equivalent to calling /// setPageTitle() and enabling the page. /// - void addPage(QWidget * pWidget,const QString &szTitle); + void addPage(TQWidget * pWidget,const TQString &szTitle); /// /// Adds a page to the wizard with the specified title /// and in the specified position. /// Adding a page a second time is equivalent to calling /// setPageTitle() and enabling the page. /// - void insertPage(QWidget * pWidget,const QString &szTitle,int iIndex); + void insertPage(TQWidget * pWidget,const TQString &szTitle,int iIndex); /// /// Enables or disables a page. A disabled page /// is skipped when the user presses "Next" in the @@ -75,14 +76,14 @@ public: /// Returns true on success or false if the pWidget /// does not identify a page that has been added to this wizard. /// - bool setPageEnabled(QWidget * pWidget,bool bEnabled); + bool setPageEnabled(TQWidget * pWidget,bool bEnabled); /// /// Changes a page title. /// /// Returns true on success or false if the pWidget /// does not identify a page that has been added to this wizard. /// - bool setPageTitle(QWidget * pWidget,const QString &szTitle); + bool setPageTitle(TQWidget * pWidget,const TQString &szTitle); /// /// Switches the wizard to the specified page. /// Please note that this class handles page switching @@ -91,56 +92,56 @@ public: /// Returns true on success or false if the pWidget /// does not identify a page that has been added to this wizard. /// - bool setCurrentPage(QWidget * pWidget); + bool setCurrentPage(TQWidget * pWidget); /// /// Returns a pointer to the current page /// - QWidget * currentPage(); + TQWidget * currentPage(); /// /// Enables or disables the help button for the specified page. /// By default the help button is always disabled. /// - void setHelpEnabled(QWidget * pWidget,bool bEnabled); + void setHelpEnabled(TQWidget * pWidget,bool bEnabled); /// /// Enables or disables the cancel button for the specified page. /// By default the cancel button is always enabled. /// - void setCancelEnabled(QWidget * pWidget,bool bEnabled); + void setCancelEnabled(TQWidget * pWidget,bool bEnabled); /// /// Enables or disables the finish button for the specified page. /// By default the finish button is always disabled. /// - void setFinishEnabled(QWidget * pWidget,bool bEnabled); + void setFinishEnabled(TQWidget * pWidget,bool bEnabled); /// /// Enables or disables the next button for the specified page. /// By default the next button is always enabled. /// - void setNextEnabled(QWidget * pWidget,bool bEnabled); + void setNextEnabled(TQWidget * pWidget,bool bEnabled); /// /// Enables or disables the prev button for the specified page. /// By default the prev button is always enabled. /// - void setBackEnabled(QWidget * pWidget,bool bEnabled); + void setBackEnabled(TQWidget * pWidget,bool bEnabled); /// /// Returns a pointer to the cancel button displayed in the dialog. /// - QPushButton * cancelButton(); + TQPushButton * cancelButton(); /// /// Returns a pointer to the help button displayed in the dialog. /// - QPushButton * helpButton(); + TQPushButton * helpButton(); /// /// Returns a pointer to the finish button displayed in the dialog. /// - QPushButton * finishButton(); + TQPushButton * finishButton(); /// /// Returns a pointer to the next button displayed in the dialog. /// - QPushButton * nextButton(); + TQPushButton * nextButton(); /// /// Returns a pointer to the back button displayed in the dialog. /// - QPushButton * backButton(); + TQPushButton * backButton(); signals: /// /// Emitted when the help button is clicked. @@ -150,11 +151,11 @@ protected: /// /// Displays the first page if no other page is shown yet. /// - virtual void showEvent(QShowEvent * e); + virtual void showEvent(TQShowEvent * e); /// /// Handles redirects the close button to the "cancel" operation. /// - virtual void closeEvent(QCloseEvent * e); + virtual void closeEvent(TQCloseEvent * e); protected: void setCurrentPage(KviTalWizardPageData * pData); protected slots: diff --git a/src/kvilib/tal/moc_kvi_tal_wizard.cpp b/src/kvilib/tal/moc_kvi_tal_wizard.cpp index 0ad29754..edf13270 100644 --- a/src/kvilib/tal/moc_kvi_tal_wizard.cpp +++ b/src/kvilib/tal/moc_kvi_tal_wizard.cpp @@ -2,21 +2,21 @@ ** KviTalWizard meta object code from reading C++ file 'kvi_tal_wizard.h' ** ** Created: Sun Mar 23 20:56:27 2008 -** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) +** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#undef QT_NO_COMPAT +#undef TQT_NO_COMPAT #include "kvi_tal_wizard.h" -#include <qmetaobject.h> -#include <qapplication.h> +#include <tqmetaobject.h> +#include <tqapplication.h> -#include <private/qucomextra_p.h> -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.8. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" +#include <private/tqucomextra_p.h> +#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26) +#error "This file was generated using the tqmoc from 3.3.8. It" +#error "cannot be used with the include files from this version of TQt." +#error "(The tqmoc has changed too much.)" #endif const char *KviTalWizard::className() const @@ -24,77 +24,77 @@ const char *KviTalWizard::className() const return "KviTalWizard"; } -QMetaObject *KviTalWizard::metaObj = 0; -static QMetaObjectCleanUp cleanUp_KviTalWizard( "KviTalWizard", &KviTalWizard::staticMetaObject ); +TQMetaObject *KviTalWizard::metaObj = 0; +static TQMetaObjectCleanUp cleanUp_KviTalWizard( "KviTalWizard", &KviTalWizard::staticMetaObject ); -#ifndef QT_NO_TRANSLATION -QString KviTalWizard::tr( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION +TQString KviTalWizard::tr( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviTalWizard", s, c, QApplication::DefaultCodec ); + if ( tqApp ) + return tqApp->translate( "KviTalWizard", s, c, TQApplication::DefaultCodec ); else - return QString::fromLatin1( s ); + return TQString::tqfromLatin1( s ); } -#ifndef QT_NO_TRANSLATION_UTF8 -QString KviTalWizard::trUtf8( const char *s, const char *c ) +#ifndef TQT_NO_TRANSLATION_UTF8 +TQString KviTalWizard::trUtf8( const char *s, const char *c ) { - if ( qApp ) - return qApp->translate( "KviTalWizard", s, c, QApplication::UnicodeUTF8 ); + if ( tqApp ) + return tqApp->translate( "KviTalWizard", s, c, TQApplication::UnicodeUTF8 ); else - return QString::fromUtf8( s ); + return TQString::fromUtf8( s ); } -#endif // QT_NO_TRANSLATION_UTF8 +#endif // TQT_NO_TRANSLATION_UTF8 -#endif // QT_NO_TRANSLATION +#endif // TQT_NO_TRANSLATION -QMetaObject* KviTalWizard::staticMetaObject() +TQMetaObject* KviTalWizard::staticMetaObject() { if ( metaObj ) return metaObj; - QMetaObject* parentObject = QDialog::staticMetaObject(); - static const QUMethod slot_0 = {"backButtonClicked", 0, 0 }; - static const QUMethod slot_1 = {"nextButtonClicked", 0, 0 }; - static const QUMethod slot_2 = {"helpButtonClicked", 0, 0 }; - static const QUMethod slot_3 = {"cancelButtonClicked", 0, 0 }; - static const QUMethod slot_4 = {"finishButtonClicked", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "backButtonClicked()", &slot_0, QMetaData::Protected }, - { "nextButtonClicked()", &slot_1, QMetaData::Protected }, - { "helpButtonClicked()", &slot_2, QMetaData::Protected }, - { "cancelButtonClicked()", &slot_3, QMetaData::Protected }, - { "finishButtonClicked()", &slot_4, QMetaData::Protected } + TQMetaObject* tqparentObject = TQDialog::staticMetaObject(); + static const TQUMethod slot_0 = {"backButtonClicked", 0, 0 }; + static const TQUMethod slot_1 = {"nextButtonClicked", 0, 0 }; + static const TQUMethod slot_2 = {"helpButtonClicked", 0, 0 }; + static const TQUMethod slot_3 = {"cancelButtonClicked", 0, 0 }; + static const TQUMethod slot_4 = {"finishButtonClicked", 0, 0 }; + static const TQMetaData slot_tbl[] = { + { "backButtonClicked()", &slot_0, TQMetaData::Protected }, + { "nextButtonClicked()", &slot_1, TQMetaData::Protected }, + { "helpButtonClicked()", &slot_2, TQMetaData::Protected }, + { "cancelButtonClicked()", &slot_3, TQMetaData::Protected }, + { "finishButtonClicked()", &slot_4, TQMetaData::Protected } }; - static const QUMethod signal_0 = {"helpClicked", 0, 0 }; - static const QMetaData signal_tbl[] = { - { "helpClicked()", &signal_0, QMetaData::Public } + static const TQUMethod signal_0 = {"helpClicked", 0, 0 }; + static const TQMetaData signal_tbl[] = { + { "helpClicked()", &signal_0, TQMetaData::Public } }; - metaObj = QMetaObject::new_metaobject( - "KviTalWizard", parentObject, + metaObj = TQMetaObject::new_metaobject( + "KviTalWizard", tqparentObject, slot_tbl, 5, signal_tbl, 1, -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES 0, 0, 0, 0, -#endif // QT_NO_PROPERTIES +#endif // TQT_NO_PROPERTIES 0, 0 ); cleanUp_KviTalWizard.setMetaObject( metaObj ); return metaObj; } -void* KviTalWizard::qt_cast( const char* clname ) +void* KviTalWizard::tqqt_cast( const char* clname ) { if ( !qstrcmp( clname, "KviTalWizard" ) ) return this; - return QDialog::qt_cast( clname ); + return TQDialog::tqqt_cast( clname ); } -// SIGNAL helpClicked +// TQT_SIGNAL helpClicked void KviTalWizard::helpClicked() { activate_signal( staticMetaObject()->signalOffset() + 0 ); } -bool KviTalWizard::qt_invoke( int _id, QUObject* _o ) +bool KviTalWizard::qt_invoke( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: backButtonClicked(); break; @@ -103,26 +103,26 @@ bool KviTalWizard::qt_invoke( int _id, QUObject* _o ) case 3: cancelButtonClicked(); break; case 4: finishButtonClicked(); break; default: - return QDialog::qt_invoke( _id, _o ); + return TQDialog::qt_invoke( _id, _o ); } return TRUE; } -bool KviTalWizard::qt_emit( int _id, QUObject* _o ) +bool KviTalWizard::qt_emit( int _id, TQUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: helpClicked(); break; default: - return QDialog::qt_emit(_id,_o); + return TQDialog::qt_emit(_id,_o); } return TRUE; } -#ifndef QT_NO_PROPERTIES +#ifndef TQT_NO_PROPERTIES -bool KviTalWizard::qt_property( int id, int f, QVariant* v) +bool KviTalWizard::qt_property( int id, int f, TQVariant* v) { - return QDialog::qt_property( id, f, v); + return TQDialog::qt_property( id, f, v); } -bool KviTalWizard::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES +bool KviTalWizard::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; } +#endif // TQT_NO_PROPERTIES |