diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kio/kio | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/kio')
156 files changed, 5328 insertions, 5328 deletions
diff --git a/kio/kio/authinfo.cpp b/kio/kio/authinfo.cpp index 1415c14ae..d4aa27353 100644 --- a/kio/kio/authinfo.cpp +++ b/kio/kio/authinfo.cpp @@ -26,8 +26,8 @@ #include <sys/stat.h> #include <sys/types.h> -#include <qdir.h> -#include <qfile.h> +#include <tqdir.h> +#include <tqfile.h> #include <kdebug.h> #include <kstandarddirs.h> @@ -72,7 +72,7 @@ AuthInfo& AuthInfo::operator= ( const AuthInfo& info ) return *this; } -QDataStream& KIO::operator<< (QDataStream& s, const AuthInfo& a) +TQDataStream& KIO::operator<< (TQDataStream& s, const AuthInfo& a) { s << a.url << a.username << a.password << a.prompt << a.caption << a.comment << a.commentLabel << a.realmValue << a.digestInfo @@ -81,7 +81,7 @@ QDataStream& KIO::operator<< (QDataStream& s, const AuthInfo& a) return s; } -QDataStream& KIO::operator>> (QDataStream& s, AuthInfo& a) +TQDataStream& KIO::operator>> (TQDataStream& s, AuthInfo& a) { Q_UINT8 verify = 0; Q_UINT8 ro = 0; @@ -120,7 +120,7 @@ NetRC* NetRC::self() } bool NetRC::lookup( const KURL& url, AutoLogin& login, bool userealnetrc, - QString type, int mode ) + TQString type, int mode ) { // kdDebug() << "AutoLogin lookup for: " << url.host() << endl; if ( !url.isValid() ) @@ -133,12 +133,12 @@ bool NetRC::lookup( const KURL& url, AutoLogin& login, bool userealnetrc, { loginMap.clear(); - QString filename = locateLocal("config", "kionetrc"); + TQString filename = locateLocal("config", "kionetrc"); bool status = parse (openf (filename)); if ( userealnetrc ) { - filename = QDir::homeDirPath()+ QDir::separator() + ".netrc"; + filename = TQDir::homeDirPath()+ TQDir::separator() + ".netrc"; status |= parse (openf(filename)); } @@ -158,7 +158,7 @@ bool NetRC::lookup( const KURL& url, AutoLogin& login, bool userealnetrc, AutoLogin &log = *it; if ( (mode & defaultOnly) == defaultOnly && - log.machine == QString::fromLatin1("default") && + log.machine == TQString::fromLatin1("default") && (login.login.isEmpty() || login.login == log.login) ) { login.type = log.type; @@ -169,7 +169,7 @@ bool NetRC::lookup( const KURL& url, AutoLogin& login, bool userealnetrc, } if ( (mode & presetOnly) == presetOnly && - log.machine == QString::fromLatin1("preset") && + log.machine == TQString::fromLatin1("preset") && (login.login.isEmpty() || login.login == log.login) ) { login.type = log.type; @@ -195,10 +195,10 @@ bool NetRC::lookup( const KURL& url, AutoLogin& login, bool userealnetrc, return true; } -int NetRC::openf( const QString& f ) +int NetRC::openf( const TQString& f ) { KDE_struct_stat sbuff; - QCString ef = QFile::encodeName(f); + TQCString ef = TQFile::encodeName(f); if ( KDE_stat(ef, &sbuff) != 0 ) return -1; @@ -210,7 +210,7 @@ int NetRC::openf( const QString& f ) return KDE_open( ef, O_RDONLY ); } -QString NetRC::extract( const char* buf, const char* key, int& pos ) +TQString NetRC::extract( const char* buf, const char* key, int& pos ) { int idx = pos; int m_len = strlen(key); @@ -237,12 +237,12 @@ QString NetRC::extract( const char* buf, const char* key, int& pos ) if ( idx > start ) { pos = idx; - return QString::fromLatin1( buf+start, idx-start); + return TQString::fromLatin1( buf+start, idx-start); } } } - return QString::null; + return TQString::null; } bool NetRC::parse( int fd ) @@ -250,8 +250,8 @@ bool NetRC::parse( int fd ) if (fd == -1) return false; - QString type; - QString macro; + TQString type; + TQString macro; uint index = 0; bool isMacro = false; @@ -280,7 +280,7 @@ bool NetRC::parse( int fd ) while( buf[tail-1] == '\n' || buf[tail-1] =='\r' ) tail--; - QString mac = QString::fromLatin1(buf, tail).stripWhiteSpace(); + TQString mac = TQString::fromLatin1(buf, tail).stripWhiteSpace(); if ( !mac.isEmpty() ) loginMap[type][index].macdef[macro].append( mac ); @@ -294,12 +294,12 @@ bool NetRC::parse( int fd ) if (strncasecmp(buf+pos, "default", 7) == 0 ) { pos += 7; - l.machine = QString::fromLatin1("default"); + l.machine = TQString::fromLatin1("default"); } else if (strncasecmp(buf+pos, "preset", 6) == 0 ) { pos += 6; - l.machine = QString::fromLatin1("preset"); + l.machine = TQString::fromLatin1("preset"); } } // kdDebug() << "Machine: " << l.machine << endl; @@ -314,7 +314,7 @@ bool NetRC::parse( int fd ) type = l.type = extract( buf, "type", pos ); if ( l.type.isEmpty() && !l.machine.isEmpty() ) - type = l.type = QString::fromLatin1("ftp"); + type = l.type = TQString::fromLatin1("ftp"); // kdDebug() << "Type: " << l.type << endl; macro = extract( buf, "macdef", pos ); diff --git a/kio/kio/authinfo.h b/kio/kio/authinfo.h index 2beb4f7bf..3f92e58d1 100644 --- a/kio/kio/authinfo.h +++ b/kio/kio/authinfo.h @@ -21,8 +21,8 @@ #ifndef __KIO_AUTHINFO_H #define __KIO_AUTHINFO_H -#include <qmap.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqvaluelist.h> #include <kurl.h> @@ -50,8 +50,8 @@ namespace KIO { */ class KIO_EXPORT AuthInfo { - KIO_EXPORT friend QDataStream& operator<< (QDataStream& s, const AuthInfo& a); - KIO_EXPORT friend QDataStream& operator>> (QDataStream& s, AuthInfo& a); + KIO_EXPORT friend TQDataStream& operator<< (TQDataStream& s, const AuthInfo& a); + KIO_EXPORT friend TQDataStream& operator>> (TQDataStream& s, AuthInfo& a); public: /** @@ -96,12 +96,12 @@ public: /** * This is @em required for caching. */ - QString username; + TQString username; /** * This is @em required for caching. */ - QString password; + TQString password; /** * Information to be displayed when prompting @@ -112,7 +112,7 @@ public: * * This setting is @em optional and empty by default. */ - QString prompt; + TQString prompt; /** * The text to displayed in the title bar of @@ -123,7 +123,7 @@ public: * * This setting is @em optional and empty by default. */ - QString caption; + TQString caption; /** * Additional comment to be displayed when prompting @@ -147,7 +147,7 @@ public: * * This setting is @em optional and empty by default. */ - QString comment; + TQString comment; /** * Descriptive label to be displayed in front of the @@ -156,7 +156,7 @@ public: * This setting is @em optional and only applicable when * the comment field is also set. */ - QString commentLabel; + TQString commentLabel; /** * A unique identifier that allows caching of multiple @@ -174,7 +174,7 @@ public: * * This setting is @em optional and not set by default. */ - QString realmValue; + TQString realmValue; /** * Field to store any extra authentication information for @@ -184,7 +184,7 @@ public: * protocol. However, any protocol can make use of it to * store extra info. */ - QString digestInfo; + TQString digestInfo; /** * Flag that, if set, indicates whether a path match should be @@ -225,8 +225,8 @@ private: class AuthInfoPrivate* d; }; -KIO_EXPORT QDataStream& operator<< (QDataStream& s, const AuthInfo& a); -KIO_EXPORT QDataStream& operator>> (QDataStream& s, AuthInfo& a); +KIO_EXPORT TQDataStream& operator<< (TQDataStream& s, const AuthInfo& a); +KIO_EXPORT TQDataStream& operator>> (TQDataStream& s, AuthInfo& a); /** * A Singleton class that provides access to passwords @@ -264,11 +264,11 @@ public: */ struct AutoLogin { - QString type; - QString machine; - QString login; - QString password; - QMap<QString, QStringList> macdef; + TQString type; + TQString machine; + TQString login; + TQString password; + TQMap<TQString, TQStringList> macdef; }; /** @@ -289,7 +289,7 @@ public: */ bool lookup( const KURL& url, AutoLogin& login, bool userealnetrc = false, - QString type = QString::null, + TQString type = TQString::null, int mode = (exactOnly|defaultOnly) ); /** * Reloads the auto login information. @@ -297,8 +297,8 @@ public: void reload() { isDirty = true; } protected: - QString extract( const char*, const char*, int& ); - int openf( const QString& ); + TQString extract( const char*, const char*, int& ); + int openf( const TQString& ); bool parse( int ); private: @@ -308,8 +308,8 @@ private: private: bool isDirty; - typedef QValueList<AutoLogin> LoginList; - typedef QMap<QString, LoginList> LoginMap; + typedef TQValueList<AutoLogin> LoginList; + typedef TQMap<TQString, LoginList> LoginMap; LoginMap loginMap; static NetRC* instance; diff --git a/kio/kio/chmodjob.cpp b/kio/kio/chmodjob.cpp index 5f00aa30c..e1d343c10 100644 --- a/kio/kio/chmodjob.cpp +++ b/kio/kio/chmodjob.cpp @@ -27,8 +27,8 @@ #include <unistd.h> #include <assert.h> -#include <qtimer.h> -#include <qfile.h> +#include <tqtimer.h> +#include <tqfile.h> #include <klocale.h> #include <kdebug.h> #include <kmessagebox.h> @@ -48,7 +48,7 @@ ChmodJob::ChmodJob( const KFileItemList& lstItems, int permissions, int mask, m_newOwner( newOwner ), m_newGroup( newGroup ), m_recursive( recursive ), m_lstItems( lstItems ) { - QTimer::singleShot( 0, this, SLOT(processList()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(processList()) ); } void ChmodJob::processList() @@ -63,12 +63,12 @@ void ChmodJob::processList() info.url = item->url(); // This is a toplevel file, we apply changes directly (no +X emulation here) info.permissions = ( m_permissions & m_mask ) | ( item->permissions() & ~m_mask ); - /*kdDebug(7007) << "\n current permissions=" << QString::number(item->permissions(),8) - << "\n wanted permission=" << QString::number(m_permissions,8) - << "\n with mask=" << QString::number(m_mask,8) - << "\n with ~mask (mask bits we keep) =" << QString::number((uint)~m_mask,8) - << "\n bits we keep =" << QString::number(item->permissions() & ~m_mask,8) - << "\n new permissions = " << QString::number(info.permissions,8) + /*kdDebug(7007) << "\n current permissions=" << TQString::number(item->permissions(),8) + << "\n wanted permission=" << TQString::number(m_permissions,8) + << "\n with mask=" << TQString::number(m_mask,8) + << "\n with ~mask (mask bits we keep) =" << TQString::number((uint)~m_mask,8) + << "\n bits we keep =" << TQString::number(item->permissions() & ~m_mask,8) + << "\n new permissions = " << TQString::number(info.permissions,8) << endl;*/ m_infos.prepend( info ); //kdDebug(7007) << "processList : Adding info for " << info.url.prettyURL() << endl; @@ -77,9 +77,9 @@ void ChmodJob::processList() { //kdDebug(7007) << "ChmodJob::processList dir -> listing" << endl; KIO::ListJob * listJob = KIO::listRecursive( item->url(), false /* no GUI */ ); - connect( listJob, SIGNAL(entries( KIO::Job *, + connect( listJob, TQT_SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList& )), - SLOT( slotEntries( KIO::Job*, + TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList& ))); addSubjob( listJob ); return; // we'll come back later, when this one's finished @@ -102,7 +102,7 @@ void ChmodJob::slotEntries( KIO::Job*, const KIO::UDSEntryList & list ) mode_t permissions = 0; bool isDir = false; bool isLink = false; - QString relativePath; + TQString relativePath; for( ; it2 != (*it).end(); it2++ ) { switch( (*it2).m_uds ) { case KIO::UDS_NAME: @@ -121,7 +121,7 @@ void ChmodJob::slotEntries( KIO::Job*, const KIO::UDSEntryList & list ) break; } } - if ( !isLink && relativePath != QString::fromLatin1("..") ) + if ( !isLink && relativePath != TQString::fromLatin1("..") ) { ChmodInfo info; info.url = m_lstItems.first()->url(); // base directory @@ -143,12 +143,12 @@ void ChmodJob::slotEntries( KIO::Job*, const KIO::UDSEntryList & list ) } } info.permissions = ( m_permissions & mask ) | ( permissions & ~mask ); - /*kdDebug(7007) << "\n current permissions=" << QString::number(permissions,8) - << "\n wanted permission=" << QString::number(m_permissions,8) - << "\n with mask=" << QString::number(mask,8) - << "\n with ~mask (mask bits we keep) =" << QString::number((uint)~mask,8) - << "\n bits we keep =" << QString::number(permissions & ~mask,8) - << "\n new permissions = " << QString::number(info.permissions,8) + /*kdDebug(7007) << "\n current permissions=" << TQString::number(permissions,8) + << "\n wanted permission=" << TQString::number(m_permissions,8) + << "\n with mask=" << TQString::number(mask,8) + << "\n with ~mask (mask bits we keep) =" << TQString::number((uint)~mask,8) + << "\n bits we keep =" << TQString::number(permissions & ~mask,8) + << "\n new permissions = " << TQString::number(info.permissions,8) << endl;*/ // Prepend this info in our todo list. // This way, the toplevel dirs are done last. @@ -167,10 +167,10 @@ void ChmodJob::chmodNextFile() // (permissions have to set after, in case of suid and sgid) if ( info.url.isLocalFile() && ( m_newOwner != -1 || m_newGroup != -1 ) ) { - QString path = info.url.path(); - if ( chown( QFile::encodeName(path), m_newOwner, m_newGroup ) != 0 ) + TQString path = info.url.path(); + if ( chown( TQFile::encodeName(path), m_newOwner, m_newGroup ) != 0 ) { - int answer = KMessageBox::warningContinueCancel( 0, i18n( "<qt>Could not modify the ownership of file <b>%1</b>. You have insufficient access to the file to perform the change.</qt>" ).arg(path), QString::null, i18n("&Skip File") ); + int answer = KMessageBox::warningContinueCancel( 0, i18n( "<qt>Could not modify the ownership of file <b>%1</b>. You have insufficient access to the file to perform the change.</qt>" ).arg(path), TQString::null, i18n("&Skip File") ); if (answer == KMessageBox::Cancel) { m_error = ERR_USER_CANCELED; @@ -181,11 +181,11 @@ void ChmodJob::chmodNextFile() } kdDebug(7007) << "ChmodJob::chmodNextFile chmod'ing " << info.url.prettyURL() - << " to " << QString::number(info.permissions,8) << endl; + << " to " << TQString::number(info.permissions,8) << endl; KIO::SimpleJob * job = KIO::chmod( info.url, info.permissions ); // copy the metadata for acl and default acl - const QString aclString = queryMetaData( "ACL_STRING" ); - const QString defaultAclString = queryMetaData( "DEFAULT_ACL_STRING" ); + const TQString aclString = queryMetaData( "ACL_STRING" ); + const TQString defaultAclString = queryMetaData( "DEFAULT_ACL_STRING" ); if ( !aclString.isEmpty() ) job->addMetaData( "ACL_STRING", aclString ); if ( !defaultAclString.isEmpty() ) @@ -226,15 +226,15 @@ void ChmodJob::slotResult( KIO::Job * job ) } } -// antlarr: KDE 4: Make owner and group be const QString & +// antlarr: KDE 4: Make owner and group be const TQString & KIO_EXPORT ChmodJob *KIO::chmod( const KFileItemList& lstItems, int permissions, int mask, - QString owner, QString group, + TQString owner, TQString group, bool recursive, bool showProgressInfo ) { uid_t newOwnerID = (uid_t)-1; // chown(2) : -1 means no change if ( !owner.isEmpty() ) { - struct passwd* pw = getpwnam(QFile::encodeName(owner)); + struct passwd* pw = getpwnam(TQFile::encodeName(owner)); if ( pw == 0L ) kdError(250) << " ERROR: No user " << owner << endl; else @@ -243,7 +243,7 @@ KIO_EXPORT ChmodJob *KIO::chmod( const KFileItemList& lstItems, int permissions, gid_t newGroupID = (gid_t)-1; // chown(2) : -1 means no change if ( !group.isEmpty() ) { - struct group* g = getgrnam(QFile::encodeName(group)); + struct group* g = getgrnam(TQFile::encodeName(group)); if ( g == 0L ) kdError(250) << " ERROR: No group " << group << endl; else diff --git a/kio/kio/chmodjob.h b/kio/kio/chmodjob.h index 4b5d6f85e..fdb873b17 100644 --- a/kio/kio/chmodjob.h +++ b/kio/kio/chmodjob.h @@ -22,7 +22,7 @@ #define __kio_chmodjob_h__ #include <kurl.h> -#include <qstring.h> +#include <tqstring.h> #include <kio/global.h> #include <kio/job.h> @@ -68,7 +68,7 @@ namespace KIO { int m_newGroup; bool m_recursive; KFileItemList m_lstItems; - QValueList<ChmodInfo> m_infos; + TQValueList<ChmodInfo> m_infos; protected: virtual void virtual_hook( int id, void* data ); private: @@ -101,7 +101,7 @@ namespace KIO { * @return The job handling the operation. */ KIO_EXPORT ChmodJob * chmod( const KFileItemList& lstItems, int permissions, int mask, - QString newOwner, QString newGroup, + TQString newOwner, TQString newGroup, bool recursive, bool showProgressInfo = true ); } diff --git a/kio/kio/connection.cpp b/kio/kio/connection.cpp index f8b2e69ed..b2a84a798 100644 --- a/kio/kio/connection.cpp +++ b/kio/kio/connection.cpp @@ -24,7 +24,7 @@ #include <kde_file.h> #include <ksock.h> -#include <qtimer.h> +#include <tqtimer.h> #include <sys/types.h> #include <sys/signal.h> @@ -41,7 +41,7 @@ #include "kio/connection.h" #include <kdebug.h> -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> using namespace KIO; @@ -95,7 +95,7 @@ void Connection::close() tasks.clear(); } -void Connection::send(int cmd, const QByteArray& data) +void Connection::send(int cmd, const TQByteArray& data) { if (!inited() || tasks.count() > 0) { Task *task = new Task(); @@ -132,11 +132,11 @@ void Connection::init(KSocket *sock) f_out = KDE_fdopen( socket->socket(), "wb" ); #endif if (receiver && ( fd_in != -1 )) { - notifier = new QSocketNotifier(fd_in, QSocketNotifier::Read); + notifier = new TQSocketNotifier(fd_in, TQSocketNotifier::Read); if ( m_suspended ) { suspend(); } - QObject::connect(notifier, SIGNAL(activated(int)), receiver, member); + TQObject::connect(notifier, TQT_SIGNAL(activated(int)), receiver, member); } dequeue(); } @@ -148,31 +148,31 @@ void Connection::init(int _fd_in, int fd_out) fd_in = _fd_in; f_out = KDE_fdopen( fd_out, "wb" ); if (receiver && ( fd_in != -1 )) { - notifier = new QSocketNotifier(fd_in, QSocketNotifier::Read); + notifier = new TQSocketNotifier(fd_in, TQSocketNotifier::Read); if ( m_suspended ) { suspend(); } - QObject::connect(notifier, SIGNAL(activated(int)), receiver, member); + TQObject::connect(notifier, TQT_SIGNAL(activated(int)), receiver, member); } dequeue(); } -void Connection::connect(QObject *_receiver, const char *_member) +void Connection::connect(TQObject *_receiver, const char *_member) { receiver = _receiver; member = _member; delete notifier; notifier = 0; if (receiver && (fd_in != -1 )) { - notifier = new QSocketNotifier(fd_in, QSocketNotifier::Read); + notifier = new TQSocketNotifier(fd_in, TQSocketNotifier::Read); if ( m_suspended ) suspend(); - QObject::connect(notifier, SIGNAL(activated(int)), receiver, member); + TQObject::connect(notifier, TQT_SIGNAL(activated(int)), receiver, member); } } -bool Connection::sendnow( int _cmd, const QByteArray &data ) +bool Connection::sendnow( int _cmd, const TQByteArray &data ) { if (f_out == 0) { return false; @@ -206,7 +206,7 @@ bool Connection::sendnow( int _cmd, const QByteArray &data ) return true; } -int Connection::read( int* _cmd, QByteArray &data ) +int Connection::read( int* _cmd, TQByteArray &data ) { if (fd_in == -1 ) { kdError(7017) << "read: not yet inited" << endl; diff --git a/kio/kio/connection.h b/kio/kio/connection.h index 140a7cc28..2adc6e018 100644 --- a/kio/kio/connection.h +++ b/kio/kio/connection.h @@ -27,8 +27,8 @@ #include <sys/types.h> #include <stdio.h> -#include <qptrlist.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqobject.h> class KSocket; class QSocketNotifier; @@ -37,7 +37,7 @@ namespace KIO { struct KIO_EXPORT Task { int cmd; - QByteArray data; + TQByteArray data; }; /** @@ -71,7 +71,7 @@ namespace KIO { * @see inited() */ void init(int fd_in, int fd_out); // Used by KDENOX - void connect(QObject *receiver = 0, const char *member = 0); + void connect(TQObject *receiver = 0, const char *member = 0); /// Closes the connection. void close(); @@ -98,7 +98,7 @@ namespace KIO { * @param cmd the command to set * @param arr the bytes to send */ - void send(int cmd, const QByteArray &arr = QByteArray()); + void send(int cmd, const TQByteArray &arr = TQByteArray()); /** * Sends the given command immediately. @@ -106,7 +106,7 @@ namespace KIO { * @param data the bytes to send * @return true if successful, false otherwise */ - bool sendnow( int _cmd, const QByteArray &data ); + bool sendnow( int _cmd, const TQByteArray &data ); /** * Receive data. @@ -116,7 +116,7 @@ namespace KIO { * @return >=0 indicates the received data size upon success * -1 indicates error */ - int read( int* _cmd, QByteArray &data ); + int read( int* _cmd, TQByteArray &data ); /** * Don't handle incoming data until resumed. @@ -144,10 +144,10 @@ namespace KIO { int fd_in; FILE *f_out; KSocket *socket; - QSocketNotifier *notifier; - QObject *receiver; + TQSocketNotifier *notifier; + TQObject *receiver; const char *member; - QPtrList<Task> tasks; + TQPtrList<Task> tasks; bool m_suspended; private: class ConnectionPrivate* d; diff --git a/kio/kio/dataprotocol.cpp b/kio/kio/dataprotocol.cpp index 86ebe23cf..161c82296 100644 --- a/kio/kio/dataprotocol.cpp +++ b/kio/kio/dataprotocol.cpp @@ -23,10 +23,10 @@ #include <kurl.h> #include <kio/global.h> -#include <qcstring.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtextcodec.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtextcodec.h> #ifdef DATAKIOSLAVE # include <kinstance.h> @@ -67,22 +67,22 @@ extern "C" { /** structure containing header information */ struct DataHeader { - QString mime_type; // mime type of content (lowercase) + TQString mime_type; // mime type of content (lowercase) MetaData attributes; // attribute/value pairs (attribute lowercase, // value unchanged) bool is_base64; // true if data is base64 encoded - QString url; // reference to decoded url + TQString url; // reference to decoded url int data_offset; // zero-indexed position within url // where the real data begins. May point beyond // the end to indicate that there is no data - QString *charset; // shortcut to charset (it always exists) + TQString *charset; // shortcut to charset (it always exists) }; // constant string data -const QChar text_plain_str[] = { 't','e','x','t','/','p','l','a','i','n' }; -const QChar charset_str[] = { 'c','h','a','r','s','e','t' }; -const QChar us_ascii_str[] = { 'u','s','-','a','s','c','i','i' }; -const QChar base64_str[] = { 'b','a','s','e','6','4' }; +const TQChar text_plain_str[] = { 't','e','x','t','/','p','l','a','i','n' }; +const TQChar charset_str[] = { 'c','h','a','r','s','e','t' }; +const TQChar us_ascii_str[] = { 'u','s','-','a','s','c','i','i' }; +const TQChar base64_str[] = { 'b','a','s','e','6','4' }; /** returns the position of the first occurrence of any of the given characters * @p c1 to @p c3 or buf.length() if none is contained. @@ -92,12 +92,12 @@ const QChar base64_str[] = { 'b','a','s','e','6','4' }; * @param c2 alternative character to find or '\0' to ignore * @param c3 alternative character to find or '\0' to ignore */ -static int find(const QString &buf, int begin, QChar c1, QChar c2 = '\0', - QChar c3 = '\0') { +static int find(const TQString &buf, int begin, TQChar c1, TQChar c2 = '\0', + TQChar c3 = '\0') { int pos = begin; int size = (int)buf.length(); while (pos < size) { - QChar ch = buf[pos]; + TQChar ch = buf[pos]; if (ch == c1 || (c2 != '\0' && ch == c2) || (c3 != '\0' && ch == c3)) @@ -117,11 +117,11 @@ static int find(const QString &buf, int begin, QChar c1, QChar c2 = '\0', * @param c2 alternative character to find or 0 to ignore * @param c3 alternative character to find or 0 to ignore */ -inline QString extract(const QString &buf, int &pos, QChar c1, - QChar c2 = '\0', QChar c3 = '\0') { +inline TQString extract(const TQString &buf, int &pos, TQChar c1, + TQChar c2 = '\0', TQChar c3 = '\0') { int oldpos = pos; pos = find(buf,oldpos,c1,c2,c3); - return QString(buf.unicode() + oldpos, pos - oldpos); + return TQString(buf.unicode() + oldpos, pos - oldpos); } /** ignores all whitespaces @@ -130,9 +130,9 @@ inline QString extract(const QString &buf, int &pos, QChar c1, * Upon return @p pos will either point to the first non-whitespace * character or to the end of the buffer. */ -inline void ignoreWS(const QString &buf, int &pos) { +inline void ignoreWS(const TQString &buf, int &pos) { int size = (int)buf.length(); - QChar ch = buf[pos]; + TQChar ch = buf[pos]; while (pos < size && (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')) ch = buf[++pos]; @@ -146,14 +146,14 @@ inline void ignoreWS(const QString &buf, int &pos) { * @return the extracted string. @p pos will be updated to point to the * character following the trailing quote. */ -static QString parseQuotedString(const QString &buf, int &pos) { +static TQString parseQuotedString(const TQString &buf, int &pos) { int size = (int)buf.length(); - QString res; + TQString res; pos++; // jump over leading quote bool escaped = false; // if true means next character is literal bool parsing = true; // true as long as end quote not found while (parsing && pos < size) { - QChar ch = buf[pos++]; + TQChar ch = buf[pos++]; if (escaped) { res += ch; escaped = false; @@ -174,10 +174,10 @@ static QString parseQuotedString(const QString &buf, int &pos) { * information */ static void parseDataHeader(const KURL &url, DataHeader &header_info) { - QConstString text_plain(text_plain_str,sizeof text_plain_str/sizeof text_plain_str[0]); - QConstString charset(charset_str,sizeof charset_str/sizeof charset_str[0]); - QConstString us_ascii(us_ascii_str,sizeof us_ascii_str/sizeof us_ascii_str[0]); - QConstString base64(base64_str,sizeof base64_str/sizeof base64_str[0]); + TQConstString text_plain(text_plain_str,sizeof text_plain_str/sizeof text_plain_str[0]); + TQConstString charset(charset_str,sizeof charset_str/sizeof charset_str[0]); + TQConstString us_ascii(us_ascii_str,sizeof us_ascii_str/sizeof us_ascii_str[0]); + TQConstString base64(base64_str,sizeof base64_str/sizeof base64_str[0]); // initialize header info members header_info.mime_type = text_plain.string(); header_info.charset = &header_info.attributes.insert( @@ -186,7 +186,7 @@ static void parseDataHeader(const KURL &url, DataHeader &header_info) { header_info.is_base64 = false; // decode url and save it - QString &raw_url = header_info.url = QString::fromLatin1("data:") + url.path(); + TQString &raw_url = header_info.url = TQString::fromLatin1("data:") + url.path(); int raw_url_len = (int)raw_url.length(); // jump over scheme part (must be "data:", we don't even check that) @@ -195,7 +195,7 @@ static void parseDataHeader(const KURL &url, DataHeader &header_info) { // read mime type if (header_info.data_offset >= raw_url_len) return; - QString mime_type = extract(raw_url,header_info.data_offset,';',',') + TQString mime_type = extract(raw_url,header_info.data_offset,';',',') .stripWhiteSpace(); if (!mime_type.isEmpty()) header_info.mime_type = mime_type; @@ -207,7 +207,7 @@ static void parseDataHeader(const KURL &url, DataHeader &header_info) { bool data_begin_reached = false; while (!data_begin_reached && header_info.data_offset < raw_url_len) { // read attribute - QString attribute = extract(raw_url,header_info.data_offset,'=',';',',') + TQString attribute = extract(raw_url,header_info.data_offset,'=',';',',') .stripWhiteSpace(); if (header_info.data_offset >= raw_url_len || raw_url[header_info.data_offset] != '=') { @@ -221,7 +221,7 @@ static void parseDataHeader(const KURL &url, DataHeader &header_info) { ignoreWS(raw_url,header_info.data_offset); if (header_info.data_offset >= raw_url_len) return; - QString value; + TQString value; if (raw_url[header_info.data_offset] == '"') { value = parseQuotedString(raw_url,header_info.data_offset); ignoreWS(raw_url,header_info.data_offset); @@ -241,7 +241,7 @@ static void parseDataHeader(const KURL &url, DataHeader &header_info) { } #ifdef DATAKIOSLAVE -DataProtocol::DataProtocol(const QCString &pool_socket, const QCString &app_socket) +DataProtocol::DataProtocol(const TQCString &pool_socket, const TQCString &app_socket) : SlaveBase("kio_data", pool_socket, app_socket) { #else DataProtocol::DataProtocol() { @@ -268,8 +268,8 @@ void DataProtocol::get(const KURL& url) { int size = (int)hdr.url.length(); int data_ofs = QMIN(hdr.data_offset,size); // FIXME: string is copied, would be nice if we could have a reference only - QString url_data = hdr.url.mid(data_ofs); - QCString outData; + TQString url_data = hdr.url.mid(data_ofs); + TQCString outData; #ifdef TESTKIO // cout << "current charset: \"" << *hdr.charset << "\"" << endl; @@ -281,7 +281,7 @@ void DataProtocol::get(const KURL& url) { } else { // FIXME: This is all flawed, must be reworked thoroughly // non encoded data must be converted to the given charset - QTextCodec *codec = QTextCodec::codecForName(hdr.charset->latin1()); + TQTextCodec *codec = TQTextCodec::codecForName(hdr.charset->latin1()); if (codec != 0) { outData = codec->fromUnicode(url_data); } else { @@ -317,7 +317,7 @@ void DataProtocol::get(const KURL& url) { // empiric studies have shown that this shouldn't be queued & dispatched /*DISPATCH*/(data(outData)); // kdDebug() << "(2) queue size " << dispatchQueue.size() << endl; - DISPATCH(data(QByteArray())); + DISPATCH(data(TQByteArray())); // kdDebug() << "(3) queue size " << dispatchQueue.size() << endl; DISPATCH(finished()); // kdDebug() << "(4) queue size " << dispatchQueue.size() << endl; diff --git a/kio/kio/dataprotocol.h b/kio/kio/dataprotocol.h index b59e36c5b..d33a86a32 100644 --- a/kio/kio/dataprotocol.h +++ b/kio/kio/dataprotocol.h @@ -53,7 +53,7 @@ class DataProtocol : public DataSlave { public: #if defined(DATAKIOSLAVE) - DataProtocol(const QCString &pool_socket, const QCString &app_socket); + DataProtocol(const TQCString &pool_socket, const TQCString &app_socket); #else DataProtocol(); #endif diff --git a/kio/kio/dataslave.cpp b/kio/kio/dataslave.cpp index 5b81d3d2f..d16ecc0d4 100644 --- a/kio/kio/dataslave.cpp +++ b/kio/kio/dataslave.cpp @@ -26,7 +26,7 @@ #include <klocale.h> #include <kdebug.h> -#include <qtimer.h> +#include <tqtimer.h> using namespace KIO; @@ -57,12 +57,12 @@ using namespace KIO; DataSlave::DataSlave() : - Slave(true, 0, "data", QString::null) + Slave(true, 0, "data", TQString::null) { //kdDebug() << this << k_funcinfo << endl; _suspended = false; - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), SLOT(dispatchNext())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), TQT_SLOT(dispatchNext())); } DataSlave::~DataSlave() { @@ -115,8 +115,8 @@ void DataSlave::dispatchNext() { dispatchQueue.pop_front(); } -void DataSlave::send(int cmd, const QByteArray &arr) { - QDataStream stream(arr, IO_ReadOnly); +void DataSlave::send(int cmd, const TQByteArray &arr) { + TQDataStream stream(arr, IO_ReadOnly); KURL url; @@ -137,7 +137,7 @@ void DataSlave::send(int cmd, const QByteArray &arr) { break; default: error(ERR_UNSUPPORTED_ACTION, - unsupportedActionErrorString(QString::fromLatin1("data"),cmd)); + unsupportedActionErrorString(TQString::fromLatin1("data"),cmd)); }/*end switch*/ } @@ -145,16 +145,16 @@ bool DataSlave::suspended() { return _suspended; } -void DataSlave::setHost(const QString &/*host*/, int /*port*/, - const QString &/*user*/, const QString &/*passwd*/) { +void DataSlave::setHost(const TQString &/*host*/, int /*port*/, + const TQString &/*user*/, const TQString &/*passwd*/) { // irrelevant -> will be ignored } void DataSlave::setConfig(const MetaData &/*config*/) { // FIXME: decide to handle this directly or not at all #if 0 - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); stream << config; slaveconn.send( CMD_CONFIG, data ); #endif @@ -202,10 +202,10 @@ void DataSlave::virtual_hook( int id, void* data ) { } } -DISPATCH_IMPL1(mimeType, const QString &, s) +DISPATCH_IMPL1(mimeType, const TQString &, s) DISPATCH_IMPL1(totalSize, KIO::filesize_t, size) DISPATCH_IMPL(sendMetaData) -DISPATCH_IMPL1(data, const QByteArray &, ba) +DISPATCH_IMPL1(data, const TQByteArray &, ba) #undef DISPATCH_IMPL #undef DISPATCH_IMPL1 diff --git a/kio/kio/dataslave.h b/kio/kio/dataslave.h index 7ca24610c..1c6ebfad5 100644 --- a/kio/kio/dataslave.h +++ b/kio/kio/dataslave.h @@ -53,14 +53,14 @@ namespace KIO { virtual ~DataSlave(); - virtual void setHost(const QString &host, int port, - const QString &user, const QString &passwd); + virtual void setHost(const TQString &host, int port, + const TQString &user, const TQString &passwd); virtual void setConfig(const MetaData &config); virtual void suspend(); virtual void resume(); virtual bool suspended(); - virtual void send(int cmd, const QByteArray &data = QByteArray()); + virtual void send(int cmd, const TQByteArray &data = TQByteArray()); virtual void hold(const KURL &url); @@ -89,20 +89,20 @@ namespace KIO { */ struct QueueStruct { QueueType type; - QString s; + TQString s; KIO::filesize_t size; - QByteArray ba; + TQByteArray ba; QueueStruct() {} QueueStruct(QueueType type) : type(type) {} }; - typedef QValueList<QueueStruct> DispatchQueue; + typedef TQValueList<QueueStruct> DispatchQueue; DispatchQueue dispatchQueue; - DISPATCH_DECL1(mimeType, const QString &, s) + DISPATCH_DECL1(mimeType, const TQString &, s) DISPATCH_DECL1(totalSize, KIO::filesize_t, size) DISPATCH_DECL(sendMetaData) - DISPATCH_DECL1(data, const QByteArray &, ba) + DISPATCH_DECL1(data, const TQByteArray &, ba) DISPATCH_DECL(finished) protected slots: @@ -115,7 +115,7 @@ namespace KIO { private: MetaData meta_data; bool _suspended; - QTimer *timer; + TQTimer *timer; }; } diff --git a/kio/kio/davjob.cpp b/kio/kio/davjob.cpp index 57f00045c..1f3b208a6 100644 --- a/kio/kio/davjob.cpp +++ b/kio/kio/davjob.cpp @@ -20,12 +20,12 @@ #include <kurl.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qguardedptr.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> +#include <tqdom.h> #include <sys/types.h> #include <sys/stat.h> @@ -38,24 +38,24 @@ #include <kio/job.h> #include <kio/slaveinterface.h> -#define KIO_ARGS QByteArray packedArgs; QDataStream stream( packedArgs, IO_WriteOnly ); stream +#define KIO_ARGS TQByteArray packedArgs; TQDataStream stream( packedArgs, IO_WriteOnly ); stream using namespace KIO; class DavJob::DavJobPrivate { public: - QByteArray savedStaticData; - QByteArray str_response; // replaces the QString previously used in DavJob itself + TQByteArray savedStaticData; + TQByteArray str_response; // replaces the TQString previously used in DavJob itself }; -DavJob::DavJob( const KURL& url, int method, const QString& request, bool showProgressInfo ) - : TransferJob( url, KIO::CMD_SPECIAL, QByteArray(), QByteArray(), showProgressInfo ) +DavJob::DavJob( const KURL& url, int method, const TQString& request, bool showProgressInfo ) + : TransferJob( url, KIO::CMD_SPECIAL, TQByteArray(), TQByteArray(), showProgressInfo ) { d = new DavJobPrivate; // We couldn't set the args when calling the parent constructor, // so do it now. - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << (int) 7 << url << method; // Same for static data if ( ! request.isEmpty() && ! request.isNull() ) { @@ -65,7 +65,7 @@ DavJob::DavJob( const KURL& url, int method, const QString& request, bool showPr } } -void DavJob::slotData( const QByteArray& data ) +void DavJob::slotData( const TQByteArray& data ) { if(m_redirectionURL.isEmpty() || !m_redirectionURL.isValid() || m_error) { unsigned int oldSize = d->str_response.size(); @@ -79,7 +79,7 @@ void DavJob::slotFinished() // kdDebug(7113) << "DavJob::slotFinished()" << endl; // kdDebug(7113) << d->str_response << endl; if (!m_redirectionURL.isEmpty() && m_redirectionURL.isValid() && (m_command == CMD_SPECIAL)) { - QDataStream istream( m_packedArgs, IO_ReadOnly ); + TQDataStream istream( m_packedArgs, IO_ReadOnly ); int s_cmd, s_method; KURL s_url; istream >> s_cmd; @@ -88,16 +88,16 @@ void DavJob::slotFinished() // PROPFIND if ( (s_cmd == 7) && (s_method == (int)KIO::DAV_PROPFIND) ) { m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << (int)7 << m_redirectionURL << (int)KIO::DAV_PROPFIND; } } else if ( ! m_response.setContent( d->str_response, true ) ) { // An error occurred parsing the XML response - QDomElement root = m_response.createElementNS( "DAV:", "error-report" ); + TQDomElement root = m_response.createElementNS( "DAV:", "error-report" ); m_response.appendChild( root ); - QDomElement el = m_response.createElementNS( "DAV:", "offending-response" ); - QDomText textnode = m_response.createTextNode( d->str_response ); + TQDomElement el = m_response.createElementNS( "DAV:", "offending-response" ); + TQDomText textnode = m_response.createTextNode( d->str_response ); el.appendChild( textnode ); root.appendChild( el ); delete d; // Should be in virtual destructor @@ -113,8 +113,8 @@ void DavJob::slotFinished() /* Convenience methods */ -// KDE 4: Make it const QString & -DavJob* KIO::davPropFind( const KURL& url, const QDomDocument& properties, QString depth, bool showProgressInfo ) +// KDE 4: Make it const TQString & +DavJob* KIO::davPropFind( const KURL& url, const TQDomDocument& properties, TQString depth, bool showProgressInfo ) { DavJob *job = new DavJob( url, (int) KIO::DAV_PROPFIND, properties.toString(), showProgressInfo ); job->addMetaData( "davDepth", depth ); @@ -122,17 +122,17 @@ DavJob* KIO::davPropFind( const KURL& url, const QDomDocument& properties, QStri } -DavJob* KIO::davPropPatch( const KURL& url, const QDomDocument& properties, bool showProgressInfo ) +DavJob* KIO::davPropPatch( const KURL& url, const TQDomDocument& properties, bool showProgressInfo ) { return new DavJob( url, (int) KIO::DAV_PROPPATCH, properties.toString(), showProgressInfo ); } -DavJob* KIO::davSearch( const KURL& url, const QString& nsURI, const QString& qName, const QString& query, bool showProgressInfo ) +DavJob* KIO::davSearch( const KURL& url, const TQString& nsURI, const TQString& qName, const TQString& query, bool showProgressInfo ) { - QDomDocument doc; - QDomElement searchrequest = doc.createElementNS( "DAV:", "searchrequest" ); - QDomElement searchelement = doc.createElementNS( nsURI, qName ); - QDomText text = doc.createTextNode( query ); + TQDomDocument doc; + TQDomElement searchrequest = doc.createElementNS( "DAV:", "searchrequest" ); + TQDomElement searchelement = doc.createElementNS( nsURI, qName ); + TQDomText text = doc.createTextNode( query ); searchelement.appendChild( text ); searchrequest.appendChild( searchelement ); doc.appendChild( searchrequest ); diff --git a/kio/kio/davjob.h b/kio/kio/davjob.h index 400ca9f8e..b6a951190 100644 --- a/kio/kio/davjob.h +++ b/kio/kio/davjob.h @@ -23,12 +23,12 @@ #include <kurl.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qguardedptr.h> -#include <qdom.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> +#include <tqdom.h> #include <sys/types.h> #include <sys/stat.h> @@ -63,16 +63,16 @@ namespace KIO { * KIO::davSearch() to create a new DavJob. */ DavJob(const KURL& url, int method, - const QString& request, bool showProgressInfo); + const TQString& request, bool showProgressInfo); /** - * Returns the response as a QDomDocument. + * Returns the response as a TQDomDocument. * @return the response document */ - QDomDocument& response() { return m_response; } + TQDomDocument& response() { return m_response; } protected slots: virtual void slotFinished(); - virtual void slotData( const QByteArray &data); + virtual void slotData( const TQByteArray &data); protected: bool m_suspended; @@ -80,8 +80,8 @@ namespace KIO { private: class DavJobPrivate; DavJobPrivate *d; - QString dummy; // kept around for BC reasons - QDomDocument m_response; + TQString dummy; // kept around for BC reasons + TQDomDocument m_response; }; /** @@ -95,7 +95,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the new DavJob */ - KIO_EXPORT DavJob* davPropFind( const KURL& url, const QDomDocument& properties, QString depth, bool showProgressInfo=true ); + KIO_EXPORT DavJob* davPropFind( const KURL& url, const TQDomDocument& properties, TQString depth, bool showProgressInfo=true ); /** * Creates a new DavJob that issues a PROPPATCH command. PROPPATCH sets @@ -107,7 +107,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the new DavJob */ - KIO_EXPORT DavJob* davPropPatch( const KURL& url, const QDomDocument& properties, bool showProgressInfo=true ); + KIO_EXPORT DavJob* davPropPatch( const KURL& url, const TQDomDocument& properties, bool showProgressInfo=true ); /** * Creates a new DavJob that issues a SEARCH command. @@ -119,7 +119,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the new DavJob */ - KIO_EXPORT DavJob* davSearch( const KURL &url, const QString& nsURI, const QString& qName, const QString& query, bool showProgressInfo=true ); + KIO_EXPORT DavJob* davSearch( const KURL &url, const TQString& nsURI, const TQString& qName, const TQString& query, bool showProgressInfo=true ); } diff --git a/kio/kio/defaultprogress.cpp b/kio/kio/defaultprogress.cpp index 7073da04f..8293901ae 100644 --- a/kio/kio/defaultprogress.cpp +++ b/kio/kio/defaultprogress.cpp @@ -16,11 +16,11 @@ Boston, MA 02110-1301, USA. */ -#include <qtimer.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qdatetime.h> -#include <qcheckbox.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqdatetime.h> +#include <tqcheckbox.h> #include <kapplication.h> #include <kdebug.h> @@ -52,9 +52,9 @@ public: KPushButton *cancelClose; KPushButton *openFile; KPushButton *openLocation; - QCheckBox *keepOpen; + TQCheckBox *keepOpen; KURL location; - QTime startTime; + TQTime startTime; }; DefaultProgress::DefaultProgress( bool showNow ) @@ -69,7 +69,7 @@ DefaultProgress::DefaultProgress( bool showNow ) } } -DefaultProgress::DefaultProgress( QWidget* parent, const char* /*name*/ ) +DefaultProgress::DefaultProgress( TQWidget* parent, const char* /*name*/ ) : ProgressBase( parent ), m_iTotalSize(0), m_iTotalFiles(0), m_iTotalDirs(0), m_iProcessedSize(0), m_iProcessedDirs(0), m_iProcessedFiles(0) @@ -93,22 +93,22 @@ void DefaultProgress::init() KGlobal::iconLoader()->loadIcon( "filesave", KIcon::NoGroup, 16 ) ); #endif - QVBoxLayout *topLayout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout *topLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); topLayout->addStrut( 360 ); // makes dlg at least that wide - QGridLayout *grid = new QGridLayout( 2, 3 ); + TQGridLayout *grid = new TQGridLayout( 2, 3 ); topLayout->addLayout(grid); grid->addColSpacing(1, KDialog::spacingHint()); // filenames or action name - grid->addWidget(new QLabel(i18n("Source:"), this), 0, 0); + grid->addWidget(new TQLabel(i18n("Source:"), this), 0, 0); sourceEdit = new KLineEdit(this); sourceEdit->setReadOnly(true); sourceEdit->setEnableSqueezedText(true); grid->addWidget(sourceEdit, 0, 2); - destInvite = new QLabel(i18n("Destination:"), this); + destInvite = new TQLabel(i18n("Destination:"), this); grid->addWidget(destInvite, 1, 0); destEdit = new KLineEdit(this); @@ -120,55 +120,55 @@ void DefaultProgress::init() topLayout->addWidget( m_pProgressBar ); // processed info - QHBoxLayout *hBox = new QHBoxLayout(); + TQHBoxLayout *hBox = new TQHBoxLayout(); topLayout->addLayout(hBox); - sizeLabel = new QLabel(this); + sizeLabel = new TQLabel(this); hBox->addWidget(sizeLabel); - resumeLabel = new QLabel(this); + resumeLabel = new TQLabel(this); hBox->addWidget(resumeLabel); - progressLabel = new QLabel( this ); -/* progressLabel->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, - QSizePolicy::Preferred ) );*/ - progressLabel->setAlignment( QLabel::AlignRight ); + progressLabel = new TQLabel( this ); +/* progressLabel->setSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding, + TQSizePolicy::Preferred ) );*/ + progressLabel->setAlignment( TQLabel::AlignRight ); hBox->addWidget( progressLabel ); - hBox = new QHBoxLayout(); + hBox = new TQHBoxLayout(); topLayout->addLayout(hBox); - speedLabel = new QLabel(this); + speedLabel = new TQLabel(this); hBox->addWidget(speedLabel, 1); - QFrame *line = new QFrame( this ); - line->setFrameShape( QFrame::HLine ); - line->setFrameShadow( QFrame::Sunken ); + TQFrame *line = new TQFrame( this ); + line->setFrameShape( TQFrame::HLine ); + line->setFrameShadow( TQFrame::Sunken ); topLayout->addWidget( line ); - d->keepOpen = new QCheckBox( i18n("&Keep this window open after transfer is complete"), this); - connect( d->keepOpen, SIGNAL( toggled(bool) ), SLOT( slotKeepOpenToggled(bool) ) ); + d->keepOpen = new TQCheckBox( i18n("&Keep this window open after transfer is complete"), this); + connect( d->keepOpen, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotKeepOpenToggled(bool) ) ); topLayout->addWidget(d->keepOpen); d->keepOpen->hide(); - hBox = new QHBoxLayout(); + hBox = new TQHBoxLayout(); topLayout->addLayout(hBox); d->openFile = new KPushButton( i18n("Open &File"), this ); - connect( d->openFile, SIGNAL( clicked() ), SLOT( slotOpenFile() ) ); + connect( d->openFile, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOpenFile() ) ); hBox->addWidget( d->openFile ); d->openFile->setEnabled(false); d->openFile->hide(); d->openLocation = new KPushButton( i18n("Open &Destination"), this ); - connect( d->openLocation, SIGNAL( clicked() ), SLOT( slotOpenLocation() ) ); + connect( d->openLocation, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOpenLocation() ) ); hBox->addWidget( d->openLocation ); d->openLocation->hide(); hBox->addStretch(1); d->cancelClose = new KPushButton( KStdGuiItem::cancel(), this ); - connect( d->cancelClose, SIGNAL( clicked() ), SLOT( slotStop() ) ); + connect( d->cancelClose, TQT_SIGNAL( clicked() ), TQT_SLOT( slotStop() ) ); hBox->addWidget( d->cancelClose ); resize( sizeHint() ); @@ -219,7 +219,7 @@ void DefaultProgress::showTotals() // of CopyJob takes a long time (e.g. over networks). if ( m_iProcessedFiles == 0 && m_iProcessedDirs == 0 ) { - QString tmps; + TQString tmps; if ( m_iTotalDirs > 1 ) // that we have a singular to translate looks weired but is only logical // xgettext: no-c-format @@ -231,12 +231,12 @@ void DefaultProgress::showTotals() } //static -QString DefaultProgress::makePercentString( unsigned long percent, +TQString DefaultProgress::makePercentString( unsigned long percent, KIO::filesize_t totalSize, unsigned long totalFiles ) { if ( totalSize ) - return i18n( "%1 % of %2 " ).arg( QString::number(percent) , KIO::convertSize( totalSize ) ); + return i18n( "%1 % of %2 " ).arg( TQString::number(percent) , KIO::convertSize( totalSize ) ); else if ( totalFiles ) return i18n( "%1 % of 1 file", "%1 % of %n files", totalFiles ).arg( percent ); else @@ -245,7 +245,7 @@ QString DefaultProgress::makePercentString( unsigned long percent, void DefaultProgress::slotPercent( KIO::Job*, unsigned long percent ) { - QString caption = makePercentString( percent, m_iTotalSize, m_iTotalFiles ); + TQString caption = makePercentString( percent, m_iTotalSize, m_iTotalFiles ); m_pProgressBar->setValue( percent ); switch(mode) { case Copy: @@ -270,7 +270,7 @@ void DefaultProgress::slotPercent( KIO::Job*, unsigned long percent ) } -void DefaultProgress::slotInfoMessage( KIO::Job*, const QString & msg ) +void DefaultProgress::slotInfoMessage( KIO::Job*, const TQString & msg ) { speedLabel->setText( msg ); speedLabel->setAlignment( speedLabel->alignment() & ~Qt::WordBreak ); @@ -282,7 +282,7 @@ void DefaultProgress::slotProcessedSize( KIO::Job*, KIO::filesize_t bytes ) { return; m_iProcessedSize = bytes; - QString tmp = i18n( "%1 of %2 complete") + TQString tmp = i18n( "%1 of %2 complete") .arg( KIO::convertSize(bytes) ) .arg( KIO::convertSize(m_iTotalSize)); sizeLabel->setText( tmp ); @@ -295,7 +295,7 @@ void DefaultProgress::slotProcessedDirs( KIO::Job*, unsigned long dirs ) return; m_iProcessedDirs = dirs; - QString tmps; + TQString tmps; tmps = i18n("%1 / %n folder", "%1 / %n folders", m_iTotalDirs).arg( m_iProcessedDirs ); tmps += " "; tmps += i18n("%1 / %n file", "%1 / %n files", m_iTotalFiles).arg( m_iProcessedFiles ); @@ -309,7 +309,7 @@ void DefaultProgress::slotProcessedFiles( KIO::Job*, unsigned long files ) return; m_iProcessedFiles = files; - QString tmps; + TQString tmps; if ( m_iTotalDirs > 1 ) { tmps = i18n("%1 / %n folder", "%1 / %n folders", m_iTotalDirs).arg( m_iProcessedDirs ); tmps += " "; @@ -398,14 +398,14 @@ void DefaultProgress::slotStating( KIO::Job*, const KURL& url ) setDestVisible( false ); } -void DefaultProgress::slotMounting( KIO::Job*, const QString & dev, const QString & point ) +void DefaultProgress::slotMounting( KIO::Job*, const TQString & dev, const TQString & point ) { setCaption(i18n("Mounting %1").arg(dev)); sourceEdit->setText(point); setDestVisible( false ); } -void DefaultProgress::slotUnmounting( KIO::Job*, const QString & point ) +void DefaultProgress::slotUnmounting( KIO::Job*, const TQString & point ) { setCaption(i18n("Unmounting")); sourceEdit->setText(point); @@ -424,7 +424,7 @@ void DefaultProgress::slotCanResume( KIO::Job*, KIO::filesize_t resume ) void DefaultProgress::setDestVisible( bool visible ) { // We can't hide the destInvite/destEdit labels, - // because it screws up the QGridLayout. + // because it screws up the TQGridLayout. if (visible) { destInvite->show(); @@ -436,8 +436,8 @@ void DefaultProgress::setDestVisible( bool visible ) { destInvite->hide(); destEdit->hide(); - destInvite->setText( QString::null ); - destEdit->setText( QString::null ); + destInvite->setText( TQString::null ); + destEdit->setText( TQString::null ); } } @@ -469,9 +469,9 @@ void DefaultProgress::slotKeepOpenToggled(bool keepopen) void DefaultProgress::checkDestination(const KURL& dest) { bool ok = true; if ( dest.isLocalFile() ) { - QString path = dest.path( -1 ); - QStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" ); - for ( QStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it ) + TQString path = dest.path( -1 ); + TQStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" ); + for ( TQStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it ) if ( path.contains( *it ) ) ok = false; // it's in the tmp resource } diff --git a/kio/kio/defaultprogress.h b/kio/kio/defaultprogress.h index 9f57622d7..8dca499bd 100644 --- a/kio/kio/defaultprogress.h +++ b/kio/kio/defaultprogress.h @@ -18,7 +18,7 @@ #ifndef __defaultprogress_h__ #define __defaultprogress_h__ -#include <qlabel.h> +#include <tqlabel.h> #include <kio/global.h> @@ -51,13 +51,13 @@ public: * @param name the name of the dialog, can be 0 * @since 3.1 */ - DefaultProgress( QWidget* parent, const char* name = 0 ); + DefaultProgress( TQWidget* parent, const char* name = 0 ); ~DefaultProgress(); bool keepOpen() const; /// Shared with uiserver.cpp - static QString makePercentString( unsigned long percent, + static TQString makePercentString( unsigned long percent, KIO::filesize_t totalSize, unsigned long totalFiles ); @@ -77,7 +77,7 @@ public slots: * @param job the KIO::Job * @param msg the message to set */ - virtual void slotInfoMessage( KIO::Job *job, const QString & msg ); + virtual void slotInfoMessage( KIO::Job *job, const TQString & msg ); virtual void slotCopying( KIO::Job* job, const KURL& src, const KURL& dest ); virtual void slotMoving( KIO::Job* job, const KURL& src, const KURL& dest ); @@ -103,13 +103,13 @@ public slots: * @param dev the device to mount * @param point the mount point */ - virtual void slotMounting( KIO::Job* job, const QString & dev, const QString & point ); + virtual void slotMounting( KIO::Job* job, const TQString & dev, const TQString & point ); /** * Called when the job is unmounting. * @param job the KIO::Job * @param point the mount point */ - virtual void slotUnmounting( KIO::Job* job, const QString & point ); + virtual void slotUnmounting( KIO::Job* job, const TQString & point ); virtual void slotCanResume( KIO::Job* job, KIO::filesize_t from); /** @@ -128,11 +128,11 @@ protected: KLineEdit* sourceEdit; KLineEdit* destEdit; - QLabel* progressLabel; - QLabel* destInvite; - QLabel* speedLabel; - QLabel* sizeLabel; - QLabel* resumeLabel; + TQLabel* progressLabel; + TQLabel* destInvite; + TQLabel* speedLabel; + TQLabel* sizeLabel; + TQLabel* resumeLabel; KProgress* m_pProgressBar; diff --git a/kio/kio/forwardingslavebase.cpp b/kio/kio/forwardingslavebase.cpp index a1e505a87..5caa08465 100644 --- a/kio/kio/forwardingslavebase.cpp +++ b/kio/kio/forwardingslavebase.cpp @@ -22,8 +22,8 @@ #include <kmimetype.h> #include <kprotocolinfo.h> -#include <qapplication.h> -#include <qeventloop.h> +#include <tqapplication.h> +#include <tqeventloop.h> #include "forwardingslavebase.h" @@ -34,10 +34,10 @@ class ForwardingSlaveBasePrivate { }; -ForwardingSlaveBase::ForwardingSlaveBase(const QCString &protocol, - const QCString &poolSocket, - const QCString &appSocket) - : QObject(), SlaveBase(protocol, poolSocket, appSocket) +ForwardingSlaveBase::ForwardingSlaveBase(const TQCString &protocol, + const TQCString &poolSocket, + const TQCString &appSocket) + : TQObject(), SlaveBase(protocol, poolSocket, appSocket) { } @@ -70,7 +70,7 @@ void ForwardingSlaveBase::prepareUDSEntry(KIO::UDSEntry &entry, << listing << endl; bool url_found = false; - QString name; + TQString name; KURL url; KIO::UDSEntry::iterator it = entry.begin(); @@ -217,7 +217,7 @@ void ForwardingSlaveBase::rename(const KURL &src, const KURL &dest, } } -void ForwardingSlaveBase::symlink(const QString &target, const KURL &dest, +void ForwardingSlaveBase::symlink(const TQString &target, const KURL &dest, bool overwrite) { kdDebug() << "ForwardingSlaveBase::symlink: " << target << ", " << dest << endl; @@ -302,45 +302,45 @@ void ForwardingSlaveBase::connectJob(KIO::Job *job) kdDebug() << it.key() << " = " << it.data() << endl; #endif - connect( job, SIGNAL( result(KIO::Job *) ), - this, SLOT( slotResult(KIO::Job *) ) ); - connect( job, SIGNAL( warning(KIO::Job *, const QString &) ), - this, SLOT( slotWarning(KIO::Job *, const QString &) ) ); - connect( job, SIGNAL( infoMessage(KIO::Job *, const QString &) ), - this, SLOT( slotInfoMessage(KIO::Job *, const QString &) ) ); - connect( job, SIGNAL( totalSize(KIO::Job *, KIO::filesize_t) ), - this, SLOT( slotTotalSize(KIO::Job *, KIO::filesize_t) ) ); - connect( job, SIGNAL( processedSize(KIO::Job *, KIO::filesize_t) ), - this, SLOT( slotProcessedSize(KIO::Job *, KIO::filesize_t) ) ); - connect( job, SIGNAL( speed(KIO::Job *, unsigned long) ), - this, SLOT( slotSpeed(KIO::Job *, unsigned long) ) ); + connect( job, TQT_SIGNAL( result(KIO::Job *) ), + this, TQT_SLOT( slotResult(KIO::Job *) ) ); + connect( job, TQT_SIGNAL( warning(KIO::Job *, const TQString &) ), + this, TQT_SLOT( slotWarning(KIO::Job *, const TQString &) ) ); + connect( job, TQT_SIGNAL( infoMessage(KIO::Job *, const TQString &) ), + this, TQT_SLOT( slotInfoMessage(KIO::Job *, const TQString &) ) ); + connect( job, TQT_SIGNAL( totalSize(KIO::Job *, KIO::filesize_t) ), + this, TQT_SLOT( slotTotalSize(KIO::Job *, KIO::filesize_t) ) ); + connect( job, TQT_SIGNAL( processedSize(KIO::Job *, KIO::filesize_t) ), + this, TQT_SLOT( slotProcessedSize(KIO::Job *, KIO::filesize_t) ) ); + connect( job, TQT_SIGNAL( speed(KIO::Job *, unsigned long) ), + this, TQT_SLOT( slotSpeed(KIO::Job *, unsigned long) ) ); } void ForwardingSlaveBase::connectSimpleJob(KIO::SimpleJob *job) { connectJob(job); - connect( job, SIGNAL( redirection(KIO::Job *, const KURL &) ), - this, SLOT( slotRedirection(KIO::Job *, const KURL &) ) ); + connect( job, TQT_SIGNAL( redirection(KIO::Job *, const KURL &) ), + this, TQT_SLOT( slotRedirection(KIO::Job *, const KURL &) ) ); } void ForwardingSlaveBase::connectListJob(KIO::ListJob *job) { connectSimpleJob(job); - connect( job, SIGNAL( entries(KIO::Job *, const KIO::UDSEntryList &) ), - this, SLOT( slotEntries(KIO::Job *, const KIO::UDSEntryList &) ) ); + connect( job, TQT_SIGNAL( entries(KIO::Job *, const KIO::UDSEntryList &) ), + this, TQT_SLOT( slotEntries(KIO::Job *, const KIO::UDSEntryList &) ) ); } void ForwardingSlaveBase::connectTransferJob(KIO::TransferJob *job) { connectSimpleJob(job); - connect( job, SIGNAL( data(KIO::Job *, const QByteArray &) ), - this, SLOT( slotData(KIO::Job *, const QByteArray &) ) ); - connect( job, SIGNAL( dataReq(KIO::Job *, QByteArray &) ), - this, SLOT( slotDataReq(KIO::Job *, QByteArray &) ) ); - connect( job, SIGNAL( mimetype(KIO::Job *, const QString &) ), - this, SLOT( slotMimetype(KIO::Job *, const QString &) ) ); - connect( job, SIGNAL( canResume(KIO::Job *, KIO::filesize_t) ), - this, SLOT( slotCanResume(KIO::Job *, KIO::filesize_t) ) ); + connect( job, TQT_SIGNAL( data(KIO::Job *, const TQByteArray &) ), + this, TQT_SLOT( slotData(KIO::Job *, const TQByteArray &) ) ); + connect( job, TQT_SIGNAL( dataReq(KIO::Job *, TQByteArray &) ), + this, TQT_SLOT( slotDataReq(KIO::Job *, TQByteArray &) ) ); + connect( job, TQT_SIGNAL( mimetype(KIO::Job *, const TQString &) ), + this, TQT_SLOT( slotMimetype(KIO::Job *, const TQString &) ) ); + connect( job, TQT_SIGNAL( canResume(KIO::Job *, KIO::filesize_t) ), + this, TQT_SLOT( slotCanResume(KIO::Job *, KIO::filesize_t) ) ); } ////////////////////////////////////////////////////////////////////////////// @@ -366,12 +366,12 @@ void ForwardingSlaveBase::slotResult(KIO::Job *job) qApp->eventLoop()->exitLoop(); } -void ForwardingSlaveBase::slotWarning(KIO::Job* /*job*/, const QString &msg) +void ForwardingSlaveBase::slotWarning(KIO::Job* /*job*/, const TQString &msg) { warning(msg); } -void ForwardingSlaveBase::slotInfoMessage(KIO::Job* /*job*/, const QString &msg) +void ForwardingSlaveBase::slotInfoMessage(KIO::Job* /*job*/, const TQString &msg) { infoMessage(msg); } @@ -418,18 +418,18 @@ void ForwardingSlaveBase::slotEntries(KIO::Job* /*job*/, listEntries( final_entries ); } -void ForwardingSlaveBase::slotData(KIO::Job* /*job*/, const QByteArray &d) +void ForwardingSlaveBase::slotData(KIO::Job* /*job*/, const TQByteArray &d) { data(d); } -void ForwardingSlaveBase::slotDataReq(KIO::Job* /*job*/, QByteArray &data) +void ForwardingSlaveBase::slotDataReq(KIO::Job* /*job*/, TQByteArray &data) { dataReq(); readData(data); } -void ForwardingSlaveBase::slotMimetype (KIO::Job* /*job*/, const QString &type) +void ForwardingSlaveBase::slotMimetype (KIO::Job* /*job*/, const TQString &type) { mimeType(type); } diff --git a/kio/kio/forwardingslavebase.h b/kio/kio/forwardingslavebase.h index ff7003463..a536a9f02 100644 --- a/kio/kio/forwardingslavebase.h +++ b/kio/kio/forwardingslavebase.h @@ -23,7 +23,7 @@ #include <kio/slavebase.h> #include <kio/jobclasses.h> -#include <qobject.h> +#include <tqobject.h> namespace KIO { @@ -85,13 +85,13 @@ class ForwardingSlaveBasePrivate; * @since 3.4 * @author Kevin Ottens <ervin@ipsquad.net> */ -class KIO_EXPORT ForwardingSlaveBase : public QObject, public SlaveBase +class KIO_EXPORT ForwardingSlaveBase : public TQObject, public SlaveBase { Q_OBJECT public: - ForwardingSlaveBase(const QCString &protocol, - const QCString &poolSocket, - const QCString &appSocket); + ForwardingSlaveBase(const TQCString &protocol, + const TQCString &poolSocket, + const TQCString &appSocket); virtual ~ForwardingSlaveBase(); virtual void get(const KURL &url); @@ -109,7 +109,7 @@ public: virtual void rename(const KURL &src, const KURL &dest, bool overwrite); - virtual void symlink(const QString &target, const KURL &dest, + virtual void symlink(const TQString &target, const KURL &dest, bool overwrite); virtual void chmod(const KURL &url, int permissions); @@ -174,8 +174,8 @@ private: private slots: // KIO::Job void slotResult(KIO::Job *job); - void slotWarning(KIO::Job *job, const QString &msg); - void slotInfoMessage(KIO::Job *job, const QString &msg); + void slotWarning(KIO::Job *job, const TQString &msg); + void slotInfoMessage(KIO::Job *job, const TQString &msg); void slotTotalSize(KIO::Job *job, KIO::filesize_t size); void slotProcessedSize(KIO::Job *job, KIO::filesize_t size); void slotSpeed(KIO::Job *job, unsigned long bytesPerSecond); @@ -187,9 +187,9 @@ private slots: void slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries); // KIO::TransferJob - void slotData(KIO::Job *job, const QByteArray &data); - void slotDataReq(KIO::Job *job, QByteArray &data); - void slotMimetype (KIO::Job *job, const QString &type); + void slotData(KIO::Job *job, const TQByteArray &data); + void slotDataReq(KIO::Job *job, TQByteArray &data); + void slotMimetype (KIO::Job *job, const TQString &type); void slotCanResume (KIO::Job *job, KIO::filesize_t offset); }; diff --git a/kio/kio/global.cpp b/kio/kio/global.cpp index e36368dad..f67c09ed9 100644 --- a/kio/kio/global.cpp +++ b/kio/kio/global.cpp @@ -42,7 +42,7 @@ #include <volmgt.h> #endif -KIO_EXPORT QString KIO::convertSizeWithBytes( KIO::filesize_t size ) +KIO_EXPORT TQString KIO::convertSizeWithBytes( KIO::filesize_t size ) { if ( size >= 1024 ) return convertSize( size ) + " (" + i18n( "%1 B" ).arg( KGlobal::locale()->formatNumber(size, 0) ) + ")"; @@ -50,10 +50,10 @@ KIO_EXPORT QString KIO::convertSizeWithBytes( KIO::filesize_t size ) return convertSize( size ); } -KIO_EXPORT QString KIO::convertSize( KIO::filesize_t size ) +KIO_EXPORT TQString KIO::convertSize( KIO::filesize_t size ) { double fsize = size; - QString s; + TQString s; // Giga-byte if ( size >= 1073741824 ) { @@ -88,16 +88,16 @@ KIO_EXPORT QString KIO::convertSize( KIO::filesize_t size ) return s; } -KIO_EXPORT QString KIO::convertSizeFromKB( KIO::filesize_t kbSize ) +KIO_EXPORT TQString KIO::convertSizeFromKB( KIO::filesize_t kbSize ) { return convertSize(kbSize * 1024); } -KIO_EXPORT QString KIO::number( KIO::filesize_t size ) +KIO_EXPORT TQString KIO::number( KIO::filesize_t size ) { char charbuf[256]; sprintf(charbuf, "%lld", size); - return QString::fromLatin1(charbuf); + return TQString::fromLatin1(charbuf); } KIO_EXPORT unsigned int KIO::calculateRemainingSeconds( KIO::filesize_t totalSize, @@ -109,24 +109,24 @@ KIO_EXPORT unsigned int KIO::calculateRemainingSeconds( KIO::filesize_t totalSiz return 0; } -KIO_EXPORT QString KIO::convertSeconds( unsigned int seconds ) +KIO_EXPORT TQString KIO::convertSeconds( unsigned int seconds ) { unsigned int days = seconds / 86400; unsigned int hours = (seconds - (days * 86400)) / 3600; unsigned int mins = (seconds - (days * 86400) - (hours * 3600)) / 60; seconds = (seconds - (days * 86400) - (hours * 3600) - (mins * 60)); - const QTime time(hours, mins, seconds); - const QString timeStr( KGlobal::locale()->formatTime(time, true /*with seconds*/, true /*duration*/) ); + const TQTime time(hours, mins, seconds); + const TQString timeStr( KGlobal::locale()->formatTime(time, true /*with seconds*/, true /*duration*/) ); if ( days > 0 ) return i18n("1 day %1", "%n days %1", days).arg(timeStr); else return timeStr; } -KIO_EXPORT QTime KIO::calculateRemaining( KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed ) +KIO_EXPORT TQTime KIO::calculateRemaining( KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed ) { - QTime remainingTime; + TQTime remainingTime; if ( speed != 0 ) { KIO::filesize_t secs; @@ -147,9 +147,9 @@ KIO_EXPORT QTime KIO::calculateRemaining( KIO::filesize_t totalSize, KIO::filesi return remainingTime; } -KIO_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) +KIO_EXPORT TQString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) { - QString text = items == 0 ? i18n( "No Items" ) : i18n( "One Item", "%n Items", items ); + TQString text = items == 0 ? i18n( "No Items" ) : i18n( "One Item", "%n Items", items ); text += " - "; text += files == 0 ? i18n( "No Files" ) : i18n( "One File", "%n Files", files ); if ( showSize && files > 0 ) @@ -162,9 +162,9 @@ KIO_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KI return text; } -KIO_EXPORT QString KIO::encodeFileName( const QString & _str ) +KIO_EXPORT TQString KIO::encodeFileName( const TQString & _str ) { - QString str( _str ); + TQString str( _str ); int i = 0; while ( ( i = str.find( "%", i ) ) != -1 ) @@ -177,9 +177,9 @@ KIO_EXPORT QString KIO::encodeFileName( const QString & _str ) return str; } -KIO_EXPORT QString KIO::decodeFileName( const QString & _str ) +KIO_EXPORT TQString KIO::decodeFileName( const TQString & _str ) { - QString str; + TQString str; unsigned int i = 0; for ( ; i < _str.length() ; ++i ) @@ -205,14 +205,14 @@ KIO_EXPORT QString KIO::decodeFileName( const QString & _str ) return str; } -KIO_EXPORT QString KIO::Job::errorString() const +KIO_EXPORT TQString KIO::Job::errorString() const { return KIO::buildErrorString(m_error, m_errorText); } -KIO_EXPORT QString KIO::buildErrorString(int errorCode, const QString &errorText) +KIO_EXPORT TQString KIO::buildErrorString(int errorCode, const TQString &errorText) { - QString result; + TQString result; switch( errorCode ) { @@ -284,7 +284,7 @@ KIO_EXPORT QString KIO::buildErrorString(int errorCode, const QString &errorText result = i18n( "Could not create socket for accessing %1." ).arg( errorText ); break; case KIO::ERR_COULD_NOT_CONNECT: - result = i18n( "Could not connect to host %1." ).arg( errorText.isEmpty() ? QString::fromLatin1("localhost") : errorText ); + result = i18n( "Could not connect to host %1." ).arg( errorText.isEmpty() ? TQString::fromLatin1("localhost") : errorText ); break; case KIO::ERR_CONNECTION_BROKEN: result = i18n( "Connection to host %1 is broken." ).arg( errorText ); @@ -416,7 +416,7 @@ KIO_EXPORT QString KIO::buildErrorString(int errorCode, const QString &errorText return result; } -KIO_EXPORT QString KIO::unsupportedActionErrorString(const QString &protocol, int cmd) { +KIO_EXPORT TQString KIO::unsupportedActionErrorString(const TQString &protocol, int cmd) { switch (cmd) { case CMD_CONNECT: return i18n("Opening connections is not supported with the protocol %1." ).arg(protocol); @@ -455,18 +455,18 @@ KIO_EXPORT QString KIO::unsupportedActionErrorString(const QString &protocol, in }/*end switch*/ } -KIO_EXPORT QStringList KIO::Job::detailedErrorStrings( const KURL *reqUrl /*= 0L*/, +KIO_EXPORT TQStringList KIO::Job::detailedErrorStrings( const KURL *reqUrl /*= 0L*/, int method /*= -1*/ ) const { - QString errorName, techName, description, ret2; - QStringList causes, solutions, ret; + TQString errorName, techName, description, ret2; + TQStringList causes, solutions, ret; - QByteArray raw = rawErrorDetail( m_error, m_errorText, reqUrl, method ); - QDataStream stream(raw, IO_ReadOnly); + TQByteArray raw = rawErrorDetail( m_error, m_errorText, reqUrl, method ); + TQDataStream stream(raw, IO_ReadOnly); stream >> errorName >> techName >> description >> causes >> solutions; - QString url, protocol, datetime; + TQString url, protocol, datetime; if ( reqUrl ) { url = reqUrl->htmlURL(); protocol = reqUrl->protocol(); @@ -474,16 +474,16 @@ KIO_EXPORT QStringList KIO::Job::detailedErrorStrings( const KURL *reqUrl /*= 0L url = i18n( "(unknown)" ); } - datetime = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), + datetime = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), false ); ret << errorName; - ret << QString::fromLatin1( "<qt><p><b>" ) + errorName + - QString::fromLatin1( "</b></p><p>" ) + description + - QString::fromLatin1( "</p>" ); - ret2 = QString::fromLatin1( "<qt><p>" ); + ret << TQString::fromLatin1( "<qt><p><b>" ) + errorName + + TQString::fromLatin1( "</b></p><p>" ) + description + + TQString::fromLatin1( "</p>" ); + ret2 = TQString::fromLatin1( "<qt><p>" ); if ( !techName.isEmpty() ) - ret2 += i18n( "<b>Technical reason</b>: " ) + techName + QString::fromLatin1( "</p>" ); + ret2 += i18n( "<b>Technical reason</b>: " ) + techName + TQString::fromLatin1( "</p>" ); ret2 += i18n( "</p><p><b>Details of the request</b>:" ); ret2 += i18n( "</p><ul><li>URL: %1</li>" ).arg( url ); if ( !protocol.isEmpty() ) { @@ -494,21 +494,21 @@ KIO_EXPORT QStringList KIO::Job::detailedErrorStrings( const KURL *reqUrl /*= 0L if ( !causes.isEmpty() ) { ret2 += i18n( "<p><b>Possible causes</b>:</p><ul><li>" ); ret2 += causes.join( "</li><li>" ); - ret2 += QString::fromLatin1( "</li></ul>" ); + ret2 += TQString::fromLatin1( "</li></ul>" ); } if ( !solutions.isEmpty() ) { ret2 += i18n( "<p><b>Possible solutions</b>:</p><ul><li>" ); ret2 += solutions.join( "</li><li>" ); - ret2 += QString::fromLatin1( "</li></ul>" ); + ret2 += TQString::fromLatin1( "</li></ul>" ); } ret << ret2; return ret; } -KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorText, +KIO_EXPORT TQByteArray KIO::rawErrorDetail(int errorCode, const TQString &errorText, const KURL *reqUrl /*= 0L*/, int /*method = -1*/ ) { - QString url, host, protocol, datetime, domain, path, dir, filename; + TQString url, host, protocol, datetime, domain, path, dir, filename; bool isSlaveNetwork = false; if ( reqUrl ) { url = reqUrl->prettyURL(); @@ -556,34 +556,34 @@ KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorTex protocol = i18n( "(unknown)" ); } - datetime = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), + datetime = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), false ); - QString errorName, techName, description; - QStringList causes, solutions; + TQString errorName, techName, description; + TQStringList causes, solutions; // c == cause, s == solution - QString sSysadmin = i18n( "Contact your appropriate computer support system, " + TQString sSysadmin = i18n( "Contact your appropriate computer support system, " "whether the system administrator, or technical support group for further " "assistance." ); - QString sServeradmin = i18n( "Contact the administrator of the server " + TQString sServeradmin = i18n( "Contact the administrator of the server " "for further assistance." ); // FIXME active link to permissions dialog - QString sAccess = i18n( "Check your access permissions on this resource." ); - QString cAccess = i18n( "Your access permissions may be inadequate to " + TQString sAccess = i18n( "Check your access permissions on this resource." ); + TQString cAccess = i18n( "Your access permissions may be inadequate to " "perform the requested operation on this resource." ); - QString cLocked = i18n( "The file may be in use (and thus locked) by " + TQString cLocked = i18n( "The file may be in use (and thus locked) by " "another user or application." ); - QString sQuerylock = i18n( "Check to make sure that no other " + TQString sQuerylock = i18n( "Check to make sure that no other " "application or user is using the file or has locked the file." ); - QString cHardware = i18n( "Although unlikely, a hardware error may have " + TQString cHardware = i18n( "Although unlikely, a hardware error may have " "occurred." ); - QString cBug = i18n( "You may have encountered a bug in the program." ); - QString cBuglikely = i18n( "This is most likely to be caused by a bug in the " + TQString cBug = i18n( "You may have encountered a bug in the program." ); + TQString cBuglikely = i18n( "This is most likely to be caused by a bug in the " "program. Please consider submitting a full bug report as detailed below." ); - QString sUpdate = i18n( "Update your software to the latest version. " + TQString sUpdate = i18n( "Update your software to the latest version. " "Your distribution should provide tools to update your software." ); - QString sBugreport = i18n( "When all else fails, please consider helping the " + TQString sBugreport = i18n( "When all else fails, please consider helping the " "KDE team or the third party maintainer of this software by submitting a " "high quality bug report. If the software is provided by a third party, " "please contact them directly. Otherwise, first look to see if " @@ -591,22 +591,22 @@ KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorTex "<a href=\"http://bugs.kde.org/\">KDE bug reporting website</a>. If not, take " "note of the details given above, and include them in your bug report, along " "with as many other details as you think might help." ); - QString cNetwork = i18n( "There may have been a problem with your network " + TQString cNetwork = i18n( "There may have been a problem with your network " "connection." ); // FIXME netconf kcontrol link - QString cNetconf = i18n( "There may have been a problem with your network " + TQString cNetconf = i18n( "There may have been a problem with your network " "configuration. If you have been accessing the Internet with no problems " "recently, this is unlikely." ); - QString cNetpath = i18n( "There may have been a problem at some point along " + TQString cNetpath = i18n( "There may have been a problem at some point along " "the network path between the server and this computer." ); - QString sTryagain = i18n( "Try again, either now or at a later time." ); - QString cProtocol = i18n( "A protocol error or incompatibility may have occurred." ); - QString sExists = i18n( "Ensure that the resource exists, and try again." ); - QString cExists = i18n( "The specified resource may not exist." ); - QString cTypo = i18n( "You may have incorrectly typed the location." ); - QString sTypo = i18n( "Double-check that you have entered the correct location " + TQString sTryagain = i18n( "Try again, either now or at a later time." ); + TQString cProtocol = i18n( "A protocol error or incompatibility may have occurred." ); + TQString sExists = i18n( "Ensure that the resource exists, and try again." ); + TQString cExists = i18n( "The specified resource may not exist." ); + TQString cTypo = i18n( "You may have incorrectly typed the location." ); + TQString sTypo = i18n( "Double-check that you have entered the correct location " "and try again." ); - QString sNetwork = i18n( "Check your network connection status." ); + TQString sNetwork = i18n( "Check your network connection status." ); switch( errorCode ) { case KIO::ERR_CANNOT_OPEN_FOR_READING: @@ -869,7 +869,7 @@ KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorTex "<strong>L</strong>ocator (URL) that you entered did not refer to " "a valid mechanism of accessing the specific resource, " "<strong>%1%2</strong>." ) - .arg( !host.isNull() ? host + '/' : QString::null ).arg( dir ); + .arg( !host.isNull() ? host + '/' : TQString::null ).arg( dir ); causes << i18n( "KDE is able to communicate through a protocol within a " "protocol. This request specified a protocol be used as such, however " "this protocol is not capable of such an action. This is a rare event, " @@ -1231,7 +1231,7 @@ KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorTex // We assume that the slave has all the details case KIO::ERR_SLAVE_DEFINED: - errorName = QString::null; + errorName = TQString::null; description = errorText; break; @@ -1241,8 +1241,8 @@ KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorTex description = buildErrorString( errorCode, errorText ); } - QByteArray ret; - QDataStream stream(ret, IO_WriteOnly); + TQByteArray ret; + TQDataStream stream(ret, IO_WriteOnly); stream << errorName << techName << description << causes << solutions; return ret; } @@ -1252,7 +1252,7 @@ KIO_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorTex #include <limits.h> #include <stdlib.h> #include <stdio.h> -#include <qfile.h> +#include <tqfile.h> #include <config.h> @@ -1365,9 +1365,9 @@ extern "C" void endvfsent( ); #endif /* HAVE_GETMNTINFO */ -QString KIO::findDeviceMountPoint( const QString& filename ) +TQString KIO::findDeviceMountPoint( const TQString& filename ) { - QString result; + TQString result; #ifdef HAVE_VOLMGT /* @@ -1377,22 +1377,22 @@ QString KIO::findDeviceMountPoint( const QString& filename ) FILE *mnttab; struct mnttab mnt; int len; - QCString devname; + TQCString devname; if( (volpath = volmgt_root()) == NULL ) { kdDebug( 7007 ) << "findDeviceMountPoint: " << "VOLMGT: can't find volmgt root dir" << endl; - return QString::null; + return TQString::null; } if( (mnttab = fopen( MNTTAB, "r" )) == NULL ) { kdDebug( 7007 ) << "findDeviceMountPoint: " << "VOLMGT: can't open mnttab" << endl; - return QString::null; + return TQString::null; } devname = volpath; - devname += QFile::encodeName( filename ); + devname += TQFile::encodeName( filename ); devname += '/'; len = devname.length(); // kdDebug( 7007 ) << "findDeviceMountPoint: " @@ -1407,7 +1407,7 @@ QString KIO::findDeviceMountPoint( const QString& filename ) * /dev/dsk/cXtYdZs2 => <volpath>/dev/dsk/cXtYdZ (without slice#) */ rewind( mnttab ); - result = QString::null; + result = TQString::null; while( getmntent( mnttab, &mnt ) == 0 ) { /* * either match the exact device name (floppies), @@ -1416,7 +1416,7 @@ QString KIO::findDeviceMountPoint( const QString& filename ) if( strncmp( devname.data(), mnt.mnt_special, len ) == 0 || (strncmp( devname.data(), mnt.mnt_special, len - 3 ) == 0 && mnt.mnt_special[len - 3] == '/' ) - || (strcmp(QFile::encodeName(filename).data() + || (strcmp(TQFile::encodeName(filename).data() , mnt.mnt_special)==0)) { result = mnt.mnt_mountp; break; @@ -1426,9 +1426,9 @@ QString KIO::findDeviceMountPoint( const QString& filename ) #else char realpath_buffer[MAXPATHLEN]; - QCString realname; + TQCString realname; - realname = QFile::encodeName(filename); + realname = TQFile::encodeName(filename); /* If the path contains symlinks, get the real name */ if (realpath(realname, realpath_buffer) != 0) // succes, use result from realpath @@ -1448,7 +1448,7 @@ QString KIO::findDeviceMountPoint( const QString& filename ) for (int i=0;i<num_fs;i++) { - QCString device_name = mounted[i].f_mntfromname; + TQCString device_name = mounted[i].f_mntfromname; // If the path contains symlinks, get // the real name @@ -1509,7 +1509,7 @@ QString KIO::findDeviceMountPoint( const QString& filename ) mountedfrom[fsname_len] = '\0'; strncpy(mountedfrom, (char *)vmt2dataptr(vm, VMT_OBJECT), fsname_len); - QCString device_name = mountedfrom; + TQCString device_name = mountedfrom; if (realpath(device_name, realpath_buffer) != 0) // success, use result from realpath @@ -1540,7 +1540,7 @@ QString KIO::findDeviceMountPoint( const QString& filename ) if ((mtab = SETMNTENT(MNTTAB, "r")) == 0) { perror("setmntent"); - return QString::null; + return TQString::null; } /* Loop over all file systems and see if we can find our @@ -1559,7 +1559,7 @@ QString KIO::findDeviceMountPoint( const QString& filename ) { // There may be symbolic links into the /etc/mnttab // So we have to find the real device name here as well! - QCString device_name = FSNAME(me); + TQCString device_name = FSNAME(me); if (device_name.isEmpty() || (device_name == "none")) continue; @@ -1630,9 +1630,9 @@ static void check_mount_point(const char *mounttype, // returns the mount point, checks the mount state. // if ismanual == Wrong this function does not check the manual mount state -static QString get_mount_info(const QString& filename, +static TQString get_mount_info(const TQString& filename, MountState& isautofs, MountState& isslow, MountState& ismanual, - QString& fstype) + TQString& fstype) { static bool gotRoot = false; static dev_t rootDevice; @@ -1640,11 +1640,11 @@ static QString get_mount_info(const QString& filename, struct cachedDevice_t { dev_t device; - QString mountPoint; + TQString mountPoint; MountState isautofs; MountState isslow; MountState ismanual; - QString fstype; + TQString fstype; }; static struct cachedDevice_t *cachedDevice = 0; @@ -1658,16 +1658,16 @@ static QString get_mount_info(const QString& filename, bool gotDevice = false; KDE_struct_stat stat_buf; - if (KDE_stat(QFile::encodeName(filename), &stat_buf) == 0) + if (KDE_stat(TQFile::encodeName(filename), &stat_buf) == 0) { gotDevice = true; if (stat_buf.st_dev == rootDevice) { - static const QString &root = KGlobal::staticQString("/"); + static const TQString &root = KGlobal::staticQString("/"); isautofs = Wrong; isslow = Wrong; ismanual = Wrong; - fstype = QString::null; // ### do we need it? + fstype = TQString::null; // ### do we need it? return root; } if (cachedDevice && (stat_buf.st_dev == cachedDevice->device)) @@ -1688,13 +1688,13 @@ static QString get_mount_info(const QString& filename, memset(realname, 0, MAXPATHLEN); /* If the path contains symlinks, get the real name */ - if (realpath(QFile::encodeName(filename), realname) == 0) { - if( strlcpy(realname, QFile::encodeName(filename), MAXPATHLEN)>=MAXPATHLEN) - return QString::null; + if (realpath(TQFile::encodeName(filename), realname) == 0) { + if( strlcpy(realname, TQFile::encodeName(filename), MAXPATHLEN)>=MAXPATHLEN) + return TQString::null; } int max = 0; - QString mountPoint; + TQString mountPoint; /* Loop over all file systems and see if we can find our * mount point. @@ -1720,7 +1720,7 @@ static QString get_mount_info(const QString& filename, for (int i=0;i<num_fs;i++) { - QCString device_name = mounted[i].f_mntfromname; + TQCString device_name = mounted[i].f_mntfromname; // If the path contains symlinks, get // the real name @@ -1734,8 +1734,8 @@ static QString get_mount_info(const QString& filename, #endif if ( is_my_mountpoint( mounted[i].f_mntonname, realname, max ) ) { - mountPoint = QFile::decodeName(mounted[i].f_mntonname); - fstype = QString::fromLatin1(mounttype); + mountPoint = TQFile::decodeName(mounted[i].f_mntonname); + fstype = TQString::fromLatin1(mounttype); check_mount_point( mounttype, mounted[i].f_mntfromname, isautofs, isslow ); // keep going, looking for a potentially better one @@ -1787,7 +1787,7 @@ static QString get_mount_info(const QString& filename, strncpy(mountedfrom, (char *)vmt2dataptr(vm, VMT_OBJECT), fsname_len); /* get the mount-from information: */ - QCString device_name = mountedfrom; + TQCString device_name = mountedfrom; if (realpath(device_name, realpath_buffer) != 0) // success, use result from realpath @@ -1801,8 +1801,8 @@ static QString get_mount_info(const QString& filename, if ( is_my_mountpoint( mountedto, realname, max ) ) { - mountPoint = QFile::decodeName(mountedto); - fstype = QString::fromLatin1(ent->vfsent_name); + mountPoint = TQFile::decodeName(mountedto); + fstype = TQString::fromLatin1(ent->vfsent_name); check_mount_point(ent->vfsent_name, device_name, isautofs, isslow); if (ismanual == Unseen) @@ -1832,7 +1832,7 @@ static QString get_mount_info(const QString& filename, if ((mtab = SETMNTENT(MNTTAB, "r")) == 0) { perror("setmntent"); - return QString::null; + return TQString::null; } STRUCT_MNTENT me; @@ -1843,7 +1843,7 @@ static QString get_mount_info(const QString& filename, if ( is_my_mountpoint( MOUNTPOINT(me), realname, max ) ) { - mountPoint = QFile::decodeName( MOUNTPOINT(me) ); + mountPoint = TQFile::decodeName( MOUNTPOINT(me) ); fstype = MOUNTTYPE(me); check_mount_point(MOUNTTYPE(me), FSNAME(me), isautofs, isslow); // we don't check if ismanual is Right, if /a/b is manually @@ -1852,8 +1852,8 @@ static QString get_mount_info(const QString& filename, { // The next GETMNTENT call may destroy 'me' // Copy out the info that we need - QCString fsname_me = FSNAME(me); - QCString mounttype_me = MOUNTTYPE(me); + TQCString fsname_me = FSNAME(me); + TQCString mounttype_me = MOUNTTYPE(me); STRUCT_SETMNTENT fstab; if ((fstab = SETMNTENT(FSTAB, "r")) == 0) { @@ -1906,53 +1906,53 @@ static QString get_mount_info(const QString& filename, #else //!Q_OS_UNIX //dummy -QString KIO::findDeviceMountPoint( const QString& filename ) +TQString KIO::findDeviceMountPoint( const TQString& filename ) { - return QString::null; + return TQString::null; } #endif -QString KIO::findPathMountPoint(const QString& filename) +TQString KIO::findPathMountPoint(const TQString& filename) { #ifdef Q_OS_UNIX MountState isautofs = Unseen, isslow = Unseen, ismanual = Wrong; - QString fstype; + TQString fstype; return get_mount_info(filename, isautofs, isslow, ismanual, fstype); #else //!Q_OS_UNIX - return QString::null; + return TQString::null; #endif } -bool KIO::manually_mounted(const QString& filename) +bool KIO::manually_mounted(const TQString& filename) { #ifdef Q_OS_UNIX MountState isautofs = Unseen, isslow = Unseen, ismanual = Unseen; - QString fstype; - QString mountPoint = get_mount_info(filename, isautofs, isslow, ismanual, fstype); + TQString fstype; + TQString mountPoint = get_mount_info(filename, isautofs, isslow, ismanual, fstype); return !mountPoint.isNull() && (ismanual == Right); #else //!Q_OS_UNIX return false; #endif } -bool KIO::probably_slow_mounted(const QString& filename) +bool KIO::probably_slow_mounted(const TQString& filename) { #ifdef Q_OS_UNIX MountState isautofs = Unseen, isslow = Unseen, ismanual = Wrong; - QString fstype; - QString mountPoint = get_mount_info(filename, isautofs, isslow, ismanual, fstype); + TQString fstype; + TQString mountPoint = get_mount_info(filename, isautofs, isslow, ismanual, fstype); return !mountPoint.isNull() && (isslow == Right); #else //!Q_OS_UNIX return false; #endif } -bool KIO::testFileSystemFlag(const QString& filename, FileSystemFlag flag) +bool KIO::testFileSystemFlag(const TQString& filename, FileSystemFlag flag) { #ifdef Q_OS_UNIX MountState isautofs = Unseen, isslow = Unseen, ismanual = Wrong; - QString fstype; - QString mountPoint = get_mount_info(filename, isautofs, isslow, ismanual, fstype); + TQString fstype; + TQString mountPoint = get_mount_info(filename, isautofs, isslow, ismanual, fstype); kdDebug() << "testFileSystemFlag: fstype=" << fstype << endl; if (mountPoint.isNull()) return false; @@ -1970,9 +1970,9 @@ bool KIO::testFileSystemFlag(const QString& filename, FileSystemFlag flag) return false; } -KIO::CacheControl KIO::parseCacheControl(const QString &cacheControl) +KIO::CacheControl KIO::parseCacheControl(const TQString &cacheControl) { - QString tmp = cacheControl.lower(); + TQString tmp = cacheControl.lower(); if (tmp == "cacheonly") return KIO::CC_CacheOnly; @@ -1989,7 +1989,7 @@ KIO::CacheControl KIO::parseCacheControl(const QString &cacheControl) return KIO::CC_Verify; } -QString KIO::getCacheControlString(KIO::CacheControl cacheControl) +TQString KIO::getCacheControlString(KIO::CacheControl cacheControl) { if (cacheControl == KIO::CC_CacheOnly) return "CacheOnly"; @@ -2002,5 +2002,5 @@ QString KIO::getCacheControlString(KIO::CacheControl cacheControl) if (cacheControl == KIO::CC_Reload) return "Reload"; kdDebug() << "unrecognized Cache control enum value:"<<cacheControl<<endl; - return QString::null; + return TQString::null; } diff --git a/kio/kio/global.h b/kio/kio/global.h index 4ff622d6e..cea9dc5f4 100644 --- a/kio/kio/global.h +++ b/kio/kio/global.h @@ -18,12 +18,12 @@ #ifndef __kio_global_h__ #define __kio_global_h__ -#include <qstring.h> -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qdatastream.h> -#include <qdatetime.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqdatastream.h> +#include <tqdatetime.h> +#include <tqmap.h> #include <kurl.h> @@ -44,7 +44,7 @@ namespace KIO * @param size size in bytes * @return converted size as a string - e.g. 123.4 kB , 12.0 MB */ - KIO_EXPORT QString convertSize( KIO::filesize_t size ); + KIO_EXPORT TQString convertSize( KIO::filesize_t size ); /** * Converts @p size from bytes to a string representation with includes @@ -53,15 +53,15 @@ namespace KIO * @param size size in bytes * @return converted size as a string - e.g. 1.4 KB (1495 B), 45 B */ - KIO_EXPORT QString convertSizeWithBytes( KIO::filesize_t size ); + KIO_EXPORT TQString convertSizeWithBytes( KIO::filesize_t size ); /** * Converts a size to a string representation - * Not unlike QString::number(...) + * Not unlike TQString::number(...) * * @param size size in bytes * @return converted size as a string - e.g. 123456789 */ - KIO_EXPORT QString number( KIO::filesize_t size ); + KIO_EXPORT TQString number( KIO::filesize_t size ); /** * Converts size from kilo-bytes to the string representation. @@ -69,7 +69,7 @@ namespace KIO * @param kbSize size in kilo-bytes * @return converted size as a string - e.g. 123.4 kB , 12.0 MB */ - KIO_EXPORT QString convertSizeFromKB( KIO::filesize_t kbSize ); + KIO_EXPORT TQString convertSizeFromKB( KIO::filesize_t kbSize ); /** * Calculates remaining time in seconds from total size, processed size and speed. @@ -92,18 +92,18 @@ namespace KIO * * @since 3.4 */ - KIO_EXPORT QString convertSeconds( unsigned int seconds ); + KIO_EXPORT TQString convertSeconds( unsigned int seconds ); /** * Calculates remaining time from total size, processed size and speed. - * Warning: As QTime is limited to 23:59:59, use calculateRemainingSeconds() instead + * Warning: As TQTime is limited to 23:59:59, use calculateRemainingSeconds() instead * * @param totalSize total size in bytes * @param processedSize processed size in bytes * @param speed speed in bytes per second * @return calculated remaining time */ - KIO_EXPORT QTime calculateRemaining( KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed ) KDE_DEPRECATED; + KIO_EXPORT TQTime calculateRemaining( KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed ) KDE_DEPRECATED; /** * Helper for showing information about a set of files and directories @@ -114,7 +114,7 @@ namespace KIO * @param showSize whether to show the size in the result * @return the summary string */ - KIO_EXPORT QString itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize); + KIO_EXPORT TQString itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize); /** * Encodes (from the text displayed to the real filename) @@ -123,14 +123,14 @@ namespace KIO * @param str the file name to encode * @return the encoded file name */ - KIO_EXPORT QString encodeFileName( const QString & str ); + KIO_EXPORT TQString encodeFileName( const TQString & str ); /** * Decodes (from the filename to the text displayed) * This translates %2[fF] into / and %% into % * @param str the file name to decode * @return the decoded file name */ - KIO_EXPORT QString decodeFileName( const QString & str ); + KIO_EXPORT TQString decodeFileName( const TQString & str ); /** * Commands that can be invoked by a job. @@ -255,7 +255,7 @@ namespace KIO * @param errorText the additional error text * @return the created error string */ - KIO_EXPORT QString buildErrorString(int errorCode, const QString &errorText); + KIO_EXPORT TQString buildErrorString(int errorCode, const TQString &errorText); /** * Returns a translated html error message for @p errorCode using the @@ -267,7 +267,7 @@ namespace KIO * @param method the ioslave method * @return the created error string */ - KIO_EXPORT QString buildHTMLErrorString(int errorCode, const QString &errorText, + KIO_EXPORT TQString buildHTMLErrorString(int errorCode, const TQString &errorText, const KURL *reqUrl = 0L, int method = -1 ); /** @@ -280,13 +280,13 @@ namespace KIO * @param reqUrl the request URL * @param method the ioslave method * @return the following data: - * @li QString errorName - the name of the error - * @li QString techName - if not null, the more technical name of the error - * @li QString description - a description of the error - * @li QStringList causes - a list of possible causes of the error - * @li QStringList solutions - a liso of solutions for the error + * @li TQString errorName - the name of the error + * @li TQString techName - if not null, the more technical name of the error + * @li TQString description - a description of the error + * @li TQStringList causes - a list of possible causes of the error + * @li TQStringList solutions - a liso of solutions for the error */ - KIO_EXPORT QByteArray rawErrorDetail(int errorCode, const QString &errorText, + KIO_EXPORT TQByteArray rawErrorDetail(int errorCode, const TQString &errorText, const KURL *reqUrl = 0L, int method = -1 ); /** @@ -297,7 +297,7 @@ namespace KIO * @see enum Command * @since 3.2 */ - KIO_EXPORT QString unsupportedActionErrorString(const QString &protocol, int cmd); + KIO_EXPORT TQString unsupportedActionErrorString(const TQString &protocol, int cmd); /** * Constants used to specify the type of a KUDSAtom. @@ -398,7 +398,7 @@ namespace KIO * @return the cache control value * @see getCacheControlString() */ - KIO_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl); + KIO_EXPORT KIO::CacheControl parseCacheControl(const TQString &cacheControl); /** * Returns a string representation of the given cache control method. @@ -407,14 +407,14 @@ namespace KIO * @return the string representation * @see parseCacheControl() */ - KIO_EXPORT QString getCacheControlString(KIO::CacheControl cacheControl); + KIO_EXPORT TQString getCacheControlString(KIO::CacheControl cacheControl); /** * Returns the mount point where @p device is mounted * right now. This means, it has to be mounted, not just * defined in fstab. */ - KIO_EXPORT QString findDeviceMountPoint( const QString& device ); + KIO_EXPORT TQString findDeviceMountPoint( const TQString& device ); /** * Returns the mount point on which resides @p filename. @@ -423,7 +423,7 @@ namespace KIO * @param filename the file name to check * @return the mount point of the given @p filename */ - KIO_EXPORT QString findPathMountPoint( const QString & filename ); + KIO_EXPORT TQString findPathMountPoint( const TQString & filename ); /** * Checks if the path belongs to a filesystem that is probably @@ -432,7 +432,7 @@ namespace KIO * @param filename the file name to check * @return true if the filesystem is probably slow */ - KIO_EXPORT bool probably_slow_mounted(const QString& filename); + KIO_EXPORT bool probably_slow_mounted(const TQString& filename); /** * Checks if the path belongs to a filesystem that is manually @@ -440,7 +440,7 @@ namespace KIO * @param filename the file name to check * @return true if the filesystem is manually mounted */ - KIO_EXPORT bool manually_mounted(const QString& filename); + KIO_EXPORT bool manually_mounted(const TQString& filename); enum FileSystemFlag { SupportsChmod, SupportsChown, SupportsUTime, SupportsSymlinks, CaseInsensitive }; @@ -464,7 +464,7 @@ namespace KIO * "foo" and "FOO" as being the same file (true for msdos systems) * */ - KIO_EXPORT bool testFileSystemFlag(const QString& filename, FileSystemFlag flag); + KIO_EXPORT bool testFileSystemFlag(const TQString& filename, FileSystemFlag flag); /************ @@ -486,7 +486,7 @@ public: /** * Whether 'm_str' or 'm_long' is used depends on the value of 'm_uds'. */ - QString m_str; + TQString m_str; /** * Whether 'm_str' or 'm_long' is used depends on the value of 'm_uds'. */ @@ -501,35 +501,35 @@ public: /** * An entry is the list of atoms containing all the informations for a file or URL */ -typedef QValueList<UDSAtom> UDSEntry; -typedef QValueList<UDSEntry> UDSEntryList; -typedef QValueListIterator<UDSEntry> UDSEntryListIterator; -typedef QValueListConstIterator<UDSEntry> UDSEntryListConstIterator; +typedef TQValueList<UDSAtom> UDSEntry; +typedef TQValueList<UDSEntry> UDSEntryList; +typedef TQValueListIterator<UDSEntry> UDSEntryListIterator; +typedef TQValueListConstIterator<UDSEntry> UDSEntryListConstIterator; /** * MetaData is a simple map of key/value strings. */ -class KIO_EXPORT MetaData : public QMap<QString, QString> +class KIO_EXPORT MetaData : public TQMap<TQString, TQString> { public: /** * Creates an empty meta data map. */ - MetaData() : QMap<QString, QString>() { }; + MetaData() : TQMap<TQString, TQString>() { }; /** * Copy constructor. */ - MetaData(const QMap<QString, QString>&metaData) : - QMap<QString, QString>(metaData) { }; + MetaData(const TQMap<TQString, TQString>&metaData) : + TQMap<TQString, TQString>(metaData) { }; /** * Adds the given meta data map to this map. * @param metaData the map to add * @return this map */ - MetaData & operator+= ( const QMap<QString,QString> &metaData ) + MetaData & operator+= ( const TQMap<TQString,TQString> &metaData ) { - QMap<QString,QString>::ConstIterator it; + TQMap<TQString,TQString>::ConstIterator it; for( it = metaData.begin(); it != metaData.end(); ++it) diff --git a/kio/kio/job.cpp b/kio/kio/job.cpp index 96e2e1647..b20c09c10 100644 --- a/kio/kio/job.cpp +++ b/kio/kio/job.cpp @@ -38,8 +38,8 @@ extern "C" { #include <pwd.h> #include <grp.h> } -#include <qtimer.h> -#include <qfile.h> +#include <tqtimer.h> +#include <tqfile.h> #include <kapplication.h> #include <kglobal.h> @@ -79,12 +79,12 @@ extern "C" { #endif using namespace KIO; -template class QPtrList<KIO::Job>; +template class TQPtrList<KIO::Job>; //this will update the report dialog with 5 Hz, I think this is fast enough, aleXXX #define REPORT_TIMEOUT 200 -#define KIO_ARGS QByteArray packedArgs; QDataStream stream( packedArgs, IO_WriteOnly ); stream +#define KIO_ARGS TQByteArray packedArgs; TQDataStream stream( packedArgs, IO_WriteOnly ); stream class Job::JobPrivate { @@ -97,8 +97,8 @@ public: bool m_autoErrorHandling; bool m_autoWarningHandling; bool m_interactive; - QGuardedPtr<QWidget> m_errorParentWidget; - // Maybe we could use the QObject parent/child mechanism instead + TQGuardedPtr<TQWidget> m_errorParentWidget; + // Maybe we could use the TQObject parent/child mechanism instead // (requires a new ctor, and moving the ctor code to some init()). Job* m_parentJob; int m_extraFlags; @@ -106,7 +106,7 @@ public: unsigned long m_userTimestamp; }; -Job::Job(bool showProgressInfo) : QObject(0, "job"), m_error(0), m_percent(0) +Job::Job(bool showProgressInfo) : TQObject(0, "job"), m_error(0), m_percent(0) , m_progressId(0), m_speedTimer(0), d( new JobPrivate ) { // All jobs delete themselves after emiting 'result'. @@ -115,19 +115,19 @@ Job::Job(bool showProgressInfo) : QObject(0, "job"), m_error(0), m_percent(0) if ( showProgressInfo ) { m_progressId = Observer::self()->newJob( this, true ); - addMetaData("progress-id", QString::number(m_progressId)); + addMetaData("progress-id", TQString::number(m_progressId)); //kdDebug(7007) << "Created job " << this << " with progress info -- m_progressId=" << m_progressId << endl; // Connect global progress info signals - connect( this, SIGNAL( percent( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( infoMessage( KIO::Job*, const QString & ) ), - Observer::self(), SLOT( slotInfoMessage( KIO::Job*, const QString & ) ) ); - connect( this, SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), - Observer::self(), SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( this, SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), - Observer::self(), SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( this, SIGNAL( speed( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotSpeed( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( percent( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( infoMessage( KIO::Job*, const TQString & ) ), + Observer::self(), TQT_SLOT( slotInfoMessage( KIO::Job*, const TQString & ) ) ); + connect( this, TQT_SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), + Observer::self(), TQT_SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( this, TQT_SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), + Observer::self(), TQT_SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( this, TQT_SIGNAL( speed( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotSpeed( KIO::Job*, unsigned long ) ) ); } // Don't exit while this job is running if (kapp) @@ -164,15 +164,15 @@ void Job::addSubjob(Job *job, bool inheritMetaData) //kdDebug(7007) << "addSubjob(" << job << ") this = " << this << endl; subjobs.append(job); - connect( job, SIGNAL(result(KIO::Job*)), - SLOT(slotResult(KIO::Job*)) ); + connect( job, TQT_SIGNAL(result(KIO::Job*)), + TQT_SLOT(slotResult(KIO::Job*)) ); // Forward information from that subjob. - connect( job, SIGNAL(speed( KIO::Job*, unsigned long )), - SLOT(slotSpeed(KIO::Job*, unsigned long)) ); + connect( job, TQT_SIGNAL(speed( KIO::Job*, unsigned long )), + TQT_SLOT(slotSpeed(KIO::Job*, unsigned long)) ); - connect( job, SIGNAL(infoMessage( KIO::Job*, const QString & )), - SLOT(slotInfoMessage(KIO::Job*, const QString &)) ); + connect( job, TQT_SIGNAL(infoMessage( KIO::Job*, const TQString & )), + TQT_SLOT(slotInfoMessage(KIO::Job*, const TQString &)) ); if (inheritMetaData) job->mergeMetaData(m_outgoingMetaData); @@ -218,8 +218,8 @@ void Job::emitSpeed( unsigned long bytes_per_second ) //kdDebug(7007) << "Job " << this << " emitSpeed " << bytes_per_second << endl; if ( !m_speedTimer ) { - m_speedTimer = new QTimer(); - connect( m_speedTimer, SIGNAL( timeout() ), SLOT( slotSpeedTimeout() ) ); + m_speedTimer = new TQTimer(); + connect( m_speedTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotSpeedTimeout() ) ); } emit speed( this, bytes_per_second ); m_speedTimer->start( 5000 ); // 5 seconds interval should be enough @@ -240,7 +240,7 @@ void Job::kill( bool quietly ) { kdDebug(7007) << "Job::kill this=" << this << " " << className() << " m_progressId=" << m_progressId << " quietly=" << quietly << endl; // kill all subjobs, without triggering their result slot - QPtrListIterator<Job> it( subjobs ); + TQPtrListIterator<Job> it( subjobs ); for ( ; it.current() ; ++it ) (*it)->kill( true ); subjobs.clear(); @@ -275,7 +275,7 @@ void Job::slotSpeed( KIO::Job*, unsigned long speed ) emitSpeed( speed ); } -void Job::slotInfoMessage( KIO::Job*, const QString & msg ) +void Job::slotInfoMessage( KIO::Job*, const TQString & msg ) { emit infoMessage( this, msg ); } @@ -291,7 +291,7 @@ void Job::slotSpeedTimeout() //Job::errorString is implemented in global.cpp -void Job::showErrorDialog( QWidget * parent ) +void Job::showErrorDialog( TQWidget * parent ) { //kdDebug(7007) << "Job::showErrorDialog parent=" << parent << endl; kapp->enableStyles(); @@ -303,9 +303,9 @@ void Job::showErrorDialog( QWidget * parent ) KMessageBox::queuedMessageBox( parent, KMessageBox::Error, errorString() ); #if 0 } else { - QStringList errors = detailedErrorStrings(); - QString caption, err, detail; - QStringList::const_iterator it = errors.begin(); + TQStringList errors = detailedErrorStrings(); + TQString caption, err, detail; + TQStringList::const_iterator it = errors.begin(); if ( it != errors.end() ) caption = *(it++); if ( it != errors.end() ) @@ -318,7 +318,7 @@ void Job::showErrorDialog( QWidget * parent ) } } -void Job::setAutoErrorHandlingEnabled( bool enable, QWidget *parentWidget ) +void Job::setAutoErrorHandlingEnabled( bool enable, TQWidget *parentWidget ) { d->m_autoErrorHandling = enable; d->m_errorParentWidget = parentWidget; @@ -349,13 +349,13 @@ bool Job::isInteractive() const return d->m_interactive; } -void Job::setWindow(QWidget *window) +void Job::setWindow(TQWidget *window) { m_window = window; KIO::Scheduler::registerWindow(window); } -QWidget *Job::window() const +TQWidget *Job::window() const { return m_window; } @@ -390,10 +390,10 @@ MetaData Job::metaData() const return m_incomingMetaData; } -QString Job::queryMetaData(const QString &key) +TQString Job::queryMetaData(const TQString &key) { if (!m_incomingMetaData.contains(key)) - return QString::null; + return TQString::null; return m_incomingMetaData[key]; } @@ -402,21 +402,21 @@ void Job::setMetaData( const KIO::MetaData &_metaData) m_outgoingMetaData = _metaData; } -void Job::addMetaData( const QString &key, const QString &value) +void Job::addMetaData( const TQString &key, const TQString &value) { m_outgoingMetaData.insert(key, value); } -void Job::addMetaData( const QMap<QString,QString> &values) +void Job::addMetaData( const TQMap<TQString,TQString> &values) { - QMapConstIterator<QString,QString> it = values.begin(); + TQMapConstIterator<TQString,TQString> it = values.begin(); for(;it != values.end(); ++it) m_outgoingMetaData.insert(it.key(), it.data()); } -void Job::mergeMetaData( const QMap<QString,QString> &values) +void Job::mergeMetaData( const TQMap<TQString,TQString> &values) { - QMapConstIterator<QString,QString> it = values.begin(); + TQMapConstIterator<TQString,TQString> it = values.begin(); for(;it != values.end(); ++it) m_outgoingMetaData.insert(it.key(), it.data(), false); } @@ -427,7 +427,7 @@ MetaData Job::outgoingMetaData() const } -SimpleJob::SimpleJob(const KURL& url, int command, const QByteArray &packedArgs, +SimpleJob::SimpleJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo ) : Job(showProgressInfo), m_slave(0), m_packedArgs(packedArgs), m_url(url), m_command(command), m_totalSize(0) @@ -449,7 +449,7 @@ SimpleJob::SimpleJob(const KURL& url, int command, const QByteArray &packedArgs, kdDebug() << "ERR_MALFORMED_URL" << endl; m_error = ERR_MALFORMED_URL; m_errorText = m_url.url(); - QTimer::singleShot(0, this, SLOT(slotFinished()) ); + TQTimer::singleShot(0, this, TQT_SLOT(slotFinished()) ); return; } } @@ -495,51 +495,51 @@ void SimpleJob::start(Slave *slave) { m_slave = slave; - connect( m_slave, SIGNAL( error( int , const QString & ) ), - SLOT( slotError( int , const QString & ) ) ); + connect( m_slave, TQT_SIGNAL( error( int , const TQString & ) ), + TQT_SLOT( slotError( int , const TQString & ) ) ); - connect( m_slave, SIGNAL( warning( const QString & ) ), - SLOT( slotWarning( const QString & ) ) ); + connect( m_slave, TQT_SIGNAL( warning( const TQString & ) ), + TQT_SLOT( slotWarning( const TQString & ) ) ); - connect( m_slave, SIGNAL( infoMessage( const QString & ) ), - SLOT( slotInfoMessage( const QString & ) ) ); + connect( m_slave, TQT_SIGNAL( infoMessage( const TQString & ) ), + TQT_SLOT( slotInfoMessage( const TQString & ) ) ); - connect( m_slave, SIGNAL( connected() ), - SLOT( slotConnected() ) ); + connect( m_slave, TQT_SIGNAL( connected() ), + TQT_SLOT( slotConnected() ) ); - connect( m_slave, SIGNAL( finished() ), - SLOT( slotFinished() ) ); + connect( m_slave, TQT_SIGNAL( finished() ), + TQT_SLOT( slotFinished() ) ); if ((extraFlags() & EF_TransferJobDataSent) == 0) { - connect( m_slave, SIGNAL( totalSize( KIO::filesize_t ) ), - SLOT( slotTotalSize( KIO::filesize_t ) ) ); + connect( m_slave, TQT_SIGNAL( totalSize( KIO::filesize_t ) ), + TQT_SLOT( slotTotalSize( KIO::filesize_t ) ) ); - connect( m_slave, SIGNAL( processedSize( KIO::filesize_t ) ), - SLOT( slotProcessedSize( KIO::filesize_t ) ) ); + connect( m_slave, TQT_SIGNAL( processedSize( KIO::filesize_t ) ), + TQT_SLOT( slotProcessedSize( KIO::filesize_t ) ) ); - connect( m_slave, SIGNAL( speed( unsigned long ) ), - SLOT( slotSpeed( unsigned long ) ) ); + connect( m_slave, TQT_SIGNAL( speed( unsigned long ) ), + TQT_SLOT( slotSpeed( unsigned long ) ) ); } - connect( slave, SIGNAL( needProgressId() ), - SLOT( slotNeedProgressId() ) ); + connect( slave, TQT_SIGNAL( needProgressId() ), + TQT_SLOT( slotNeedProgressId() ) ); - connect( slave, SIGNAL(metaData( const KIO::MetaData& ) ), - SLOT( slotMetaData( const KIO::MetaData& ) ) ); + connect( slave, TQT_SIGNAL(metaData( const KIO::MetaData& ) ), + TQT_SLOT( slotMetaData( const KIO::MetaData& ) ) ); if (m_window) { - QString id; + TQString id; addMetaData("window-id", id.setNum((ulong)m_window->winId())); } if (userTimestamp()) { - QString id; + TQString id; addMetaData("user-timestamp", id.setNum(userTimestamp())); } - QString sslSession = KSSLCSessionCache::getSessionForURL(m_url); + TQString sslSession = KSSLCSessionCache::getSessionForURL(m_url); if ( !sslSession.isNull() ) { addMetaData("ssl_session_id", sslSession); @@ -592,7 +592,7 @@ void SimpleJob::slotFinished( ) else /*if ( m_command == CMD_RENAME )*/ { KURL src, dst; - QDataStream str( m_packedArgs, IO_ReadOnly ); + TQDataStream str( m_packedArgs, IO_ReadOnly ); str >> src >> dst; if ( src.directory() == dst.directory() ) // For the user, moving isn't renaming. Only renaming is. allDirNotify.FileRenamed( src, dst ); @@ -602,19 +602,19 @@ void SimpleJob::slotFinished( ) } } -void SimpleJob::slotError( int error, const QString & errorText ) +void SimpleJob::slotError( int error, const TQString & errorText ) { m_error = error; m_errorText = errorText; if ((m_error == ERR_UNKNOWN_HOST) && m_url.host().isEmpty()) - m_errorText = QString::null; + m_errorText = TQString::null; // error terminates the job slotFinished(); } -void SimpleJob::slotWarning( const QString & errorText ) +void SimpleJob::slotWarning( const TQString & errorText ) { - QGuardedPtr<SimpleJob> guard( this ); + TQGuardedPtr<SimpleJob> guard( this ); if (isInteractive() && isAutoWarningHandlingEnabled()) { static uint msgBoxDisplayed = 0; @@ -631,7 +631,7 @@ void SimpleJob::slotWarning( const QString & errorText ) emit warning( this, errorText ); } -void SimpleJob::slotInfoMessage( const QString & msg ) +void SimpleJob::slotInfoMessage( const TQString & msg ) { emit infoMessage( this, msg ); } @@ -680,7 +680,7 @@ void SimpleJob::slotMetaData( const KIO::MetaData &_metaData) } void SimpleJob::storeSSLSessionFromJob(const KURL &m_redirectionURL) { - QString sslSession = queryMetaData("ssl_session_id"); + TQString sslSession = queryMetaData("ssl_session_id"); if ( !sslSession.isNull() ) { const KURL &queryURL = m_redirectionURL.isEmpty()?m_url:m_redirectionURL; @@ -690,15 +690,15 @@ void SimpleJob::storeSSLSessionFromJob(const KURL &m_redirectionURL) { ////////// MkdirJob::MkdirJob( const KURL& url, int command, - const QByteArray &packedArgs, bool showProgressInfo ) + const TQByteArray &packedArgs, bool showProgressInfo ) : SimpleJob(url, command, packedArgs, showProgressInfo) { } void MkdirJob::start(Slave *slave) { - connect( slave, SIGNAL( redirection(const KURL &) ), - SLOT( slotRedirection(const KURL &) ) ); + connect( slave, TQT_SIGNAL( redirection(const KURL &) ), + TQT_SLOT( slotRedirection(const KURL &) ) ); SimpleJob::start(slave); } @@ -733,13 +733,13 @@ void MkdirJob::slotFinished() emit permanentRedirection(this, m_url, m_redirectionURL); KURL dummyUrl; int permissions; - QDataStream istream( m_packedArgs, IO_ReadOnly ); + TQDataStream istream( m_packedArgs, IO_ReadOnly ); istream >> dummyUrl >> permissions; m_url = m_redirectionURL; m_redirectionURL = KURL(); m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url << permissions; // Return slave to the scheduler @@ -776,30 +776,30 @@ SimpleJob *KIO::rename( const KURL& src, const KURL & dest, bool overwrite ) return new SimpleJob(src, CMD_RENAME, packedArgs, false); } -SimpleJob *KIO::symlink( const QString& target, const KURL & dest, bool overwrite, bool showProgressInfo ) +SimpleJob *KIO::symlink( const TQString& target, const KURL & dest, bool overwrite, bool showProgressInfo ) { //kdDebug(7007) << "symlink target=" << target << " " << dest << endl; KIO_ARGS << target << dest << (Q_INT8) overwrite; return new SimpleJob(dest, CMD_SYMLINK, packedArgs, showProgressInfo); } -SimpleJob *KIO::special(const KURL& url, const QByteArray & data, bool showProgressInfo) +SimpleJob *KIO::special(const KURL& url, const TQByteArray & data, bool showProgressInfo) { //kdDebug(7007) << "special " << url << endl; return new SimpleJob(url, CMD_SPECIAL, data, showProgressInfo); } -SimpleJob *KIO::mount( bool ro, const char *fstype, const QString& dev, const QString& point, bool showProgressInfo ) +SimpleJob *KIO::mount( bool ro, const char *fstype, const TQString& dev, const TQString& point, bool showProgressInfo ) { KIO_ARGS << int(1) << Q_INT8( ro ? 1 : 0 ) - << QString::fromLatin1(fstype) << dev << point; + << TQString::fromLatin1(fstype) << dev << point; SimpleJob *job = special( KURL("file:/"), packedArgs, showProgressInfo ); if ( showProgressInfo ) Observer::self()->mounting( job, dev, point ); return job; } -SimpleJob *KIO::unmount( const QString& point, bool showProgressInfo ) +SimpleJob *KIO::unmount( const TQString& point, bool showProgressInfo ) { KIO_ARGS << int(2) << point; SimpleJob *job = special( KURL("file:/"), packedArgs, showProgressInfo ); @@ -813,7 +813,7 @@ SimpleJob *KIO::unmount( const QString& point, bool showProgressInfo ) ////////// StatJob::StatJob( const KURL& url, int command, - const QByteArray &packedArgs, bool showProgressInfo ) + const TQByteArray &packedArgs, bool showProgressInfo ) : SimpleJob(url, command, packedArgs, showProgressInfo), m_bSource(true), m_details(2) { @@ -822,12 +822,12 @@ StatJob::StatJob( const KURL& url, int command, void StatJob::start(Slave *slave) { m_outgoingMetaData.replace( "statSide", m_bSource ? "source" : "dest" ); - m_outgoingMetaData.replace( "details", QString::number(m_details) ); + m_outgoingMetaData.replace( "details", TQString::number(m_details) ); - connect( slave, SIGNAL( statEntry( const KIO::UDSEntry& ) ), - SLOT( slotStatEntry( const KIO::UDSEntry & ) ) ); - connect( slave, SIGNAL( redirection(const KURL &) ), - SLOT( slotRedirection(const KURL &) ) ); + connect( slave, TQT_SIGNAL( statEntry( const KIO::UDSEntry& ) ), + TQT_SLOT( slotStatEntry( const KIO::UDSEntry & ) ) ); + connect( slave, TQT_SIGNAL( redirection(const KURL &) ), + TQT_SLOT( slotRedirection(const KURL &) ) ); SimpleJob::start(slave); } @@ -869,7 +869,7 @@ void StatJob::slotFinished() m_url = m_redirectionURL; m_redirectionURL = KURL(); m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url; // Return slave to the scheduler @@ -914,8 +914,8 @@ SimpleJob *KIO::http_update_cache( const KURL& url, bool no_cache, time_t expire ////////// TransferJob::TransferJob( const KURL& url, int command, - const QByteArray &packedArgs, - const QByteArray &_staticData, + const TQByteArray &packedArgs, + const TQByteArray &_staticData, bool showProgressInfo) : SimpleJob(url, command, packedArgs, showProgressInfo), staticData( _staticData) { @@ -927,7 +927,7 @@ TransferJob::TransferJob( const KURL& url, int command, } // Slave sends data -void TransferJob::slotData( const QByteArray &_data) +void TransferJob::slotData( const TQByteArray &_data) { if(m_redirectionURL.isEmpty() || !m_redirectionURL.isValid() || m_error) emit data( this, _data); @@ -985,13 +985,13 @@ void TransferJob::slotFinished() m_url = m_redirectionURL; m_redirectionURL = KURL(); // The very tricky part is the packed arguments business - QString dummyStr; + TQString dummyStr; KURL dummyUrl; - QDataStream istream( m_packedArgs, IO_ReadOnly ); + TQDataStream istream( m_packedArgs, IO_ReadOnly ); switch( m_command ) { case CMD_GET: { m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url; break; } @@ -1000,7 +1000,7 @@ void TransferJob::slotFinished() Q_INT8 iOverwrite, iResume; istream >> dummyUrl >> iOverwrite >> iResume >> permissions; m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url << iOverwrite << iResume << permissions; break; } @@ -1011,7 +1011,7 @@ void TransferJob::slotFinished() { addMetaData("cache","reload"); m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url; m_command = CMD_GET; } @@ -1033,7 +1033,7 @@ void TransferJob::setAsyncDataEnabled(bool enabled) extraFlags() &= ~EF_TransferJobAsync; } -void TransferJob::sendAsyncData(const QByteArray &dataForSlave) +void TransferJob::sendAsyncData(const TQByteArray &dataForSlave) { if (extraFlags() & EF_TransferJobNeedData) { @@ -1070,14 +1070,14 @@ bool TransferJob::reportDataSent() // Slave requests data void TransferJob::slotDataReq() { - QByteArray dataForSlave; + TQByteArray dataForSlave; extraFlags() |= EF_TransferJobNeedData; if (!staticData.isEmpty()) { dataForSlave = staticData; - staticData = QByteArray(); + staticData = TQByteArray(); } else { @@ -1105,7 +1105,7 @@ void TransferJob::slotDataReq() } } -void TransferJob::slotMimetype( const QString& type ) +void TransferJob::slotMimetype( const TQString& type ) { m_mimetype = type; emit mimetype( this, m_mimetype); @@ -1129,26 +1129,26 @@ void TransferJob::resume() void TransferJob::start(Slave *slave) { assert(slave); - connect( slave, SIGNAL( data( const QByteArray & ) ), - SLOT( slotData( const QByteArray & ) ) ); + connect( slave, TQT_SIGNAL( data( const TQByteArray & ) ), + TQT_SLOT( slotData( const TQByteArray & ) ) ); - connect( slave, SIGNAL( dataReq() ), - SLOT( slotDataReq() ) ); + connect( slave, TQT_SIGNAL( dataReq() ), + TQT_SLOT( slotDataReq() ) ); - connect( slave, SIGNAL( redirection(const KURL &) ), - SLOT( slotRedirection(const KURL &) ) ); + connect( slave, TQT_SIGNAL( redirection(const KURL &) ), + TQT_SLOT( slotRedirection(const KURL &) ) ); - connect( slave, SIGNAL(mimeType( const QString& ) ), - SLOT( slotMimetype( const QString& ) ) ); + connect( slave, TQT_SIGNAL(mimeType( const TQString& ) ), + TQT_SLOT( slotMimetype( const TQString& ) ) ); - connect( slave, SIGNAL(errorPage() ), - SLOT( slotErrorPage() ) ); + connect( slave, TQT_SIGNAL(errorPage() ), + TQT_SLOT( slotErrorPage() ) ); - connect( slave, SIGNAL( needSubURLData() ), - SLOT( slotNeedSubURLData() ) ); + connect( slave, TQT_SIGNAL( needSubURLData() ), + TQT_SLOT( slotNeedSubURLData() ) ); - connect( slave, SIGNAL(canResume( KIO::filesize_t ) ), - SLOT( slotCanResume( KIO::filesize_t ) ) ); + connect( slave, TQT_SIGNAL(canResume( KIO::filesize_t ) ), + TQT_SLOT( slotCanResume( KIO::filesize_t ) ) ); if (slave->suspended()) { @@ -1167,12 +1167,12 @@ void TransferJob::slotNeedSubURLData() // Job needs data from subURL. m_subJob = KIO::get( m_subUrl, false, false); suspend(); // Put job on hold until we have some data. - connect(m_subJob, SIGNAL( data(KIO::Job*,const QByteArray &)), - SLOT( slotSubURLData(KIO::Job*,const QByteArray &))); + connect(m_subJob, TQT_SIGNAL( data(KIO::Job*,const TQByteArray &)), + TQT_SLOT( slotSubURLData(KIO::Job*,const TQByteArray &))); addSubjob(m_subJob); } -void TransferJob::slotSubURLData(KIO::Job*, const QByteArray &data) +void TransferJob::slotSubURLData(KIO::Job*, const TQByteArray &data) { // The Alternating Bitburg protocol in action again. staticData = data; @@ -1221,7 +1221,7 @@ TransferJob *KIO::get( const KURL& url, bool reload, bool showProgressInfo ) { // Send decoded path and encoded query KIO_ARGS << url; - TransferJob * job = new TransferJob( url, CMD_GET, packedArgs, QByteArray(), showProgressInfo ); + TransferJob * job = new TransferJob( url, CMD_GET, packedArgs, TQByteArray(), showProgressInfo ); if (reload) job->addMetaData("cache", "reload"); return job; @@ -1231,7 +1231,7 @@ class PostErrorJob : public TransferJob { public: - PostErrorJob(int _error, const QString& url, const QByteArray &packedArgs, const QByteArray &postData, bool showProgressInfo) + PostErrorJob(int _error, const TQString& url, const TQByteArray &packedArgs, const TQByteArray &postData, bool showProgressInfo) : TransferJob(KURL(), CMD_SPECIAL, packedArgs, postData, showProgressInfo) { m_error = _error; @@ -1240,7 +1240,7 @@ public: }; -TransferJob *KIO::http_post( const KURL& url, const QByteArray &postData, bool showProgressInfo ) +TransferJob *KIO::http_post( const KURL& url, const TQByteArray &postData, bool showProgressInfo ) { int _error = 0; @@ -1317,15 +1317,15 @@ TransferJob *KIO::http_post( const KURL& url, const QByteArray &postData, bool s if( _error ) { static bool override_loaded = false; - static QValueList< int >* overriden_ports = NULL; + static TQValueList< int >* overriden_ports = NULL; if( !override_loaded ) { KConfig cfg( "kio_httprc", true ); - overriden_ports = new QValueList< int >; + overriden_ports = new TQValueList< int >; *overriden_ports = cfg.readIntListEntry( "OverriddenPorts" ); override_loaded = true; } - for( QValueList< int >::ConstIterator it = overriden_ports->begin(); + for( TQValueList< int >::ConstIterator it = overriden_ports->begin(); it != overriden_ports->end(); ++it ) if( overriden_ports->contains( url.port())) @@ -1361,7 +1361,7 @@ TransferJob *KIO::http_post( const KURL& url, const QByteArray &postData, bool s packedArgs, postData, showProgressInfo ); if (redirection) - QTimer::singleShot(0, job, SLOT(slotPostRedirection()) ); + TQTimer::singleShot(0, job, TQT_SLOT(slotPostRedirection()) ); return job; } @@ -1381,43 +1381,43 @@ TransferJob *KIO::put( const KURL& url, int permissions, bool overwrite, bool resume, bool showProgressInfo ) { KIO_ARGS << url << Q_INT8( overwrite ? 1 : 0 ) << Q_INT8( resume ? 1 : 0 ) << permissions; - TransferJob * job = new TransferJob( url, CMD_PUT, packedArgs, QByteArray(), showProgressInfo ); + TransferJob * job = new TransferJob( url, CMD_PUT, packedArgs, TQByteArray(), showProgressInfo ); return job; } ////////// StoredTransferJob::StoredTransferJob(const KURL& url, int command, - const QByteArray &packedArgs, - const QByteArray &_staticData, + const TQByteArray &packedArgs, + const TQByteArray &_staticData, bool showProgressInfo) : TransferJob( url, command, packedArgs, _staticData, showProgressInfo ), m_uploadOffset( 0 ) { - connect( this, SIGNAL( data( KIO::Job *, const QByteArray & ) ), - SLOT( slotStoredData( KIO::Job *, const QByteArray & ) ) ); - connect( this, SIGNAL( dataReq( KIO::Job *, QByteArray & ) ), - SLOT( slotStoredDataReq( KIO::Job *, QByteArray & ) ) ); + connect( this, TQT_SIGNAL( data( KIO::Job *, const TQByteArray & ) ), + TQT_SLOT( slotStoredData( KIO::Job *, const TQByteArray & ) ) ); + connect( this, TQT_SIGNAL( dataReq( KIO::Job *, TQByteArray & ) ), + TQT_SLOT( slotStoredDataReq( KIO::Job *, TQByteArray & ) ) ); } -void StoredTransferJob::setData( const QByteArray& arr ) +void StoredTransferJob::setData( const TQByteArray& arr ) { Q_ASSERT( m_data.isNull() ); // check that we're only called once Q_ASSERT( m_uploadOffset == 0 ); // no upload started yet m_data = arr; } -void StoredTransferJob::slotStoredData( KIO::Job *, const QByteArray &data ) +void StoredTransferJob::slotStoredData( KIO::Job *, const TQByteArray &data ) { // check for end-of-data marker: if ( data.size() == 0 ) return; unsigned int oldSize = m_data.size(); - m_data.resize( oldSize + data.size(), QGArray::SpeedOptim ); + m_data.resize( oldSize + data.size(), TQGArray::SpeedOptim ); memcpy( m_data.data() + oldSize, data.data(), data.size() ); } -void StoredTransferJob::slotStoredDataReq( KIO::Job *, QByteArray &data ) +void StoredTransferJob::slotStoredDataReq( KIO::Job *, TQByteArray &data ) { // Inspired from kmail's KMKernel::byteArrayToRemoteFile // send the data in 64 KB chunks @@ -1432,7 +1432,7 @@ void StoredTransferJob::slotStoredDataReq( KIO::Job *, QByteArray &data ) } else { // send the remaining bytes to the receiver (deep copy) data.duplicate( m_data.data() + m_uploadOffset, remainingBytes ); - m_data = QByteArray(); + m_data = TQByteArray(); m_uploadOffset = 0; //kdDebug() << "Sending " << remainingBytes << " bytes\n"; } @@ -1442,17 +1442,17 @@ StoredTransferJob *KIO::storedGet( const KURL& url, bool reload, bool showProgre { // Send decoded path and encoded query KIO_ARGS << url; - StoredTransferJob * job = new StoredTransferJob( url, CMD_GET, packedArgs, QByteArray(), showProgressInfo ); + StoredTransferJob * job = new StoredTransferJob( url, CMD_GET, packedArgs, TQByteArray(), showProgressInfo ); if (reload) job->addMetaData("cache", "reload"); return job; } -StoredTransferJob *KIO::storedPut( const QByteArray& arr, const KURL& url, int permissions, +StoredTransferJob *KIO::storedPut( const TQByteArray& arr, const KURL& url, int permissions, bool overwrite, bool resume, bool showProgressInfo ) { KIO_ARGS << url << Q_INT8( overwrite ? 1 : 0 ) << Q_INT8( resume ? 1 : 0 ) << permissions; - StoredTransferJob * job = new StoredTransferJob( url, CMD_PUT, packedArgs, QByteArray(), showProgressInfo ); + StoredTransferJob * job = new StoredTransferJob( url, CMD_PUT, packedArgs, TQByteArray(), showProgressInfo ); job->setData( arr ); return job; } @@ -1460,8 +1460,8 @@ StoredTransferJob *KIO::storedPut( const QByteArray& arr, const KURL& url, int p ////////// MimetypeJob::MimetypeJob( const KURL& url, int command, - const QByteArray &packedArgs, bool showProgressInfo ) - : TransferJob(url, command, packedArgs, QByteArray(), showProgressInfo) + const TQByteArray &packedArgs, bool showProgressInfo ) + : TransferJob(url, command, packedArgs, TQByteArray(), showProgressInfo) { } @@ -1480,7 +1480,7 @@ void MimetypeJob::slotFinished( ) // Due to the "protocol doesn't support listing" code in KRun, we // assumed it was a file. kdDebug(7007) << "It is in fact a directory!" << endl; - m_mimetype = QString::fromLatin1("inode/directory"); + m_mimetype = TQString::fromLatin1("inode/directory"); emit TransferJob::mimetype( this, m_mimetype ); m_error = 0; } @@ -1497,7 +1497,7 @@ void MimetypeJob::slotFinished( ) m_url = m_redirectionURL; m_redirectionURL = KURL(); m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url; // Return slave to the scheduler @@ -1518,15 +1518,15 @@ MimetypeJob *KIO::mimetype(const KURL& url, bool showProgressInfo ) ////////////////////////// DirectCopyJob::DirectCopyJob( const KURL& url, int command, - const QByteArray &packedArgs, bool showProgressInfo ) + const TQByteArray &packedArgs, bool showProgressInfo ) : SimpleJob(url, command, packedArgs, showProgressInfo) { } void DirectCopyJob::start( Slave* slave ) { - connect( slave, SIGNAL(canResume( KIO::filesize_t ) ), - SLOT( slotCanResume( KIO::filesize_t ) ) ); + connect( slave, TQT_SIGNAL(canResume( KIO::filesize_t ) ), + TQT_SLOT( slotCanResume( KIO::filesize_t ) ) ); SimpleJob::start(slave); } @@ -1573,7 +1573,7 @@ FileCopyJob::FileCopyJob( const KURL& src, const KURL& dest, int permissions, d->m_delJob = 0; d->m_sourceSize = (KIO::filesize_t) -1; d->m_modificationTime = static_cast<time_t>( -1 ); - QTimer::singleShot(0, this, SLOT(slotStart())); + TQTimer::singleShot(0, this, TQT_SLOT(slotStart())); } void FileCopyJob::slotStart() @@ -1667,8 +1667,8 @@ void FileCopyJob::startCopyJob(const KURL &slave_url) m_copyJob = new DirectCopyJob(slave_url, CMD_COPY, packedArgs, false); addSubjob( m_copyJob ); connectSubjob( m_copyJob ); - connect( m_copyJob, SIGNAL(canResume(KIO::Job *, KIO::filesize_t)), - SLOT( slotCanResume(KIO::Job *, KIO::filesize_t))); + connect( m_copyJob, TQT_SIGNAL(canResume(KIO::Job *, KIO::filesize_t)), + TQT_SLOT( slotCanResume(KIO::Job *, KIO::filesize_t))); } void FileCopyJob::startRenameJob(const KURL &slave_url) @@ -1681,14 +1681,14 @@ void FileCopyJob::startRenameJob(const KURL &slave_url) void FileCopyJob::connectSubjob( SimpleJob * job ) { - connect( job, SIGNAL(totalSize( KIO::Job*, KIO::filesize_t )), - this, SLOT( slotTotalSize(KIO::Job*, KIO::filesize_t)) ); + connect( job, TQT_SIGNAL(totalSize( KIO::Job*, KIO::filesize_t )), + this, TQT_SLOT( slotTotalSize(KIO::Job*, KIO::filesize_t)) ); - connect( job, SIGNAL(processedSize( KIO::Job*, KIO::filesize_t )), - this, SLOT( slotProcessedSize(KIO::Job*, KIO::filesize_t)) ); + connect( job, TQT_SIGNAL(processedSize( KIO::Job*, KIO::filesize_t )), + this, TQT_SLOT( slotProcessedSize(KIO::Job*, KIO::filesize_t)) ); - connect( job, SIGNAL(percent( KIO::Job*, unsigned long )), - this, SLOT( slotPercent(KIO::Job*, unsigned long)) ); + connect( job, TQT_SIGNAL(percent( KIO::Job*, unsigned long )), + this, TQT_SLOT( slotPercent(KIO::Job*, unsigned long)) ); } @@ -1729,17 +1729,17 @@ void FileCopyJob::startDataPump() m_getJob = 0L; // for now m_putJob = put( m_dest, m_permissions, m_overwrite, m_resume, false /* no GUI */); if ( d->m_modificationTime != static_cast<time_t>( -1 ) ) { - QDateTime dt; dt.setTime_t( d->m_modificationTime ); + TQDateTime dt; dt.setTime_t( d->m_modificationTime ); m_putJob->addMetaData( "modified", dt.toString( Qt::ISODate ) ); } //kdDebug(7007) << "FileCopyJob: m_putJob = " << m_putJob << " m_dest=" << m_dest << endl; // The first thing the put job will tell us is whether we can // resume or not (this is always emitted) - connect( m_putJob, SIGNAL(canResume(KIO::Job *, KIO::filesize_t)), - SLOT( slotCanResume(KIO::Job *, KIO::filesize_t))); - connect( m_putJob, SIGNAL(dataReq(KIO::Job *, QByteArray&)), - SLOT( slotDataReq(KIO::Job *, QByteArray&))); + connect( m_putJob, TQT_SIGNAL(canResume(KIO::Job *, KIO::filesize_t)), + TQT_SLOT( slotCanResume(KIO::Job *, KIO::filesize_t))); + connect( m_putJob, TQT_SIGNAL(dataReq(KIO::Job *, TQByteArray&)), + TQT_SLOT( slotDataReq(KIO::Job *, TQByteArray&))); addSubjob( m_putJob ); } @@ -1754,7 +1754,7 @@ void FileCopyJob::slotCanResume( KIO::Job* job, KIO::filesize_t offset ) if (!KProtocolManager::autoResume() && !m_overwrite) { - QString newPath; + TQString newPath; KIO::Job* job = ( !m_progressId && parentJob() ) ? parentJob() : this; // Ask confirmation about resuming previous transfer res = Observer::self()->open_RenameDlg( @@ -1798,8 +1798,8 @@ void FileCopyJob::slotCanResume( KIO::Job* job, KIO::filesize_t offset ) m_getJob->addMetaData( "resume", KIO::number(offset) ); // Might or might not get emitted - connect( m_getJob, SIGNAL(canResume(KIO::Job *, KIO::filesize_t)), - SLOT( slotCanResume(KIO::Job *, KIO::filesize_t))); + connect( m_getJob, TQT_SIGNAL(canResume(KIO::Job *, KIO::filesize_t)), + TQT_SLOT( slotCanResume(KIO::Job *, KIO::filesize_t))); } m_putJob->slave()->setOffset( offset ); @@ -1808,10 +1808,10 @@ void FileCopyJob::slotCanResume( KIO::Job* job, KIO::filesize_t offset ) connectSubjob( m_getJob ); // Progress info depends on get m_getJob->resume(); // Order a beer - connect( m_getJob, SIGNAL(data(KIO::Job*,const QByteArray&)), - SLOT( slotData(KIO::Job*,const QByteArray&)) ); - connect( m_getJob, SIGNAL(mimetype(KIO::Job*,const QString&) ), - SLOT(slotMimetype(KIO::Job*,const QString&)) ); + connect( m_getJob, TQT_SIGNAL(data(KIO::Job*,const TQByteArray&)), + TQT_SLOT( slotData(KIO::Job*,const TQByteArray&)) ); + connect( m_getJob, TQT_SIGNAL(mimetype(KIO::Job*,const TQString&) ), + TQT_SLOT(slotMimetype(KIO::Job*,const TQString&)) ); } else // copyjob { @@ -1831,7 +1831,7 @@ void FileCopyJob::slotCanResume( KIO::Job* job, KIO::filesize_t offset ) << " m_getJob=" << m_getJob << " m_putJob=" << m_putJob << endl; } -void FileCopyJob::slotData( KIO::Job * , const QByteArray &data) +void FileCopyJob::slotData( KIO::Job * , const TQByteArray &data) { //kdDebug(7007) << "FileCopyJob::slotData" << endl; //kdDebug(7007) << " data size : " << data.size() << endl; @@ -1851,7 +1851,7 @@ void FileCopyJob::slotData( KIO::Job * , const QByteArray &data) } } -void FileCopyJob::slotDataReq( KIO::Job * , QByteArray &data) +void FileCopyJob::slotDataReq( KIO::Job * , TQByteArray &data) { //kdDebug(7007) << "FileCopyJob::slotDataReq" << endl; if (!m_resumeAnswerSent && !m_getJob) @@ -1869,10 +1869,10 @@ void FileCopyJob::slotDataReq( KIO::Job * , QByteArray &data) m_putJob->suspend(); } data = m_buffer; - m_buffer = QByteArray(); + m_buffer = TQByteArray(); } -void FileCopyJob::slotMimetype( KIO::Job*, const QString& type ) +void FileCopyJob::slotMimetype( KIO::Job*, const TQString& type ) { emit mimetype( this, type ); } @@ -1980,14 +1980,14 @@ SimpleJob *KIO::file_delete( const KURL& src, bool showProgressInfo) ////////// -// KDE 4: Make it const QString & _prefix -ListJob::ListJob(const KURL& u, bool showProgressInfo, bool _recursive, QString _prefix, bool _includeHidden) : - SimpleJob(u, CMD_LISTDIR, QByteArray(), showProgressInfo), +// KDE 4: Make it const TQString & _prefix +ListJob::ListJob(const KURL& u, bool showProgressInfo, bool _recursive, TQString _prefix, bool _includeHidden) : + SimpleJob(u, CMD_LISTDIR, TQByteArray(), showProgressInfo), recursive(_recursive), includeHidden(_includeHidden), prefix(_prefix), m_processedEntries(0) { // We couldn't set the args when calling the parent constructor, // so do it now. - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << u; } @@ -2031,7 +2031,7 @@ void ListJob::slotListEntries( const KIO::UDSEntryList& list ) } } if (isDir && !isLink) { - const QString filename = itemURL.fileName(); + const TQString filename = itemURL.fileName(); // skip hidden dirs when listing if requested if (filename != ".." && filename != "." && (includeHidden || filename[0] != '.')) { ListJob *job = new ListJob(itemURL, @@ -2040,9 +2040,9 @@ void ListJob::slotListEntries( const KIO::UDSEntryList& list ) prefix + filename + "/", includeHidden); Scheduler::scheduleJob(job); - connect(job, SIGNAL(entries( KIO::Job *, + connect(job, TQT_SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList& )), - SLOT( gotEntries( KIO::Job*, + TQT_SLOT( gotEntries( KIO::Job*, const KIO::UDSEntryList& ))); addSubjob(job); } @@ -2065,7 +2065,7 @@ void ListJob::slotListEntries( const KIO::UDSEntryList& list ) UDSEntry newone = *it; UDSEntry::Iterator it2 = newone.begin(); - QString filename; + TQString filename; for( ; it2 != newone.end(); it2++ ) { if ((*it2).m_uds == UDS_NAME) { filename = (*it2).m_str; @@ -2115,7 +2115,7 @@ void ListJob::slotFinished() if ( m_error == KIO::ERR_IS_FILE && m_url.isLocalFile() ) { KMimeType::Ptr ptr = KMimeType::findByURL( m_url, 0, true, true ); if ( ptr ) { - QString proto = ptr->property("X-KDE-LocalProtocol").toString(); + TQString proto = ptr->property("X-KDE-LocalProtocol").toString(); if ( !proto.isEmpty() && KProtocolInfo::isKnownProtocol(proto) ) { m_redirectionURL = m_url; m_redirectionURL.setProtocol( proto ); @@ -2135,7 +2135,7 @@ void ListJob::slotFinished() m_url = m_redirectionURL; m_redirectionURL = KURL(); m_packedArgs.truncate(0); - QDataStream stream( m_packedArgs, IO_WriteOnly ); + TQDataStream stream( m_packedArgs, IO_WriteOnly ); stream << m_url; // Return slave to the scheduler @@ -2151,13 +2151,13 @@ void ListJob::slotMetaData( const KIO::MetaData &_metaData) { ListJob *KIO::listDir( const KURL& url, bool showProgressInfo, bool includeHidden ) { - ListJob * job = new ListJob(url, showProgressInfo,false,QString::null,includeHidden); + ListJob * job = new ListJob(url, showProgressInfo,false,TQString::null,includeHidden); return job; } ListJob *KIO::listRecursive( const KURL& url, bool showProgressInfo, bool includeHidden ) { - ListJob * job = new ListJob(url, showProgressInfo, true,QString::null,includeHidden); + ListJob * job = new ListJob(url, showProgressInfo, true,TQString::null,includeHidden); return job; } @@ -2175,15 +2175,15 @@ void ListJob::start(Slave *slave) { m_error = ERR_ACCESS_DENIED; m_errorText = m_url.url(); - QTimer::singleShot(0, this, SLOT(slotFinished()) ); + TQTimer::singleShot(0, this, TQT_SLOT(slotFinished()) ); return; } - connect( slave, SIGNAL( listEntries( const KIO::UDSEntryList& )), - SLOT( slotListEntries( const KIO::UDSEntryList& ))); - connect( slave, SIGNAL( totalSize( KIO::filesize_t ) ), - SLOT( slotTotalSize( KIO::filesize_t ) ) ); - connect( slave, SIGNAL( redirection(const KURL &) ), - SLOT( slotRedirection(const KURL &) ) ); + connect( slave, TQT_SIGNAL( listEntries( const KIO::UDSEntryList& )), + TQT_SLOT( slotListEntries( const KIO::UDSEntryList& ))); + connect( slave, TQT_SIGNAL( totalSize( KIO::filesize_t ) ), + TQT_SLOT( slotTotalSize( KIO::filesize_t ) ) ); + connect( slave, TQT_SIGNAL( redirection(const KURL &) ), + TQT_SLOT( slotRedirection(const KURL &) ) ); SimpleJob::start(slave); } @@ -2208,7 +2208,7 @@ public: bool m_bURLDirty; // Used after copying all the files into the dirs, to set mtime (TODO: and permissions?) // after the copy is done - QValueList<CopyInfo> m_directoriesCopied; + TQValueList<CopyInfo> m_directoriesCopied; }; CopyJob::CopyJob( const KURL::List& src, const KURL& dest, CopyMode mode, bool asMethod, bool showProgressInfo ) @@ -2226,13 +2226,13 @@ CopyJob::CopyJob( const KURL::List& src, const KURL& dest, CopyMode mode, bool a d->m_globalDestinationState = destinationState; if ( showProgressInfo ) { - connect( this, SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); } - QTimer::singleShot(0, this, SLOT(slotStart())); + TQTimer::singleShot(0, this, TQT_SLOT(slotStart())); /** States: STATE_STATING for the dest @@ -2261,9 +2261,9 @@ void CopyJob::slotStart() Calling a function via a signal takes approx. 65 times the time compared to calling it directly (at least on my machine). aleXXX */ - m_reportTimer = new QTimer(this); + m_reportTimer = new TQTimer(this); - connect(m_reportTimer,SIGNAL(timeout()),this,SLOT(slotReport())); + connect(m_reportTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotReport())); m_reportTimer->start(REPORT_TIMEOUT,false); // Stat the dest @@ -2314,8 +2314,8 @@ void CopyJob::slotResultStating( Job *job ) UDSEntry entry = ((StatJob*)job)->statResult(); bool bDir = false; bool bLink = false; - QString sName; - QString sLocalPath; + TQString sName; + TQString sLocalPath; UDSEntry::ConstIterator it2 = entry.begin(); for( ; it2 != entry.end(); it2++ ) { if ( ((*it2).m_uds) == UDS_FILE_TYPE ) @@ -2398,7 +2398,7 @@ void CopyJob::slotResultStating( Job *job ) if ( !m_asMethod ) { // Use <desturl>/<directory_copied> as destination, from now on - QString directory = srcurl.fileName(); + TQString directory = srcurl.fileName(); if ( !sName.isEmpty() && KProtocolInfo::fileNameUsedForCopying( srcurl ) == KProtocolInfo::Name ) { directory = sName; @@ -2502,9 +2502,9 @@ void CopyJob::slotEntries(KIO::Job* job, const UDSEntryList& list) info.mtime = (time_t) -1; info.ctime = (time_t) -1; info.size = (KIO::filesize_t)-1; - QString displayName; + TQString displayName; KURL url; - QString localPath; + TQString localPath; bool isDir = false; for( ; it2 != (*it).end(); it2++ ) { switch ((*it2).m_uds) { @@ -2566,13 +2566,13 @@ void CopyJob::slotEntries(KIO::Job* job, const UDSEntryList& list) // (passed here during stating) but not its children (during listing) ( ! ( m_asMethod && state == STATE_STATING ) ) ) { - QString destFileName; + TQString destFileName; if ( hasCustomURL && KProtocolInfo::fileNameUsedForCopying( url ) == KProtocolInfo::FromURL ) { //destFileName = url.fileName(); // Doesn't work for recursive listing // Count the number of prefixes used by the recursive listjob int numberOfSlashes = displayName.contains( '/' ); // don't make this a find()! - QString path = url.path(); + TQString path = url.path(); int pos = 0; for ( int n = 0; n < numberOfSlashes + 1; ++n ) { pos = path.findRev( '/', pos - 1 ); @@ -2707,7 +2707,7 @@ void CopyJob::statCurrentSrc() // if the file system doesn't support deleting, we do not even stat if (m_mode == Move && !KProtocolInfo::supportsDeleting(m_currentSrcURL)) { - QGuardedPtr<CopyJob> that = this; + TQGuardedPtr<CopyJob> that = this; if (isInteractive()) KMessageBox::information( 0, buildErrorString(ERR_CANNOT_DELETE, m_currentSrcURL.prettyURL())); if (that) @@ -2759,7 +2759,7 @@ void CopyJob::startRenameJob( const KURL& slave_url ) info.size = (KIO::filesize_t)-1; info.uSource = m_currentSrcURL; info.uDest = dest; - QValueList<CopyInfo> files; + TQValueList<CopyInfo> files; files.append(info); emit aboutToCreate( this, files ); @@ -2777,9 +2777,9 @@ void CopyJob::startListing( const KURL & src ) d->m_bURLDirty = true; ListJob * newjob = listRecursive( src, false ); newjob->setUnrestricted(true); - connect(newjob, SIGNAL(entries( KIO::Job *, + connect(newjob, TQT_SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList& )), - SLOT( slotEntries( KIO::Job*, + TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList& ))); addSubjob( newjob ); } @@ -2798,20 +2798,20 @@ void CopyJob::skip( const KURL & sourceUrl ) dirsToRemove.remove( sourceUrl ); } -bool CopyJob::shouldOverwrite( const QString& path ) const +bool CopyJob::shouldOverwrite( const TQString& path ) const { if ( m_bOverwriteAll ) return true; - QStringList::ConstIterator sit = m_overwriteList.begin(); + TQStringList::ConstIterator sit = m_overwriteList.begin(); for( ; sit != m_overwriteList.end(); ++sit ) if ( path.startsWith( *sit ) ) return true; return false; } -bool CopyJob::shouldSkip( const QString& path ) const +bool CopyJob::shouldSkip( const TQString& path ) const { - QStringList::ConstIterator sit = m_skipList.begin(); + TQStringList::ConstIterator sit = m_skipList.begin(); for( ; sit != m_skipList.end(); ++sit ) if ( path.startsWith( *sit ) ) return true; @@ -2821,7 +2821,7 @@ bool CopyJob::shouldSkip( const QString& path ) const void CopyJob::slotResultCreatingDirs( Job * job ) { // The dir we are trying to create: - QValueList<CopyInfo>::Iterator it = dirs.begin(); + TQValueList<CopyInfo>::Iterator it = dirs.begin(); // Was there an error creating a dir ? if ( job->error() ) { @@ -2838,7 +2838,7 @@ void CopyJob::slotResultCreatingDirs( Job * job ) dirs.remove( it ); // Move on to next dir } else { // Did the user choose to overwrite already? - const QString destFile = (*it).uDest.path(); + const TQString destFile = (*it).uDest.path(); if ( shouldOverwrite( destFile ) ) { // overwrite => just skip emit copyingDone( this, ( *it ).uSource, ( *it ).uDest, true /* directory */, false /* renamed */ ); dirs.remove( it ); // Move on to next dir @@ -2890,12 +2890,12 @@ void CopyJob::slotResultConflictCreatingDirs( KIO::Job * job ) // We come here after a conflict has been detected and we've stated the existing dir // The dir we were trying to create: - QValueList<CopyInfo>::Iterator it = dirs.begin(); + TQValueList<CopyInfo>::Iterator it = dirs.begin(); // Its modification time: time_t destmtime = (time_t)-1; time_t destctime = (time_t)-1; KIO::filesize_t destsize = 0; - QString linkDest; + TQString linkDest; UDSEntry entry = ((KIO::StatJob*)job)->statResult(); KIO::UDSEntry::ConstIterator it2 = entry.begin(); @@ -2931,8 +2931,8 @@ void CopyJob::slotResultConflictCreatingDirs( KIO::Job * job ) mode = (RenameDlg_Mode)( mode | M_OVERWRITE ); } - QString existingDest = (*it).uDest.path(); - QString newPath; + TQString existingDest = (*it).uDest.path(); + TQString newPath; if (m_reportTimer) m_reportTimer->stop(); RenameDlg_Result r = Observer::self()->open_RenameDlg( this, i18n("Folder Already Exists"), @@ -2951,7 +2951,7 @@ void CopyJob::slotResultConflictCreatingDirs( KIO::Job * job ) return; case R_RENAME: { - QString oldPath = (*it).uDest.path( 1 ); + TQString oldPath = (*it).uDest.path( 1 ); KURL newUrl( (*it).uDest ); newUrl.setPath( newPath ); emit renamed( this, (*it).uDest, newUrl ); // for e.g. kpropsdlg @@ -2959,14 +2959,14 @@ void CopyJob::slotResultConflictCreatingDirs( KIO::Job * job ) // Change the current one and strip the trailing '/' (*it).uDest.setPath( newUrl.path( -1 ) ); newPath = newUrl.path( 1 ); // With trailing slash - QValueList<CopyInfo>::Iterator renamedirit = it; + TQValueList<CopyInfo>::Iterator renamedirit = it; ++renamedirit; // Change the name of subdirectories inside the directory for( ; renamedirit != dirs.end() ; ++renamedirit ) { - QString path = (*renamedirit).uDest.path(); + TQString path = (*renamedirit).uDest.path(); if ( path.left(oldPath.length()) == oldPath ) { - QString n = path; + TQString n = path; n.replace( 0, oldPath.length(), newPath ); kdDebug(7007) << "dirs list: " << (*renamedirit).uSource.path() << " was going to be " << path @@ -2975,12 +2975,12 @@ void CopyJob::slotResultConflictCreatingDirs( KIO::Job * job ) } } // Change filenames inside the directory - QValueList<CopyInfo>::Iterator renamefileit = files.begin(); + TQValueList<CopyInfo>::Iterator renamefileit = files.begin(); for( ; renamefileit != files.end() ; ++renamefileit ) { - QString path = (*renamefileit).uDest.path(); + TQString path = (*renamefileit).uDest.path(); if ( path.left(oldPath.length()) == oldPath ) { - QString n = path; + TQString n = path; n.replace( 0, oldPath.length(), newPath ); kdDebug(7007) << "files list: " << (*renamefileit).uSource.path() << " was going to be " << path @@ -3032,11 +3032,11 @@ void CopyJob::createNextDir() if ( !dirs.isEmpty() ) { // Take first dir to create out of list - QValueList<CopyInfo>::Iterator it = dirs.begin(); + TQValueList<CopyInfo>::Iterator it = dirs.begin(); // Is this URL on the skip list or the overwrite list ? while( it != dirs.end() && udir.isEmpty() ) { - const QString dir = (*it).uDest.path(); + const TQString dir = (*it).uDest.path(); if ( shouldSkip( dir ) ) { dirs.remove( it ); it = dirs.begin(); @@ -3071,7 +3071,7 @@ void CopyJob::createNextDir() void CopyJob::slotResultCopyingFiles( Job * job ) { // The file we were trying to copy: - QValueList<CopyInfo>::Iterator it = files.begin(); + TQValueList<CopyInfo>::Iterator it = files.begin(); if ( job->error() ) { // Should we skip automatically ? @@ -3138,7 +3138,7 @@ void CopyJob::slotResultCopyingFiles( Job * job ) if ( m_bCurrentOperationIsLink ) { - QString target = ( m_mode == Link ? (*it).uSource.path() : (*it).linkDest ); + TQString target = ( m_mode == Link ? (*it).uSource.path() : (*it).linkDest ); //required for the undo feature emit copyingLinkDone( this, (*it).uSource, target, (*it).uDest ); } @@ -3165,10 +3165,10 @@ void CopyJob::slotResultConflictCopyingFiles( KIO::Job * job ) { // We come here after a conflict has been detected and we've stated the existing file // The file we were trying to create: - QValueList<CopyInfo>::Iterator it = files.begin(); + TQValueList<CopyInfo>::Iterator it = files.begin(); RenameDlg_Result res; - QString newPath; + TQString newPath; if (m_reportTimer) m_reportTimer->stop(); @@ -3181,7 +3181,7 @@ void CopyJob::slotResultConflictCopyingFiles( KIO::Job * job ) time_t destmtime = (time_t)-1; time_t destctime = (time_t)-1; KIO::filesize_t destsize = 0; - QString linkDest; + TQString linkDest; UDSEntry entry = ((KIO::StatJob*)job)->statResult(); KIO::UDSEntry::ConstIterator it2 = entry.begin(); for( ; it2 != entry.end(); it2++ ) { @@ -3271,7 +3271,7 @@ void CopyJob::slotResultConflictCopyingFiles( KIO::Job * job ) emit renamed( this, (*it).uDest, newUrl ); // for e.g. kpropsdlg (*it).uDest = newUrl; - QValueList<CopyInfo> files; + TQValueList<CopyInfo> files; files.append(*it); emit aboutToCreate( this, files ); } @@ -3306,11 +3306,11 @@ void CopyJob::copyNextFile() bool bCopyFile = false; //kdDebug(7007) << "CopyJob::copyNextFile()" << endl; // Take the first file in the list - QValueList<CopyInfo>::Iterator it = files.begin(); + TQValueList<CopyInfo>::Iterator it = files.begin(); // Is this URL on the skip list ? while (it != files.end() && !bCopyFile) { - const QString destFile = (*it).uDest.path(); + const TQString destFile = (*it).uDest.path(); bCopyFile = !shouldSkip( destFile ); if ( !bCopyFile ) { files.remove( it ); @@ -3322,7 +3322,7 @@ void CopyJob::copyNextFile() { // Do we set overwrite ? bool bOverwrite; - const QString destFile = (*it).uDest.path(); + const TQString destFile = (*it).uDest.path(); kdDebug(7007) << "copying " << destFile << endl; if ( (*it).uDest == (*it).uSource ) bOverwrite = false; @@ -3359,18 +3359,18 @@ void CopyJob::copyNextFile() bool devicesOk=false; // if the source is a devices url, handle it a littlebit special - if ((*it).uSource.protocol()==QString::fromLatin1("devices")) + if ((*it).uSource.protocol()==TQString::fromLatin1("devices")) { - QByteArray data; - QByteArray param; - QCString retType; - QDataStream streamout(param,IO_WriteOnly); + TQByteArray data; + TQByteArray param; + TQCString retType; + TQDataStream streamout(param,IO_WriteOnly); streamout<<(*it).uSource; streamout<<(*it).uDest; if ( kapp && kapp->dcopClient()->call( "kded", "mountwatcher", "createLink(KURL, KURL)", param,retType,data,false ) ) { - QDataStream streamin(data,IO_ReadOnly); + TQDataStream streamin(data,IO_ReadOnly); streamin>>devicesOk; } if (devicesOk) @@ -3385,9 +3385,9 @@ void CopyJob::copyNextFile() if (!devicesOk) { - QString path = (*it).uDest.path(); + TQString path = (*it).uDest.path(); //kdDebug(7007) << "CopyJob::copyNextFile path=" << path << endl; - QFile f( path ); + TQFile f( path ); if ( f.open( IO_ReadWrite ) ) { f.close(); @@ -3395,20 +3395,20 @@ void CopyJob::copyNextFile() config.setDesktopGroup(); KURL url = (*it).uSource; url.setPass( "" ); - config.writePathEntry( QString::fromLatin1("URL"), url.url() ); - config.writeEntry( QString::fromLatin1("Name"), url.url() ); - config.writeEntry( QString::fromLatin1("Type"), QString::fromLatin1("Link") ); - QString protocol = (*it).uSource.protocol(); - if ( protocol == QString::fromLatin1("ftp") ) - config.writeEntry( QString::fromLatin1("Icon"), QString::fromLatin1("ftp") ); - else if ( protocol == QString::fromLatin1("http") ) - config.writeEntry( QString::fromLatin1("Icon"), QString::fromLatin1("www") ); - else if ( protocol == QString::fromLatin1("info") ) - config.writeEntry( QString::fromLatin1("Icon"), QString::fromLatin1("info") ); - else if ( protocol == QString::fromLatin1("mailto") ) // sven: - config.writeEntry( QString::fromLatin1("Icon"), QString::fromLatin1("kmail") ); // added mailto: support + config.writePathEntry( TQString::fromLatin1("URL"), url.url() ); + config.writeEntry( TQString::fromLatin1("Name"), url.url() ); + config.writeEntry( TQString::fromLatin1("Type"), TQString::fromLatin1("Link") ); + TQString protocol = (*it).uSource.protocol(); + if ( protocol == TQString::fromLatin1("ftp") ) + config.writeEntry( TQString::fromLatin1("Icon"), TQString::fromLatin1("ftp") ); + else if ( protocol == TQString::fromLatin1("http") ) + config.writeEntry( TQString::fromLatin1("Icon"), TQString::fromLatin1("www") ); + else if ( protocol == TQString::fromLatin1("info") ) + config.writeEntry( TQString::fromLatin1("Icon"), TQString::fromLatin1("info") ); + else if ( protocol == TQString::fromLatin1("mailto") ) // sven: + config.writeEntry( TQString::fromLatin1("Icon"), TQString::fromLatin1("kmail") ); // added mailto: support else - config.writeEntry( QString::fromLatin1("Icon"), QString::fromLatin1("unknown") ); + config.writeEntry( TQString::fromLatin1("Icon"), TQString::fromLatin1("unknown") ); config.sync(); files.remove( it ); m_processedFiles++; @@ -3484,10 +3484,10 @@ void CopyJob::copyNextFile() d->m_bURLDirty = true; } addSubjob(newjob); - connect( newjob, SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), - this, SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( newjob, SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), - this, SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( newjob, TQT_SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), + this, TQT_SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( newjob, TQT_SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), + this, TQT_SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); } else { @@ -3524,11 +3524,11 @@ void CopyJob::setNextDirAttribute() state = STATE_SETTING_DIR_ATTRIBUTES; #ifdef Q_OS_UNIX // TODO KDE4: this should use a SlaveBase method, but we have none yet in KDE3. - QValueList<CopyInfo>::Iterator it = d->m_directoriesCopied.begin(); + TQValueList<CopyInfo>::Iterator it = d->m_directoriesCopied.begin(); for ( ; it != d->m_directoriesCopied.end() ; ++it ) { const KURL& url = (*it).uDest; if ( url.isLocalFile() && (*it).mtime != (time_t)-1 ) { - const QCString path = QFile::encodeName( url.path() ); + const TQCString path = TQFile::encodeName( url.path() ); KDE_struct_stat statbuf; if (KDE_lstat(path, &statbuf) == 0) { struct utimbuf utbuf; @@ -3633,7 +3633,7 @@ void CopyJob::slotResultSettingDirAttributes( Job * job ) void CopyJob::slotResultRenaming( Job* job ) { int err = job->error(); - const QString errText = job->errorText(); + const TQString errText = job->errorText(); removeSubjob( job, true, false ); // merge metadata assert ( subjobs.isEmpty() ); // Determine dest again @@ -3652,15 +3652,15 @@ void CopyJob::slotResultRenaming( Job* job ) err == ERR_IDENTICAL_FILES ) ) { kdDebug(7007) << "Couldn't rename directly, dest already exists. Detected special case of lower/uppercase renaming in same dir, try with 2 rename calls" << endl; - QCString _src( QFile::encodeName(m_currentSrcURL.path()) ); - QCString _dest( QFile::encodeName(dest.path()) ); + TQCString _src( TQFile::encodeName(m_currentSrcURL.path()) ); + TQCString _dest( TQFile::encodeName(dest.path()) ); KTempFile tmpFile( m_currentSrcURL.directory(false) ); - QCString _tmp( QFile::encodeName(tmpFile.name()) ); + TQCString _tmp( TQFile::encodeName(tmpFile.name()) ); kdDebug(7007) << "CopyJob::slotResult KTempFile status:" << tmpFile.status() << " using " << _tmp << " as intermediary" << endl; tmpFile.unlink(); if ( ::rename( _src, _tmp ) == 0 ) { - if ( !QFile::exists( _dest ) && ::rename( _tmp, _dest ) == 0 ) + if ( !TQFile::exists( _dest ) && ::rename( _tmp, _dest ) == 0 ) { kdDebug(7007) << "Success." << endl; err = 0; @@ -3706,7 +3706,7 @@ void CopyJob::slotResultRenaming( Job* job ) } else if ( m_bOverwriteAll ) { ; // nothing to do, stat+copy+del will overwrite } else { - QString newPath; + TQString newPath; // If src==dest, use "overwrite-itself" RenameDlg_Mode mode = (RenameDlg_Mode) ( ( m_currentSrcURL == dest ) ? M_OVERWRITE_ITSELF : M_OVERWRITE ); @@ -3728,13 +3728,13 @@ void CopyJob::slotResultRenaming( Job* job ) KDE_struct_stat stat_buf; if ( m_currentSrcURL.isLocalFile() && - KDE_stat(QFile::encodeName(m_currentSrcURL.path()), &stat_buf) == 0 ) { + KDE_stat(TQFile::encodeName(m_currentSrcURL.path()), &stat_buf) == 0 ) { sizeSrc = stat_buf.st_size; ctimeSrc = stat_buf.st_ctime; mtimeSrc = stat_buf.st_mtime; } if ( dest.isLocalFile() && - KDE_stat(QFile::encodeName(dest.path()), &stat_buf) == 0 ) { + KDE_stat(TQFile::encodeName(dest.path()), &stat_buf) == 0 ) { sizeDest = stat_buf.st_size; ctimeDest = stat_buf.st_ctime; mtimeDest = stat_buf.st_mtime; @@ -3967,29 +3967,29 @@ DeleteJob::DeleteJob( const KURL::List& src, bool /*shred*/, bool showProgressIn { if ( showProgressInfo ) { - connect( this, SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); // See slotReport - /*connect( this, SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), - m_observer, SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); + /*connect( this, TQT_SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), + m_observer, TQT_SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), - m_observer, SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), + m_observer, TQT_SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( deleting( KIO::Job*, const KURL& ) ), - m_observer, SLOT( slotDeleting( KIO::Job*, const KURL& ) ) );*/ + connect( this, TQT_SIGNAL( deleting( KIO::Job*, const KURL& ) ), + m_observer, TQT_SLOT( slotDeleting( KIO::Job*, const KURL& ) ) );*/ - m_reportTimer=new QTimer(this); - connect(m_reportTimer,SIGNAL(timeout()),this,SLOT(slotReport())); + m_reportTimer=new TQTimer(this); + connect(m_reportTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotReport())); //this will update the report dialog with 5 Hz, I think this is fast enough, aleXXX m_reportTimer->start(REPORT_TIMEOUT,false); } - QTimer::singleShot(0, this, SLOT(slotStart())); + TQTimer::singleShot(0, this, TQT_SLOT(slotStart())); } void DeleteJob::slotStart() @@ -4040,7 +4040,7 @@ void DeleteJob::slotEntries(KIO::Job* job, const UDSEntryList& list) UDSEntry::ConstIterator it2 = (*it).begin(); bool bDir = false; bool bLink = false; - QString displayName; + TQString displayName; KURL url; int atomsFound(0); for( ; it2 != (*it).end(); it2++ ) @@ -4100,7 +4100,7 @@ void DeleteJob::statNextSrc() // if the file system doesn't support deleting, we do not even stat if (!KProtocolInfo::supportsDeleting(m_currentURL)) { - QGuardedPtr<DeleteJob> that = this; + TQGuardedPtr<DeleteJob> that = this; ++m_currentStat; if (isInteractive()) KMessageBox::information( 0, buildErrorString(ERR_CANNOT_DELETE, m_currentURL.prettyURL())); @@ -4124,7 +4124,7 @@ void DeleteJob::statNextSrc() // To speed things up and prevent double-notification, we disable KDirWatch // on those dirs temporarily (using KDirWatch::self, that's the instanced // used by e.g. kdirlister). - for ( QStringList::Iterator it = m_parentDirs.begin() ; it != m_parentDirs.end() ; ++it ) + for ( TQStringList::Iterator it = m_parentDirs.begin() ; it != m_parentDirs.end() ; ++it ) KDirWatch::self()->stopDirScan( *it ); state = STATE_DELETING_FILES; deleteNextFile(); @@ -4148,7 +4148,7 @@ void DeleteJob::deleteNextFile() } // Normal deletion // If local file, try do it directly - if ( (*it).isLocalFile() && unlink( QFile::encodeName((*it).path()) ) == 0 ) { + if ( (*it).isLocalFile() && unlink( TQFile::encodeName((*it).path()) ) == 0 ) { //kdDebug(7007) << "DeleteJob deleted " << (*it).path() << endl; job = 0; m_processedFiles++; @@ -4185,7 +4185,7 @@ void DeleteJob::deleteNextDir() // Take first dir to delete out of list - last ones first ! KURL::List::Iterator it = dirs.fromLast(); // If local dir, try to rmdir it directly - if ( (*it).isLocalFile() && ::rmdir( QFile::encodeName((*it).path()) ) == 0 ) { + if ( (*it).isLocalFile() && ::rmdir( TQFile::encodeName((*it).path()) ) == 0 ) { m_processedDirs++; if ( m_processedDirs % 100 == 0 ) { // update progress info every 100 dirs @@ -4211,7 +4211,7 @@ void DeleteJob::deleteNextDir() } // Re-enable watching on the dirs that held the deleted files - for ( QStringList::Iterator it = m_parentDirs.begin() ; it != m_parentDirs.end() ; ++it ) + for ( TQStringList::Iterator it = m_parentDirs.begin() ; it != m_parentDirs.end() ; ++it ) KDirWatch::self()->restartDirScan( *it ); // Finished - tell the world @@ -4315,9 +4315,9 @@ void DeleteJob::slotResult( Job *job ) ListJob *newjob = listRecursive( url, false ); newjob->setUnrestricted(true); // No KIOSK restrictions Scheduler::scheduleJob(newjob); - connect(newjob, SIGNAL(entries( KIO::Job *, + connect(newjob, TQT_SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList& )), - SLOT( slotEntries( KIO::Job*, + TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList& ))); addSubjob(newjob); } else { @@ -4399,7 +4399,7 @@ DeleteJob *KIO::del( const KURL::List& src, bool shred, bool showProgressInfo ) MultiGetJob::MultiGetJob(const KURL& url, bool showProgressInfo) - : TransferJob(url, 0, QByteArray(), QByteArray(), showProgressInfo) + : TransferJob(url, 0, TQByteArray(), TQByteArray(), showProgressInfo) { m_waitQueue.setAutoDelete(true); m_activeQueue.setAutoDelete(true); @@ -4409,11 +4409,11 @@ MultiGetJob::MultiGetJob(const KURL& url, void MultiGetJob::get(long id, const KURL &url, const MetaData &metaData) { GetRequest *entry = new GetRequest(id, url, metaData); - entry->metaData["request-id"] = QString("%1").arg(id); + entry->metaData["request-id"] = TQString("%1").arg(id); m_waitQueue.append(entry); } -void MultiGetJob::flushQueue(QPtrList<GetRequest> &queue) +void MultiGetJob::flushQueue(TQPtrList<GetRequest> &queue) { GetRequest *entry; // Use multi-get @@ -4541,18 +4541,18 @@ void MultiGetJob::slotFinished() } } -void MultiGetJob::slotData( const QByteArray &_data) +void MultiGetJob::slotData( const TQByteArray &_data) { if(!m_currentEntry) return;// Error, unknown request! if(m_redirectionURL.isEmpty() || !m_redirectionURL.isValid() || m_error) emit data(m_currentEntry->id, _data); } -void MultiGetJob::slotMimetype( const QString &_mimetype ) +void MultiGetJob::slotMimetype( const TQString &_mimetype ) { if (b_multiGetActive) { - QPtrList<GetRequest> newQueue; + TQPtrList<GetRequest> newQueue; flushQueue(newQueue); if (!newQueue.isEmpty()) { @@ -4579,11 +4579,11 @@ CacheInfo::CacheInfo(const KURL &url) m_url = url; } -QString CacheInfo::cachedFileName() +TQString CacheInfo::cachedFileName() { - const QChar separator = '_'; + const TQChar separator = '_'; - QString CEF = m_url.path(); + TQString CEF = m_url.path(); int p = CEF.find('/'); @@ -4593,10 +4593,10 @@ QString CacheInfo::cachedFileName() p = CEF.find('/', p); } - QString host = m_url.host().lower(); + TQString host = m_url.host().lower(); CEF = host + CEF + '_'; - QString dir = KProtocolManager::cacheDir(); + TQString dir = KProtocolManager::cacheDir(); if (dir[dir.length()-1] != '/') dir += "/"; @@ -4613,13 +4613,13 @@ QString CacheInfo::cachedFileName() dir += "0"; unsigned long hash = 0x00000000; - QCString u = m_url.url().latin1(); + TQCString u = m_url.url().latin1(); for(int i = u.length(); i--;) { hash = (hash * 12211 + u[i]) % 2147483563; } - QString hashString; + TQString hashString; hashString.sprintf("%08lx", hash); CEF = CEF + hashString; @@ -4629,7 +4629,7 @@ QString CacheInfo::cachedFileName() return CEF; } -QFile *CacheInfo::cachedFile() +TQFile *CacheInfo::cachedFile() { #ifdef Q_WS_WIN const char *mode = (readWrite ? "rb+" : "rb"); @@ -4637,7 +4637,7 @@ QFile *CacheInfo::cachedFile() const char *mode = (readWrite ? "r+" : "r"); #endif - FILE *fs = fopen(QFile::encodeName(CEF), mode); // Open for reading and writing + FILE *fs = fopen(TQFile::encodeName(CEF), mode); // Open for reading and writing if (!fs) return 0; @@ -4701,7 +4701,7 @@ QFile *CacheInfo::cachedFile() ok = false; if (ok) { - m_etag = QString(buffer).stripWhiteSpace(); + m_etag = TQString(buffer).stripWhiteSpace(); } // Last-Modified @@ -4709,7 +4709,7 @@ QFile *CacheInfo::cachedFile() ok = false; if (ok) { - m_lastModified = QString(buffer).stripWhiteSpace(); + m_lastModified = TQString(buffer).stripWhiteSpace(); } fclose(fs); @@ -4717,7 +4717,7 @@ QFile *CacheInfo::cachedFile() if (ok) return fs; - unlink( QFile::encodeName(CEF) ); + unlink( TQFile::encodeName(CEF) ); return 0; } diff --git a/kio/kio/job.h b/kio/kio/job.h index 5a10d8577..03edb5024 100644 --- a/kio/kio/job.h +++ b/kio/kio/job.h @@ -87,7 +87,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the job handling the operation. */ - KIO_EXPORT SimpleJob * symlink( const QString & target, const KURL& dest, bool overwrite, bool showProgressInfo = true ); + KIO_EXPORT SimpleJob * symlink( const TQString & target, const KURL& dest, bool overwrite, bool showProgressInfo = true ); /** * Execute any command that is specific to one slave (protocol). @@ -101,7 +101,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the job handling the operation. */ - KIO_EXPORT SimpleJob * special( const KURL& url, const QByteArray & data, bool showProgressInfo = true ); + KIO_EXPORT SimpleJob * special( const KURL& url, const TQByteArray & data, bool showProgressInfo = true ); /** * Mount filesystem. @@ -115,7 +115,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the job handling the operation. */ - KIO_EXPORT SimpleJob *mount( bool ro, const char *fstype, const QString& dev, const QString& point, bool showProgressInfo = true ); + KIO_EXPORT SimpleJob *mount( bool ro, const char *fstype, const TQString& dev, const TQString& point, bool showProgressInfo = true ); /** * Unmount filesystem. @@ -126,7 +126,7 @@ namespace KIO { * @param showProgressInfo true to show progress information * @return the job handling the operation. */ - KIO_EXPORT SimpleJob *unmount( const QString & point, bool showProgressInfo = true ); + KIO_EXPORT SimpleJob *unmount( const TQString & point, bool showProgressInfo = true ); /** * HTTP cache update @@ -230,11 +230,11 @@ namespace KIO { * @param showProgressInfo true to display * @return the job handling the operation. */ - KIO_EXPORT TransferJob *http_post( const KURL& url, const QByteArray &postData, + KIO_EXPORT TransferJob *http_post( const KURL& url, const TQByteArray &postData, bool showProgressInfo = true ); /** - * Get (a.k.a. read), into a single QByteArray. + * Get (a.k.a. read), into a single TQByteArray. * @see StoredTransferJob * * @param url the URL of the file @@ -246,7 +246,7 @@ namespace KIO { KIO_EXPORT StoredTransferJob *storedGet( const KURL& url, bool reload=false, bool showProgressInfo = true ); /** - * Put (a.k.a. write) data from a single QByteArray. + * Put (a.k.a. write) data from a single TQByteArray. * @see StoredTransferJob * * @param arr The data to write @@ -259,7 +259,7 @@ namespace KIO { * @return the job handling the operation. * @since 3.3 */ - KIO_EXPORT StoredTransferJob *storedPut( const QByteArray& arr, const KURL& url, int permissions, + KIO_EXPORT StoredTransferJob *storedPut( const TQByteArray& arr, const KURL& url, int permissions, bool overwrite, bool resume, bool showProgressInfo = true ); /** diff --git a/kio/kio/jobclasses.h b/kio/kio/jobclasses.h index 7f5058661..a6ccd8484 100644 --- a/kio/kio/jobclasses.h +++ b/kio/kio/jobclasses.h @@ -22,11 +22,11 @@ #ifndef __kio_jobclasses_h__ #define __kio_jobclasses_h__ -#include <qobject.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qguardedptr.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> #include <sys/types.h> #include <sys/stat.h> @@ -51,8 +51,8 @@ namespace KIO { * * \code * KIO::Job * job = KIO::someoperation( some parameters ); - * connect( job, SIGNAL( result( KIO::Job * ) ), - * this, SLOT( slotResult( KIO::Job * ) ) ); + * connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + * this, TQT_SLOT( slotResult( KIO::Job * ) ) ); * \endcode * (other connects, specific to the job) * @@ -65,7 +65,7 @@ namespace KIO { * @see KIO::Scheduler * @see KIO::Slave */ - class KIO_EXPORT Job : public QObject { + class KIO_EXPORT Job : public TQObject { Q_OBJECT protected: @@ -108,7 +108,7 @@ namespace KIO { * @return a string to help understand the error, usually the url * related to the error. Only valid if error() is not 0. */ - const QString & errorText() const { return m_errorText; } + const TQString & errorText() const { return m_errorText; } /** * Converts an error code and a non-i18n error message into an @@ -127,7 +127,7 @@ namespace KIO { * telling the user that the app is broken, so check with * error() whether there is an error */ - QString errorString() const; + TQString errorString() const; /** * Converts an error code and a non-i18n error message into i18n @@ -139,7 +139,7 @@ namespace KIO { * @return the following strings: caption, error + description, * causes+solutions */ - QStringList detailedErrorStrings(const KURL *reqUrl = 0L, + TQStringList detailedErrorStrings(const KURL *reqUrl = 0L, int method = -1) const; /** @@ -150,7 +150,7 @@ namespace KIO { * @param parent the parent widget for the dialog box, can be 0 for * top-level */ - void showErrorDialog( QWidget * parent = 0L ); + void showErrorDialog( TQWidget * parent = 0L ); /** * Enable or disable the automatic error handling. When automatic @@ -165,7 +165,7 @@ namespace KIO { * Can be 0 for top-level * @see isAutoErrorHandlingEnabled(), showErrorDialog() */ - void setAutoErrorHandlingEnabled( bool enable, QWidget *parentWidget = 0 ); + void setAutoErrorHandlingEnabled( bool enable, TQWidget *parentWidget = 0 ); /** * Returns whether automatic error handling is enabled or disabled. @@ -219,14 +219,14 @@ namespace KIO { * @param window the window to associate to * @see window() */ - void setWindow(QWidget *window); + void setWindow(TQWidget *window); /** * Returns the window this job is associated with. * @return the associated window * @see setWindow() */ - QWidget *window() const; + TQWidget *window() const; /** * Updates the last user action timestamp to the given time. @@ -271,7 +271,7 @@ namespace KIO { * @see setMetaData() * @see mergeMetaData() */ - void addMetaData(const QString &key, const QString &value); + void addMetaData(const TQString &key, const TQString &value); /** * Add key/value pairs to the meta data that is sent to the slave. @@ -280,7 +280,7 @@ namespace KIO { * @see setMetaData() * @see mergeMetaData() */ - void addMetaData(const QMap<QString,QString> &values); + void addMetaData(const TQMap<TQString,TQString> &values); /** * Add key/value pairs to the meta data that is sent to the slave. @@ -289,7 +289,7 @@ namespace KIO { * @see setMetaData() * @see addMetaData() */ - void mergeMetaData(const QMap<QString,QString> &values); + void mergeMetaData(const TQMap<TQString,TQString> &values); /** * @internal. For the scheduler. Do not use. @@ -307,10 +307,10 @@ namespace KIO { * Query meta data received from the slave. * (Valid when first data is received and/or slave is finished) * @param key the key of the meta data to retrieve - * @return the value of the meta data, or QString::null if the + * @return the value of the meta data, or TQString::null if the * @p key does not exist */ - QString queryMetaData(const QString &key); + TQString queryMetaData(const TQString &key); /** * Returns the processed size for this job. @@ -342,7 +342,7 @@ namespace KIO { * @param job the job that emitted this signal * @param msg the info message */ - void infoMessage( KIO::Job *job, const QString & msg ); + void infoMessage( KIO::Job *job, const TQString & msg ); // KDE4: Separate rich-text string from plain-text string, for different widgets. /** @@ -351,7 +351,7 @@ namespace KIO { * @param msg the info message * @since 3.5 */ - void warning( KIO::Job *job, const QString & msg ); + void warning( KIO::Job *job, const TQString & msg ); // KDE4: Separate rich-text string from plain-text string, for different widgets. /** @@ -419,7 +419,7 @@ namespace KIO { * @param msg the info message * @see infoMessage() */ - void slotInfoMessage( KIO::Job *job, const QString &msg ); + void slotInfoMessage( KIO::Job *job, const TQString &msg ); /** * Remove speed information. @@ -503,13 +503,13 @@ namespace KIO { EF_ListJobUnrestricted = (1 << 3) }; int &extraFlags(); - QPtrList<Job> subjobs; + TQPtrList<Job> subjobs; int m_error; - QString m_errorText; + TQString m_errorText; unsigned long m_percent; int m_progressId; // for uiserver - QTimer *m_speedTimer; - QGuardedPtr<QWidget> m_window; + TQTimer *m_speedTimer; + TQGuardedPtr<TQWidget> m_window; MetaData m_outgoingMetaData; MetaData m_incomingMetaData; protected: @@ -537,7 +537,7 @@ namespace KIO { * @param packedArgs the arguments * @param showProgressInfo true to show progress information to the user */ - SimpleJob(const KURL& url, int command, const QByteArray &packedArgs, + SimpleJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo); ~SimpleJob(); @@ -611,14 +611,14 @@ namespace KIO { * @internal * Called on a slave's warning. */ - void slotWarning( const QString & ); // KDE4: make virtual + void slotWarning( const TQString & ); // KDE4: make virtual /** * Called on a slave's info message. * @param s the info message * @see infoMessage() */ - void slotInfoMessage( const QString &s ); // KDE4: make virtual + void slotInfoMessage( const TQString &s ); // KDE4: make virtual /** * Called on a slave's connected signal. @@ -652,7 +652,7 @@ namespace KIO { * Called on a slave's error. * Made public for the scheduler. */ - virtual void slotError( int , const QString & ); + virtual void slotError( int , const TQString & ); protected slots: /** @@ -662,7 +662,7 @@ namespace KIO { protected: Slave * m_slave; - QByteArray m_packedArgs; + TQByteArray m_packedArgs; KURL m_url; KURL m_subUrl; int m_command; @@ -697,7 +697,7 @@ namespace KIO { * @param packedArgs the arguments * @param showProgressInfo true to show progress information to the user */ - StatJob(const KURL& url, int command, const QByteArray &packedArgs, bool showProgressInfo); + StatJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo); /** * A stat() can have two meanings. Either we want to read from this URL, @@ -789,7 +789,7 @@ namespace KIO { * @param packedArgs the arguments * @param showProgressInfo true to show progress information to the user */ - MkdirJob(const KURL& url, int command, const QByteArray &packedArgs, bool showProgressInfo); + MkdirJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo); /** * @internal @@ -843,7 +843,7 @@ namespace KIO { /** * Do not create a DirectCopyJob. Use KIO::copy() or KIO::file_copy() instead. */ - DirectCopyJob(const KURL& url, int command, const QByteArray &packedArgs, + DirectCopyJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo); /** * @internal @@ -886,8 +886,8 @@ namespace KIO { * @param showProgressInfo true to show progress information to the user */ TransferJob(const KURL& url, int command, - const QByteArray &packedArgs, - const QByteArray &_staticData, + const TQByteArray &packedArgs, + const TQByteArray &_staticData, bool showProgressInfo); /** @@ -945,7 +945,7 @@ namespace KIO { * Sending an empty block indicates end of data. * @since 3.2 */ - void sendAsyncData(const QByteArray &data); + void sendAsyncData(const TQByteArray &data); /** * When enabled, the job reports the amount of data that has been sent, @@ -974,7 +974,7 @@ namespace KIO { * should not be certain of data.size() == 0 ever happening (e.g. in case * of an error), so you should rely on result() instead. */ - void data( KIO::Job *job, const QByteArray &data ); + void data( KIO::Job *job, const TQByteArray &data ); /** * Request for data. @@ -987,7 +987,7 @@ namespace KIO { * @param data buffer to fill with data to send to the * slave. An empty buffer indicates end of data. (EOD) */ - void dataReq( KIO::Job *job, QByteArray &data ); + void dataReq( KIO::Job *job, TQByteArray &data ); /** * Signals a redirection. @@ -1013,7 +1013,7 @@ namespace KIO { * @param job the job that emitted this signal * @param type the mime type */ - void mimetype( KIO::Job *job, const QString &type ); + void mimetype( KIO::Job *job, const TQString &type ); /** * @internal @@ -1028,11 +1028,11 @@ namespace KIO { protected slots: virtual void slotRedirection( const KURL &url); virtual void slotFinished(); - virtual void slotData( const QByteArray &data); + virtual void slotData( const TQByteArray &data); virtual void slotDataReq(); - virtual void slotMimetype( const QString &mimetype ); + virtual void slotMimetype( const TQString &mimetype ); virtual void slotNeedSubURLData(); - virtual void slotSubURLData(KIO::Job*, const QByteArray &); + virtual void slotSubURLData(KIO::Job*, const TQByteArray &); virtual void slotMetaData( const KIO::MetaData &_metaData); void slotErrorPage(); void slotCanResume( KIO::filesize_t offset ); @@ -1041,10 +1041,10 @@ namespace KIO { protected: bool m_suspended; bool m_errorPage; - QByteArray staticData; + TQByteArray staticData; KURL m_redirectionURL; KURL::List m_redirectionList; - QString m_mimetype; + TQString m_mimetype; TransferJob *m_subJob; protected: virtual void virtual_hook( int id, void* data ); @@ -1054,21 +1054,21 @@ namespace KIO { /** * StoredTransferJob is a TransferJob (for downloading or uploading data) that - * also stores a QByteArray with the data, making it simpler to use than the + * also stores a TQByteArray with the data, making it simpler to use than the * standard TransferJob. * - * For KIO::storedGet it puts the data into the member QByteArray, so the user + * For KIO::storedGet it puts the data into the member TQByteArray, so the user * of this class can get hold of the whole data at once by calling data() * when the result signal is emitted. * You should only use StoredTransferJob to download data if you cannot * process the data by chunks while it's being downloaded, since storing - * everything in a QByteArray can potentially require a lot of memory. + * everything in a TQByteArray can potentially require a lot of memory. * * For KIO::storedPut the user of this class simply provides the bytearray from * the start, and the job takes care of uploading it. * You should only use StoredTransferJob to upload data if you cannot * provide the in chunks while it's being uploaded, since storing - * everything in a QByteArray can potentially require a lot of memory. + * everything in a TQByteArray can potentially require a lot of memory. * * @since 3.3 */ @@ -1086,28 +1086,28 @@ namespace KIO { * @param showProgressInfo true to show progress information to the user */ StoredTransferJob(const KURL& url, int command, - const QByteArray &packedArgs, - const QByteArray &_staticData, + const TQByteArray &packedArgs, + const TQByteArray &_staticData, bool showProgressInfo); /** * Set data to be uploaded. This is for put jobs. - * Automatically called by KIO::storedPut(const QByteArray &, ...), + * Automatically called by KIO::storedPut(const TQByteArray &, ...), * do not call this yourself. */ - void setData( const QByteArray& arr ); + void setData( const TQByteArray& arr ); /** * Get hold of the downloaded data. This is for get jobs. * You're supposed to call this only from the slot connected to the result() signal. */ - QByteArray data() const { return m_data; } + TQByteArray data() const { return m_data; } private slots: - void slotStoredData( KIO::Job *job, const QByteArray &data ); - void slotStoredDataReq( KIO::Job *job, QByteArray &data ); + void slotStoredData( KIO::Job *job, const TQByteArray &data ); + void slotStoredDataReq( KIO::Job *job, TQByteArray &data ); private: - QByteArray m_data; + TQByteArray m_data; int m_uploadOffset; }; @@ -1154,14 +1154,14 @@ namespace KIO { * @param data data received from the slave. * End of data (EOD) has been reached if data.size() == 0 */ - void data( long id, const QByteArray &data); + void data( long id, const TQByteArray &data); /** * Mimetype determined * @param id the id of the request * @param type the mime type */ - void mimetype( long id, const QString &type ); + void mimetype( long id, const TQString &type ); /** * File transfer completed. @@ -1175,8 +1175,8 @@ namespace KIO { protected slots: virtual void slotRedirection( const KURL &url); virtual void slotFinished(); - virtual void slotData( const QByteArray &data); - virtual void slotMimetype( const QString &mimetype ); + virtual void slotData( const TQByteArray &data); + virtual void slotMimetype( const TQString &mimetype ); private: struct GetRequest { public: @@ -1187,10 +1187,10 @@ namespace KIO { MetaData metaData; }; bool findCurrentEntry(); - void flushQueue(QPtrList<GetRequest> &queue); + void flushQueue(TQPtrList<GetRequest> &queue); - QPtrList<GetRequest> m_waitQueue; - QPtrList<GetRequest> m_activeQueue; + TQPtrList<GetRequest> m_waitQueue; + TQPtrList<GetRequest> m_activeQueue; bool b_multiGetActive; GetRequest *m_currentEntry; protected: @@ -1217,14 +1217,14 @@ namespace KIO { * @param packedArgs the arguments * @param showProgressInfo true to show progress information to the user */ - MimetypeJob(const KURL& url, int command, const QByteArray &packedArgs, bool showProgressInfo); + MimetypeJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo); /** * Call this in the slot connected to result, * and only after making sure no error happened. * @return the mimetype of the URL */ - QString mimetype() const { return m_mimetype; } + TQString mimetype() const { return m_mimetype; } /** * @internal @@ -1310,13 +1310,13 @@ namespace KIO { * * @since 3.5.7 */ - void mimetype( KIO::Job *job, const QString &type ); + void mimetype( KIO::Job *job, const TQString &type ); public slots: void slotStart(); - void slotData( KIO::Job *, const QByteArray &data); - void slotDataReq( KIO::Job *, QByteArray &data); - void slotMimetype( KIO::Job *, const QString& type ); + void slotData( KIO::Job *, const TQByteArray &data); + void slotDataReq( KIO::Job *, TQByteArray &data); + void slotMimetype( KIO::Job *, const TQString& type ); protected slots: /** @@ -1369,7 +1369,7 @@ namespace KIO { bool m_resume:1; bool m_canResume:1; bool m_resumeAnswerSent:1; - QByteArray m_buffer; + TQByteArray m_buffer; SimpleJob *m_moveJob; SimpleJob *m_copyJob; TransferJob *m_getJob; @@ -1400,11 +1400,11 @@ namespace KIO { * @param showProgressInfo true to show progress information to the user * @param recursive true to get the data recursively from child directories, * false to get only the content of the specified dir - * @param prefix the prefix of the files, or QString::null for no prefix + * @param prefix the prefix of the files, or TQString::null for no prefix * @param includeHidden true to include hidden files (those starting with '.') */ ListJob(const KURL& url, bool showProgressInfo, - bool recursive = false, QString prefix = QString::null, + bool recursive = false, TQString prefix = TQString::null, bool includeHidden = true); /** @@ -1471,7 +1471,7 @@ namespace KIO { private: bool recursive; bool includeHidden; - QString prefix; + TQString prefix; unsigned long m_processedEntries; KURL m_redirectionURL; protected: @@ -1485,7 +1485,7 @@ namespace KIO { { KURL uSource; KURL uDest; - QString linkDest; // for symlinks only + TQString linkDest; // for symlinks only int permissions; //mode_t type; time_t ctime; @@ -1594,7 +1594,7 @@ namespace KIO { * @param job the job that emitted this signal * @param files a list of items that are about to be created. */ - void aboutToCreate( KIO::Job *job, const QValueList<KIO::CopyInfo> &files); + void aboutToCreate( KIO::Job *job, const TQValueList<KIO::CopyInfo> &files); /** * Sends the number of processed files. @@ -1624,7 +1624,7 @@ namespace KIO { * being linked * @param to the destination of the current operation */ - void linking( KIO::Job *job, const QString& target, const KURL& to ); + void linking( KIO::Job *job, const TQString& target, const KURL& to ); /** * The job is moving a file or directory. * @param job the job that emitted this signal @@ -1669,7 +1669,7 @@ namespace KIO { * @param target the target * @param to the destination URL */ - void copyingLinkDone( KIO::Job *job, const KURL &from, const QString& target, const KURL& to ); + void copyingLinkDone( KIO::Job *job, const KURL &from, const TQString& target, const KURL& to ); protected: void statCurrentSrc(); @@ -1692,8 +1692,8 @@ namespace KIO { void setNextDirAttribute(); private: void startRenameJob(const KURL &slave_url); - bool shouldOverwrite( const QString& path ) const; - bool shouldSkip( const QString& path ) const; + bool shouldOverwrite( const TQString& path ) const; + bool shouldSkip( const TQString& path ) const; void skipSrc(); protected slots: @@ -1724,8 +1724,8 @@ namespace KIO { KIO::filesize_t m_fileProcessedSize; int m_processedFiles; int m_processedDirs; - QValueList<CopyInfo> files; - QValueList<CopyInfo> dirs; + TQValueList<CopyInfo> files; + TQValueList<CopyInfo> dirs; KURL::List dirsToRemove; KURL::List m_srcList; KURL::List::Iterator m_currentStatSrc; @@ -1736,13 +1736,13 @@ namespace KIO { KURL m_dest; KURL m_currentDest; // - QStringList m_skipList; - QStringList m_overwriteList; + TQStringList m_skipList; + TQStringList m_overwriteList; bool m_bAutoSkip; bool m_bOverwriteAll; int m_conflictError; - QTimer *m_reportTimer; + TQTimer *m_reportTimer; //these both are used for progress dialog reporting KURL m_currentSrcURL; KURL m_currentDestURL; @@ -1848,9 +1848,9 @@ namespace KIO { KURL::List dirs; KURL::List m_srcList; KURL::List::Iterator m_currentStat; - QStringList m_parentDirs; + TQStringList m_parentDirs; bool m_shred; // BIC: remove in KDE4 - QTimer *m_reportTimer; + TQTimer *m_reportTimer; protected: /** \internal */ virtual void virtual_hook( int id, void* data ); diff --git a/kio/kio/kacl.cpp b/kio/kio/kacl.cpp index 0812c1f14..432a50d31 100644 --- a/kio/kio/kacl.cpp +++ b/kio/kio/kacl.cpp @@ -33,7 +33,7 @@ #include <posixacladdons.h> #endif #endif -#include <qintdict.h> +#include <tqintdict.h> #include <kdebug.h> @@ -41,8 +41,8 @@ #ifdef USE_POSIX_ACL -static void printACL( acl_t acl, const QString &comment ); -static QString aclAsString(const acl_t acl); +static void printACL( acl_t acl, const TQString &comment ); +static TQString aclAsString(const acl_t acl); #endif class KACL::KACLPrivate { @@ -60,20 +60,20 @@ public: // helpers #ifdef USE_POSIX_ACL bool setMaskPermissions( unsigned short v ); - QString getUserName( uid_t uid ) const; - QString getGroupName( gid_t gid ) const; - bool setAllUsersOrGroups( const QValueList< QPair<QString, unsigned short> > &list, acl_tag_t type ); - bool setNamedUserOrGroupPermissions( const QString& name, unsigned short permissions, acl_tag_t type ); + TQString getUserName( uid_t uid ) const; + TQString getGroupName( gid_t gid ) const; + bool setAllUsersOrGroups( const TQValueList< QPair<TQString, unsigned short> > &list, acl_tag_t type ); + bool setNamedUserOrGroupPermissions( const TQString& name, unsigned short permissions, acl_tag_t type ); acl_t m_acl; #else int m_acl; #endif - mutable QIntDict<QString> m_usercache; - mutable QIntDict<QString> m_groupcache; + mutable TQIntDict<TQString> m_usercache; + mutable TQIntDict<TQString> m_groupcache; }; -KACL::KACL( const QString &aclString ) +KACL::KACL( const TQString &aclString ) : d( new KACLPrivate ) { setACL( aclString ); @@ -172,12 +172,12 @@ static void permissionsToEntry( acl_entry_t entry, unsigned short v ) if ( v & 1 ) acl_add_perm( permset, ACL_EXECUTE ); } -static void printACL( acl_t acl, const QString &comment ) +static void printACL( acl_t acl, const TQString &comment ) { kdDebug() << comment << aclAsString( acl ) << endl; } -static int getUidForName( const QString& name ) +static int getUidForName( const TQString& name ) { struct passwd *user = getpwnam( name.latin1() ); if ( user ) @@ -186,7 +186,7 @@ static int getUidForName( const QString& name ) return -1; } -static int getGidForName( const QString& name ) +static int getGidForName( const TQString& name ) { struct group *group = getgrnam( name.latin1() ); if ( group ) @@ -312,7 +312,7 @@ bool KACL::setMaskPermissions( unsigned short v ) /************************** * Deal with named users * **************************/ -unsigned short KACL::namedUserPermissions( const QString& name, bool *exists ) const +unsigned short KACL::namedUserPermissions( const TQString& name, bool *exists ) const { #ifdef USE_POSIX_ACL acl_entry_t entry; @@ -339,7 +339,7 @@ unsigned short KACL::namedUserPermissions( const QString& name, bool *exists ) c } #ifdef USE_POSIX_ACL -bool KACL::KACLPrivate::setNamedUserOrGroupPermissions( const QString& name, unsigned short permissions, acl_tag_t type ) +bool KACL::KACLPrivate::setNamedUserOrGroupPermissions( const TQString& name, unsigned short permissions, acl_tag_t type ) { bool allIsWell = true; acl_t newACL = acl_dup( m_acl ); @@ -352,7 +352,7 @@ bool KACL::KACLPrivate::setNamedUserOrGroupPermissions( const QString& name, uns acl_get_tag_type( entry, ¤tTag ); if ( currentTag == type ) { int id = * (int*)acl_get_qualifier( entry ); - const QString entryName = type == ACL_USER? getUserName( id ): getGroupName( id ); + const TQString entryName = type == ACL_USER? getUserName( id ): getGroupName( id ); if ( entryName == name ) { // found him, update permissionsToEntry( entry, permissions ); @@ -394,7 +394,7 @@ bool KACL::KACLPrivate::setNamedUserOrGroupPermissions( const QString& name, uns } #endif -bool KACL::setNamedUserPermissions( const QString& name, unsigned short permissions ) +bool KACL::setNamedUserPermissions( const TQString& name, unsigned short permissions ) { #ifdef USE_POSIX_ACL return d->setNamedUserOrGroupPermissions( name, permissions, ACL_USER ); @@ -417,7 +417,7 @@ ACLUserPermissionsList KACL::allUserPermissions() const acl_get_tag_type( entry, ¤tTag ); if ( currentTag == ACL_USER ) { id = *( (uid_t*) acl_get_qualifier( entry ) ); - QString name = d->getUserName( id ); + TQString name = d->getUserName( id ); unsigned short permissions = entryToPermissions( entry ); ACLUserPermissions pair = qMakePair( name, permissions ); list.append( pair ); @@ -429,7 +429,7 @@ ACLUserPermissionsList KACL::allUserPermissions() const } #ifdef USE_POSIX_ACL -bool KACL::KACLPrivate::setAllUsersOrGroups( const QValueList< QPair<QString, unsigned short> > &list, acl_tag_t type ) +bool KACL::KACLPrivate::setAllUsersOrGroups( const TQValueList< QPair<TQString, unsigned short> > &list, acl_tag_t type ) { bool allIsWell = true; bool atLeastOneUserOrGroup = false; @@ -456,7 +456,7 @@ bool KACL::KACLPrivate::setAllUsersOrGroups( const QValueList< QPair<QString, un //printACL( newACL, "After cleaning out entries: " ); // now add the entries from the list - QValueList< QPair<QString, unsigned short> >::const_iterator it = list.constBegin(); + TQValueList< QPair<TQString, unsigned short> >::const_iterator it = list.constBegin(); while ( it != list.constEnd() ) { acl_create_entry( &newACL, &entry ); acl_set_tag_type( entry, type ); @@ -506,7 +506,7 @@ bool KACL::setAllUserPermissions( const ACLUserPermissionsList &users ) * Deal with named groups * **************************/ -unsigned short KACL::namedGroupPermissions( const QString& name, bool *exists ) const +unsigned short KACL::namedGroupPermissions( const TQString& name, bool *exists ) const { *exists = false; #ifdef USE_POSIX_ACL @@ -531,7 +531,7 @@ unsigned short KACL::namedGroupPermissions( const QString& name, bool *exists ) return 0; } -bool KACL::setNamedGroupPermissions( const QString& name, unsigned short permissions ) +bool KACL::setNamedGroupPermissions( const TQString& name, unsigned short permissions ) { #ifdef USE_POSIX_ACL return d->setNamedUserOrGroupPermissions( name, permissions, ACL_GROUP ); @@ -555,7 +555,7 @@ ACLGroupPermissionsList KACL::allGroupPermissions() const acl_get_tag_type( entry, ¤tTag ); if ( currentTag == ACL_GROUP ) { id = *( (gid_t*) acl_get_qualifier( entry ) ); - QString name = d->getGroupName( id ); + TQString name = d->getGroupName( id ); unsigned short permissions = entryToPermissions( entry ); ACLGroupPermissions pair = qMakePair( name, permissions ); list.append( pair ); @@ -580,7 +580,7 @@ bool KACL::setAllGroupPermissions( const ACLGroupPermissionsList &groups ) * from and to string * **************************/ -bool KACL::setACL( const QString &aclStr ) +bool KACL::setACL( const TQString &aclStr ) { bool ret = false; #ifdef USE_POSIX_ACL @@ -603,12 +603,12 @@ bool KACL::setACL( const QString &aclStr ) return ret; } -QString KACL::asString() const +TQString KACL::asString() const { #ifdef USE_POSIX_ACL return aclAsString( d->m_acl ); #else - return QString::null; + return TQString::null; #endif } @@ -616,45 +616,45 @@ QString KACL::asString() const // helpers #ifdef USE_POSIX_ACL -QString KACL::KACLPrivate::getUserName( uid_t uid ) const +TQString KACL::KACLPrivate::getUserName( uid_t uid ) const { - QString *temp; + TQString *temp; temp = m_usercache.find( uid ); if ( !temp ) { struct passwd *user = getpwuid( uid ); if ( user ) { - m_usercache.insert( uid, new QString(QString::fromLatin1(user->pw_name)) ); - return QString::fromLatin1( user->pw_name ); + m_usercache.insert( uid, new TQString(TQString::fromLatin1(user->pw_name)) ); + return TQString::fromLatin1( user->pw_name ); } else - return QString::number( uid ); + return TQString::number( uid ); } else return *temp; } -QString KACL::KACLPrivate::getGroupName( gid_t gid ) const +TQString KACL::KACLPrivate::getGroupName( gid_t gid ) const { - QString *temp; + TQString *temp; temp = m_groupcache.find( gid ); if ( !temp ) { struct group *grp = getgrgid( gid ); if ( grp ) { - m_groupcache.insert( gid, new QString(QString::fromLatin1(grp->gr_name)) ); - return QString::fromLatin1( grp->gr_name ); + m_groupcache.insert( gid, new TQString(TQString::fromLatin1(grp->gr_name)) ); + return TQString::fromLatin1( grp->gr_name ); } else - return QString::number( gid ); + return TQString::number( gid ); } else return *temp; } -static QString aclAsString(const acl_t acl) +static TQString aclAsString(const acl_t acl) { char *aclString = acl_to_text( acl, 0 ); - QString ret = QString::fromLatin1( aclString ); + TQString ret = TQString::fromLatin1( aclString ); acl_free( (void*)aclString ); return ret; } @@ -665,15 +665,15 @@ static QString aclAsString(const acl_t acl) void KACL::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -QDataStream & operator<< ( QDataStream & s, const KACL & a ) +TQDataStream & operator<< ( TQDataStream & s, const KACL & a ) { s << a.asString(); return s; } -QDataStream & operator>> ( QDataStream & s, KACL & a ) +TQDataStream & operator>> ( TQDataStream & s, KACL & a ) { - QString str; + TQString str; s >> str; a.setACL( str ); return s; diff --git a/kio/kio/kacl.h b/kio/kio/kacl.h index c5254f054..53bc762b0 100644 --- a/kio/kio/kacl.h +++ b/kio/kio/kacl.h @@ -23,15 +23,15 @@ #include <sys/types.h> #include <kio/global.h> -typedef QPair<QString, unsigned short> ACLUserPermissions; -typedef QValueList<ACLUserPermissions> ACLUserPermissionsList; -typedef QValueListIterator<ACLUserPermissions> ACLUserPermissionsIterator; -typedef QValueListConstIterator<ACLUserPermissions> ACLUserPermissionsConstIterator; +typedef QPair<TQString, unsigned short> ACLUserPermissions; +typedef TQValueList<ACLUserPermissions> ACLUserPermissionsList; +typedef TQValueListIterator<ACLUserPermissions> ACLUserPermissionsIterator; +typedef TQValueListConstIterator<ACLUserPermissions> ACLUserPermissionsConstIterator; -typedef QPair<QString, unsigned short> ACLGroupPermissions; -typedef QValueList<ACLGroupPermissions> ACLGroupPermissionsList; -typedef QValueListIterator<ACLGroupPermissions> ACLGroupPermissionsIterator; -typedef QValueListConstIterator<ACLGroupPermissions> ACLGroupPermissionsConstIterator; +typedef QPair<TQString, unsigned short> ACLGroupPermissions; +typedef TQValueList<ACLGroupPermissions> ACLGroupPermissionsList; +typedef TQValueListIterator<ACLGroupPermissions> ACLGroupPermissionsIterator; +typedef TQValueListConstIterator<ACLGroupPermissions> ACLGroupPermissionsConstIterator; /** * The KCAL class encapsulates a POSIX Access Control List. It follows the @@ -46,7 +46,7 @@ public: * Creates a new KACL from @p aclString. If the string is a valid acl * string, isValid() will afterwards return true. */ - KACL( const QString & aclString ); + KACL( const TQString & aclString ); /** Copy ctor */ KACL( const KACL& rhs ); @@ -137,13 +137,13 @@ public: * exists. @p exists is set to true if a matching entry exists and * to false otherwise. * @return the permissions for a user entry with the name in @p name */ - unsigned short namedUserPermissions( const QString& name, bool *exists ) const; + unsigned short namedUserPermissions( const TQString& name, bool *exists ) const; /** Set the permissions for a user with the name @p name. Will fail * if the user doesn't exist, in which case the ACL will be unchanged. * @return success or failure. */ - bool setNamedUserPermissions( const QString& name, unsigned short ); + bool setNamedUserPermissions( const TQString& name, unsigned short ); /** Returns the list of all group permission entries. Each entry consists * of a name/permissions pair. This is a QPair, therefore access is provided @@ -162,12 +162,12 @@ public: * exists. @p exists is set to true if a matching entry exists and * to false otherwise. * @return the permissions for a group with the name in @p name */ - unsigned short namedGroupPermissions( const QString& name, bool *exists ) const; + unsigned short namedGroupPermissions( const TQString& name, bool *exists ) const; /** Set the permissions for a group with the name @p name. Will fail * if the group doesn't exist, in which case the ACL be unchanged. * @return success or failure. */ - bool setNamedGroupPermissions( const QString& name, unsigned short ); + bool setNamedGroupPermissions( const TQString& name, unsigned short ); /** Returns the list of all group permission entries. Each entry consists * of a name/permissions pair. This is a QPair, therefor access is provided @@ -184,24 +184,24 @@ public: /** Sets the whole list from a string. If the string in @p aclStr represents * a valid ACL, it will be set, otherwise the ACL remains unchanged. * @return whether setting the ACL was successful. */ - bool setACL( const QString &aclStr ); + bool setACL( const TQString &aclStr ); /** Return a string representation of the ACL. * @return a string version of the ACL in the format compatible with libacl and * POSIX 1003.1e. Implementations conforming to that standard should be able * to take such strings as input. */ - QString asString() const; + TQString asString() const; protected: virtual void virtual_hook( int id, void* data ); private: class KACLPrivate; KACLPrivate * d; - KIO_EXPORT friend QDataStream & operator<< ( QDataStream & s, const KACL & a ); - KIO_EXPORT friend QDataStream & operator>> ( QDataStream & s, KACL & a ); + KIO_EXPORT friend TQDataStream & operator<< ( TQDataStream & s, const KACL & a ); + KIO_EXPORT friend TQDataStream & operator>> ( TQDataStream & s, KACL & a ); }; -KIO_EXPORT QDataStream & operator<< ( QDataStream & s, const KACL & a ); -KIO_EXPORT QDataStream & operator>> ( QDataStream & s, KACL & a ); +KIO_EXPORT TQDataStream & operator<< ( TQDataStream & s, const KACL & a ); +KIO_EXPORT TQDataStream & operator>> ( TQDataStream & s, KACL & a ); #endif diff --git a/kio/kio/kar.cpp b/kio/kio/kar.cpp index 557512529..9f9435294 100644 --- a/kio/kio/kar.cpp +++ b/kio/kio/kar.cpp @@ -17,13 +17,13 @@ Boston, MA 02110-1301, USA. */ -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> #include <time.h> #include <kdebug.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include <kmimetype.h> -#include <qregexp.h> +#include <tqregexp.h> #include "kfilterdev.h" #include "kar.h" @@ -39,19 +39,19 @@ public: KArPrivate() {} }; -KAr::KAr( const QString& filename ) +KAr::KAr( const TQString& filename ) : KArchive( 0L ) { //kdDebug(7042) << "KAr(filename) reached." << endl; m_filename = filename; d = new KArPrivate; - setDevice( new QFile( filename ) ); + setDevice( new TQFile( filename ) ); } -KAr::KAr( QIODevice * dev ) +KAr::KAr( TQIODevice * dev ) : KArchive( dev ) { - //kdDebug(7042) << "KAr::KAr( QIODevice * dev) reached." << endl; + //kdDebug(7042) << "KAr::KAr( TQIODevice * dev) reached." << endl; d = new KArPrivate; } @@ -80,7 +80,7 @@ bool KAr::openArchive( int mode ) return false; } - QIODevice* dev = device(); + TQIODevice* dev = device(); if ( !dev ) return false; @@ -93,9 +93,9 @@ bool KAr::openArchive( int mode ) char *ar_longnames = 0; while (! dev->atEnd()) { - QCString ar_header; + TQCString ar_header; ar_header.resize(61); - QCString name; + TQCString name; int date, uid, gid, mode, size; dev->at( dev->at() + (2 - (dev->at() % 2)) % 2 ); // Ar headers are padded to byte boundary diff --git a/kio/kio/kar.h b/kio/kio/kar.h index d91972cee..1b8f2cef2 100644 --- a/kio/kio/kar.h +++ b/kio/kio/kar.h @@ -21,10 +21,10 @@ #include <sys/stat.h> #include <sys/types.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> #include <karchive.h> @@ -43,14 +43,14 @@ public: * * @param filename is a local path (e.g. "/home/holger/myfile.ar") */ - KAr( const QString& filename ); + KAr( const TQString& filename ); /** * Creates an instance that operates on the given device. - * The device can be compressed (KFilterDev) or not (QFile, etc.). + * The device can be compressed (KFilterDev) or not (TQFile, etc.). * @param dev the device to read from */ - KAr( QIODevice * dev ); + KAr( TQIODevice * dev ); /** * If the ar file is still opened, then it will be @@ -60,15 +60,15 @@ public: /** * The name of the ar file, as passed to the constructor. - * @return the filename. Null if you used the QIODevice constructor + * @return the filename. Null if you used the TQIODevice constructor */ - QString fileName() { return m_filename; } + TQString fileName() { return m_filename; } /* * Writing not supported by this class, will always fail. * @return always false */ - virtual bool prepareWriting( const QString& name, const QString& user, const QString& group, uint size ) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); Q_UNUSED(size); return false; } + virtual bool prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size ) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); Q_UNUSED(size); return false; } /* * Writing not supported by this class, will always fail. @@ -80,7 +80,7 @@ public: * Writing not supported by this class, will always fail. * @return always false */ - virtual bool writeDir( const QString& name, const QString& user, const QString& group ) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); return false; } + virtual bool writeDir( const TQString& name, const TQString& user, const TQString& group ) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); return false; } protected: /** @@ -95,7 +95,7 @@ protected: protected: virtual void virtual_hook( int id, void* data ); private: - QString m_filename; + TQString m_filename; class KArPrivate; KArPrivate * d; }; diff --git a/kio/kio/karchive.cpp b/kio/kio/karchive.cpp index ef50e289f..592e513d4 100644 --- a/kio/kio/karchive.cpp +++ b/kio/kio/karchive.cpp @@ -30,13 +30,13 @@ #include <sys/types.h> #include <sys/stat.h> -#include <qptrlist.h> -#include <qptrstack.h> -#include <qvaluestack.h> -#include <qmap.h> -#include <qcstring.h> -#include <qdir.h> -#include <qfile.h> +#include <tqptrlist.h> +#include <tqptrstack.h> +#include <tqvaluestack.h> +#include <tqmap.h> +#include <tqcstring.h> +#include <tqdir.h> +#include <tqfile.h> #include <kdebug.h> #include <kfilterdev.h> @@ -46,7 +46,7 @@ #include "karchive.h" #include "klimitediodevice.h" -template class QDict<KArchiveEntry>; +template class TQDict<KArchiveEntry>; class KArchive::KArchivePrivate @@ -56,10 +56,10 @@ public: bool closeSucceeded; }; -class PosSortedPtrList : public QPtrList<KArchiveFile> { +class PosSortedPtrList : public TQPtrList<KArchiveFile> { protected: - int compareItems( QPtrCollection::Item i1, - QPtrCollection::Item i2 ) + int compareItems( TQPtrCollection::Item i1, + TQPtrCollection::Item i2 ) { int pos1 = static_cast<KArchiveFile*>( i1 )->position(); int pos2 = static_cast<KArchiveFile*>( i2 )->position(); @@ -72,7 +72,7 @@ protected: /////////////////////////// KArchive /////////////////////////////////// //////////////////////////////////////////////////////////////////////// -KArchive::KArchive( QIODevice * dev ) +KArchive::KArchive( TQIODevice * dev ) { d = new KArchivePrivate; d->rootDir = 0; @@ -133,9 +133,9 @@ const KArchiveDirectory* KArchive::directory() const } -bool KArchive::addLocalFile( const QString& fileName, const QString& destName ) +bool KArchive::addLocalFile( const TQString& fileName, const TQString& destName ) { - QFileInfo fileInfo( fileName ); + TQFileInfo fileInfo( fileName ); if ( !fileInfo.isFile() && !fileInfo.isSymLink() ) { kdWarning() << "KArchive::addLocalFile " << fileName << " doesn't exist or is not a regular file." << endl; @@ -143,7 +143,7 @@ bool KArchive::addLocalFile( const QString& fileName, const QString& destName ) } KDE_struct_stat fi; - if (KDE_lstat(QFile::encodeName(fileName),&fi) == -1) { + if (KDE_lstat(TQFile::encodeName(fileName),&fi) == -1) { kdWarning() << "KArchive::addLocalFile stating " << fileName << " failed: " << strerror(errno) << endl; return false; @@ -160,7 +160,7 @@ bool KArchive::addLocalFile( const QString& fileName, const QString& destName ) // the file must be opened before prepareWriting is called, otherwise // if the opening fails, no content will follow the already written // header and the tar file is effectively f*cked up - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { kdWarning() << "KArchive::addLocalFile couldn't open file " << fileName << endl; @@ -175,7 +175,7 @@ bool KArchive::addLocalFile( const QString& fileName, const QString& destName ) } // Read and write data in chunks to minimize memory usage - QByteArray array(8*1024); + TQByteArray array(8*1024); int n; uint total = 0; while ( ( n = file.readBlock( array.data(), array.size() ) ) > 0 ) @@ -197,23 +197,23 @@ bool KArchive::addLocalFile( const QString& fileName, const QString& destName ) return true; } -bool KArchive::addLocalDirectory( const QString& path, const QString& destName ) +bool KArchive::addLocalDirectory( const TQString& path, const TQString& destName ) { - QString dot = "."; - QString dotdot = ".."; - QDir dir( path ); + TQString dot = "."; + TQString dotdot = ".."; + TQDir dir( path ); if ( !dir.exists() ) return false; - dir.setFilter(dir.filter() | QDir::Hidden); - QStringList files = dir.entryList(); - for ( QStringList::Iterator it = files.begin(); it != files.end(); ++it ) + dir.setFilter(dir.filter() | TQDir::Hidden); + TQStringList files = dir.entryList(); + for ( TQStringList::Iterator it = files.begin(); it != files.end(); ++it ) { if ( *it != dot && *it != dotdot ) { - QString fileName = path + "/" + *it; + TQString fileName = path + "/" + *it; // kdDebug() << "storing " << fileName << endl; - QString dest = destName.isEmpty() ? *it : (destName + "/" + *it); - QFileInfo fileInfo( fileName ); + TQString dest = destName.isEmpty() ? *it : (destName + "/" + *it); + TQFileInfo fileInfo( fileName ); if ( fileInfo.isFile() || fileInfo.isSymLink() ) addLocalFile( fileName, dest ); @@ -225,15 +225,15 @@ bool KArchive::addLocalDirectory( const QString& path, const QString& destName ) return true; } -bool KArchive::writeFile( const QString& name, const QString& user, const QString& group, uint size, const char* data ) +bool KArchive::writeFile( const TQString& name, const TQString& user, const TQString& group, uint size, const char* data ) { mode_t perm = 0100644; time_t the_time = time(0); return writeFile(name,user,group,size,perm,the_time,the_time,the_time,data); } -bool KArchive::prepareWriting( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, +bool KArchive::prepareWriting( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime ) { PrepareWritingParams params; params.name = &name; @@ -248,16 +248,16 @@ bool KArchive::prepareWriting( const QString& name, const QString& user, return params.retval; } -bool KArchive::prepareWriting_impl(const QString &name, const QString &user, - const QString &group, uint size, mode_t /*perm*/, +bool KArchive::prepareWriting_impl(const TQString &name, const TQString &user, + const TQString &group, uint size, mode_t /*perm*/, time_t /*atime*/, time_t /*mtime*/, time_t /*ctime*/ ) { kdWarning(7040) << "New prepareWriting API not implemented in this class." << endl << "Falling back to old API (metadata information will be lost)" << endl; return prepareWriting(name,user,group,size); } -bool KArchive::writeFile( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, +bool KArchive::writeFile( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char* data ) { WriteFileParams params; @@ -274,8 +274,8 @@ bool KArchive::writeFile( const QString& name, const QString& user, return params.retval; } -bool KArchive::writeFile_impl( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, +bool KArchive::writeFile_impl( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char* data ) { @@ -301,8 +301,8 @@ bool KArchive::writeFile_impl( const QString& name, const QString& user, return true; } -bool KArchive::writeDir(const QString& name, const QString& user, - const QString& group, mode_t perm, +bool KArchive::writeDir(const TQString& name, const TQString& user, + const TQString& group, mode_t perm, time_t atime, time_t mtime, time_t ctime) { WriteDirParams params; params.name = &name; @@ -316,16 +316,16 @@ bool KArchive::writeDir(const QString& name, const QString& user, return params.retval; } -bool KArchive::writeDir_impl(const QString &name, const QString &user, - const QString &group, mode_t /*perm*/, +bool KArchive::writeDir_impl(const TQString &name, const TQString &user, + const TQString &group, mode_t /*perm*/, time_t /*atime*/, time_t /*mtime*/, time_t /*ctime*/ ) { kdWarning(7040) << "New writeDir API not implemented in this class." << endl << "Falling back to old API (metadata information will be lost)" << endl; return writeDir(name,user,group); } -bool KArchive::writeSymLink(const QString &name, const QString &target, - const QString &user, const QString &group, +bool KArchive::writeSymLink(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) { WriteSymlinkParams params; params.name = &name; @@ -340,8 +340,8 @@ bool KArchive::writeSymLink(const QString &name, const QString &target, return params.retval; } -bool KArchive::writeSymLink_impl(const QString &/*name*/,const QString &/*target*/, - const QString &/*user*/, const QString &/*group*/, +bool KArchive::writeSymLink_impl(const TQString &/*name*/,const TQString &/*target*/, + const TQString &/*user*/, const TQString &/*group*/, mode_t /*perm*/, time_t /*atime*/, time_t /*mtime*/, time_t /*ctime*/) { kdWarning(7040) << "writeSymLink not implemented in this class." << endl @@ -372,15 +372,15 @@ KArchiveDirectory * KArchive::rootDir() //kdDebug() << "Making root dir " << endl; struct passwd* pw = getpwuid( getuid() ); struct group* grp = getgrgid( getgid() ); - QString username = pw ? QFile::decodeName(pw->pw_name) : QString::number( getuid() ); - QString groupname = grp ? QFile::decodeName(grp->gr_name) : QString::number( getgid() ); + TQString username = pw ? TQFile::decodeName(pw->pw_name) : TQString::number( getuid() ); + TQString groupname = grp ? TQFile::decodeName(grp->gr_name) : TQString::number( getgid() ); - d->rootDir = new KArchiveDirectory( this, QString::fromLatin1("/"), (int)(0777 + S_IFDIR), 0, username, groupname, QString::null ); + d->rootDir = new KArchiveDirectory( this, TQString::fromLatin1("/"), (int)(0777 + S_IFDIR), 0, username, groupname, TQString::null ); } return d->rootDir; } -KArchiveDirectory * KArchive::findOrCreate( const QString & path ) +KArchiveDirectory * KArchive::findOrCreate( const TQString & path ) { //kdDebug() << "KArchive::findOrCreate " << path << endl; if ( path.isEmpty() || path == "/" || path == "." ) // root dir => found @@ -408,7 +408,7 @@ KArchiveDirectory * KArchive::findOrCreate( const QString & path ) // Otherwise go up and try again int pos = path.findRev( '/' ); KArchiveDirectory * parent; - QString dirname; + TQString dirname; if ( pos == -1 ) // no more slash => create in root dir { parent = rootDir(); @@ -416,7 +416,7 @@ KArchiveDirectory * KArchive::findOrCreate( const QString & path ) } else { - QString left = path.left( pos ); + TQString left = path.left( pos ); dirname = path.mid( pos + 1 ); parent = findOrCreate( left ); // recursive call... until we find an existing dir. } @@ -425,12 +425,12 @@ KArchiveDirectory * KArchive::findOrCreate( const QString & path ) // Found -> add the missing piece KArchiveDirectory * e = new KArchiveDirectory( this, dirname, d->rootDir->permissions(), d->rootDir->date(), d->rootDir->user(), - d->rootDir->group(), QString::null ); + d->rootDir->group(), TQString::null ); parent->addEntry( e ); return e; // now a directory to <path> exists } -void KArchive::setDevice( QIODevice * dev ) +void KArchive::setDevice( TQIODevice * dev ) { m_dev = dev; } @@ -444,9 +444,9 @@ void KArchive::setRootDir( KArchiveDirectory *rootDir ) //////////////////////////////////////////////////////////////////////// /////////////////////// KArchiveEntry ////////////////////////////////// //////////////////////////////////////////////////////////////////////// -KArchiveEntry::KArchiveEntry( KArchive* t, const QString& name, int access, int date, - const QString& user, const QString& group, const - QString& symlink) +KArchiveEntry::KArchiveEntry( KArchive* t, const TQString& name, int access, int date, + const TQString& user, const TQString& group, const + TQString& symlink) { m_name = name; m_access = access; @@ -458,9 +458,9 @@ KArchiveEntry::KArchiveEntry( KArchive* t, const QString& name, int access, int } -QDateTime KArchiveEntry::datetime() const +TQDateTime KArchiveEntry::datetime() const { - QDateTime d; + TQDateTime d; d.setTime_t( m_date ); return d; } @@ -469,9 +469,9 @@ QDateTime KArchiveEntry::datetime() const /////////////////////// KArchiveFile /////////////////////////////////// //////////////////////////////////////////////////////////////////////// -KArchiveFile::KArchiveFile( KArchive* t, const QString& name, int access, int date, - const QString& user, const QString& group, - const QString & symlink, +KArchiveFile::KArchiveFile( KArchive* t, const TQString& name, int access, int date, + const TQString& user, const TQString& group, + const TQString & symlink, int pos, int size ) : KArchiveEntry( t, name, access, date, user, group, symlink ) { @@ -489,12 +489,12 @@ int KArchiveFile::size() const return m_size; } -QByteArray KArchiveFile::data() const +TQByteArray KArchiveFile::data() const { archive()->device()->at( m_pos ); // Read content - QByteArray arr( m_size ); + TQByteArray arr( m_size ); if ( m_size ) { assert( arr.data() ); @@ -506,14 +506,14 @@ QByteArray KArchiveFile::data() const } // ** This should be a virtual method, and this code should be in ktar.cpp -QIODevice *KArchiveFile::device() const +TQIODevice *KArchiveFile::device() const { return new KLimitedIODevice( archive()->device(), m_pos, m_size ); } -void KArchiveFile::copyTo(const QString& dest) const +void KArchiveFile::copyTo(const TQString& dest) const { - QFile f( dest + "/" + name() ); + TQFile f( dest + "/" + name() ); f.open( IO_ReadWrite | IO_Truncate ); f.writeBlock( data() ); f.close(); @@ -524,28 +524,28 @@ void KArchiveFile::copyTo(const QString& dest) const //////////////////////////////////////////////////////////////////////// -KArchiveDirectory::KArchiveDirectory( KArchive* t, const QString& name, int access, +KArchiveDirectory::KArchiveDirectory( KArchive* t, const TQString& name, int access, int date, - const QString& user, const QString& group, - const QString &symlink) + const TQString& user, const TQString& group, + const TQString &symlink) : KArchiveEntry( t, name, access, date, user, group, symlink ) { m_entries.setAutoDelete( true ); } -QStringList KArchiveDirectory::entries() const +TQStringList KArchiveDirectory::entries() const { - QStringList l; + TQStringList l; - QDictIterator<KArchiveEntry> it( m_entries ); + TQDictIterator<KArchiveEntry> it( m_entries ); for( ; it.current(); ++it ) l.append( it.currentKey() ); return l; } -KArchiveEntry* KArchiveDirectory::entry( QString name ) - // not "const QString & name" since we want a local copy +KArchiveEntry* KArchiveDirectory::entry( TQString name ) + // not "const TQString & name" since we want a local copy // (to remove leading slash if any) { int pos = name.find( '/' ); @@ -567,8 +567,8 @@ KArchiveEntry* KArchiveDirectory::entry( QString name ) } if ( pos != -1 ) { - QString left = name.left( pos ); - QString right = name.mid( pos + 1 ); + TQString left = name.left( pos ); + TQString right = name.mid( pos + 1 ); //kdDebug() << "KArchiveDirectory::entry left=" << left << " right=" << right << endl; @@ -581,7 +581,7 @@ KArchiveEntry* KArchiveDirectory::entry( QString name ) return m_entries[ name ]; } -const KArchiveEntry* KArchiveDirectory::entry( QString name ) const +const KArchiveEntry* KArchiveDirectory::entry( TQString name ) const { return ((KArchiveDirectory*)this)->entry( name ); } @@ -596,26 +596,26 @@ void KArchiveDirectory::addEntry( KArchiveEntry* entry ) m_entries.insert( entry->name(), entry ); } -void KArchiveDirectory::copyTo(const QString& dest, bool recursiveCopy ) const +void KArchiveDirectory::copyTo(const TQString& dest, bool recursiveCopy ) const { - QDir root; + TQDir root; PosSortedPtrList fileList; - QMap<int, QString> fileToDir; + TQMap<int, TQString> fileToDir; - QStringList::Iterator it; + TQStringList::Iterator it; // placeholders for iterated items KArchiveDirectory* curDir; - QString curDirName; + TQString curDirName; - QStringList dirEntries; + TQStringList dirEntries; KArchiveEntry* curEntry; KArchiveFile* curFile; - QPtrStack<KArchiveDirectory> dirStack; - QValueStack<QString> dirNameStack; + TQPtrStack<KArchiveDirectory> dirStack; + TQValueStack<TQString> dirNameStack; dirStack.push( this ); // init stack at current directory dirNameStack.push( dest ); // ... with given path @@ -628,7 +628,7 @@ void KArchiveDirectory::copyTo(const QString& dest, bool recursiveCopy ) const for ( it = dirEntries.begin(); it != dirEntries.end(); ++it ) { curEntry = curDir->entry(*it); if (!curEntry->symlink().isEmpty()) { - const QString linkName = curDirName+'/'+curEntry->name(); + const TQString linkName = curDirName+'/'+curEntry->name(); kdDebug() << "symlink(" << curEntry->symlink() << ',' << linkName << ')'; #ifdef Q_OS_UNIX if (!::symlink(curEntry->symlink().local8Bit(), linkName.local8Bit())) { diff --git a/kio/kio/karchive.h b/kio/kio/karchive.h index 0011e5ebb..dbfe02bff 100644 --- a/kio/kio/karchive.h +++ b/kio/kio/karchive.h @@ -24,10 +24,10 @@ #include <sys/stat.h> #include <sys/types.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> #include <kdelibs_export.h> @@ -47,7 +47,7 @@ protected: * @param dev the I/O device where the archive reads its data * Note that this can be a file, but also a data buffer, a compression filter, etc. */ - KArchive( QIODevice * dev ); + KArchive( TQIODevice * dev ); public: virtual ~KArchive(); @@ -93,7 +93,7 @@ public: * The underlying device. * @return the underlying device. */ - QIODevice * device() const { return m_dev; } + TQIODevice * device() const { return m_dev; } /** * If an archive is opened for reading, then the contents @@ -112,7 +112,7 @@ public: * @param fileName full path to an existing local file, to be added to the archive. * @param destName the resulting name (or relative path) of the file in the archive. */ - bool addLocalFile( const QString& fileName, const QString& destName ); + bool addLocalFile( const TQString& fileName, const TQString& destName ); /** * Writes a local directory into the archive, including all its contents, recursively. @@ -125,7 +125,7 @@ public: * @param path full path to an existing local directory, to be added to the archive. * @param destName the resulting name (or relative path) of the file in the archive. */ - bool addLocalDirectory( const QString& path, const QString& destName ); + bool addLocalDirectory( const TQString& path, const TQString& destName ); /** * If an archive is opened for writing then you can add new directories @@ -139,7 +139,7 @@ public: * writeDir(name,user,group,perm,atime,mtime,ctime) * or eliminate it */ - virtual bool writeDir( const QString& name, const QString& user, const QString& group ) = 0; + virtual bool writeDir( const TQString& name, const TQString& user, const TQString& group ) = 0; /** * If an archive is opened for writing then you can add new directories @@ -158,7 +158,7 @@ public: * @since 3.2 * @todo TODO(BIC): make this virtual. For now use virtual hook */ - bool writeDir( const QString& name, const QString& user, const QString& group, + bool writeDir( const TQString& name, const TQString& user, const TQString& group, mode_t perm, time_t atime, time_t mtime, time_t ctime ); /** @@ -175,8 +175,8 @@ public: * @since 3.2 * @todo TODO(BIC) make virtual. For now it must be implemented by virtual_hook. */ - bool writeSymLink(const QString &name, const QString &target, - const QString &user, const QString &group, + bool writeSymLink(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime); /** @@ -192,7 +192,7 @@ public: * @todo TODO(BIC): make this a thin non-virtual wrapper around * writeFile(name,user,group,size,perm,atime,mtime,ctime,data) */ - virtual bool writeFile( const QString& name, const QString& user, const QString& group, uint size, const char* data ); + virtual bool writeFile( const TQString& name, const TQString& user, const TQString& group, uint size, const char* data ); /** * If an archive is opened for writing then you can add a new file @@ -215,7 +215,7 @@ public: * @since 3.2 * @todo TODO(BIC): make virtual. For now use virtual hook */ - bool writeFile( const QString& name, const QString& user, const QString& group, + bool writeFile( const TQString& name, const TQString& user, const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char* data ); @@ -235,7 +235,7 @@ public: * prepareWriting(name,user,group,size,perm,atime,mtime,ctime) * or eliminate it. */ - virtual bool prepareWriting( const QString& name, const QString& user, const QString& group, uint size ) = 0; + virtual bool prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size ) = 0; /** * Here's another way of writing a file into an archive: @@ -258,8 +258,8 @@ public: * @since 3.2 * @todo TODO(BIC): make this virtual. For now use virtual hook. */ - bool prepareWriting( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool prepareWriting( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime ); /** @@ -304,12 +304,12 @@ protected: * @param path the path of the directory * @return the directory with the given @p path */ - KArchiveDirectory * findOrCreate( const QString & path ); + KArchiveDirectory * findOrCreate( const TQString & path ); /** * @internal for inherited constructors */ - void setDevice( QIODevice *dev ); + void setDevice( TQIODevice *dev ); /** * @internal for inherited classes @@ -317,7 +317,7 @@ protected: void setRootDir( KArchiveDirectory *rootDir ); private: - QIODevice * m_dev; + TQIODevice * m_dev; bool m_open; char m_mode; protected: @@ -325,51 +325,51 @@ protected: /* @internal for virtual_hook */ enum { VIRTUAL_WRITE_DATA = 1, VIRTUAL_WRITE_SYMLINK, VIRTUAL_WRITE_DIR, VIRTUAL_WRITE_FILE, VIRTUAL_PREPARE_WRITING }; - bool prepareWriting_impl( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool prepareWriting_impl( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime ); struct PrepareWritingParams { - const QString *name; - const QString *user; - const QString *group; + const TQString *name; + const TQString *user; + const TQString *group; uint size; mode_t perm; time_t atime, mtime, ctime; bool retval; }; - bool writeFile_impl( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool writeFile_impl( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char* data ); struct WriteFileParams { - const QString *name; - const QString *user; - const QString *group; + const TQString *name; + const TQString *user; + const TQString *group; uint size; mode_t perm; time_t atime, mtime, ctime; const char *data; bool retval; }; - bool writeDir_impl(const QString& name, const QString& user, - const QString& group, mode_t perm, + bool writeDir_impl(const TQString& name, const TQString& user, + const TQString& group, mode_t perm, time_t atime, time_t mtime, time_t ctime); struct WriteDirParams { - const QString *name; - const QString *user; - const QString *group; + const TQString *name; + const TQString *user; + const TQString *group; mode_t perm; time_t atime, mtime, ctime; bool retval; }; - bool writeSymLink_impl(const QString &name, const QString &target, - const QString &user, const QString &group, + bool writeSymLink_impl(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime); struct WriteSymlinkParams { - const QString *name; - const QString *target; - const QString *user; - const QString *group; + const TQString *name; + const TQString *target; + const TQString *user; + const TQString *group; mode_t perm; time_t atime, mtime, ctime; bool retval; @@ -403,11 +403,11 @@ public: * @param date the date (in seconds since 1970) * @param user the user that owns the entry * @param group the group that owns the entry - * @param symlink the symlink, or QString::null + * @param symlink the symlink, or TQString::null */ - KArchiveEntry( KArchive* archive, const QString& name, int access, int date, - const QString& user, const QString& group, - const QString &symlink ); + KArchiveEntry( KArchive* archive, const TQString& name, int access, int date, + const TQString& user, const TQString& group, + const TQString &symlink ); virtual ~KArchiveEntry() { } @@ -415,7 +415,7 @@ public: * Creation date of the file. * @return the creation date */ - QDateTime datetime() const; + TQDateTime datetime() const; /** * Creation date of the file. @@ -427,7 +427,7 @@ public: * Name of the file without path. * @return the file name without path */ - QString name() const { return m_name; } + TQString name() const { return m_name; } /** * The permissions and mode flags as returned by the stat() function * in st_mode. @@ -438,18 +438,18 @@ public: * User who created the file. * @return the owner of the file */ - QString user() const { return m_user; } + TQString user() const { return m_user; } /** * Group of the user who created the file. * @return the group of the file */ - QString group() const { return m_group; } + TQString group() const { return m_group; } /** * Symlink if there is one. - * @return the symlink, or QString::null + * @return the symlink, or TQString::null */ - QString symlink() const { return m_symlink; } + TQString symlink() const { return m_symlink; } /** * Checks whether the entry is a file. @@ -467,12 +467,12 @@ protected: KArchive* archive() const { return m_archive; } private: - QString m_name; + TQString m_name; int m_date; mode_t m_access; - QString m_user; - QString m_group; - QString m_symlink; + TQString m_user; + TQString m_group; + TQString m_symlink; KArchive* m_archive; protected: virtual void virtual_hook( int id, void* data ); @@ -498,12 +498,12 @@ public: * @param date the date (in seconds since 1970) * @param user the user that owns the entry * @param group the group that owns the entry - * @param symlink the symlink, or QString::null + * @param symlink the symlink, or TQString::null * @param pos the position of the file in the directory * @param size the size of the file */ - KArchiveFile( KArchive* archive, const QString& name, int access, int date, - const QString& user, const QString& group, const QString &symlink, + KArchiveFile( KArchive* archive, const TQString& name, int access, int date, + const TQString& user, const TQString& group, const TQString &symlink, int pos, int size ); virtual ~KArchiveFile() { } @@ -529,17 +529,17 @@ public: * Call data() with care (only once per file), this data isn't cached. * @return the content of this file. */ - virtual QByteArray data() const; + virtual TQByteArray data() const; /** - * This method returns QIODevice (internal class: KLimitedIODevice) - * on top of the underlying QIODevice. This is obviously for reading only. + * This method returns TQIODevice (internal class: KLimitedIODevice) + * on top of the underlying TQIODevice. This is obviously for reading only. * Note that the ownership of the device is being transferred to the caller, * who will have to delete it. * The returned device auto-opens (in readonly mode), no need to open it. - * @return the QIODevice of the file + * @return the TQIODevice of the file */ - QIODevice *device() const; // TODO make virtual + TQIODevice *device() const; // TODO make virtual /** * Checks whether this entry is a file. @@ -552,7 +552,7 @@ public: * @param dest the directory to extract to * @since 3.1 */ - void copyTo(const QString& dest) const; + void copyTo(const TQString& dest) const; private: int m_pos; // TODO use Q_LONG in KDE-4.0 @@ -581,11 +581,11 @@ public: * @param date the date (in seconds since 1970) * @param user the user that owns the entry * @param group the group that owns the entry - * @param symlink the symlink, or QString::null + * @param symlink the symlink, or TQString::null */ - KArchiveDirectory( KArchive* archive, const QString& name, int access, int date, - const QString& user, const QString& group, - const QString& symlink); + KArchiveDirectory( KArchive* archive, const TQString& name, int access, int date, + const TQString& user, const TQString& group, + const TQString& symlink); virtual ~KArchiveDirectory() { } @@ -593,19 +593,19 @@ public: * Returns a list of sub-entries. * @return the names of all entries in this directory (filenames, no path). */ - QStringList entries() const; + TQStringList entries() const; /** * Returns the entry with the given name. * @param name may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc. * @return a pointer to the entry in the directory. */ - KArchiveEntry* entry( QString name ); + KArchiveEntry* entry( TQString name ); /** * Returns the entry with the given name. * @param name may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc. * @return a pointer to the entry in the directory. */ - const KArchiveEntry* entry( QString name ) const; + const KArchiveEntry* entry( TQString name ) const; /** * @internal @@ -626,10 +626,10 @@ public: * @param recursive if set to true, subdirectories are extracted as well * @since 3.1 */ - void copyTo(const QString& dest, bool recursive = true) const; + void copyTo(const TQString& dest, bool recursive = true) const; private: - QDict<KArchiveEntry> m_entries; + TQDict<KArchiveEntry> m_entries; protected: virtual void virtual_hook( int id, void* data ); private: diff --git a/kio/kio/kautomount.cpp b/kio/kio/kautomount.cpp index 23d3c970c..a4782c313 100644 --- a/kio/kio/kautomount.cpp +++ b/kio/kio/kautomount.cpp @@ -29,8 +29,8 @@ * ***********************************************************************/ -KAutoMount::KAutoMount( bool _readonly, const QString& _format, const QString& _device, - const QString& _mountpoint, const QString & _desktopFile, +KAutoMount::KAutoMount( bool _readonly, const TQString& _format, const TQString& _device, + const TQString& _mountpoint, const TQString & _desktopFile, bool _show_filemanager_window ) : m_strDevice( _device ), m_desktopFile( _desktopFile ) @@ -39,7 +39,7 @@ KAutoMount::KAutoMount( bool _readonly, const QString& _format, const QString& _ m_bShowFilemanagerWindow = _show_filemanager_window; KIO::Job* job = KIO::mount( _readonly, _format.ascii(), _device, _mountpoint ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotResult( KIO::Job * ) ) ); } void KAutoMount::slotResult( KIO::Job * job ) @@ -77,11 +77,11 @@ void KAutoMount::slotResult( KIO::Job * job ) delete this; } -KAutoUnmount::KAutoUnmount( const QString & _mountpoint, const QString & _desktopFile ) +KAutoUnmount::KAutoUnmount( const TQString & _mountpoint, const TQString & _desktopFile ) : m_desktopFile( _desktopFile ), m_mountpoint( _mountpoint ) { KIO::Job * job = KIO::unmount( m_mountpoint ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotResult( KIO::Job * ) ) ); } void KAutoUnmount::slotResult( KIO::Job * job ) diff --git a/kio/kio/kautomount.h b/kio/kio/kautomount.h index 07f37c1c1..1d8662590 100644 --- a/kio/kio/kautomount.h +++ b/kio/kio/kautomount.h @@ -19,8 +19,8 @@ #ifndef __auto_mount_h__ #define __auto_mount_h__ -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <kdelibs_export.h> @@ -54,8 +54,8 @@ public: * @param show_filemanager_window if true, a file-manager window for that mountpoint is shown after * the mount, if successful. */ - KAutoMount( bool readonly, const QString& format, const QString& device, const QString& mountpoint, - const QString & desktopFile, bool show_filemanager_window = true ); + KAutoMount( bool readonly, const TQString& format, const TQString& device, const TQString& mountpoint, + const TQString & desktopFile, bool show_filemanager_window = true ); signals: /** Emitted when the directory has been mounted */ @@ -67,9 +67,9 @@ protected slots: void slotResult( KIO::Job * ); protected: - QString m_strDevice; + TQString m_strDevice; bool m_bShowFilemanagerWindow; - QString m_desktopFile; + TQString m_desktopFile; private: /** KAutoMount deletes itself. Don't delete it manually. */ ~KAutoMount() {} @@ -94,7 +94,7 @@ public: * @param desktopFile the file the user clicked on - to notify KDirWatch of the fact that * it should emit fileDirty for it (to have the icon change) */ - KAutoUnmount( const QString & mountpoint, const QString & desktopFile ); + KAutoUnmount( const TQString & mountpoint, const TQString & desktopFile ); signals: /** Emitted when the directory has been unmounted */ @@ -105,8 +105,8 @@ signals: protected slots: void slotResult( KIO::Job * ); private: - QString m_desktopFile; - QString m_mountpoint; + TQString m_desktopFile; + TQString m_mountpoint; private: /** KAutoUnmount deletes itself. Don't delete it manually. */ ~KAutoUnmount() {} diff --git a/kio/kio/kdatatool.cpp b/kio/kio/kdatatool.cpp index 2b7c58665..bb6462006 100644 --- a/kio/kio/kdatatool.cpp +++ b/kio/kio/kdatatool.cpp @@ -28,8 +28,8 @@ #include <ktrader.h> #include <kparts/componentfactory.h> -#include <qpixmap.h> -#include <qfile.h> +#include <tqpixmap.h> +#include <tqfile.h> /************************************************* * @@ -68,18 +68,18 @@ KDataToolInfo& KDataToolInfo::operator= ( const KDataToolInfo& info ) return *this; } -QString KDataToolInfo::dataType() const +TQString KDataToolInfo::dataType() const { if ( !m_service ) - return QString::null; + return TQString::null; return m_service->property( "DataType" ).toString(); } -QStringList KDataToolInfo::mimeTypes() const +TQStringList KDataToolInfo::mimeTypes() const { if ( !m_service ) - return QStringList(); + return TQStringList(); return m_service->property( "DataMimeTypes" ).toStringList(); } @@ -92,58 +92,58 @@ bool KDataToolInfo::isReadOnly() const return m_service->property( "ReadOnly" ).toBool(); } -QPixmap KDataToolInfo::icon() const +TQPixmap KDataToolInfo::icon() const { if ( !m_service ) - return QPixmap(); + return TQPixmap(); - QPixmap pix; - QStringList lst = KGlobal::dirs()->resourceDirs("icon"); - QStringList::ConstIterator it = lst.begin(); + TQPixmap pix; + TQStringList lst = KGlobal::dirs()->resourceDirs("icon"); + TQStringList::ConstIterator it = lst.begin(); while (!pix.load( *it + "/" + m_service->icon() ) && it != lst.end() ) it++; return pix; } -QPixmap KDataToolInfo::miniIcon() const +TQPixmap KDataToolInfo::miniIcon() const { if ( !m_service ) - return QPixmap(); + return TQPixmap(); - QPixmap pix; - QStringList lst = KGlobal::dirs()->resourceDirs("mini"); - QStringList::ConstIterator it = lst.begin(); + TQPixmap pix; + TQStringList lst = KGlobal::dirs()->resourceDirs("mini"); + TQStringList::ConstIterator it = lst.begin(); while (!pix.load( *it + "/" + m_service->icon() ) && it != lst.end() ) it++; return pix; } -QString KDataToolInfo::iconName() const +TQString KDataToolInfo::iconName() const { if ( !m_service ) - return QString::null; + return TQString::null; return m_service->icon(); } -QStringList KDataToolInfo::commands() const +TQStringList KDataToolInfo::commands() const { if ( !m_service ) - return QString::null; + return TQString::null; return m_service->property( "Commands" ).toStringList(); } -QStringList KDataToolInfo::userCommands() const +TQStringList KDataToolInfo::userCommands() const { if ( !m_service ) - return QString::null; + return TQString::null; - return QStringList::split( ',', m_service->comment() ); + return TQStringList::split( ',', m_service->comment() ); } -KDataTool* KDataToolInfo::createTool( QObject* parent, const char* name ) const +KDataTool* KDataToolInfo::createTool( TQObject* parent, const char* name ) const { if ( !m_service ) return 0; @@ -159,19 +159,19 @@ KService::Ptr KDataToolInfo::service() const return m_service; } -QValueList<KDataToolInfo> KDataToolInfo::query( const QString& datatype, const QString& mimetype, KInstance* instance ) +TQValueList<KDataToolInfo> KDataToolInfo::query( const TQString& datatype, const TQString& mimetype, KInstance* instance ) { - QValueList<KDataToolInfo> lst; + TQValueList<KDataToolInfo> lst; - QString constr; + TQString constr; if ( !datatype.isEmpty() ) { - constr = QString::fromLatin1( "DataType == '%1'" ).arg( datatype ); + constr = TQString::fromLatin1( "DataType == '%1'" ).arg( datatype ); } if ( !mimetype.isEmpty() ) { - QString tmp = QString::fromLatin1( "'%1' in DataMimeTypes" ).arg( mimetype ); + TQString tmp = TQString::fromLatin1( "'%1' in DataMimeTypes" ).arg( mimetype ); if ( constr.isEmpty() ) constr = tmp; else @@ -180,7 +180,7 @@ QValueList<KDataToolInfo> KDataToolInfo::query( const QString& datatype, const Q /* Bug in KTrader ? Test with HEAD-kdelibs! if ( instance ) { - QString tmp = QString::fromLatin1( "not ('%1' in ExcludeFrom)" ).arg( instance->instanceName() ); + TQString tmp = TQString::fromLatin1( "not ('%1' in ExcludeFrom)" ).arg( instance->instanceName() ); if ( constr.isEmpty() ) constr = tmp; else @@ -215,8 +215,8 @@ bool KDataToolInfo::isValid() const * KDataToolAction * *************************************************/ -KDataToolAction::KDataToolAction( const QString & text, const KDataToolInfo & info, const QString & command, - QObject * parent, const char * name ) +KDataToolAction::KDataToolAction( const TQString & text, const KDataToolInfo & info, const TQString & command, + TQObject * parent, const char * name ) : KAction( text, info.iconName(), 0, parent, name ), m_command( command ), m_info( info ) @@ -228,30 +228,30 @@ void KDataToolAction::slotActivated() emit toolActivated( m_info, m_command ); } -QPtrList<KAction> KDataToolAction::dataToolActionList( const QValueList<KDataToolInfo> & tools, const QObject *receiver, const char* slot ) +TQPtrList<KAction> KDataToolAction::dataToolActionList( const TQValueList<KDataToolInfo> & tools, const TQObject *receiver, const char* slot ) { - QPtrList<KAction> actionList; + TQPtrList<KAction> actionList; if ( tools.isEmpty() ) return actionList; actionList.append( new KActionSeparator() ); - QValueList<KDataToolInfo>::ConstIterator entry = tools.begin(); + TQValueList<KDataToolInfo>::ConstIterator entry = tools.begin(); for( ; entry != tools.end(); ++entry ) { - QStringList userCommands = (*entry).userCommands(); - QStringList commands = (*entry).commands(); + TQStringList userCommands = (*entry).userCommands(); + TQStringList commands = (*entry).commands(); Q_ASSERT(!commands.isEmpty()); if ( commands.count() != userCommands.count() ) kdWarning() << "KDataTool desktop file error (" << (*entry).service()->entryPath() << "). " << commands.count() << " commands and " << userCommands.count() << " descriptions." << endl; - QStringList::ConstIterator uit = userCommands.begin(); - QStringList::ConstIterator cit = commands.begin(); + TQStringList::ConstIterator uit = userCommands.begin(); + TQStringList::ConstIterator cit = commands.begin(); for (; uit != userCommands.end() && cit != commands.end(); ++uit, ++cit ) { //kdDebug() << "creating action " << *uit << " " << *cit << endl; KDataToolAction * action = new KDataToolAction( *uit, *entry, *cit ); - connect( action, SIGNAL( toolActivated( const KDataToolInfo &, const QString & ) ), + connect( action, TQT_SIGNAL( toolActivated( const KDataToolInfo &, const TQString & ) ), receiver, slot ); actionList.append( action ); } @@ -266,8 +266,8 @@ QPtrList<KAction> KDataToolAction::dataToolActionList( const QValueList<KDataToo * *************************************************/ -KDataTool::KDataTool( QObject* parent, const char* name ) - : QObject( parent, name ), m_instance( 0L ) +KDataTool::KDataTool( TQObject* parent, const char* name ) + : TQObject( parent, name ), m_instance( 0L ) { } diff --git a/kio/kio/kdatatool.h b/kio/kio/kdatatool.h index 4871f08db..c27b8fbe5 100644 --- a/kio/kio/kdatatool.h +++ b/kio/kio/kdatatool.h @@ -21,8 +21,8 @@ #ifndef KDATATOOL_H #define KDATATOOL_H -#include <qobject.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqvaluelist.h> #include <kaction.h> #include <kservice.h> @@ -69,14 +69,14 @@ public: /** * Returns the data type that the DataTool can accept. * @return the C++ data type that this DataTool accepts. - * For example "QString" or "QImage" or something more + * For example "TQString" or "TQImage" or something more * complicated. */ - QString dataType() const; + TQString dataType() const; /** * Returns a list of mime type that will be accepted by the DataTool. * The mimetypes are only used if the dataType can be used to store - * different mimetypes. For example in a "QString" you could save "text/plain" + * different mimetypes. For example in a "TQString" you could save "text/plain" * or "text/html" or "text/xml". * * @return the mime types accepted by this DataTool. For example @@ -84,7 +84,7 @@ public: * determines the accepted type of data perfectly. In this cases * this list may be empty. */ - QStringList mimeTypes() const; + TQStringList mimeTypes() const; /** * Checks whether the DataTool is read-only. @@ -97,20 +97,20 @@ public: * @return a large pixmap for the DataTool. * @deprecated, use iconName() */ - QPixmap icon() const KDE_DEPRECATED; + TQPixmap icon() const KDE_DEPRECATED; /** * Returns the mini icon of this data tool. * @return a mini pixmap for the DataTool. * @deprecated, use iconName() */ - QPixmap miniIcon() const KDE_DEPRECATED; + TQPixmap miniIcon() const KDE_DEPRECATED; /** * Returns the icon name for this DataTool. * @return the name of the icon for the DataTool */ - QString iconName() const; + TQString iconName() const; /** - * Returns a list of strings that you can put in a QPopupMenu item, for example to + * Returns a list of strings that you can put in a TQPopupMenu item, for example to * offer the DataTools services to the user. The returned value * is usually something like "Spell checking", "Shrink Image", "Rotate Image" * or something like that. @@ -120,9 +120,9 @@ public: * Each of the strings returned corresponds to a string in the list returned by * commands. * - * @return a list of strings that you can put in a QPopupMenu item + * @return a list of strings that you can put in a TQPopupMenu item */ - QStringList userCommands() const; + TQStringList userCommands() const; /** * Returns the list of commands the DataTool can execute. The application * passes the command to the KDataTool::run method. @@ -134,15 +134,15 @@ public: * @return the list of commands the DataTool can execute, suitable for * the KDataTool::run method. */ - QStringList commands() const; + TQStringList commands() const; /** * Creates the data tool described by this KDataToolInfo. - * @param parent the parent of the QObject (or 0 for parent-less KDataTools) - * @param name the name of the QObject, can be 0 + * @param parent the parent of the TQObject (or 0 for parent-less KDataTools) + * @param name the name of the TQObject, can be 0 * @return a pointer to the created data tool or 0 on error. */ - KDataTool* createTool( QObject* parent = 0, const char* name = 0 ) const; + KDataTool* createTool( TQObject* parent = 0, const char* name = 0 ) const; /** * The KDataToolInfo's service that is represented by this class. @@ -165,13 +165,13 @@ public: /** * Queries the KTrader about installed KDataTool implementations. - * @param datatype a type that the application can 'export' to the tools (e.g. QString) + * @param datatype a type that the application can 'export' to the tools (e.g. TQString) * @param mimetype the mimetype of the data (e.g. text/plain) * @param instance the application (or the part)'s instance (to check if a tool is excluded from this part, * and also used if the tool wants to read its configuration in the app's config file). * @return the list of results */ - static QValueList<KDataToolInfo> query( const QString& datatype, const QString& mimetype, KInstance * instance ); + static TQValueList<KDataToolInfo> query( const TQString& datatype, const TQString& mimetype, KInstance * instance ); private: KService::Ptr m_service; @@ -204,7 +204,7 @@ public: * @param parent This action's parent. * @param name An internal name for this action. */ - KDataToolAction( const QString & text, const KDataToolInfo & info, const QString & command, QObject * parent = 0, const char * name = 0); + KDataToolAction( const TQString & text, const KDataToolInfo & info, const TQString & command, TQObject * parent = 0, const char * name = 0); /** * Creates a list of actions from a list of information about data-tools. @@ -216,7 +216,7 @@ public: * @param slot the slot that will receive the toolActivated() signals * @return the KActions */ - static QPtrList<KAction> dataToolActionList( const QValueList<KDataToolInfo> & tools, const QObject *receiver, const char* slot ); + static TQPtrList<KAction> dataToolActionList( const TQValueList<KDataToolInfo> & tools, const TQObject *receiver, const char* slot ); signals: /** @@ -224,13 +224,13 @@ signals: * @param info a description of the activated tools * @param command the command for the tool */ - void toolActivated( const KDataToolInfo & info, const QString & command ); + void toolActivated( const KDataToolInfo & info, const TQString & command ); protected: virtual void slotActivated(); private: - QString m_command; + TQString m_command; KDataToolInfo m_info; protected: virtual void virtual_hook( int id, void* data ); @@ -257,10 +257,10 @@ public: /** * Constructor * The data-tool is only created when a menu-item, that relates to it, is activated. - * @param parent the parent of the QObject (or 0 for parent-less KDataTools) - * @param name the name of the QObject, can be 0 + * @param parent the parent of the TQObject (or 0 for parent-less KDataTools) + * @param name the name of the TQObject, can be 0 */ - KDataTool( QObject* parent = 0, const char* name = 0 ); + KDataTool( TQObject* parent = 0, const char* name = 0 ); /** * @internal. Do not use under any circumstance (including bad weather). @@ -284,10 +284,10 @@ public: * and for getting it back and updating itself with it, after the tool ran. * @param datatype defines the type of @p data. * @param mimetype defines the mimetype of the data (for instance datatype may be - * QString, but the mimetype can be text/plain, text/html etc.) + * TQString, but the mimetype can be text/plain, text/html etc.) * @return true if successful, false otherwise */ - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype) = 0; + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype) = 0; private: KInstance * m_instance; diff --git a/kio/kio/kdcopservicestarter.cpp b/kio/kio/kdcopservicestarter.cpp index 023789ab8..3c9b55501 100644 --- a/kio/kio/kdcopservicestarter.cpp +++ b/kio/kio/kdcopservicestarter.cpp @@ -46,15 +46,15 @@ KDCOPServiceStarter::~KDCOPServiceStarter() { } -int KDCOPServiceStarter::findServiceFor( const QString& serviceType, - const QString& _constraint, - const QString& preferences, - QString *error, QCString* pDcopService, +int KDCOPServiceStarter::findServiceFor( const TQString& serviceType, + const TQString& _constraint, + const TQString& preferences, + TQString *error, TQCString* pDcopService, int flags ) { // Ask the trader which service is preferred for this servicetype // We want one that provides a DCOP interface - QString constraint = _constraint; + TQString constraint = _constraint; if ( !constraint.isEmpty() ) constraint += " and "; constraint += "exist [X-DCOP-ServiceName]"; @@ -66,11 +66,11 @@ int KDCOPServiceStarter::findServiceFor( const QString& serviceType, return -1; } KService::Ptr ptr = offers.first(); - QCString dcopService = ptr->property("X-DCOP-ServiceName").toString().latin1(); + TQCString dcopService = ptr->property("X-DCOP-ServiceName").toString().latin1(); if ( !kapp->dcopClient()->isApplicationRegistered( dcopService ) ) { - QString error; + TQString error; if ( startServiceFor( serviceType, constraint, preferences, &error, &dcopService, flags ) != 0 ) { kdDebug() << "KDCOPServiceStarter: Couldn't start service: " << error << endl; @@ -83,15 +83,15 @@ int KDCOPServiceStarter::findServiceFor( const QString& serviceType, return 0; } -int KDCOPServiceStarter::startServiceFor( const QString& serviceType, - const QString& constraint, - const QString& preferences, - QString *error, QCString* dcopService, int /*flags*/ ) +int KDCOPServiceStarter::startServiceFor( const TQString& serviceType, + const TQString& constraint, + const TQString& preferences, + TQString *error, TQCString* dcopService, int /*flags*/ ) { KTrader::OfferList offers = KTrader::self()->query(serviceType, "Application", constraint, preferences); if ( offers.isEmpty() ) return -1; KService::Ptr ptr = offers.first(); kdDebug() << "KDCOPServiceStarter: starting " << ptr->desktopEntryPath() << endl; - return kapp->startServiceByDesktopPath( ptr->desktopEntryPath(), QStringList(), error, dcopService ); + return kapp->startServiceByDesktopPath( ptr->desktopEntryPath(), TQStringList(), error, dcopService ); } diff --git a/kio/kio/kdcopservicestarter.h b/kio/kio/kdcopservicestarter.h index 1318c431a..c6b6b4e0e 100644 --- a/kio/kio/kdcopservicestarter.h +++ b/kio/kio/kdcopservicestarter.h @@ -19,7 +19,7 @@ #ifndef KDCOPSERVICESTARTER_H #define KDCOPSERVICESTARTER_H -#include <qstring.h> +#include <tqstring.h> #include <kstaticdeleter.h> class KDCOPServiceStarter; @@ -58,10 +58,10 @@ public: * * @return an error code indicating success (== 0) or failure (> 0). */ - int findServiceFor( const QString& serviceType, - const QString& constraint = QString::null, - const QString& preferences = QString::null, - QString *error=0, QCString* dcopService=0, + int findServiceFor( const TQString& serviceType, + const TQString& constraint = TQString::null, + const TQString& preferences = TQString::null, + TQString *error=0, TQCString* dcopService=0, int flags=0 ); /** @@ -86,10 +86,10 @@ public: * * @return an error code indicating success (== 0) or failure (> 0). */ - virtual int startServiceFor( const QString& serviceType, - const QString& constraint = QString::null, - const QString& preferences = QString::null, - QString *error=0, QCString* dcopService=0, + virtual int startServiceFor( const TQString& serviceType, + const TQString& constraint = TQString::null, + const TQString& preferences = TQString::null, + TQString *error=0, TQCString* dcopService=0, int flags=0 ); protected: KDCOPServiceStarter(); diff --git a/kio/kio/kdirlister.cpp b/kio/kio/kdirlister.cpp index 4c16a5d36..7be6da985 100644 --- a/kio/kio/kdirlister.cpp +++ b/kio/kio/kdirlister.cpp @@ -21,9 +21,9 @@ #include "kdirlister.h" -#include <qregexp.h> -#include <qptrlist.h> -#include <qtimer.h> +#include <tqregexp.h> +#include <tqptrlist.h> +#include <tqtimer.h> #include <kapplication.h> #include <kdebug.h> @@ -61,12 +61,12 @@ KDirListerCache::KDirListerCache( int maxCount ) urlsCurrentlyHeld.setAutoDelete( true ); pendingUpdates.setAutoDelete( true ); - connect( kdirwatch, SIGNAL( dirty( const QString& ) ), - this, SLOT( slotFileDirty( const QString& ) ) ); - connect( kdirwatch, SIGNAL( created( const QString& ) ), - this, SLOT( slotFileCreated( const QString& ) ) ); - connect( kdirwatch, SIGNAL( deleted( const QString& ) ), - this, SLOT( slotFileDeleted( const QString& ) ) ); + connect( kdirwatch, TQT_SIGNAL( dirty( const TQString& ) ), + this, TQT_SLOT( slotFileDirty( const TQString& ) ) ); + connect( kdirwatch, TQT_SIGNAL( created( const TQString& ) ), + this, TQT_SLOT( slotFileCreated( const TQString& ) ) ); + connect( kdirwatch, TQT_SIGNAL( deleted( const TQString& ) ), + this, TQT_SLOT( slotFileDeleted( const TQString& ) ) ); } KDirListerCache::~KDirListerCache() @@ -92,7 +92,7 @@ bool KDirListerCache::listDir( KDirLister *lister, const KURL& _u, KURL _url = _u; _url.cleanPath(); // kill consecutive slashes _url.adjustPath(-1); - QString urlStr = _url.url(); + TQString urlStr = _url.url(); if ( !lister->validURL( _url ) ) return false; @@ -186,7 +186,7 @@ bool KDirListerCache::listDir( KDirLister *lister, const KURL& _u, lister->emitItems(); Q_ASSERT( !urlsCurrentlyHeld[urlStr] ); - QPtrList<KDirLister> *list = new QPtrList<KDirLister>; + TQPtrList<KDirLister> *list = new TQPtrList<KDirLister>; list->append( lister ); urlsCurrentlyHeld.insert( urlStr, list ); @@ -203,7 +203,7 @@ bool KDirListerCache::listDir( KDirLister *lister, const KURL& _u, { kdDebug(7004) << "listDir: Entry not in cache or reloaded: " << _url << endl; - QPtrList<KDirLister> *list = new QPtrList<KDirLister>; + TQPtrList<KDirLister> *list = new TQPtrList<KDirLister>; list->append( lister ); urlsCurrentlyListed.insert( urlStr, list ); @@ -223,7 +223,7 @@ bool KDirListerCache::listDir( KDirLister *lister, const KURL& _u, lister->d->rootFileItem = 0; KIO::ListJob* job = KIO::listDir( _url, false /* no default GUI */ ); - jobs.insert( job, QValueList<KIO::UDSEntry>() ); + jobs.insert( job, TQValueList<KIO::UDSEntry>() ); lister->jobStarted( job ); lister->connectJob( job ); @@ -231,12 +231,12 @@ bool KDirListerCache::listDir( KDirLister *lister, const KURL& _u, if ( lister->d->window ) job->setWindow( lister->d->window ); - connect( job, SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList & ) ), - this, SLOT( slotEntries( KIO::Job *, const KIO::UDSEntryList & ) ) ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotResult( KIO::Job * ) ) ); - connect( job, SIGNAL( redirection( KIO::Job *, const KURL & ) ), - this, SLOT( slotRedirection( KIO::Job *, const KURL & ) ) ); + connect( job, TQT_SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList & ) ), + this, TQT_SLOT( slotEntries( KIO::Job *, const KIO::UDSEntryList & ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( redirection( KIO::Job *, const KURL & ) ), + this, TQT_SLOT( slotRedirection( KIO::Job *, const KURL & ) ) ); emit lister->started( _url ); @@ -279,7 +279,7 @@ bool KDirListerCache::validURL( const KDirLister *lister, const KURL& url ) cons { if ( lister->d->autoErrorHandling ) { - QString tmp = i18n("Malformed URL\n%1").arg( url.prettyURL() ); + TQString tmp = i18n("Malformed URL\n%1").arg( url.prettyURL() ); KMessageBox::error( lister->d->errorParent, tmp ); } return false; @@ -290,7 +290,7 @@ bool KDirListerCache::validURL( const KDirLister *lister, const KURL& url ) cons if ( lister->d->autoErrorHandling ) { // TODO: this message should be changed during next string unfreeze! - QString tmp = i18n("Malformed URL\n%1").arg( url.prettyURL() ); + TQString tmp = i18n("Malformed URL\n%1").arg( url.prettyURL() ); KMessageBox::error( lister->d->errorParent, tmp ); } return false; @@ -307,14 +307,14 @@ void KDirListerCache::stop( KDirLister *lister ) kdDebug(7004) << k_funcinfo << "lister: " << lister << endl; bool stopped = false; - QDictIterator< QPtrList<KDirLister> > it( urlsCurrentlyListed ); - QPtrList<KDirLister> *listers; + TQDictIterator< TQPtrList<KDirLister> > it( urlsCurrentlyListed ); + TQPtrList<KDirLister> *listers; while ( (listers = it.current()) ) { if ( listers->findRef( lister ) > -1 ) { // lister is listing url - QString url = it.currentKey(); + TQString url = it.currentKey(); //kdDebug(7004) << k_funcinfo << " found lister in list - for " << url << endl; bool ret = listers->removeRef( lister ); @@ -325,10 +325,10 @@ void KDirListerCache::stop( KDirLister *lister ) lister->jobDone( job ); // move lister to urlsCurrentlyHeld - QPtrList<KDirLister> *holders = urlsCurrentlyHeld[url]; + TQPtrList<KDirLister> *holders = urlsCurrentlyHeld[url]; if ( !holders ) { - holders = new QPtrList<KDirLister>; + holders = new TQPtrList<KDirLister>; urlsCurrentlyHeld.insert( url, holders ); } @@ -365,21 +365,21 @@ void KDirListerCache::stop( KDirLister *lister ) void KDirListerCache::stop( KDirLister *lister, const KURL& _u ) { - QString urlStr( _u.url(-1) ); + TQString urlStr( _u.url(-1) ); KURL _url( urlStr ); // TODO: consider to stop all the "child jobs" of _url as well kdDebug(7004) << k_funcinfo << lister << " url=" << _url << endl; - QPtrList<KDirLister> *listers = urlsCurrentlyListed[urlStr]; + TQPtrList<KDirLister> *listers = urlsCurrentlyListed[urlStr]; if ( !listers || !listers->removeRef( lister ) ) return; // move lister to urlsCurrentlyHeld - QPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr]; + TQPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr]; if ( !holders ) { - holders = new QPtrList<KDirLister>; + holders = new TQPtrList<KDirLister>; urlsCurrentlyHeld.insert( urlStr, holders ); } @@ -445,8 +445,8 @@ void KDirListerCache::forgetDirs( KDirLister *lister, const KURL& _url, bool not KURL url( _url ); url.adjustPath( -1 ); - QString urlStr = url.url(); - QPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr]; + TQString urlStr = url.url(); + TQPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr]; Q_ASSERT( holders ); holders->removeRef( lister ); @@ -534,7 +534,7 @@ void KDirListerCache::updateDirectory( const KURL& _dir ) { kdDebug(7004) << k_funcinfo << _dir << endl; - QString urlStr = _dir.url(-1); + TQString urlStr = _dir.url(-1); if ( !checkUpdate( urlStr ) ) return; @@ -544,12 +544,12 @@ void KDirListerCache::updateDirectory( const KURL& _dir ) // - update a currently running listing: the listers are in urlsCurrentlyListed // and urlsCurrentlyHeld - QPtrList<KDirLister> *listers = urlsCurrentlyListed[urlStr]; - QPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr]; + TQPtrList<KDirLister> *listers = urlsCurrentlyListed[urlStr]; + TQPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr]; // restart the job for _dir if it is running already bool killed = false; - QWidget *window = 0; + TQWidget *window = 0; KIO::ListJob *job = jobForUrl( urlStr ); if ( job ) { @@ -574,12 +574,12 @@ void KDirListerCache::updateDirectory( const KURL& _dir ) Q_ASSERT( !listers || (listers && killed) ); job = KIO::listDir( _dir, false /* no default GUI */ ); - jobs.insert( job, QValueList<KIO::UDSEntry>() ); + jobs.insert( job, TQValueList<KIO::UDSEntry>() ); - connect( job, SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList & )), - this, SLOT(slotUpdateEntries( KIO::Job *, const KIO::UDSEntryList & )) ); - connect( job, SIGNAL(result( KIO::Job * )), - this, SLOT(slotUpdateResult( KIO::Job * )) ); + connect( job, TQT_SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList & )), + this, TQT_SLOT(slotUpdateEntries( KIO::Job *, const KIO::UDSEntryList & )) ); + connect( job, TQT_SIGNAL(result( KIO::Job * )), + this, TQT_SLOT(slotUpdateResult( KIO::Job * )) ); kdDebug(7004) << k_funcinfo << "update started in " << _dir << endl; @@ -613,7 +613,7 @@ void KDirListerCache::updateDirectory( const KURL& _dir ) } } -bool KDirListerCache::checkUpdate( const QString& _dir ) +bool KDirListerCache::checkUpdate( const TQString& _dir ) { if ( !itemsInUse[_dir] ) { @@ -636,14 +636,14 @@ bool KDirListerCache::checkUpdate( const QString& _dir ) KFileItemList *KDirListerCache::itemsForDir( const KURL &_dir ) const { - QString urlStr = _dir.url(-1); + TQString urlStr = _dir.url(-1); DirItem *item = itemsInUse[ urlStr ]; if ( !item ) item = itemsCached[ urlStr ]; return item ? item->lstItems : 0; } -KFileItem *KDirListerCache::findByName( const KDirLister *lister, const QString& _name ) const +KFileItem *KDirListerCache::findByName( const KDirLister *lister, const TQString& _name ) const { Q_ASSERT( lister ); @@ -714,7 +714,7 @@ void KDirListerCache::FilesRemoved( const KURL::List &fileList ) // file items (see the dirtree). if ( fileitem ) { - QPtrList<KDirLister> *listers = urlsCurrentlyHeld[parentDir.url()]; + TQPtrList<KDirLister> *listers = urlsCurrentlyHeld[parentDir.url()]; if ( listers ) for ( KDirLister *kdl = listers->first(); kdl; kdl = listers->next() ) kdl->emitDeleteItem( fileitem ); @@ -807,8 +807,8 @@ void KDirListerCache::aboutToRefreshItem( KFileItem *fileitem ) // Look whether this item was shown in any view, i.e. held by any dirlister KURL parentDir( fileitem->url() ); parentDir.setPath( parentDir.directory() ); - QString parentDirURL = parentDir.url(); - QPtrList<KDirLister> *listers = urlsCurrentlyHeld[parentDirURL]; + TQString parentDirURL = parentDir.url(); + TQPtrList<KDirLister> *listers = urlsCurrentlyHeld[parentDirURL]; if ( listers ) for ( KDirLister *kdl = listers->first(); kdl; kdl = listers->next() ) kdl->aboutToRefreshItem( fileitem ); @@ -825,8 +825,8 @@ void KDirListerCache::emitRefreshItem( KFileItem *fileitem ) // Look whether this item was shown in any view, i.e. held by any dirlister KURL parentDir( fileitem->url() ); parentDir.setPath( parentDir.directory() ); - QString parentDirURL = parentDir.url(); - QPtrList<KDirLister> *listers = urlsCurrentlyHeld[parentDirURL]; + TQString parentDirURL = parentDir.url(); + TQPtrList<KDirLister> *listers = urlsCurrentlyHeld[parentDirURL]; if ( listers ) for ( KDirLister *kdl = listers->first(); kdl; kdl = listers->next() ) { @@ -861,7 +861,7 @@ bool KDirListerCache::exists() // private slots // _file can also be a directory being currently held! -void KDirListerCache::slotFileDirty( const QString& _file ) +void KDirListerCache::slotFileDirty( const TQString& _file ) { kdDebug(7004) << k_funcinfo << _file << endl; @@ -877,8 +877,8 @@ void KDirListerCache::slotFileDirty( const QString& _file ) if ( checkUpdate( dir.url() ) ) { // Nice hack to save memory: use the qt object name to store the filename - QTimer *timer = new QTimer( this, _file.utf8() ); - connect( timer, SIGNAL(timeout()), this, SLOT(slotFileDirtyDelayed()) ); + TQTimer *timer = new TQTimer( this, _file.utf8() ); + connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotFileDirtyDelayed()) ); pendingUpdates.insert( _file, timer ); timer->start( 500, true ); } @@ -888,11 +888,11 @@ void KDirListerCache::slotFileDirty( const QString& _file ) // delayed updating of files, FAM is flooding us with events void KDirListerCache::slotFileDirtyDelayed() { - QString file = QString::fromUtf8( sender()->name() ); + TQString file = TQString::fromUtf8( sender()->name() ); kdDebug(7004) << k_funcinfo << file << endl; - // TODO: do it better: don't always create/delete the QTimer but reuse it. + // TODO: do it better: don't always create/delete the TQTimer but reuse it. // Delete the timer after the parent directory is removed from the cache. pendingUpdates.remove( file ); @@ -908,7 +908,7 @@ void KDirListerCache::slotFileDirtyDelayed() } } -void KDirListerCache::slotFileCreated( const QString& _file ) +void KDirListerCache::slotFileCreated( const TQString& _file ) { kdDebug(7004) << k_funcinfo << _file << endl; // XXX: how to avoid a complete rescan here? @@ -918,7 +918,7 @@ void KDirListerCache::slotFileCreated( const QString& _file ) FilesAdded( u ); } -void KDirListerCache::slotFileDeleted( const QString& _file ) +void KDirListerCache::slotFileDeleted( const TQString& _file ) { kdDebug(7004) << k_funcinfo << _file << endl; KURL u; @@ -930,14 +930,14 @@ void KDirListerCache::slotEntries( KIO::Job *job, const KIO::UDSEntryList &entri { KURL url = joburl( static_cast<KIO::ListJob *>(job) ); url.adjustPath(-1); - QString urlStr = url.url(); + TQString urlStr = url.url(); kdDebug(7004) << k_funcinfo << "new entries for " << url << endl; DirItem *dir = itemsInUse[urlStr]; Q_ASSERT( dir ); - QPtrList<KDirLister> *listers = urlsCurrentlyListed[urlStr]; + TQPtrList<KDirLister> *listers = urlsCurrentlyListed[urlStr]; Q_ASSERT( listers ); Q_ASSERT( !listers->isEmpty() ); @@ -947,15 +947,15 @@ void KDirListerCache::slotEntries( KIO::Job *job, const KIO::UDSEntryList &entri delayedMimeTypes = delayedMimeTypes && kdl->d->delayedMimeTypes; // avoid creating these QStrings again and again - static const QString& dot = KGlobal::staticQString("."); - static const QString& dotdot = KGlobal::staticQString(".."); + static const TQString& dot = KGlobal::staticQString("."); + static const TQString& dotdot = KGlobal::staticQString(".."); KIO::UDSEntryListConstIterator it = entries.begin(); KIO::UDSEntryListConstIterator end = entries.end(); for ( ; it != end; ++it ) { - QString name; + TQString name; // find out about the name KIO::UDSEntry::ConstIterator entit = (*it).begin(); @@ -1004,14 +1004,14 @@ void KDirListerCache::slotResult( KIO::Job *j ) KURL jobUrl = joburl( job ); jobUrl.adjustPath(-1); // need remove trailing slashes again, in case of redirections - QString jobUrlStr = jobUrl.url(); + TQString jobUrlStr = jobUrl.url(); kdDebug(7004) << k_funcinfo << "finished listing " << jobUrl << endl; #ifdef DEBUG_CACHE printDebug(); #endif - QPtrList<KDirLister> *listers = urlsCurrentlyListed.take( jobUrlStr ); + TQPtrList<KDirLister> *listers = urlsCurrentlyListed.take( jobUrlStr ); Q_ASSERT( listers ); // move the directory to the held directories, do it before emitting @@ -1095,7 +1095,7 @@ void KDirListerCache::slotRedirection( KIO::Job *j, const KURL& url ) DirItem *dir = itemsInUse.take( oldUrl.url() ); Q_ASSERT( dir ); - QPtrList<KDirLister> *listers = urlsCurrentlyListed.take( oldUrl.url() ); + TQPtrList<KDirLister> *listers = urlsCurrentlyListed.take( oldUrl.url() ); Q_ASSERT( listers ); Q_ASSERT( !listers->isEmpty() ); @@ -1125,7 +1125,7 @@ void KDirListerCache::slotRedirection( KIO::Job *j, const KURL& url ) // when a lister was stopped before the job emits the redirection signal, the old url will // also be in urlsCurrentlyHeld - QPtrList<KDirLister> *holders = urlsCurrentlyHeld.take( oldUrl.url() ); + TQPtrList<KDirLister> *holders = urlsCurrentlyHeld.take( oldUrl.url() ); if ( holders ) { Q_ASSERT( !holders->isEmpty() ); @@ -1175,7 +1175,7 @@ void KDirListerCache::slotRedirection( KIO::Job *j, const KURL& url ) // listers of newUrl with oldJob: forget about the oldJob and use the already running one // which will be converted to an updateJob - QPtrList<KDirLister> *curListers = urlsCurrentlyListed[newUrl.url()]; + TQPtrList<KDirLister> *curListers = urlsCurrentlyListed[newUrl.url()]; if ( curListers ) { kdDebug(7004) << "slotRedirection: and it is currently listed" << endl; @@ -1201,7 +1201,7 @@ void KDirListerCache::slotRedirection( KIO::Job *j, const KURL& url ) killJob( oldJob ); // holders of newUrl: use the already running job which will be converted to an updateJob - QPtrList<KDirLister> *curHolders = urlsCurrentlyHeld[newUrl.url()]; + TQPtrList<KDirLister> *curHolders = urlsCurrentlyHeld[newUrl.url()]; if ( curHolders ) { kdDebug(7004) << "slotRedirection: and it is currently held." << endl; @@ -1301,10 +1301,10 @@ void KDirListerCache::slotRedirection( KIO::Job *j, const KURL& url ) // make the job an update job job->disconnect( this ); - connect( job, SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList & )), - this, SLOT(slotUpdateEntries( KIO::Job *, const KIO::UDSEntryList & )) ); - connect( job, SIGNAL(result( KIO::Job * )), - this, SLOT(slotUpdateResult( KIO::Job * )) ); + connect( job, TQT_SIGNAL(entries( KIO::Job *, const KIO::UDSEntryList & )), + this, TQT_SLOT(slotUpdateEntries( KIO::Job *, const KIO::UDSEntryList & )) ); + connect( job, TQT_SIGNAL(result( KIO::Job * )), + this, TQT_SLOT(slotUpdateResult( KIO::Job * )) ); // FIXME: autoUpdate-Counts!! @@ -1316,15 +1316,15 @@ void KDirListerCache::slotRedirection( KIO::Job *j, const KURL& url ) void KDirListerCache::renameDir( const KURL &oldUrl, const KURL &newUrl ) { kdDebug(7004) << k_funcinfo << oldUrl.prettyURL() << " -> " << newUrl.prettyURL() << endl; - QString oldUrlStr = oldUrl.url(-1); - QString newUrlStr = newUrl.url(-1); + TQString oldUrlStr = oldUrl.url(-1); + TQString newUrlStr = newUrl.url(-1); // Not enough. Also need to look at any child dir, even sub-sub-sub-dir. //DirItem *dir = itemsInUse.take( oldUrlStr ); //emitRedirections( oldUrl, url ); // Look at all dirs being listed/shown - QDictIterator<DirItem> itu( itemsInUse ); + TQDictIterator<DirItem> itu( itemsInUse ); bool goNext; while ( itu.current() ) { @@ -1336,7 +1336,7 @@ void KDirListerCache::renameDir( const KURL &oldUrl, const KURL &newUrl ) if ( oldUrl.isParentOf( oldDirUrl ) ) { // TODO should use KURL::cleanpath like isParentOf does - QString relPath = oldDirUrl.path().mid( oldUrl.path().length() ); + TQString relPath = oldDirUrl.path().mid( oldUrl.path().length() ); KURL newDirUrl( newUrl ); // take new base if ( !relPath.isEmpty() ) @@ -1355,7 +1355,7 @@ void KDirListerCache::renameDir( const KURL &oldUrl, const KURL &newUrl ) for ( ; kit.current(); ++kit ) { KURL oldItemUrl = (*kit)->url(); - QString oldItemUrlStr( oldItemUrl.url(-1) ); + TQString oldItemUrlStr( oldItemUrl.url(-1) ); KURL newItemUrl( oldItemUrl ); newItemUrl.setPath( newDirUrl.path() ); newItemUrl.addPath( oldItemUrl.fileName() ); @@ -1378,15 +1378,15 @@ void KDirListerCache::renameDir( const KURL &oldUrl, const KURL &newUrl ) void KDirListerCache::emitRedirections( const KURL &oldUrl, const KURL &url ) { kdDebug(7004) << k_funcinfo << oldUrl.prettyURL() << " -> " << url.prettyURL() << endl; - QString oldUrlStr = oldUrl.url(-1); - QString urlStr = url.url(-1); + TQString oldUrlStr = oldUrl.url(-1); + TQString urlStr = url.url(-1); KIO::ListJob *job = jobForUrl( oldUrlStr ); if ( job ) killJob( job ); // Check if we were listing this dir. Need to abort and restart with new name in that case. - QPtrList<KDirLister> *listers = urlsCurrentlyListed.take( oldUrlStr ); + TQPtrList<KDirLister> *listers = urlsCurrentlyListed.take( oldUrlStr ); if ( listers ) { // Tell the world that the job listing the old url is dead. @@ -1403,7 +1403,7 @@ void KDirListerCache::emitRedirections( const KURL &oldUrl, const KURL &url ) // Check if we are currently displaying this directory (odds opposite wrt above) // Update urlsCurrentlyHeld dict with new URL - QPtrList<KDirLister> *holders = urlsCurrentlyHeld.take( oldUrlStr ); + TQPtrList<KDirLister> *holders = urlsCurrentlyHeld.take( oldUrlStr ); if ( holders ) { if ( job ) @@ -1440,7 +1440,7 @@ void KDirListerCache::emitRedirections( const KURL &oldUrl, const KURL &url ) void KDirListerCache::removeDirFromCache( const KURL& dir ) { kdDebug(7004) << "KDirListerCache::removeDirFromCache " << dir.prettyURL() << endl; - QCacheIterator<DirItem> itc( itemsCached ); + TQCacheIterator<DirItem> itc( itemsCached ); while ( itc.current() ) { if ( dir.isParentOf( KURL( itc.currentKey() ) ) ) @@ -1462,14 +1462,14 @@ void KDirListerCache::slotUpdateResult( KIO::Job * j ) KURL jobUrl = joburl( job ); jobUrl.adjustPath(-1); // need remove trailing slashes again, in case of redirections - QString jobUrlStr = jobUrl.url(); + TQString jobUrlStr = jobUrl.url(); kdDebug(7004) << k_funcinfo << "finished update " << jobUrl << endl; KDirLister *kdl; - QPtrList<KDirLister> *listers = urlsCurrentlyHeld[jobUrlStr]; - QPtrList<KDirLister> *tmpLst = urlsCurrentlyListed.take( jobUrlStr ); + TQPtrList<KDirLister> *listers = urlsCurrentlyHeld[jobUrlStr]; + TQPtrList<KDirLister> *tmpLst = urlsCurrentlyListed.take( jobUrlStr ); if ( tmpLst ) { @@ -1524,7 +1524,7 @@ void KDirListerCache::slotUpdateResult( KIO::Job * j ) delayedMimeTypes = delayedMimeTypes && kdl->d->delayedMimeTypes; // should be enough to get reasonable speed in most cases - QDict<KFileItem> fileItems( 9973 ); + TQDict<KFileItem> fileItems( 9973 ); KFileItemListIterator kit ( *(dir->lstItems) ); @@ -1535,13 +1535,13 @@ void KDirListerCache::slotUpdateResult( KIO::Job * j ) fileItems.insert( (*kit)->url().url(), *kit ); } - static const QString& dot = KGlobal::staticQString("."); - static const QString& dotdot = KGlobal::staticQString(".."); + static const TQString& dot = KGlobal::staticQString("."); + static const TQString& dotdot = KGlobal::staticQString(".."); KFileItem *item = 0, *tmp; - QValueList<KIO::UDSEntry> buf = jobs[job]; - QValueListIterator<KIO::UDSEntry> it = buf.begin(); + TQValueList<KIO::UDSEntry> buf = jobs[job]; + TQValueListIterator<KIO::UDSEntry> it = buf.begin(); for ( ; it != buf.end(); ++it ) { // Form the complete url @@ -1551,7 +1551,7 @@ void KDirListerCache::slotUpdateResult( KIO::Job * j ) item->setUDSEntry( *it, jobUrl, delayedMimeTypes, true ); // Find out about the name - QString name = item->name(); + TQString name = item->name(); Q_ASSERT( !name.isEmpty() ); // we duplicate the check for dotdot here, to avoid iterating over @@ -1637,10 +1637,10 @@ void KDirListerCache::slotUpdateResult( KIO::Job * j ) // private -KIO::ListJob *KDirListerCache::jobForUrl( const QString& url, KIO::ListJob *not_job ) +KIO::ListJob *KDirListerCache::jobForUrl( const TQString& url, KIO::ListJob *not_job ) { KIO::ListJob *job; - QMap< KIO::ListJob *, QValueList<KIO::UDSEntry> >::Iterator it = jobs.begin(); + TQMap< KIO::ListJob *, TQValueList<KIO::UDSEntry> >::Iterator it = jobs.begin(); while ( it != jobs.end() ) { job = it.key(); @@ -1666,7 +1666,7 @@ void KDirListerCache::killJob( KIO::ListJob *job ) job->kill(); } -void KDirListerCache::deleteUnmarkedItems( QPtrList<KDirLister> *listers, KFileItemList *lstItems ) +void KDirListerCache::deleteUnmarkedItems( TQPtrList<KDirLister> *listers, KFileItemList *lstItems ) { // Find all unmarked items and delete them KFileItem* item; @@ -1696,7 +1696,7 @@ void KDirListerCache::deleteDir( const KURL& dirUrl ) // Idea: tell all the KDirListers that they should forget the dir // and then remove it from the cache. - QDictIterator<DirItem> itu( itemsInUse ); + TQDictIterator<DirItem> itu( itemsInUse ); while ( itu.current() ) { KURL deletedUrl( itu.currentKey() ); @@ -1704,11 +1704,11 @@ void KDirListerCache::deleteDir( const KURL& dirUrl ) { // stop all jobs for deletedUrl - QPtrList<KDirLister> *kdls = urlsCurrentlyListed[deletedUrl.url()]; + TQPtrList<KDirLister> *kdls = urlsCurrentlyListed[deletedUrl.url()]; if ( kdls ) // yeah, I lack good names { // we need a copy because stop modifies the list - kdls = new QPtrList<KDirLister>( *kdls ); + kdls = new TQPtrList<KDirLister>( *kdls ); for ( KDirLister *kdl = kdls->first(); kdl; kdl = kdls->next() ) stop( kdl, deletedUrl ); @@ -1722,7 +1722,7 @@ void KDirListerCache::deleteDir( const KURL& dirUrl ) if ( kdls ) { // we need a copy because forgetDirs modifies the list - kdls = new QPtrList<KDirLister>( *kdls ); + kdls = new TQPtrList<KDirLister>( *kdls ); for ( KDirLister *kdl = kdls->first(); kdl; kdl = kdls->next() ) { @@ -1773,46 +1773,46 @@ void KDirListerCache::processPendingUpdates() void KDirListerCache::printDebug() { kdDebug(7004) << "Items in use: " << endl; - QDictIterator<DirItem> itu( itemsInUse ); + TQDictIterator<DirItem> itu( itemsInUse ); for ( ; itu.current() ; ++itu ) { kdDebug(7004) << " " << itu.currentKey() << " URL: " << itu.current()->url << " rootItem: " << ( itu.current()->rootItem ? itu.current()->rootItem->url() : KURL() ) << " autoUpdates refcount: " << itu.current()->autoUpdates << " complete: " << itu.current()->complete - << ( itu.current()->lstItems ? QString(" with %1 items.").arg(itu.current()->lstItems->count()) : QString(" lstItems=NULL") ) << endl; + << ( itu.current()->lstItems ? TQString(" with %1 items.").arg(itu.current()->lstItems->count()) : TQString(" lstItems=NULL") ) << endl; } kdDebug(7004) << "urlsCurrentlyHeld: " << endl; - QDictIterator< QPtrList<KDirLister> > it( urlsCurrentlyHeld ); + TQDictIterator< TQPtrList<KDirLister> > it( urlsCurrentlyHeld ); for ( ; it.current() ; ++it ) { - QString list; - for ( QPtrListIterator<KDirLister> listit( *it.current() ); listit.current(); ++listit ) - list += " 0x" + QString::number( (long)listit.current(), 16 ); + TQString list; + for ( TQPtrListIterator<KDirLister> listit( *it.current() ); listit.current(); ++listit ) + list += " 0x" + TQString::number( (long)listit.current(), 16 ); kdDebug(7004) << " " << it.currentKey() << " " << it.current()->count() << " listers: " << list << endl; } kdDebug(7004) << "urlsCurrentlyListed: " << endl; - QDictIterator< QPtrList<KDirLister> > it2( urlsCurrentlyListed ); + TQDictIterator< TQPtrList<KDirLister> > it2( urlsCurrentlyListed ); for ( ; it2.current() ; ++it2 ) { - QString list; - for ( QPtrListIterator<KDirLister> listit( *it2.current() ); listit.current(); ++listit ) - list += " 0x" + QString::number( (long)listit.current(), 16 ); + TQString list; + for ( TQPtrListIterator<KDirLister> listit( *it2.current() ); listit.current(); ++listit ) + list += " 0x" + TQString::number( (long)listit.current(), 16 ); kdDebug(7004) << " " << it2.currentKey() << " " << it2.current()->count() << " listers: " << list << endl; } - QMap< KIO::ListJob *, QValueList<KIO::UDSEntry> >::Iterator jit = jobs.begin(); + TQMap< KIO::ListJob *, TQValueList<KIO::UDSEntry> >::Iterator jit = jobs.begin(); kdDebug(7004) << "Jobs: " << endl; for ( ; jit != jobs.end() ; ++jit ) kdDebug(7004) << " " << jit.key() << " listing " << joburl( jit.key() ).prettyURL() << ": " << (*jit).count() << " entries." << endl; kdDebug(7004) << "Items in cache: " << endl; - QCacheIterator<DirItem> itc( itemsCached ); + TQCacheIterator<DirItem> itc( itemsCached ); for ( ; itc.current() ; ++itc ) kdDebug(7004) << " " << itc.currentKey() << " rootItem: " - << ( itc.current()->rootItem ? itc.current()->rootItem->url().prettyURL() : QString("NULL") ) - << ( itc.current()->lstItems ? QString(" with %1 items.").arg(itc.current()->lstItems->count()) : QString(" lstItems=NULL") ) << endl; + << ( itc.current()->rootItem ? itc.current()->rootItem->url().prettyURL() : TQString("NULL") ) + << ( itc.current()->lstItems ? TQString(" with %1 items.").arg(itc.current()->lstItems->count()) : TQString(" lstItems=NULL") ) << endl; } #endif @@ -1922,7 +1922,7 @@ bool KDirLister::autoErrorHandlingEnabled() const return d->autoErrorHandling; } -void KDirLister::setAutoErrorHandlingEnabled( bool enable, QWidget* parent ) +void KDirLister::setAutoErrorHandlingEnabled( bool enable, TQWidget* parent ) { d->autoErrorHandling = enable; d->errorParent = parent; @@ -1943,8 +1943,8 @@ void KDirLister::emitChanges() if ( d->changes == NONE ) return; - static const QString& dot = KGlobal::staticQString("."); - static const QString& dotdot = KGlobal::staticQString(".."); + static const TQString& dot = KGlobal::staticQString("."); + static const TQString& dotdot = KGlobal::staticQString(".."); for ( KURL::List::Iterator it = d->lstDirs.begin(); it != d->lstDirs.end(); ++it ) @@ -2047,7 +2047,7 @@ KFileItem *KDirLister::findByURL( const KURL& _url ) const return s_pCache->findByURL( this, _url ); } -KFileItem *KDirLister::findByName( const QString& _name ) const +KFileItem *KDirLister::findByName( const TQString& _name ) const { return s_pCache->findByName( this, _name ); } @@ -2062,7 +2062,7 @@ KFileItem *KDirLister::find( const KURL& _url ) const // ================ public filter methods ================ // -void KDirLister::setNameFilter( const QString& nameFilter ) +void KDirLister::setNameFilter( const TQString& nameFilter ) { if ( !(d->changes & NAME_FILTER) ) { @@ -2076,19 +2076,19 @@ void KDirLister::setNameFilter( const QString& nameFilter ) d->nameFilter = nameFilter; // Split on white space - QStringList list = QStringList::split( ' ', nameFilter ); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) - d->lstFilters.append( new QRegExp(*it, false, true ) ); + TQStringList list = TQStringList::split( ' ', nameFilter ); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) + d->lstFilters.append( new TQRegExp(*it, false, true ) ); d->changes |= NAME_FILTER; } -const QString& KDirLister::nameFilter() const +const TQString& KDirLister::nameFilter() const { return d->nameFilter; } -void KDirLister::setMimeFilter( const QStringList& mimeFilter ) +void KDirLister::setMimeFilter( const TQStringList& mimeFilter ) { if ( !(d->changes & MIME_FILTER) ) d->oldMimeFilter = d->mimeFilter; @@ -2102,7 +2102,7 @@ void KDirLister::setMimeFilter( const QStringList& mimeFilter ) d->changes |= MIME_FILTER; } -void KDirLister::setMimeExcludeFilter( const QStringList& mimeExcludeFilter ) +void KDirLister::setMimeExcludeFilter( const TQStringList& mimeExcludeFilter ) { if ( !(d->changes & MIME_FILTER) ) d->oldMimeExcludeFilter = d->mimeExcludeFilter; @@ -2124,17 +2124,17 @@ void KDirLister::clearMimeFilter() d->changes |= MIME_FILTER; } -const QStringList& KDirLister::mimeFilters() const +const TQStringList& KDirLister::mimeFilters() const { return d->mimeFilter; } -bool KDirLister::matchesFilter( const QString& name ) const +bool KDirLister::matchesFilter( const TQString& name ) const { return doNameFilter( name, d->lstFilters ); } -bool KDirLister::matchesMimeFilter( const QString& mime ) const +bool KDirLister::matchesMimeFilter( const TQString& mime ) const { return doMimeFilter( mime, d->mimeFilter ) && doMimeExcludeFilter(mime,d->mimeExcludeFilter); } @@ -2144,7 +2144,7 @@ bool KDirLister::matchesMimeFilter( const QString& mime ) const bool KDirLister::matchesFilter( const KFileItem *item ) const { Q_ASSERT( item ); - static const QString& dotdot = KGlobal::staticQString(".."); + static const TQString& dotdot = KGlobal::staticQString(".."); if ( item->text() == dotdot ) return false; @@ -2167,23 +2167,23 @@ bool KDirLister::matchesMimeFilter( const KFileItem *item ) const return matchesMimeFilter( item->mimetype() ); } -bool KDirLister::doNameFilter( const QString& name, const QPtrList<QRegExp>& filters ) const +bool KDirLister::doNameFilter( const TQString& name, const TQPtrList<TQRegExp>& filters ) const { - for ( QPtrListIterator<QRegExp> it( filters ); it.current(); ++it ) + for ( TQPtrListIterator<TQRegExp> it( filters ); it.current(); ++it ) if ( it.current()->exactMatch( name ) ) return true; return false; } -bool KDirLister::doMimeFilter( const QString& mime, const QStringList& filters ) const +bool KDirLister::doMimeFilter( const TQString& mime, const TQStringList& filters ) const { if ( filters.isEmpty() ) return true; KMimeType::Ptr mimeptr = KMimeType::mimeType(mime); //kdDebug(7004) << "doMimeFilter: investigating: "<<mimeptr->name()<<endl; - QStringList::ConstIterator it = filters.begin(); + TQStringList::ConstIterator it = filters.begin(); for ( ; it != filters.end(); ++it ) if ( mimeptr->is(*it) ) return true; @@ -2193,12 +2193,12 @@ bool KDirLister::doMimeFilter( const QString& mime, const QStringList& filters ) return false; } -bool KDirLister::doMimeExcludeFilter( const QString& mime, const QStringList& filters ) const +bool KDirLister::doMimeExcludeFilter( const TQString& mime, const TQStringList& filters ) const { if ( filters.isEmpty() ) return true; - QStringList::ConstIterator it = filters.begin(); + TQStringList::ConstIterator it = filters.begin(); for ( ; it != filters.end(); ++it ) if ( (*it) == mime ) return false; @@ -2247,7 +2247,7 @@ void KDirLister::addNewItems( const KFileItemList& items ) // TODO: make this faster - test if we have a filter at all first // DF: was this profiled? The matchesFoo() functions should be fast, w/o filters... // Of course if there is no filter and we can do a range-insertion instead of a loop, that might be good. - // But that's for Qt4, not possible with QPtrList. + // But that's for Qt4, not possible with TQPtrList. for ( KFileItemListIterator kit( items ); kit.current(); ++kit ) addNewItem( *kit ); } @@ -2346,7 +2346,7 @@ void KDirLister::emitDeleteItem( KFileItem *item ) // ================ private slots ================ // -void KDirLister::slotInfoMessage( KIO::Job *, const QString& message ) +void KDirLister::slotInfoMessage( KIO::Job *, const TQString& message ) { emit infoMessage( message ); } @@ -2359,7 +2359,7 @@ void KDirLister::slotPercent( KIO::Job *job, unsigned long pcnt ) KIO::filesize_t size = 0; - QMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); + TQMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); while ( dataIt != d->jobData.end() ) { result += (*dataIt).percent * (*dataIt).totalSize; @@ -2379,7 +2379,7 @@ void KDirLister::slotTotalSize( KIO::Job *job, KIO::filesize_t size ) d->jobData[static_cast<KIO::ListJob *>(job)].totalSize = size; KIO::filesize_t result = 0; - QMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); + TQMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); while ( dataIt != d->jobData.end() ) { result += (*dataIt).totalSize; @@ -2394,7 +2394,7 @@ void KDirLister::slotProcessedSize( KIO::Job *job, KIO::filesize_t size ) d->jobData[static_cast<KIO::ListJob *>(job)].processedSize = size; KIO::filesize_t result = 0; - QMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); + TQMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); while ( dataIt != d->jobData.end() ) { result += (*dataIt).processedSize; @@ -2409,7 +2409,7 @@ void KDirLister::slotSpeed( KIO::Job *job, unsigned long spd ) d->jobData[static_cast<KIO::ListJob *>(job)].speed = spd; int result = 0; - QMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); + TQMap< KIO::ListJob *, KDirListerPrivate::JobData >::Iterator dataIt = d->jobData.begin(); while ( dataIt != d->jobData.end() ) { result += (*dataIt).speed; @@ -2443,24 +2443,24 @@ void KDirLister::jobStarted( KIO::ListJob *job ) void KDirLister::connectJob( KIO::ListJob *job ) { - connect( job, SIGNAL(infoMessage( KIO::Job *, const QString& )), - this, SLOT(slotInfoMessage( KIO::Job *, const QString& )) ); - connect( job, SIGNAL(percent( KIO::Job *, unsigned long )), - this, SLOT(slotPercent( KIO::Job *, unsigned long )) ); - connect( job, SIGNAL(totalSize( KIO::Job *, KIO::filesize_t )), - this, SLOT(slotTotalSize( KIO::Job *, KIO::filesize_t )) ); - connect( job, SIGNAL(processedSize( KIO::Job *, KIO::filesize_t )), - this, SLOT(slotProcessedSize( KIO::Job *, KIO::filesize_t )) ); - connect( job, SIGNAL(speed( KIO::Job *, unsigned long )), - this, SLOT(slotSpeed( KIO::Job *, unsigned long )) ); + connect( job, TQT_SIGNAL(infoMessage( KIO::Job *, const TQString& )), + this, TQT_SLOT(slotInfoMessage( KIO::Job *, const TQString& )) ); + connect( job, TQT_SIGNAL(percent( KIO::Job *, unsigned long )), + this, TQT_SLOT(slotPercent( KIO::Job *, unsigned long )) ); + connect( job, TQT_SIGNAL(totalSize( KIO::Job *, KIO::filesize_t )), + this, TQT_SLOT(slotTotalSize( KIO::Job *, KIO::filesize_t )) ); + connect( job, TQT_SIGNAL(processedSize( KIO::Job *, KIO::filesize_t )), + this, TQT_SLOT(slotProcessedSize( KIO::Job *, KIO::filesize_t )) ); + connect( job, TQT_SIGNAL(speed( KIO::Job *, unsigned long )), + this, TQT_SLOT(slotSpeed( KIO::Job *, unsigned long )) ); } -void KDirLister::setMainWindow( QWidget *window ) +void KDirLister::setMainWindow( TQWidget *window ) { d->window = window; } -QWidget *KDirLister::mainWindow() +TQWidget *KDirLister::mainWindow() { return d->window; } diff --git a/kio/kio/kdirlister.h b/kio/kio/kdirlister.h index 8806cc718..8a0109e89 100644 --- a/kio/kio/kdirlister.h +++ b/kio/kio/kdirlister.h @@ -24,8 +24,8 @@ #include "kfileitem.h" #include "kdirnotify.h" -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <kurl.h> @@ -63,8 +63,8 @@ class KIO_EXPORT KDirLister : public QObject Q_PROPERTY( bool showingDotFiles READ showingDotFiles WRITE setShowingDotFiles ) Q_PROPERTY( bool dirOnlyMode READ dirOnlyMode WRITE setDirOnlyMode ) Q_PROPERTY( bool autoErrorHandlingEnabled READ autoErrorHandlingEnabled ) - Q_PROPERTY( QString nameFilter READ nameFilter WRITE setNameFilter ) - Q_PROPERTY( QStringList mimeFilter READ mimeFilters WRITE setMimeFilter RESET clearMimeFilter ) + Q_PROPERTY( TQString nameFilter READ nameFilter WRITE setNameFilter ) + Q_PROPERTY( TQStringList mimeFilter READ mimeFilters WRITE setMimeFilter RESET clearMimeFilter ) public: /** @@ -156,7 +156,7 @@ public: * top-level * @see autoErrorHandlingEnabled() */ - void setAutoErrorHandlingEnabled( bool enable, QWidget *parent ); + void setAutoErrorHandlingEnabled( bool enable, TQWidget *parent ); /** * Checks whether hidden files (files beginning with a dot) will be @@ -259,7 +259,7 @@ public: * @param name the item name * @return the pointer to the KFileItem */ - virtual KFileItem *findByName( const QString& name ) const; + virtual KFileItem *findByName( const TQString& name ) const; /** * Set a name filter to only list items matching this name, e.g. "*.cpp". @@ -268,17 +268,17 @@ public: * "*.cpp *.h". * Note: the direcory is not automatically reloaded. * - * @param filter the new filter, QString::null to disable filtering + * @param filter the new filter, TQString::null to disable filtering * @see matchesFilter */ - virtual void setNameFilter( const QString &filter ); + virtual void setNameFilter( const TQString &filter ); /** * Returns the current name filter, as set via setNameFilter() - * @return the current name filter, can be QString::null if filtering + * @return the current name filter, can be TQString::null if filtering * is turned off */ - const QString& nameFilter() const; + const TQString& nameFilter() const; /** * Set mime-based filter to only list items matching the given mimetypes. @@ -291,7 +291,7 @@ public: * @see clearMimeFilter * @see matchesMimeFilter */ - virtual void setMimeFilter( const QStringList &mimeList ); + virtual void setMimeFilter( const TQStringList &mimeList ); /** * Filtering should be done with KFileFilter. This will be implemented in a later @@ -308,7 +308,7 @@ public: * @since 3.1 * @internal */ - void setMimeExcludeFilter(const QStringList &mimeList ); + void setMimeExcludeFilter(const TQStringList &mimeList ); /** @@ -322,7 +322,7 @@ public: * Returns the list of mime based filters, as set via setMimeFilter(). * @return the list of mime based filters. Empty, when no mime filter is set. */ - const QStringList& mimeFilters() const; + const TQStringList& mimeFilters() const; /** * Checks whether @p name matches a filter in the list of name filters. @@ -330,7 +330,7 @@ public: * otherwise false. * @see setNameFilter */ - bool matchesFilter( const QString& name ) const; + bool matchesFilter( const TQString& name ) const; /** * Checks whether @p mime matches a filter in the list of mime types @@ -339,7 +339,7 @@ public: * otherwise false. * @see setMimeFilter. */ - bool matchesMimeFilter( const QString& mime ) const; + bool matchesMimeFilter( const TQString& mime ) const; /** * Pass the main window this object is associated with @@ -347,14 +347,14 @@ public: * @param window the window to associate with, 0 to disassociate * @since 3.1 */ - void setMainWindow( QWidget *window ); + void setMainWindow( TQWidget *window ); /** * Returns the main window associated with this object. * @return the associated main window, or 0 if there is none * @since 3.1 */ - QWidget *mainWindow(); + TQWidget *mainWindow(); /** * Used by items() and itemsForDir() to specify whether you want @@ -507,7 +507,7 @@ signals: * Examples of message are "Resolving host", "Connecting to host...", etc. * @param msg the info message */ - void infoMessage( const QString& msg ); + void infoMessage( const TQString& msg ); /** * Progress signal showing the overall progress of the KDirLister. @@ -574,7 +574,7 @@ protected: * @param name the name to filter * @param filters a list of regular expressions for filtering */ - virtual bool doNameFilter( const QString& name, const QPtrList<QRegExp>& filters ) const; + virtual bool doNameFilter( const TQString& name, const TQPtrList<TQRegExp>& filters ) const; /** * Called by the public matchesMimeFilter() to do the @@ -583,12 +583,12 @@ protected: * @param mime the mime type to filter * @param filters the list of mime types to filter */ - virtual bool doMimeFilter( const QString& mime, const QStringList& filters ) const; + virtual bool doMimeFilter( const TQString& mime, const TQStringList& filters ) const; /** * @internal */ - bool doMimeExcludeFilter( const QString& mimeExclude, const QStringList& filters ) const; + bool doMimeExcludeFilter( const TQString& mimeExclude, const TQStringList& filters ) const; /** * Checks if an url is malformed or not and displays an error message @@ -604,7 +604,7 @@ protected: virtual void virtual_hook( int id, void *data ); private slots: - void slotInfoMessage( KIO::Job *, const QString& ); + void slotInfoMessage( KIO::Job *, const TQString& ); void slotPercent( KIO::Job *, unsigned long ); void slotTotalSize( KIO::Job *, KIO::filesize_t ); void slotProcessedSize( KIO::Job *, KIO::filesize_t ); diff --git a/kio/kio/kdirlister_p.h b/kio/kio/kdirlister_p.h index 1a157e2bf..5d70ce084 100644 --- a/kio/kio/kdirlister_p.h +++ b/kio/kio/kdirlister_p.h @@ -22,10 +22,10 @@ #include "kfileitem.h" -#include <qmap.h> -#include <qdict.h> -#include <qcache.h> -#include <qwidget.h> +#include <tqmap.h> +#include <tqdict.h> +#include <tqcache.h> +#include <tqwidget.h> #include <kurl.h> #include <kio/global.h> @@ -84,7 +84,7 @@ public: bool dirOnlyMode; bool autoErrorHandling; - QWidget *errorParent; + TQWidget *errorParent; bool delayedMimeTypes; @@ -93,7 +93,7 @@ public: KIO::filesize_t processedSize, totalSize; }; - QMap<KIO::ListJob *, JobData> jobData; + TQMap<KIO::ListJob *, JobData> jobData; // file item for the root itself (".") KFileItem *rootFileItem; @@ -105,12 +105,12 @@ public: int changes; - QWidget *window; // Main window ths lister is associated with + TQWidget *window; // Main window ths lister is associated with - QString nameFilter; - QPtrList<QRegExp> lstFilters, oldFilters; - QStringList mimeFilter, oldMimeFilter; - QStringList mimeExcludeFilter, oldMimeExcludeFilter; + TQString nameFilter; + TQPtrList<TQRegExp> lstFilters, oldFilters; + TQStringList mimeFilter, oldMimeFilter; + TQStringList mimeExcludeFilter, oldMimeExcludeFilter; }; /** @@ -126,7 +126,7 @@ public: * a URL -> dirlister holding that URL (urlsCurrentlyHeld) * a URL -> dirlister currently listing that URL (urlsCurrentlyListed) */ -class KDirListerCache : public QObject, KDirNotify +class KDirListerCache : public TQObject, KDirNotify { Q_OBJECT public: @@ -150,7 +150,7 @@ public: KFileItemList *itemsForDir( const KURL &_dir ) const; - KFileItem *findByName( const KDirLister *lister, const QString &_name ) const; + KFileItem *findByName( const KDirLister *lister, const TQString &_name ) const; // if lister is set, it is checked that the url is held by the lister KFileItem *findByURL( const KDirLister *lister, const KURL &_url ) const; @@ -185,9 +185,9 @@ public: static bool exists(); private slots: - void slotFileDirty( const QString &_file ); - void slotFileCreated( const QString &_file ); - void slotFileDeleted( const QString &_file ); + void slotFileDirty( const TQString &_file ); + void slotFileCreated( const TQString &_file ); + void slotFileDeleted( const TQString &_file ); void slotFileDirtyDelayed(); @@ -199,18 +199,18 @@ private slots: void slotUpdateResult( KIO::Job *job ); private: - KIO::ListJob *jobForUrl( const QString& url, KIO::ListJob *not_job = 0 ); + KIO::ListJob *jobForUrl( const TQString& url, KIO::ListJob *not_job = 0 ); const KURL& joburl( KIO::ListJob *job ); void killJob( KIO::ListJob *job ); // check if _url is held by some lister and return true, // otherwise schedule a delayed update and return false - bool checkUpdate( const QString& _url ); + bool checkUpdate( const TQString& _url ); // when there were items deleted from the filesystem all the listers holding // the parent directory need to be notified, the unmarked items have to be deleted // and removed from the cache including all the childs. - void deleteUnmarkedItems( QPtrList<KDirLister> *, KFileItemList * ); + void deleteUnmarkedItems( TQPtrList<KDirLister> *, KFileItemList * ); void processPendingUpdates(); // common for slotRedirection and FileRenamed void renameDir( const KURL &oldUrl, const KURL &url ); @@ -255,8 +255,8 @@ private: DCOPClient *client = DCOPClient::mainClient(); if ( !client ) return; - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); arg << url; client->emitDCOPSignal( "KDirNotify", entering ? "enteredDirectory(KURL)" : "leftDirectory(KURL)", data ); } @@ -320,11 +320,11 @@ private: }; static const unsigned short MAX_JOBS_PER_LISTER; - QMap<KIO::ListJob *, KIO::UDSEntryList> jobs; + TQMap<KIO::ListJob *, KIO::UDSEntryList> jobs; // an item is a complete directory - QDict<DirItem> itemsInUse; - QCache<DirItem> itemsCached; + TQDict<DirItem> itemsInUse; + TQCache<DirItem> itemsCached; // A lister can be EITHER in urlsCurrentlyListed OR urlsCurrentlyHeld but NOT // in both at the same time. @@ -336,13 +336,13 @@ private: // saves all urls that are currently being listed and maps them // to their KDirListers - QDict< QPtrList<KDirLister> > urlsCurrentlyListed; + TQDict< TQPtrList<KDirLister> > urlsCurrentlyListed; // saves all KDirListers that are just holding url - QDict< QPtrList<KDirLister> > urlsCurrentlyHeld; + TQDict< TQPtrList<KDirLister> > urlsCurrentlyHeld; // running timers for the delayed update - QDict<QTimer> pendingUpdates; + TQDict<TQTimer> pendingUpdates; static KDirListerCache *s_pSelf; }; diff --git a/kio/kio/kdirnotify.cpp b/kio/kio/kdirnotify.cpp index 69b9e11af..fb98196f5 100644 --- a/kio/kio/kdirnotify.cpp +++ b/kio/kio/kdirnotify.cpp @@ -23,7 +23,7 @@ int KDirNotify::s_serial = 0; KDirNotify::KDirNotify() - : DCOPObject( QCString().sprintf("KDirNotify-%d", ++s_serial) ) + : DCOPObject( TQCString().sprintf("KDirNotify-%d", ++s_serial) ) { connectDCOPSignal(0, "KDirNotify", "FilesAdded(KURL)", "FilesAdded(KURL)", false); connectDCOPSignal(0, "KDirNotify", "FilesRemoved(KURL::List)", "FilesRemoved(KURL::List)", false); diff --git a/kio/kio/kdirnotify_stub.cpp b/kio/kio/kdirnotify_stub.cpp index fe160d821..66988d6c9 100644 --- a/kio/kio/kdirnotify_stub.cpp +++ b/kio/kio/kdirnotify_stub.cpp @@ -30,12 +30,12 @@ #include <kdatastream.h> -KDirNotify_stub::KDirNotify_stub( const QCString& app, const QCString& obj ) +KDirNotify_stub::KDirNotify_stub( const TQCString& app, const TQCString& obj ) : DCOPStub( app, obj ) { } -KDirNotify_stub::KDirNotify_stub( DCOPClient* client, const QCString& app, const QCString& obj ) +KDirNotify_stub::KDirNotify_stub( DCOPClient* client, const TQCString& app, const TQCString& obj ) : DCOPStub( client, app, obj ) { } @@ -51,8 +51,8 @@ void KDirNotify_stub::FilesAdded( const KURL& arg0 ) setStatus( CallFailed ); return; } - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); arg << arg0; dcopClient()->emitDCOPSignal( "KDirNotify", "FilesAdded(KURL)", data ); setStatus( CallSucceeded ); @@ -64,8 +64,8 @@ void KDirNotify_stub::FilesRemoved( const KURL::List& arg0 ) setStatus( CallFailed ); return; } - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); arg << arg0; dcopClient()->emitDCOPSignal( "KDirNotify", "FilesRemoved(KURL::List)", data ); setStatus( CallSucceeded ); @@ -77,8 +77,8 @@ void KDirNotify_stub::FilesChanged( const KURL::List& arg0 ) setStatus( CallFailed ); return; } - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); arg << arg0; dcopClient()->emitDCOPSignal( "KDirNotify", "FilesChanged(KURL::List)", data ); setStatus( CallSucceeded ); @@ -90,8 +90,8 @@ void KDirNotify_stub::FileRenamed( const KURL& arg0, const KURL& arg1 ) setStatus( CallFailed ); return; } - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); arg << arg0; arg << arg1; dcopClient()->emitDCOPSignal( "KDirNotify", "FileRenamed(KURL,KURL)", data ); diff --git a/kio/kio/kdirnotify_stub.h b/kio/kio/kdirnotify_stub.h index d73a4134a..a807ecf82 100644 --- a/kio/kio/kdirnotify_stub.h +++ b/kio/kio/kdirnotify_stub.h @@ -17,8 +17,8 @@ class KIO_EXPORT KDirNotify_stub : virtual public DCOPStub { public: - KDirNotify_stub( const QCString& app, const QCString& id ); - KDirNotify_stub( DCOPClient* client, const QCString& app, const QCString& id ); + KDirNotify_stub( const TQCString& app, const TQCString& id ); + KDirNotify_stub( DCOPClient* client, const TQCString& app, const TQCString& id ); explicit KDirNotify_stub( const DCOPRef& ref ); virtual ASYNC FilesAdded( const KURL& directory ); virtual ASYNC FilesRemoved( const KURL::List& fileList ); diff --git a/kio/kio/kdirwatch.cpp b/kio/kio/kdirwatch.cpp index aaa807ed6..08ab25b89 100644 --- a/kio/kio/kdirwatch.cpp +++ b/kio/kio/kdirwatch.cpp @@ -46,13 +46,13 @@ #include <sys/stat.h> #include <assert.h> -#include <qdir.h> -#include <qfile.h> -#include <qintdict.h> -#include <qptrlist.h> -#include <qsocketnotifier.h> -#include <qstringlist.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqintdict.h> +#include <tqptrlist.h> +#include <tqsocketnotifier.h> +#include <tqstringlist.h> +#include <tqtimer.h> #include <kapplication.h> #include <kdebug.h> @@ -120,7 +120,7 @@ void KDirWatchPrivate::dnotify_handler(int, siginfo_t *si, void *) Entry* e = dwp_self->fd_Entry.find(si->si_fd); // kdDebug(7001) << "DNOTIFY Handler: fd " << si->si_fd << " path " -// << QString(e ? e->path:"unknown") << endl; +// << TQString(e ? e->path:"unknown") << endl; if(e && e->dn_fd == si->si_fd) e->dirty = true; @@ -177,7 +177,7 @@ void KDirWatchPrivate::dnotify_sigio_handler(int sig, siginfo_t *si, void *p) * At the moment, the following methods for file watching * are supported: * - Polling: All files to be watched are polled regularly - * using stat (more precise: QFileInfo.lastModified()). + * using stat (more precise: TQFileInfo.lastModified()). * The polling frequency is determined from global kconfig * settings, defaulting to 500 ms for local directories * and 5000 ms for remote mounts @@ -201,32 +201,32 @@ void KDirWatchPrivate::dnotify_sigio_handler(int sig, siginfo_t *si, void *p) KDirWatchPrivate::KDirWatchPrivate() : rescan_timer(0, "KDirWatchPrivate::rescan_timer") { - timer = new QTimer(this, "KDirWatchPrivate::timer"); - connect (timer, SIGNAL(timeout()), this, SLOT(slotRescan())); + timer = new TQTimer(this, "KDirWatchPrivate::timer"); + connect (timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotRescan())); freq = 3600000; // 1 hour as upper bound statEntries = 0; delayRemove = false; m_ref = 0; - KConfigGroup config(KGlobal::config(), QCString("DirWatch")); + KConfigGroup config(KGlobal::config(), TQCString("DirWatch")); m_nfsPollInterval = config.readNumEntry("NFSPollInterval", 5000); m_PollInterval = config.readNumEntry("PollInterval", 500); - QString available("Stat"); + TQString available("Stat"); // used for FAM and DNOTIFY rescan_all = false; - connect(&rescan_timer, SIGNAL(timeout()), this, SLOT(slotRescan())); + connect(&rescan_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotRescan())); #ifdef HAVE_FAM // It's possible that FAM server can't be started if (FAMOpen(&fc) ==0) { available += ", FAM"; use_fam=true; - sn = new QSocketNotifier( FAMCONNECTION_GETFD(&fc), - QSocketNotifier::Read, this); - connect( sn, SIGNAL(activated(int)), - this, SLOT(famEventReceived()) ); + sn = new TQSocketNotifier( FAMCONNECTION_GETFD(&fc), + TQSocketNotifier::Read, this); + connect( sn, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(famEventReceived()) ); } else { kdDebug(7001) << "Can't use FAM (fam daemon not running?)" << endl; @@ -261,8 +261,8 @@ KDirWatchPrivate::KDirWatchPrivate() available += ", Inotify"; fcntl(m_inotify_fd, F_SETFD, FD_CLOEXEC); - mSn = new QSocketNotifier( m_inotify_fd, QSocketNotifier::Read, this ); - connect( mSn, SIGNAL(activated( int )), this, SLOT( slotActivated() ) ); + mSn = new TQSocketNotifier( m_inotify_fd, TQSocketNotifier::Read, this ); + connect( mSn, TQT_SIGNAL(activated( int )), this, TQT_SLOT( slotActivated() ) ); } #endif @@ -295,8 +295,8 @@ KDirWatchPrivate::KDirWatchPrivate() fcntl(mPipe[1], F_SETFD, FD_CLOEXEC); fcntl(mPipe[0], F_SETFL, O_NONBLOCK | fcntl(mPipe[0], F_GETFL)); fcntl(mPipe[1], F_SETFL, O_NONBLOCK | fcntl(mPipe[1], F_GETFL)); - mSn = new QSocketNotifier( mPipe[0], QSocketNotifier::Read, this); - connect(mSn, SIGNAL(activated(int)), this, SLOT(slotActivated())); + mSn = new TQSocketNotifier( mPipe[0], TQSocketNotifier::Read, this); + connect(mSn, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotActivated())); // Install the signal handler only once if ( dnotify_signal == 0 ) { @@ -388,9 +388,9 @@ void KDirWatchPrivate::slotActivated() pending -= sizeof( struct inotify_event ) + event->len; offset += sizeof( struct inotify_event ) + event->len; - QString path; + TQString path; if ( event->len ) - path = QFile::decodeName( QCString( event->name, event->len ) ); + path = TQFile::decodeName( TQCString( event->name, event->len ) ); if ( path.length() && isNoisyFile( path.latin1() ) ) continue; @@ -411,9 +411,9 @@ void KDirWatchPrivate::slotActivated() kdDebug(7001) << "-->got deleteself signal for " << e->path << endl; e->m_status = NonExistent; if (e->isDir) - addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true); + addEntry(0, TQDir::cleanDirPath(e->path+"/.."), e, true); else - addEntry(0, QFileInfo(e->path).dirPath(true), e, true); + addEntry(0, TQFileInfo(e->path).dirPath(true), e, true); } if ( event->mask & IN_IGNORED ) { e->wd = 0; @@ -426,7 +426,7 @@ void KDirWatchPrivate::slotActivated() if (sub_entry /*&& sub_entry->isDir*/) { removeEntry(0,e->path, sub_entry); KDE_struct_stat stat_buf; - QCString tpath = QFile::encodeName(path); + TQCString tpath = TQFile::encodeName(path); KDE_stat(tpath, &stat_buf); //sub_entry->isDir = S_ISDIR(stat_buf.st_mode); @@ -459,7 +459,7 @@ void KDirWatchPrivate::slotActivated() */ void KDirWatchPrivate::Entry::propagate_dirty() { - for (QPtrListIterator<Entry> sub_entry (m_entries); + for (TQPtrListIterator<Entry> sub_entry (m_entries); sub_entry.current(); ++sub_entry) { if (!sub_entry.current()->dirty) @@ -521,14 +521,14 @@ int KDirWatchPrivate::Entry::clients() } -KDirWatchPrivate::Entry* KDirWatchPrivate::entry(const QString& _path) +KDirWatchPrivate::Entry* KDirWatchPrivate::entry(const TQString& _path) { // we only support absolute paths - if (QDir::isRelativePath(_path)) { + if (TQDir::isRelativePath(_path)) { return 0; } - QString path = _path; + TQString path = _path; if ( path.length() > 1 && path.right(1) == "/" ) path.truncate( path.length() - 1 ); @@ -570,10 +570,10 @@ bool KDirWatchPrivate::useFAM(Entry* e) if (e->isDir) { if (e->m_status == NonExistent) { // If the directory does not exist we watch the parent directory - addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true); + addEntry(0, TQDir::cleanDirPath(e->path+"/.."), e, true); } else { - int res =FAMMonitorDirectory(&fc, QFile::encodeName(e->path), + int res =FAMMonitorDirectory(&fc, TQFile::encodeName(e->path), &(e->fr), e); if (res<0) { e->m_mode = UnknownMode; @@ -588,10 +588,10 @@ bool KDirWatchPrivate::useFAM(Entry* e) else { if (e->m_status == NonExistent) { // If the file does not exist we watch the directory - addEntry(0, QFileInfo(e->path).dirPath(true), e, true); + addEntry(0, TQFileInfo(e->path).dirPath(true), e, true); } else { - int res = FAMMonitorFile(&fc, QFile::encodeName(e->path), + int res = FAMMonitorFile(&fc, TQFile::encodeName(e->path), &(e->fr), e); if (res<0) { e->m_mode = UnknownMode; @@ -626,7 +626,7 @@ bool KDirWatchPrivate::useDNotify(Entry* e) if (e->isDir) { if (e->m_status == Normal) { - int fd = KDE_open(QFile::encodeName(e->path).data(), O_RDONLY); + int fd = KDE_open(TQFile::encodeName(e->path).data(), O_RDONLY); // Migrate fd to somewhere above 128. Some libraries have // constructs like: // fd = socket(...) @@ -673,13 +673,13 @@ bool KDirWatchPrivate::useDNotify(Entry* e) << ") for " << e->path << endl; } else { // NotExisting - addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true); + addEntry(0, TQDir::cleanDirPath(e->path+"/.."), e, true); } } else { // File // we always watch the directory (DNOTIFY can't watch files alone) // this notifies us about changes of files therein - addEntry(0, QFileInfo(e->path).dirPath(true), e, true); + addEntry(0, TQFileInfo(e->path).dirPath(true), e, true); } return true; @@ -708,14 +708,14 @@ bool KDirWatchPrivate::useINotify( Entry* e ) } if ( ( e->wd = inotify_add_watch( m_inotify_fd, - QFile::encodeName( e->path ), mask) ) > 0 ) + TQFile::encodeName( e->path ), mask) ) > 0 ) return true; if ( e->m_status == NonExistent ) { if (e->isDir) - addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true); + addEntry(0, TQDir::cleanDirPath(e->path+"/.."), e, true); else - addEntry(0, QFileInfo(e->path).dirPath(true), e, true); + addEntry(0, TQFileInfo(e->path).dirPath(true), e, true); return true; } @@ -753,10 +753,10 @@ bool KDirWatchPrivate::useStat(Entry* e) * Sometimes, entries are dependant on each other: if <sub_entry> !=0, * this entry needs another entry to watch himself (when notExistent). */ -void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, +void KDirWatchPrivate::addEntry(KDirWatch* instance, const TQString& _path, Entry* sub_entry, bool isDir) { - QString path = _path; + TQString path = _path; if (path.startsWith("/dev/") || (path == "/dev")) return; // Don't even go there. @@ -801,7 +801,7 @@ void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, mask |= IN_ONLYDIR; inotify_rm_watch (m_inotify_fd, e->wd); - e->wd = inotify_add_watch( m_inotify_fd, QFile::encodeName( e->path ), mask); + e->wd = inotify_add_watch( m_inotify_fd, TQFile::encodeName( e->path ), mask); } } #endif @@ -811,7 +811,7 @@ void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, (*it).addClient(instance); kdDebug(7001) << "Added already watched Entry " << path << " (now " << (*it).clients() << " clients)" - << QString(" [%1]").arg(instance->name()) << endl; + << TQString(" [%1]").arg(instance->name()) << endl; } return; } @@ -819,7 +819,7 @@ void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, // we have a new path to watch KDE_struct_stat stat_buf; - QCString tpath = QFile::encodeName(path); + TQCString tpath = TQFile::encodeName(path); bool exists = (KDE_stat(tpath, &stat_buf) == 0); Entry newEntry; @@ -854,8 +854,8 @@ void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, kdDebug(7001) << "Added " << (e->isDir ? "Dir ":"File ") << path << (e->m_status == NonExistent ? " NotExisting" : "") - << (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString("")) - << (instance ? QString(" [%1]").arg(instance->name()) : QString("")) + << (sub_entry ? TQString(" for %1").arg(sub_entry->path) : TQString("")) + << (instance ? TQString(" [%1]").arg(instance->name()) : TQString("")) << endl; @@ -883,7 +883,7 @@ void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, void KDirWatchPrivate::removeEntry( KDirWatch* instance, - const QString& _path, Entry* sub_entry ) + const TQString& _path, Entry* sub_entry ) { kdDebug(7001) << "KDirWatchPrivate::removeEntry for '" << _path << "' sub_entry: " << sub_entry << endl; Entry* e = entry(_path); @@ -920,9 +920,9 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, } else { if (e->isDir) - removeEntry(0, QDir::cleanDirPath(e->path+"/.."), e); + removeEntry(0, TQDir::cleanDirPath(e->path+"/.."), e); else - removeEntry(0, QFileInfo(e->path).dirPath(true), e); + removeEntry(0, TQFileInfo(e->path).dirPath(true), e); } } #endif @@ -938,9 +938,9 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, } else { if (e->isDir) - removeEntry(0, QDir::cleanDirPath(e->path+"/.."), e); + removeEntry(0, TQDir::cleanDirPath(e->path+"/.."), e); else - removeEntry(0, QFileInfo(e->path).dirPath(true), e); + removeEntry(0, TQFileInfo(e->path).dirPath(true), e); } } #endif @@ -948,7 +948,7 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, #ifdef HAVE_DNOTIFY if (e->m_mode == DNotifyMode) { if (!e->isDir) { - removeEntry(0, QFileInfo(e->path).dirPath(true), e); + removeEntry(0, TQFileInfo(e->path).dirPath(true), e); } else { // isDir // must close the FD. @@ -964,7 +964,7 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, } } else { - removeEntry(0, QDir::cleanDirPath(e->path+"/.."), e); + removeEntry(0, TQDir::cleanDirPath(e->path+"/.."), e); } } } @@ -979,8 +979,8 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, } kdDebug(7001) << "Removed " << (e->isDir ? "Dir ":"File ") << e->path - << (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString("")) - << (instance ? QString(" [%1]").arg(instance->name()) : QString("")) + << (sub_entry ? TQString(" for %1").arg(sub_entry->path) : TQString("")) + << (instance ? TQString(" [%1]").arg(instance->name()) : TQString("")) << endl; m_mapEntries.remove( e->path ); // <e> not valid any more } @@ -991,7 +991,7 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance, */ void KDirWatchPrivate::removeEntries( KDirWatch* instance ) { - QPtrList<Entry> list; + TQPtrList<Entry> list; int minfreq = 3600000; // put all entries where instance is a client in list @@ -1069,7 +1069,7 @@ bool KDirWatchPrivate::restartEntryScan( KDirWatch* instance, Entry* e, if (wasWatching == 0) { if (!notify) { KDE_struct_stat stat_buf; - bool exists = (KDE_stat(QFile::encodeName(e->path), &stat_buf) == 0); + bool exists = (KDE_stat(TQFile::encodeName(e->path), &stat_buf) == 0); if (exists) { e->m_ctime = stat_buf.st_ctime; e->m_status = Normal; @@ -1161,7 +1161,7 @@ int KDirWatchPrivate::scanEntry(Entry* e) } KDE_struct_stat stat_buf; - bool exists = (KDE_stat(QFile::encodeName(e->path), &stat_buf) == 0); + bool exists = (KDE_stat(TQFile::encodeName(e->path), &stat_buf) == 0); if (exists) { if (e->m_status == NonExistent) { @@ -1201,22 +1201,22 @@ int KDirWatchPrivate::scanEntry(Entry* e) * and stored pending events. When watching is stopped, the event is * added to the pending events. */ -void KDirWatchPrivate::emitEvent(Entry* e, int event, const QString &fileName) +void KDirWatchPrivate::emitEvent(Entry* e, int event, const TQString &fileName) { - QString path = e->path; + TQString path = e->path; if (!fileName.isEmpty()) { - if (!QDir::isRelativePath(fileName)) + if (!TQDir::isRelativePath(fileName)) path = fileName; else #ifdef Q_OS_UNIX path += "/" + fileName; #elif defined(Q_WS_WIN) //current drive is passed instead of / - path += QDir::currentDirPath().left(2) + "/" + fileName; + path += TQDir::currentDirPath().left(2) + "/" + fileName; #endif } - QPtrListIterator<Client> cit( e->m_clients ); + TQPtrListIterator<Client> cit( e->m_clients ); for ( ; cit.current(); ++cit ) { Client* c = cit.current(); @@ -1282,7 +1282,7 @@ void KDirWatchPrivate::slotRescan() delayRemove = true; #if defined(HAVE_DNOTIFY) || defined(HAVE_INOTIFY) - QPtrList<Entry> dList, cList; + TQPtrList<Entry> dList, cList; #endif if (rescan_all) @@ -1354,17 +1354,17 @@ void KDirWatchPrivate::slotRescan() // Scan parent of deleted directories for new creation Entry* e; for(e=dList.first();e;e=dList.next()) - addEntry(0, QDir::cleanDirPath( e->path+"/.."), e, true); + addEntry(0, TQDir::cleanDirPath( e->path+"/.."), e, true); // Remove watch of parent of new created directories for(e=cList.first();e;e=cList.next()) - removeEntry(0, QDir::cleanDirPath( e->path+"/.."), e); + removeEntry(0, TQDir::cleanDirPath( e->path+"/.."), e); #endif if ( timerRunning ) timer->start(freq); - QTimer::singleShot(0, this, SLOT(slotRemoveDelayed())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRemoveDelayed())); } bool KDirWatchPrivate::isNoisyFile( const char * filename ) @@ -1413,7 +1413,7 @@ void KDirWatchPrivate::famEventReceived() checkFAMEvent(&fe); } - QTimer::singleShot(0, this, SLOT(slotRemoveDelayed())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRemoveDelayed())); } void KDirWatchPrivate::checkFAMEvent(FAMEvent* fe) @@ -1475,7 +1475,7 @@ void KDirWatchPrivate::checkFAMEvent(FAMEvent* fe) { case FAMDeleted: // file absolute: watched dir - if (!QDir::isRelativePath(fe->filename)) + if (!TQDir::isRelativePath(fe->filename)) { // a watched directory was deleted @@ -1485,7 +1485,7 @@ void KDirWatchPrivate::checkFAMEvent(FAMEvent* fe) << FAMREQUEST_GETREQNUM(&(e->fr)) << " for " << e->path << endl; // Scan parent for a new creation - addEntry(0, QDir::cleanDirPath( e->path+"/.."), e, true); + addEntry(0, TQDir::cleanDirPath( e->path+"/.."), e, true); } break; @@ -1495,7 +1495,7 @@ void KDirWatchPrivate::checkFAMEvent(FAMEvent* fe) for(;sub_entry; sub_entry = e->m_entries.next()) if (sub_entry->path == e->path + "/" + fe->filename) break; if (sub_entry && sub_entry->isDir) { - QString path = e->path; + TQString path = e->path; removeEntry(0,e->path,sub_entry); // <e> can be invalid here!! sub_entry->m_status = Normal; if (!useFAM(sub_entry)) @@ -1539,7 +1539,7 @@ void KDirWatchPrivate::statistics() Client* c = e->m_clients.first(); for(;c; c = e->m_clients.next()) { - QString pending; + TQString pending; if (c->watchingStopped) { if (c->pending & Deleted) pending += "deleted "; if (c->pending & Created) pending += "created "; @@ -1585,14 +1585,14 @@ bool KDirWatch::exists() return s_pSelf != 0; } -KDirWatch::KDirWatch (QObject* parent, const char* name) - : QObject(parent,name) +KDirWatch::KDirWatch (TQObject* parent, const char* name) + : TQObject(parent,name) { if (!name) { static int nameCounter = 0; nameCounter++; - setName(QString("KDirWatch-%1").arg(nameCounter).ascii()); + setName(TQString("KDirWatch-%1").arg(nameCounter).ascii()); } if (!dwp_self) @@ -1616,7 +1616,7 @@ KDirWatch::~KDirWatch() // TODO: add watchFiles/recursive support -void KDirWatch::addDir( const QString& _path, +void KDirWatch::addDir( const TQString& _path, bool watchFiles, bool recursive) { if (watchFiles || recursive) { @@ -1625,34 +1625,34 @@ void KDirWatch::addDir( const QString& _path, if (d) d->addEntry(this, _path, 0, true); } -void KDirWatch::addFile( const QString& _path ) +void KDirWatch::addFile( const TQString& _path ) { if (d) d->addEntry(this, _path, 0, false); } -QDateTime KDirWatch::ctime( const QString &_path ) +TQDateTime KDirWatch::ctime( const TQString &_path ) { KDirWatchPrivate::Entry* e = d->entry(_path); if (!e) - return QDateTime(); + return TQDateTime(); - QDateTime result; + TQDateTime result; result.setTime_t(e->m_ctime); return result; } -void KDirWatch::removeDir( const QString& _path ) +void KDirWatch::removeDir( const TQString& _path ) { if (d) d->removeEntry(this, _path, 0); } -void KDirWatch::removeFile( const QString& _path ) +void KDirWatch::removeFile( const TQString& _path ) { if (d) d->removeEntry(this, _path, 0); } -bool KDirWatch::stopDirScan( const QString& _path ) +bool KDirWatch::stopDirScan( const TQString& _path ) { if (d) { KDirWatchPrivate::Entry *e = d->entry(_path); @@ -1661,7 +1661,7 @@ bool KDirWatch::stopDirScan( const QString& _path ) return false; } -bool KDirWatch::restartDirScan( const QString& _path ) +bool KDirWatch::restartDirScan( const TQString& _path ) { if (d) { KDirWatchPrivate::Entry *e = d->entry(_path); @@ -1685,7 +1685,7 @@ void KDirWatch::startScan( bool notify, bool skippedToo ) } -bool KDirWatch::contains( const QString& _path ) const +bool KDirWatch::contains( const TQString& _path ) const { KDirWatchPrivate::Entry* e = d->entry(_path); if (!e) @@ -1708,19 +1708,19 @@ void KDirWatch::statistics() } -void KDirWatch::setCreated( const QString & _file ) +void KDirWatch::setCreated( const TQString & _file ) { kdDebug(7001) << name() << " emitting created " << _file << endl; emit created( _file ); } -void KDirWatch::setDirty( const QString & _file ) +void KDirWatch::setDirty( const TQString & _file ) { kdDebug(7001) << name() << " emitting dirty " << _file << endl; emit dirty( _file ); } -void KDirWatch::setDeleted( const QString & _file ) +void KDirWatch::setDeleted( const TQString & _file ) { kdDebug(7001) << name() << " emitting deleted " << _file << endl; emit deleted( _file ); diff --git a/kio/kio/kdirwatch.h b/kio/kio/kdirwatch.h index af25ee2e6..36f2737b3 100644 --- a/kio/kio/kdirwatch.h +++ b/kio/kio/kdirwatch.h @@ -18,9 +18,9 @@ #ifndef _KDIRWATCH_H #define _KDIRWATCH_H -#include <qtimer.h> -#include <qdatetime.h> -#include <qmap.h> +#include <tqtimer.h> +#include <tqdatetime.h> +#include <tqmap.h> #include <kdelibs_export.h> @@ -70,10 +70,10 @@ class KIO_EXPORT KDirWatch : public QObject * * Scanning begins immediately when a dir/file watch * is added. - * @param parent the parent of the QObject (or 0 for parent-less KDataTools) - * @param name the name of the QObject, can be 0 + * @param parent the parent of the TQObject (or 0 for parent-less KDataTools) + * @param name the name of the TQObject, can be 0 */ - KDirWatch (QObject* parent = 0, const char* name = 0); + KDirWatch (TQObject* parent = 0, const char* name = 0); /** * Destructor. @@ -96,21 +96,21 @@ class KIO_EXPORT KDirWatch : public QObject * @param watchFiles if true, the KDirWatch will also watch files - NOT IMPLEMENTED YET * @param recursive if true, all sub directories are also watched - NOT IMPLEMENTED YET */ - void addDir(const QString& path, + void addDir(const TQString& path, bool watchFiles = false, bool recursive = false); /** * Adds a file to be watched. * @param file the file to watch */ - void addFile(const QString& file); + void addFile(const TQString& file); /** * Returns the time the directory/file was last changed. * @param path the file to check * @return the date of the last modification */ - QDateTime ctime(const QString& path); + TQDateTime ctime(const TQString& path); /** * Removes a directory from the list of scanned directories. @@ -118,7 +118,7 @@ class KIO_EXPORT KDirWatch : public QObject * If specified path is not in the list this does nothing. * @param path the path of the dir to be removed from the list */ - void removeDir(const QString& path); + void removeDir(const TQString& path); /** * Removes a file from the list of watched files. @@ -126,7 +126,7 @@ class KIO_EXPORT KDirWatch : public QObject * If specified path is not in the list this does nothing. * @param file the file to be removed from the list */ - void removeFile(const QString& file); + void removeFile(const TQString& file); /** * Stops scanning the specified path. @@ -140,7 +140,7 @@ class KIO_EXPORT KDirWatch : public QObject * @return true if the @p path is being watched, otherwise false * @see restartDirScanning() */ - bool stopDirScan(const QString& path); + bool stopDirScan(const TQString& path); /** * Restarts scanning for specified path. @@ -155,7 +155,7 @@ class KIO_EXPORT KDirWatch : public QObject * @return true if the @p path is being watched, otherwise false * @see stopDirScanning() */ - bool restartDirScan(const QString& path); + bool restartDirScan(const TQString& path); /** * Starts scanning of all dirs in list. @@ -194,7 +194,7 @@ class KIO_EXPORT KDirWatch : public QObject * @param path the directory to check * @return true if the directory is being watched */ - bool contains( const QString& path ) const; + bool contains( const TQString& path ) const; /** * Dump statistic information about all KDirWatch instances. @@ -206,17 +206,17 @@ class KIO_EXPORT KDirWatch : public QObject * Emits created(). * @param path the path of the file or directory */ - void setCreated( const QString &path ); + void setCreated( const TQString &path ); /** * Emits dirty(). * @param path the path of the file or directory */ - void setDirty( const QString &path ); + void setDirty( const TQString &path ); /** * Emits deleted(). * @param path the path of the file or directory */ - void setDeleted( const QString &path ); + void setDeleted( const TQString &path ); enum Method { FAM, DNotify, Stat, INotify }; /** @@ -262,13 +262,13 @@ class KIO_EXPORT KDirWatch : public QObject * The new ctime is set before the signal is emitted. * @param path the path of the file or directory */ - void dirty (const QString &path); + void dirty (const TQString &path); /** * Emitted when a file or directory is created. * @param path the path of the file or directory */ - void created (const QString &path ); + void created (const TQString &path ); /** * Emitted when a file or directory is deleted. @@ -276,7 +276,7 @@ class KIO_EXPORT KDirWatch : public QObject * The object is still watched for new creation. * @param path the path of the file or directory */ - void deleted (const QString &path ); + void deleted (const TQString &path ); private: bool _isStopped; diff --git a/kio/kio/kdirwatch_p.h b/kio/kio/kdirwatch_p.h index ec3a4a610..9920b866d 100644 --- a/kio/kio/kdirwatch_p.h +++ b/kio/kio/kdirwatch_p.h @@ -47,10 +47,10 @@ public: entryMode m_mode; bool isDir; // instances interested in events - QPtrList<Client> m_clients; + TQPtrList<Client> m_clients; // nonexistent entries of this directory - QPtrList<Entry> m_entries; - QString path; + TQPtrList<Entry> m_entries; + TQString path; int msecLeft, freq; @@ -74,15 +74,15 @@ public: #endif }; - typedef QMap<QString,Entry> EntryMap; + typedef TQMap<TQString,Entry> EntryMap; KDirWatchPrivate(); ~KDirWatchPrivate(); void resetList (KDirWatch*,bool); void useFreq(Entry* e, int newFreq); - void addEntry(KDirWatch*,const QString&, Entry*, bool); - void removeEntry(KDirWatch*,const QString&, Entry*); + void addEntry(KDirWatch*,const TQString&, Entry*, bool); + void removeEntry(KDirWatch*,const TQString&, Entry*); bool stopEntryScan(KDirWatch*, Entry*); bool restartEntryScan(KDirWatch*, Entry*, bool ); void stopScan(KDirWatch*); @@ -91,9 +91,9 @@ public: void removeEntries(KDirWatch*); void statistics(); - Entry* entry(const QString&); + Entry* entry(const TQString&); int scanEntry(Entry* e); - void emitEvent(Entry* e, int event, const QString &fileName = QString::null); + void emitEvent(Entry* e, int event, const TQString &fileName = TQString::null); // Memory management - delete when last KDirWatch gets deleted void ref() { m_ref++; } @@ -108,7 +108,7 @@ public slots: void slotRemoveDelayed(); public: - QTimer *timer; + TQTimer *timer; EntryMap m_mapEntries; int freq; @@ -118,13 +118,13 @@ public: bool useStat(Entry*); bool delayRemove; - QPtrList<Entry> removeList; + TQPtrList<Entry> removeList; bool rescan_all; - QTimer rescan_timer; + TQTimer rescan_timer; #ifdef HAVE_FAM - QSocketNotifier *sn; + TQSocketNotifier *sn; FAMConnection fc; bool use_fam; @@ -133,13 +133,13 @@ public: #endif #if defined(HAVE_DNOTIFY) || defined(HAVE_INOTIFY) - QSocketNotifier *mSn; + TQSocketNotifier *mSn; #endif #ifdef HAVE_DNOTIFY bool supports_dnotify; int mPipe[2]; - QIntDict<Entry> fd_Entry; + TQIntDict<Entry> fd_Entry; static void dnotify_handler(int, siginfo_t *si, void *); static void dnotify_sigio_handler(int, siginfo_t *si, void *); diff --git a/kio/kio/kemailsettings.cpp b/kio/kio/kemailsettings.cpp index 244e4043f..2f1ffe7a0 100644 --- a/kio/kio/kemailsettings.cpp +++ b/kio/kio/kemailsettings.cpp @@ -37,25 +37,25 @@ public: KEMailSettingsPrivate() : m_pConfig( 0 ) {} ~KEMailSettingsPrivate() { delete m_pConfig; } KConfig *m_pConfig; - QStringList profiles; - QString m_sDefaultProfile, m_sCurrentProfile; + TQStringList profiles; + TQString m_sDefaultProfile, m_sCurrentProfile; }; -QString KEMailSettings::defaultProfileName() const +TQString KEMailSettings::defaultProfileName() const { return p->m_sDefaultProfile; } -QString KEMailSettings::getSetting(KEMailSettings::Setting s) +TQString KEMailSettings::getSetting(KEMailSettings::Setting s) { - p->m_pConfig->setGroup(QString("PROFILE_")+p->m_sCurrentProfile); + p->m_pConfig->setGroup(TQString("PROFILE_")+p->m_sCurrentProfile); switch (s) { case ClientProgram: { return p->m_pConfig->readEntry("EmailClient"); break; } case ClientTerminal: { - return ((p->m_pConfig->readBoolEntry("TerminalClient")) ? QString("true") : QString("false") ); + return ((p->m_pConfig->readBoolEntry("TerminalClient")) ? TQString("true") : TQString("false") ); break; } case RealName: { @@ -95,7 +95,7 @@ QString KEMailSettings::getSetting(KEMailSettings::Setting s) break; } case OutServerTLS: { - return ((p->m_pConfig->readBoolEntry("OutgoingServerTLS")) ? QString("true") : QString("false") ); + return ((p->m_pConfig->readBoolEntry("OutgoingServerTLS")) ? TQString("true") : TQString("false") ); break; } case InServer: { @@ -119,15 +119,15 @@ QString KEMailSettings::getSetting(KEMailSettings::Setting s) break; } case InServerTLS: { - return ((p->m_pConfig->readBoolEntry("IncomingServerTLS")) ? QString("true") : QString("false") ); + return ((p->m_pConfig->readBoolEntry("IncomingServerTLS")) ? TQString("true") : TQString("false") ); break; } }; - return QString::null; + return TQString::null; } -void KEMailSettings::setSetting(KEMailSettings::Setting s, const QString &v) +void KEMailSettings::setSetting(KEMailSettings::Setting s, const TQString &v) { - p->m_pConfig->setGroup(QString("PROFILE_")+p->m_sCurrentProfile); + p->m_pConfig->setGroup(TQString("PROFILE_")+p->m_sCurrentProfile); switch (s) { case ClientProgram: { p->m_pConfig->writePathEntry("EmailClient", v); @@ -205,7 +205,7 @@ void KEMailSettings::setSetting(KEMailSettings::Setting s, const QString &v) p->m_pConfig->sync(); } -void KEMailSettings::setDefault(const QString &s) +void KEMailSettings::setDefault(const TQString &s) { p->m_pConfig->setGroup("Defaults"); p->m_pConfig->writeEntry("Profile", s); @@ -214,25 +214,25 @@ void KEMailSettings::setDefault(const QString &s) } -void KEMailSettings::setProfile (const QString &s) +void KEMailSettings::setProfile (const TQString &s) { - QString groupname="PROFILE_"; + TQString groupname="PROFILE_"; groupname.append(s); p->m_sCurrentProfile=s; if (!p->m_pConfig->hasGroup(groupname)) { // Create a group if it doesn't exist p->m_pConfig->setGroup(groupname); - p->m_pConfig->writeEntry("ServerType", QString::null); + p->m_pConfig->writeEntry("ServerType", TQString::null); p->m_pConfig->sync(); p->profiles+=s; } } -QString KEMailSettings::currentProfileName() const +TQString KEMailSettings::currentProfileName() const { return p->m_sCurrentProfile; } -QStringList KEMailSettings::profiles() const +TQStringList KEMailSettings::profiles() const { return p->profiles; } @@ -240,12 +240,12 @@ QStringList KEMailSettings::profiles() const KEMailSettings::KEMailSettings() { p = new KEMailSettingsPrivate(); - p->m_sCurrentProfile=QString::null; + p->m_sCurrentProfile=TQString::null; p->m_pConfig = new KConfig("emaildefaults"); - QStringList groups = p->m_pConfig->groupList(); - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { + TQStringList groups = p->m_pConfig->groupList(); + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { if ( (*it).left(8) == "PROFILE_" ) p->profiles+= (*it).mid(8, (*it).length()); } @@ -253,7 +253,7 @@ KEMailSettings::KEMailSettings() p->m_pConfig->setGroup("Defaults"); p->m_sDefaultProfile=p->m_pConfig->readEntry("Profile", i18n("Default")); if (!p->m_sDefaultProfile.isNull()) { - if (!p->m_pConfig->hasGroup(QString("PROFILE_")+p->m_sDefaultProfile)) + if (!p->m_pConfig->hasGroup(TQString("PROFILE_")+p->m_sDefaultProfile)) setDefault(i18n("Default")); else setDefault(p->m_sDefaultProfile); diff --git a/kio/kio/kemailsettings.h b/kio/kio/kemailsettings.h index a2c53c145..f072fa7f9 100644 --- a/kio/kio/kemailsettings.h +++ b/kio/kio/kemailsettings.h @@ -28,8 +28,8 @@ #ifndef _KEMAILSETTINGS_H #define _KEMAILSETTINGS_H -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <kdelibs_export.h> @@ -98,47 +98,47 @@ public: * List of profiles available. * @return the list of profiles **/ - QStringList profiles() const; + TQStringList profiles() const; /** * Returns the name of the current profile. * @returns what profile we're currently using **/ - QString currentProfileName() const; + TQString currentProfileName() const; /** * Change the current profile. * @param s the name of the new profile **/ - void setProfile (const QString &s); + void setProfile (const TQString &s); /** * Returns the name of the default profile. - * @returns the name of the one that's currently default QString::null if none + * @returns the name of the one that's currently default TQString::null if none **/ - QString defaultProfileName() const; + TQString defaultProfileName() const; /** * Sets a new default. * @param def the new default **/ - void setDefault(const QString &def); + void setDefault(const TQString &def); /** * Get one of the predefined "basic" settings. * @param s the setting to get - * @return the value of the setting, or QString::null if not + * @return the value of the setting, or TQString::null if not * set **/ - QString getSetting(KEMailSettings::Setting s); + TQString getSetting(KEMailSettings::Setting s); /** * Set one of the predefined "basic" settings. * @param s the setting to set - * @param v the new value of the setting, or QString::null to + * @param v the new value of the setting, or TQString::null to * unset **/ - void setSetting(KEMailSettings::Setting s, const QString &v); + void setSetting(KEMailSettings::Setting s, const TQString &v); private: KEMailSettingsPrivate *p; diff --git a/kio/kio/kfilefilter.cpp b/kio/kio/kfilefilter.cpp index e8d01ad2f..05c53c02c 100644 --- a/kio/kio/kfilefilter.cpp +++ b/kio/kio/kfilefilter.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include <qregexp.h> +#include <tqregexp.h> #include <kfileitem.h> #include <kglobal.h> @@ -47,27 +47,27 @@ void KSimpleFileFilter::setFilterSpecials( bool filter ) m_filterSpecials = filter; } -void KSimpleFileFilter::setNameFilters( const QString& nameFilters ) +void KSimpleFileFilter::setNameFilters( const TQString& nameFilters ) { // KDE 3.0 defaults setNameFilters( nameFilters, false, ' ' ); } -void KSimpleFileFilter::setNameFilters( const QString& nameFilters, +void KSimpleFileFilter::setNameFilters( const TQString& nameFilters, bool caseSensitive, - const QChar& separator ) + const TQChar& separator ) { m_nameFilters.clear(); // Split on white space - QStringList list = QStringList::split(separator, nameFilters); + TQStringList list = TQStringList::split(separator, nameFilters); - QStringList::ConstIterator it = list.begin(); + TQStringList::ConstIterator it = list.begin(); for ( ; it != list.end(); ++it ) - m_nameFilters.append(new QRegExp(*it, caseSensitive, true )); + m_nameFilters.append(new TQRegExp(*it, caseSensitive, true )); } -void KSimpleFileFilter::setMimeFilters( const QStringList& mimeFilters ) +void KSimpleFileFilter::setMimeFilters( const TQStringList& mimeFilters ) { m_mimeFilters = mimeFilters; } @@ -79,10 +79,10 @@ void KSimpleFileFilter::setModeFilter( mode_t mode ) bool KSimpleFileFilter::passesFilter( const KFileItem *item ) const { - static const QString& dot = KGlobal::staticQString("."); - static const QString& dotdot = KGlobal::staticQString(".."); + static const TQString& dot = KGlobal::staticQString("."); + static const TQString& dotdot = KGlobal::staticQString(".."); - const QString& name = item->name(); + const TQString& name = item->name(); if ( m_filterDotFiles && item->isHidden() ) return false; @@ -98,7 +98,7 @@ bool KSimpleFileFilter::passesFilter( const KFileItem *item ) const KMimeType::Ptr mime = item->mimeTypePtr(); bool ok = false; - QStringList::ConstIterator it = m_mimeFilters.begin(); + TQStringList::ConstIterator it = m_mimeFilters.begin(); for ( ; it != m_mimeFilters.end(); ++it ) { if ( mime->is(*it) ) { // match! ok = true; @@ -112,7 +112,7 @@ bool KSimpleFileFilter::passesFilter( const KFileItem *item ) const if ( !m_nameFilters.isEmpty() ) { bool ok = false; - QPtrListIterator<QRegExp> it( m_nameFilters ); + TQPtrListIterator<TQRegExp> it( m_nameFilters ); for ( ; it.current(); ++it ) { if ( it.current()->exactMatch( name ) ) { // match! ok = true; diff --git a/kio/kio/kfilefilter.h b/kio/kio/kfilefilter.h index 5146618cd..a6384fbad 100644 --- a/kio/kio/kfilefilter.h +++ b/kio/kio/kfilefilter.h @@ -21,8 +21,8 @@ #ifndef KFILEFILTER_H #define KFILEFILTER_H -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstringlist.h> #include <sys/types.h> #include <sys/stat.h> @@ -105,8 +105,8 @@ public: * @param separator the separator in the @p nameFilter * @since 3.1 */ - void setNameFilters( const QString& nameFilters, bool caseSensitive, - const QChar& separator = ' ' ); + void setNameFilters( const TQString& nameFilters, bool caseSensitive, + const TQChar& separator = ' ' ); /** * Sets a list of regular expressions to filter by name. * The file will only pass if its name matches one of the regular @@ -114,7 +114,7 @@ public: * @param nameFilters a list of regular expressions, separated by * space (' ') */ - virtual void setNameFilters( const QString& nameFilters ); + virtual void setNameFilters( const TQString& nameFilters ); /** * Sets a list of mime filters. A file can only pass if its @@ -122,13 +122,13 @@ public: * @param mimeFilters the list of mime types * @see setMimeFilter */ - virtual void setMimeFilters( const QStringList& mimeFilters ); + virtual void setMimeFilters( const TQStringList& mimeFilters ); /** * Returns the list of mime types. * @return the list of mime types * @see mimeFilter */ - QStringList mimeFilters() const { return m_mimeFilters; } + TQStringList mimeFilters() const { return m_mimeFilters; } /** * Sets the mode filter. If the @p mode is 0, the filter is @@ -154,10 +154,10 @@ public: virtual bool passesFilter( const KFileItem *item ) const; protected: - QPtrList<QRegExp> m_nameFilters; + TQPtrList<TQRegExp> m_nameFilters; private: - QStringList m_mimeFilters; + TQStringList m_mimeFilters; bool m_filterDotFiles :1; bool m_filterSpecials :1; mode_t m_modeFilter; diff --git a/kio/kio/kfileitem.cpp b/kio/kio/kfileitem.cpp index d06b9b083..9f89765d2 100644 --- a/kio/kio/kfileitem.cpp +++ b/kio/kio/kfileitem.cpp @@ -29,10 +29,10 @@ #include "kfileitem.h" -#include <qdir.h> -#include <qfile.h> -#include <qmap.h> -#include <qstylesheet.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqmap.h> +#include <tqstylesheet.h> #include <kdebug.h> #include <kfilemetainfo.h> @@ -48,7 +48,7 @@ class KFileItem::KFileItemPrivate { public: - QString iconName; + TQString iconName; }; KFileItem::KFileItem( const KIO::UDSEntry& _entry, const KURL& _url, @@ -87,7 +87,7 @@ KFileItem::KFileItem( mode_t _mode, mode_t _permissions, const KURL& _url, bool init( _determineMimeTypeOnDemand ); } -KFileItem::KFileItem( const KURL &url, const QString &mimeType, mode_t mode ) +KFileItem::KFileItem( const KURL &url, const TQString &mimeType, mode_t mode ) : m_url( url ), m_strName( url.fileName() ), m_strText( KIO::decodeFileName( m_strName ) ), @@ -126,7 +126,7 @@ KFileItem::~KFileItem() void KFileItem::init( bool _determineMimeTypeOnDemand ) { - m_access = QString::null; + m_access = TQString::null; m_size = (KIO::filesize_t) -1; // metaInfo = KFileMetaInfo(); for ( int i = 0; i < NumFlags; i++ ) @@ -146,7 +146,7 @@ void KFileItem::init( bool _determineMimeTypeOnDemand ) * This is the reason for the -1 */ KDE_struct_stat buf; - QCString path = QFile::encodeName(m_url.path( -1 )); + TQCString path = TQFile::encodeName(m_url.path( -1 )); if ( KDE_lstat( path.data(), &buf ) == 0 ) { mode = buf.st_mode; @@ -254,7 +254,7 @@ void KFileItem::readUDSEntry( bool _urlIsDirectory ) } // avoid creating these QStrings again and again - static const QString& dot = KGlobal::staticQString("."); + static const TQString& dot = KGlobal::staticQString("."); if ( _urlIsDirectory && !UDS_URL_seen && !m_strName.isEmpty() && m_strName != dot ) m_url.addPath( m_strName ); } @@ -264,8 +264,8 @@ void KFileItem::refresh() m_fileMode = KFileItem::Unknown; m_permissions = KFileItem::Unknown; m_pMimeType = 0L; - m_user = QString::null; - m_group = QString::null; + m_user = TQString::null; + m_group = TQString::null; m_metaInfo = KFileMetaInfo(); m_hidden = Auto; @@ -289,15 +289,15 @@ void KFileItem::setURL( const KURL &url ) setName( url.fileName() ); } -void KFileItem::setName( const QString& name ) +void KFileItem::setName( const TQString& name ) { m_strName = name; m_strText = KIO::decodeFileName( m_strName ); } -QString KFileItem::linkDest() const +TQString KFileItem::linkDest() const { - if (&m_entry == NULL) return QString::null; + if (&m_entry == NULL) return TQString::null; // Extract it from the KIO::UDSEntry KIO::UDSEntry::ConstIterator it = m_entry.begin(); @@ -308,17 +308,17 @@ QString KFileItem::linkDest() const if ( m_bIsLocalURL ) { char buf[1000]; - int n = readlink( QFile::encodeName(m_url.path( -1 )), buf, sizeof(buf)-1 ); + int n = readlink( TQFile::encodeName(m_url.path( -1 )), buf, sizeof(buf)-1 ); if ( n != -1 ) { buf[ n ] = 0; - return QFile::decodeName( buf ); + return TQFile::decodeName( buf ); } } - return QString::null; + return TQString::null; } -QString KFileItem::localPath() const +TQString KFileItem::localPath() const { if ( m_bIsLocalURL ) { @@ -326,7 +326,7 @@ QString KFileItem::localPath() const } else { - if (&m_entry == NULL) return QString::null; + if (&m_entry == NULL) return TQString::null; // Extract the local path from the KIO::UDSEntry KIO::UDSEntry::ConstIterator it = m_entry.begin(); @@ -336,7 +336,7 @@ QString KFileItem::localPath() const return (*it).m_str; } - return QString::null; + return TQString::null; } KIO::filesize_t KFileItem::size(bool &exists) const @@ -358,7 +358,7 @@ KIO::filesize_t KFileItem::size(bool &exists) const if ( m_bIsLocalURL ) { KDE_struct_stat buf; - if ( KDE_stat( QFile::encodeName(m_url.path( -1 )), &buf ) == 0 ) + if ( KDE_stat( TQFile::encodeName(m_url.path( -1 )), &buf ) == 0 ) return buf.st_size; } exists = false; @@ -448,7 +448,7 @@ time_t KFileItem::time( unsigned int which, bool &hasTime ) const if ( m_bIsLocalURL ) { KDE_struct_stat buf; - if ( KDE_stat( QFile::encodeName(m_url.path(-1)), &buf ) == 0 ) + if ( KDE_stat( TQFile::encodeName(m_url.path(-1)), &buf ) == 0 ) { if(which == KIO::UDS_CREATION_TIME) { // We can't determine creation time for local files @@ -468,32 +468,32 @@ time_t KFileItem::time( unsigned int which, bool &hasTime ) const } -QString KFileItem::user() const +TQString KFileItem::user() const { if ( m_user.isEmpty() && m_bIsLocalURL ) { KDE_struct_stat buff; - if ( KDE_lstat( QFile::encodeName(m_url.path( -1 )), &buff ) == 0) // get uid/gid of the link, if it's a link + if ( KDE_lstat( TQFile::encodeName(m_url.path( -1 )), &buff ) == 0) // get uid/gid of the link, if it's a link { struct passwd *user = getpwuid( buff.st_uid ); if ( user != 0L ) - m_user = QString::fromLocal8Bit(user->pw_name); + m_user = TQString::fromLocal8Bit(user->pw_name); } } return m_user; } -QString KFileItem::group() const +TQString KFileItem::group() const { #ifdef Q_OS_UNIX if (m_group.isEmpty() && m_bIsLocalURL ) { KDE_struct_stat buff; - if ( KDE_lstat( QFile::encodeName(m_url.path( -1 )), &buff ) == 0) // get uid/gid of the link, if it's a link + if ( KDE_lstat( TQFile::encodeName(m_url.path( -1 )), &buff ) == 0) // get uid/gid of the link, if it's a link { struct group *ge = getgrgid( buff.st_gid ); if ( ge != 0L ) { - m_group = QString::fromLocal8Bit(ge->gr_name); + m_group = TQString::fromLocal8Bit(ge->gr_name); if (m_group.isEmpty()) m_group.sprintf("%d",ge->gr_gid); } else @@ -504,7 +504,7 @@ QString KFileItem::group() const return m_group; } -QString KFileItem::mimetype() const +TQString KFileItem::mimetype() const { KFileItem * that = const_cast<KFileItem *>(this); return that->determineMimeType()->name(); @@ -533,14 +533,14 @@ bool KFileItem::isMimeTypeKnown() const return m_bMimeTypeKnown && m_guessedMimeType.isEmpty(); } -QString KFileItem::mimeComment() +TQString KFileItem::mimeComment() { KMimeType::Ptr mType = determineMimeType(); bool isLocalURL; KURL url = mostLocalURL(isLocalURL); - QString comment = mType->comment( url, isLocalURL ); + TQString comment = mType->comment( url, isLocalURL ); //kdDebug() << "finding comment for " << url.url() << " : " << m_pMimeType->name() << endl; if (!comment.isEmpty()) return comment; @@ -548,7 +548,7 @@ QString KFileItem::mimeComment() return mType->name(); } -QString KFileItem::iconName() +TQString KFileItem::iconName() { if (d && (!d->iconName.isEmpty())) return d->iconName; @@ -587,14 +587,14 @@ int KFileItem::overlays() const return _state; } -QPixmap KFileItem::pixmap( int _size, int _state ) const +TQPixmap KFileItem::pixmap( int _size, int _state ) const { if (d && (!d->iconName.isEmpty())) return DesktopIcon(d->iconName,_size,_state); if ( !m_pMimeType ) { - static const QString & defaultFolderIcon = + static const TQString & defaultFolderIcon = KGlobal::staticQString(KMimeType::mimeType( "inode/directory" )->KServiceType::icon()); if ( S_ISDIR( m_fileMode ) ) @@ -625,7 +625,7 @@ QPixmap KFileItem::pixmap( int _size, int _state ) const bool isLocalURL; KURL url = mostLocalURL(isLocalURL); - QPixmap p = mime->pixmap( url, KIcon::Desktop, _size, _state ); + TQPixmap p = mime->pixmap( url, KIcon::Desktop, _size, _state ); //kdDebug() << "finding pixmap for " << url.url() << " : " << mime->name() << endl; if (p.isNull()) kdWarning() << "Pixmap not found for mimetype " << m_pMimeType->name() << endl; @@ -637,9 +637,9 @@ bool KFileItem::isReadable() const { /* struct passwd * user = getpwuid( geteuid() ); - bool isMyFile = (QString::fromLocal8Bit(user->pw_name) == m_user); + bool isMyFile = (TQString::fromLocal8Bit(user->pw_name) == m_user); // This gets ugly for the group.... - // Maybe we want a static QString for the user and a static QStringList + // Maybe we want a static TQString for the user and a static QStringList // for the groups... then we need to handle the deletion properly... */ @@ -654,7 +654,7 @@ bool KFileItem::isReadable() const } // Or if we can't read it [using ::access()] - not network transparent - if ( m_bIsLocalURL && ::access( QFile::encodeName(m_url.path()), R_OK ) == -1 ) + if ( m_bIsLocalURL && ::access( TQFile::encodeName(m_url.path()), R_OK ) == -1 ) return false; return true; @@ -664,9 +664,9 @@ bool KFileItem::isWritable() const { /* struct passwd * user = getpwuid( geteuid() ); - bool isMyFile = (QString::fromLocal8Bit(user->pw_name) == m_user); + bool isMyFile = (TQString::fromLocal8Bit(user->pw_name) == m_user); // This gets ugly for the group.... - // Maybe we want a static QString for the user and a static QStringList + // Maybe we want a static TQString for the user and a static QStringList // for the groups... then we need to handle the deletion properly... */ @@ -677,7 +677,7 @@ bool KFileItem::isWritable() const } // Or if we can't read it [using ::access()] - not network transparent - if ( m_bIsLocalURL && ::access( QFile::encodeName(m_url.path()), W_OK ) == -1 ) + if ( m_bIsLocalURL && ::access( TQFile::encodeName(m_url.path()), W_OK ) == -1 ) return false; return true; @@ -727,20 +727,20 @@ bool KFileItem::acceptsDrops() return true; // Executable, shell script ... ? - if ( ::access( QFile::encodeName(m_url.path()), X_OK ) == 0 ) + if ( ::access( TQFile::encodeName(m_url.path()), X_OK ) == 0 ) return true; return false; } -QString KFileItem::getStatusBarInfo() +TQString KFileItem::getStatusBarInfo() { - QString text = m_strText; + TQString text = m_strText; if ( m_bLink ) { - QString comment = determineMimeType()->comment( m_url, m_bIsLocalURL ); - QString tmp; + TQString comment = determineMimeType()->comment( m_url, m_bIsLocalURL ); + TQString tmp; if ( comment.isEmpty() ) tmp = i18n ( "Symbolic Link" ); else @@ -755,7 +755,7 @@ QString KFileItem::getStatusBarInfo() bool hasSize; KIO::filesize_t sizeValue = size(hasSize); if(hasSize) - text += QString(" (%1) ").arg( KIO::convertSize( sizeValue ) ); + text += TQString(" (%1) ").arg( KIO::convertSize( sizeValue ) ); text += mimeComment(); } else if ( S_ISDIR ( m_fileMode ) ) @@ -772,10 +772,10 @@ QString KFileItem::getStatusBarInfo() return text; } -QString KFileItem::getToolTipText(int maxcount) +TQString KFileItem::getToolTipText(int maxcount) { - // we can return QString::null if no tool tip should be shown - QString tip; + // we can return TQString::null if no tool tip should be shown + TQString tip; KFileMetaInfo info = metaInfo(); // the font tags are a workaround for the fact that the tool tip gets @@ -789,7 +789,7 @@ QString KFileItem::getToolTipText(int maxcount) tip += start + i18n("Name:") + mid + text() + end; tip += start + i18n("Type:") + mid; - QString type = QStyleSheet::escape(mimeComment()); + TQString type = TQStyleSheet::escape(mimeComment()); if ( m_bLink ) { tip += i18n("Link to %1 (%2)").arg(linkDest(), type) + end; } else @@ -802,13 +802,13 @@ QString KFileItem::getToolTipText(int maxcount) tip += start + i18n("Size:") + mid + KIO::convertSizeWithBytes(sizeValue) + end; } - QString timeStr = timeString( KIO::UDS_MODIFICATION_TIME); + TQString timeStr = timeString( KIO::UDS_MODIFICATION_TIME); if(!timeStr.isEmpty()) tip += start + i18n("Modified:") + mid + timeStr + end; #ifndef Q_WS_WIN //TODO: show win32-specific permissions - QString userStr = user(); - QString groupStr = group(); + TQString userStr = user(); + TQString groupStr = group(); if(!userStr.isEmpty() || !groupStr.isEmpty()) tip += start + i18n("Owner:") + mid + userStr + " - " + groupStr + end + start + i18n("Permissions:") + mid + @@ -818,16 +818,16 @@ QString KFileItem::getToolTipText(int maxcount) if (info.isValid() && !info.isEmpty() ) { tip += "<tr><td colspan=2><center><s> </s></center></td></tr>"; - QStringList keys = info.preferredKeys(); + TQStringList keys = info.preferredKeys(); // now the rest - QStringList::Iterator it = keys.begin(); + TQStringList::Iterator it = keys.begin(); for (int count = 0; count<maxcount && it!=keys.end() ; ++it) { KFileMetaInfoItem item = info.item( *it ); if ( item.isValid() ) { - QString s = item.string(); + TQString s = item.string(); if ( ( item.attributes() & KFileMimeTypeInfo::SqueezeText ) && s.length() > 50) { s.truncate(47); @@ -837,9 +837,9 @@ QString KFileItem::getToolTipText(int maxcount) { count++; tip += start + - QStyleSheet::escape( item.translatedKey() ) + ":" + + TQStyleSheet::escape( item.translatedKey() ) + ":" + mid + - QStyleSheet::escape( s ) + + TQStyleSheet::escape( s ) + end; } @@ -929,11 +929,11 @@ void KFileItem::setUDSEntry( const KIO::UDSEntry& _entry, const KURL& _url, { m_entry = _entry; m_url = _url; - m_strName = QString::null; - m_strText = QString::null; - m_user = QString::null; - m_group = QString::null; - m_strLowerCaseName = QString::null; + m_strName = TQString::null; + m_strText = TQString::null; + m_user = TQString::null; + m_group = TQString::null; + m_strLowerCaseName = TQString::null; m_pMimeType = 0; m_fileMode = KFileItem::Unknown; m_permissions = KFileItem::Unknown; @@ -942,11 +942,11 @@ void KFileItem::setUDSEntry( const KIO::UDSEntry& _entry, const KURL& _url, m_bIsLocalURL = _url.isLocalFile(); m_bMimeTypeKnown = false; m_hidden = Auto; - m_guessedMimeType = QString::null; + m_guessedMimeType = TQString::null; m_metaInfo = KFileMetaInfo(); if ( d ) - d->iconName = QString::null; + d->iconName = TQString::null; readUDSEntry( _urlIsDirectory ); init( _determineMimeTypeOnDemand ); @@ -957,7 +957,7 @@ void KFileItem::setFileMode( mode_t m ) m_fileMode = m; } -void KFileItem::setMimeType( const QString& mimetype ) +void KFileItem::setMimeType( const TQString& mimetype ) { m_pMimeType = KMimeType::mimeType( mimetype ); } @@ -972,7 +972,7 @@ void KFileItem::setExtraData( const void *key, void *value ) const void * KFileItem::extraData( const void *key ) const { - QMapConstIterator<const void*,void*> it = m_extra.find( key ); + TQMapConstIterator<const void*,void*> it = m_extra.find( key ); if ( it != m_extra.end() ) return it.data(); return 0L; @@ -980,7 +980,7 @@ const void * KFileItem::extraData( const void *key ) const void * KFileItem::extraData( const void *key ) { - QMapIterator<const void*,void*> it = m_extra.find( key ); + TQMapIterator<const void*,void*> it = m_extra.find( key ); if ( it != m_extra.end() ) return it.data(); return 0L; @@ -991,7 +991,7 @@ void KFileItem::removeExtraData( const void *key ) m_extra.remove( key ); } -QString KFileItem::permissionsString() const +TQString KFileItem::permissionsString() const { if (m_access.isNull()) m_access = parsePermissions( m_permissions ); @@ -999,7 +999,7 @@ QString KFileItem::permissionsString() const return m_access; } -QString KFileItem::parsePermissions(mode_t perm) const +TQString KFileItem::parsePermissions(mode_t perm) const { char p[] = "---------- "; @@ -1008,44 +1008,44 @@ QString KFileItem::parsePermissions(mode_t perm) const else if (isLink()) p[0]='l'; - if (perm & QFileInfo::ReadUser) + if (perm & TQFileInfo::ReadUser) p[1]='r'; - if (perm & QFileInfo::WriteUser) + if (perm & TQFileInfo::WriteUser) p[2]='w'; - if ((perm & QFileInfo::ExeUser) && !(perm & S_ISUID)) p[3]='x'; - else if ((perm & QFileInfo::ExeUser) && (perm & S_ISUID)) p[3]='s'; - else if (!(perm & QFileInfo::ExeUser) && (perm & S_ISUID)) p[3]='S'; + if ((perm & TQFileInfo::ExeUser) && !(perm & S_ISUID)) p[3]='x'; + else if ((perm & TQFileInfo::ExeUser) && (perm & S_ISUID)) p[3]='s'; + else if (!(perm & TQFileInfo::ExeUser) && (perm & S_ISUID)) p[3]='S'; - if (perm & QFileInfo::ReadGroup) + if (perm & TQFileInfo::ReadGroup) p[4]='r'; - if (perm & QFileInfo::WriteGroup) + if (perm & TQFileInfo::WriteGroup) p[5]='w'; - if ((perm & QFileInfo::ExeGroup) && !(perm & S_ISGID)) p[6]='x'; - else if ((perm & QFileInfo::ExeGroup) && (perm & S_ISGID)) p[6]='s'; - else if (!(perm & QFileInfo::ExeGroup) && (perm & S_ISGID)) p[6]='S'; + if ((perm & TQFileInfo::ExeGroup) && !(perm & S_ISGID)) p[6]='x'; + else if ((perm & TQFileInfo::ExeGroup) && (perm & S_ISGID)) p[6]='s'; + else if (!(perm & TQFileInfo::ExeGroup) && (perm & S_ISGID)) p[6]='S'; - if (perm & QFileInfo::ReadOther) + if (perm & TQFileInfo::ReadOther) p[7]='r'; - if (perm & QFileInfo::WriteOther) + if (perm & TQFileInfo::WriteOther) p[8]='w'; - if ((perm & QFileInfo::ExeOther) && !(perm & S_ISVTX)) p[9]='x'; - else if ((perm & QFileInfo::ExeOther) && (perm & S_ISVTX)) p[9]='t'; - else if (!(perm & QFileInfo::ExeOther) && (perm & S_ISVTX)) p[9]='T'; + if ((perm & TQFileInfo::ExeOther) && !(perm & S_ISVTX)) p[9]='x'; + else if ((perm & TQFileInfo::ExeOther) && (perm & S_ISVTX)) p[9]='t'; + else if (!(perm & TQFileInfo::ExeOther) && (perm & S_ISVTX)) p[9]='T'; if (hasExtendedACL()) p[10]='+'; - return QString::fromLatin1(p); + return TQString::fromLatin1(p); } // check if we need to cache this -QString KFileItem::timeString( unsigned int which ) const +TQString KFileItem::timeString( unsigned int which ) const { bool hasTime; time_t time_ = time(which, hasTime); - if(!hasTime) return QString::null; + if(!hasTime) return TQString::null; - QDateTime t; + TQDateTime t; t.setTime_t( time_); return KGlobal::locale()->formatDateTime( t ); } @@ -1071,7 +1071,7 @@ const KFileMetaInfo & KFileItem::metaInfo(bool autoget, int) const KURL KFileItem::mostLocalURL(bool &local) const { - QString local_path = localPath(); + TQString local_path = localPath(); if ( !local_path.isEmpty() ) { @@ -1090,7 +1090,7 @@ KURL KFileItem::mostLocalURL(bool &local) const void KFileItem::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -QDataStream & operator<< ( QDataStream & s, const KFileItem & a ) +TQDataStream & operator<< ( TQDataStream & s, const KFileItem & a ) { // We don't need to save/restore anything that refresh() invalidates, // since that means we can re-determine those by ourselves. @@ -1100,7 +1100,7 @@ QDataStream & operator<< ( QDataStream & s, const KFileItem & a ) return s; } -QDataStream & operator>> ( QDataStream & s, KFileItem & a ) +TQDataStream & operator>> ( TQDataStream & s, KFileItem & a ) { s >> a.m_url; s >> a.m_strName; diff --git a/kio/kio/kfileitem.h b/kio/kio/kfileitem.h index dcb674e7e..cf6344669 100644 --- a/kio/kio/kfileitem.h +++ b/kio/kio/kfileitem.h @@ -20,10 +20,10 @@ #ifndef __kfileitem_h__ #define __kfileitem_h__ -#include <qstringlist.h> +#include <tqstringlist.h> #include <sys/stat.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include <kio/global.h> #include <kurl.h> #include <kacl.h> @@ -80,7 +80,7 @@ public: * @param mimeType the name of the file's mimetype * @param mode the mode (S_IFDIR...) */ - KFileItem( const KURL &url, const QString &mimeType, mode_t mode ); + KFileItem( const KURL &url, const TQString &mimeType, mode_t mode ); /** * Copy constructor. Note that extra-data set via setExtraData() is not @@ -125,7 +125,7 @@ public: * This method is provided for some special cases like relative paths as names (KFindPart) * @param name the item's name */ - void setName( const QString &name ); + void setName( const TQString &name ); /** * Returns the permissions of the file (stat.st_mode containing only permissions). @@ -137,7 +137,7 @@ public: * Returns the access permissions for the file as a string. * @return the access persmission as string */ - QString permissionsString() const; + TQString permissionsString() const; /** * Tells if the file has extended access level information ( Posix ACL ) @@ -170,13 +170,13 @@ public: * Returns the owner of the file. * @return the file's owner */ - QString user() const; + TQString user() const; /** * Returns the group of the file. * @return the file's group */ - QString group() const; + TQString group() const; /** * Returns true if this item represents a link in the UNIX sense of @@ -222,17 +222,17 @@ public: /** * Returns the link destination if isLink() == true. - * @return the link destination. QString::null if the item is not a link + * @return the link destination. TQString::null if the item is not a link */ - QString linkDest() const; + TQString linkDest() const; /** * Returns the local path if isLocalFile() == true or the KIO item has * a UDS_LOCAL_PATH atom. - * @return the item local path, or QString::null if not known + * @return the item local path, or TQString::null if not known * @since 3.4 */ - QString localPath() const; + TQString localPath() const; //FIXME KDE4 deprecate this in favor of size(bool &hasSize) /** @@ -270,10 +270,10 @@ public: * Requests the modification, access or creation time as a string, depending * on @p which. * @param which UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or UDS_CREATION_TIME - * @returns a formatted string of the requested time, QString::null if time is not known + * @returns a formatted string of the requested time, TQString::null if time is not known * @see time */ - QString timeString( unsigned int which = KIO::UDS_MODIFICATION_TIME ) const; + TQString timeString( unsigned int which = KIO::UDS_MODIFICATION_TIME ) const; /** * Returns true if the file is a local file. @@ -286,7 +286,7 @@ public: * It's not exactly the filename since some decoding happens ('%2F'->'/'). * @return the text of the file item */ - const QString& text() const { return m_strText; } + const TQString& text() const { return m_strText; } /** * Return the name of the file item (without a path). @@ -295,7 +295,7 @@ public: * which is useful to speed up sorting by name, case insensitively. * @return the file's name */ - const QString& name( bool lowerCase = false ) const { + const TQString& name( bool lowerCase = false ) const { if ( !lowerCase ) return m_strName; else @@ -310,7 +310,7 @@ public: * the mimetype first. Equivalent to determineMimeType()->name() * @return the mime type of the file */ - QString mimetype() const; + TQString mimetype() const; /** * Returns the mimetype of the file item. @@ -333,14 +333,14 @@ public: * the mime type itself if none is present. * @return the mime type description, or the mime type itself */ - QString mimeComment(); + TQString mimeComment(); /** * Returns the full path name to the icon that represents * this mime type. * @return iconName the name of the file's icon */ - QString iconName(); + TQString iconName(); /** * Returns a pixmap representing the file. @@ -350,7 +350,7 @@ public: * KIcon::ActiveState or KIcon::DisabledState. * @return the pixmap */ - QPixmap pixmap( int _size, int _state=0 ) const; + TQPixmap pixmap( int _size, int _state=0 ) const; /** * Returns the overlays (bitfield of KIcon::*Overlay flags) that are used @@ -365,7 +365,7 @@ public: * e.g. when the mouse is over this item * @return the status bar information */ - QString getStatusBarInfo(); + TQString getStatusBarInfo(); /** * Returns the string to be displayed in the tool tip when the mouse @@ -375,7 +375,7 @@ public: * @param maxcount the maximum number of entries shown * @return the tool tip string */ - QString getToolTipText(int maxcount = 6); + TQString getToolTipText(int maxcount = 6); /** * Returns true if files can be dropped over this item. @@ -431,7 +431,7 @@ public: * separately. * * I.e. a KFileIconView that associates a KFileIconViewItem (an item suitable - * for use with QIconView) does + * for use with TQIconView) does * * \code * kfileItem->setExtraData( this, iconViewItem ); @@ -444,7 +444,7 @@ public: * \endcode * * This is usually more efficient then having every view associate data to - * items by using a separate QDict or QMap. + * items by using a separate TQDict or TQMap. * * Note: you have to remove and destroy the data you associated yourself * when you don't need it anymore! @@ -500,7 +500,7 @@ public: * @param mimetype the new mimetype * @since 3.5.0 */ - void setMimeType( const QString& mimetype ); + void setMimeType( const TQString& mimetype ); /** * Returns the metainfo of this item. @@ -570,7 +570,7 @@ protected: /** * Parses the given permission set and provides it for access() */ - QString parsePermissions( mode_t perm ) const; + TQString parsePermissions( mode_t perm ) const; private: /** @@ -585,23 +585,23 @@ private: /** * The text for this item, i.e. the file name without path, */ - QString m_strName; + TQString m_strName; /** * The text for this item, i.e. the file name without path, decoded * ('%%' becomes '%', '%2F' becomes '/') */ - QString m_strText; + TQString m_strText; /** * the user and group assigned to the file. */ - mutable QString m_user, m_group; + mutable TQString m_user, m_group; /** * The filename in lower case (to speed up sorting) */ - mutable QString m_strLowerCaseName; + mutable TQString m_strLowerCaseName; /** * The mimetype of the file @@ -636,9 +636,9 @@ private: enum { Auto, Hidden, Shown } m_hidden:3; // For special case like link to dirs over FTP - QString m_guessedMimeType; - mutable QString m_access; - QMap<const void*, void*> m_extra; + TQString m_guessedMimeType; + mutable TQString m_access; + TQMap<const void*, void*> m_extra; mutable KFileMetaInfo m_metaInfo; enum { Modification = 0, Access = 1, Creation = 2, NumFlags = 3 }; @@ -650,22 +650,22 @@ protected: private: class KFileItemPrivate; KFileItemPrivate * d; - KIO_EXPORT friend QDataStream & operator<< ( QDataStream & s, const KFileItem & a ); - KIO_EXPORT friend QDataStream & operator>> ( QDataStream & s, KFileItem & a ); + KIO_EXPORT friend TQDataStream & operator<< ( TQDataStream & s, const KFileItem & a ); + KIO_EXPORT friend TQDataStream & operator>> ( TQDataStream & s, KFileItem & a ); }; /** * List of KFileItems */ -typedef QPtrList<KFileItem> KFileItemList; +typedef TQPtrList<KFileItem> KFileItemList; /** * Iterator for KFileItemList */ -typedef QPtrListIterator<KFileItem> KFileItemListIterator; +typedef TQPtrListIterator<KFileItem> KFileItemListIterator; -KIO_EXPORT QDataStream & operator<< ( QDataStream & s, const KFileItem & a ); -KIO_EXPORT QDataStream & operator>> ( QDataStream & s, KFileItem & a ); +KIO_EXPORT TQDataStream & operator<< ( TQDataStream & s, const KFileItem & a ); +KIO_EXPORT TQDataStream & operator>> ( TQDataStream & s, KFileItem & a ); #endif diff --git a/kio/kio/kfilemetainfo.cpp b/kio/kio/kfilemetainfo.cpp index b47b06e99..fcab35f19 100644 --- a/kio/kio/kfilemetainfo.cpp +++ b/kio/kio/kfilemetainfo.cpp @@ -22,8 +22,8 @@ #include <assert.h> -#include <qshared.h> -#include <qdict.h> +#include <tqshared.h> +#include <tqdict.h> #include <ktrader.h> #include <kstaticdeleter.h> @@ -41,8 +41,8 @@ class KFileMetaInfoItem::Data : public QShared { public: - Data( const KFileMimeTypeInfo::ItemInfo* mti, const QString& _key, - const QVariant& _value ) + Data( const KFileMimeTypeInfo::ItemInfo* mti, const TQString& _key, + const TQVariant& _value ) : QShared(), mimeTypeInfo( mti ), key( _key ), @@ -64,8 +64,8 @@ public: const KFileMimeTypeInfo::ItemInfo* mimeTypeInfo; // mimeTypeInfo has the key, too, but only for non-variable ones - QString key; - QVariant value; + TQString key; + TQVariant value; bool dirty :1; bool added :1; bool removed :1; @@ -87,14 +87,14 @@ KFileMetaInfoItem::Data* KFileMetaInfoItem::Data::makeNull() // where the d-pointer is compared against null. KFileMimeTypeInfo::ItemInfo* info = new KFileMimeTypeInfo::ItemInfo(); - null = new Data(info, QString::null, QVariant()); + null = new Data(info, TQString::null, TQVariant()); sd_KFileMetaInfoItemData.setObject( null ); } return null; } KFileMetaInfoItem::KFileMetaInfoItem( const KFileMimeTypeInfo::ItemInfo* mti, - const QString& key, const QVariant& value ) + const TQString& key, const TQVariant& value ) : d( new Data( mti, key, value ) ) { } @@ -131,7 +131,7 @@ const KFileMetaInfoItem& KFileMetaInfoItem::operator= return *this; } -bool KFileMetaInfoItem::setValue( const QVariant& value ) +bool KFileMetaInfoItem::setValue( const TQVariant& value ) { // We don't call makeNull here since it isn't necassery, see deref() if ( d == Data::null ) return false; @@ -150,8 +150,8 @@ bool KFileMetaInfoItem::setValue( const QVariant& value ) d->dirty = true; d->value = value; - // If we don't cast (and test for canCast in the above if), QVariant is - // very picky about types (e.g. QString vs. QCString or int vs. uint) + // If we don't cast (and test for canCast in the above if), TQVariant is + // very picky about types (e.g. TQString vs. TQCString or int vs. uint) d->value.cast(d->mimeTypeInfo->type()); return true; @@ -162,12 +162,12 @@ bool KFileMetaInfoItem::isRemoved() const return d->removed; } -QString KFileMetaInfoItem::key() const +TQString KFileMetaInfoItem::key() const { return d->key; } -QString KFileMetaInfoItem::translatedKey() const +TQString KFileMetaInfoItem::translatedKey() const { // are we a variable key? if (d->mimeTypeInfo->key().isNull()) @@ -179,17 +179,17 @@ QString KFileMetaInfoItem::translatedKey() const return d->mimeTypeInfo->translatedKey(); } -const QVariant& KFileMetaInfoItem::value() const +const TQVariant& KFileMetaInfoItem::value() const { return d->value; } -QString KFileMetaInfoItem::string( bool mangle ) const +TQString KFileMetaInfoItem::string( bool mangle ) const { return d->mimeTypeInfo->string(d->value, mangle); } -QVariant::Type KFileMetaInfoItem::type() const +TQVariant::Type KFileMetaInfoItem::type() const { return d->mimeTypeInfo->type(); } @@ -204,12 +204,12 @@ bool KFileMetaInfoItem::isModified() const return d->dirty; } -QString KFileMetaInfoItem::prefix() const +TQString KFileMetaInfoItem::prefix() const { return d->mimeTypeInfo->prefix(); } -QString KFileMetaInfoItem::suffix() const +TQString KFileMetaInfoItem::suffix() const { return d->mimeTypeInfo->suffix(); } @@ -285,16 +285,16 @@ public: KURL url; uint what; - QMap<QString, KFileMetaInfoGroup> groups; + TQMap<TQString, KFileMetaInfoGroup> groups; const KFileMimeTypeInfo* mimeTypeInfo; - QStringList removedGroups; + TQStringList removedGroups; static Data* null; static Data* makeNull(); }; -KFileMetaInfo::KFileMetaInfo( const QString& path, const QString& mimeType, +KFileMetaInfo::KFileMetaInfo( const TQString& path, const TQString& mimeType, uint what ) { KURL u; @@ -303,18 +303,18 @@ KFileMetaInfo::KFileMetaInfo( const QString& path, const QString& mimeType, init(u, mimeType, what); } -KFileMetaInfo::KFileMetaInfo( const KURL& url, const QString& mimeType, +KFileMetaInfo::KFileMetaInfo( const KURL& url, const TQString& mimeType, uint what ) { init(url, mimeType, what); } -void KFileMetaInfo::init( const KURL& url, const QString& mimeType, +void KFileMetaInfo::init( const KURL& url, const TQString& mimeType, uint what ) { d = new Data( url, what ); - QString mT; + TQString mT; if (mimeType.isEmpty()) mT = KMimeType::findByURL(url)->name(); else @@ -362,33 +362,33 @@ KFileMetaInfo::~KFileMetaInfo() deref(); } -QStringList KFileMetaInfo::supportedGroups() const +TQStringList KFileMetaInfo::supportedGroups() const { assert(isValid()); return d->mimeTypeInfo->supportedGroups(); } -QStringList KFileMetaInfo::supportedKeys() const +TQStringList KFileMetaInfo::supportedKeys() const { assert(isValid()); return d->mimeTypeInfo->supportedKeys(); } -QStringList KFileMetaInfo::groups() const +TQStringList KFileMetaInfo::groups() const { - QStringList list; - QMapConstIterator<QString, KFileMetaInfoGroup> it = d->groups.begin(); + TQStringList list; + TQMapConstIterator<TQString, KFileMetaInfoGroup> it = d->groups.begin(); for ( ; it != d->groups.end(); ++it ) list += (*it).name(); return list; } -QStringList KFileMetaInfo::editableGroups() const +TQStringList KFileMetaInfo::editableGroups() const { - QStringList list; - QStringList supported = supportedGroups(); - QStringList::ConstIterator it = supported.begin(); + TQStringList list; + TQStringList supported = supportedGroups(); + TQStringList::ConstIterator it = supported.begin(); for ( ; it != supported.end(); ++it ) { const KFileMimeTypeInfo::GroupInfo * groupInfo = d->mimeTypeInfo->groupInfo( *it ); if ( groupInfo && groupInfo->attributes() & @@ -399,18 +399,18 @@ QStringList KFileMetaInfo::editableGroups() const return list; } -QStringList KFileMetaInfo::preferredGroups() const +TQStringList KFileMetaInfo::preferredGroups() const { assert(isValid()); - QStringList list = groups(); - QStringList newlist; - QStringList preferred = d->mimeTypeInfo->preferredGroups(); - QStringList::Iterator pref; + TQStringList list = groups(); + TQStringList newlist; + TQStringList preferred = d->mimeTypeInfo->preferredGroups(); + TQStringList::Iterator pref; // move all keys from the preferred groups that are in our list to a new list for ( pref = preferred.begin(); pref != preferred.end(); ++pref ) { - QStringList::Iterator group = list.find(*pref); + TQStringList::Iterator group = list.find(*pref); if ( group != list.end() ) { newlist.append( *group ); @@ -425,12 +425,12 @@ QStringList KFileMetaInfo::preferredGroups() const return newlist; } -QStringList KFileMetaInfo::preferredKeys() const +TQStringList KFileMetaInfo::preferredKeys() const { - QStringList newlist; + TQStringList newlist; - QStringList list = preferredGroups(); - for (QStringList::Iterator git = list.begin(); git != list.end(); ++git) + TQStringList list = preferredGroups(); + for (TQStringList::Iterator git = list.begin(); git != list.end(); ++git) { newlist += d->groups[*git].preferredKeys(); } @@ -438,16 +438,16 @@ QStringList KFileMetaInfo::preferredKeys() const return newlist; } -KFileMetaInfoGroup KFileMetaInfo::group(const QString& key) const +KFileMetaInfoGroup KFileMetaInfo::group(const TQString& key) const { - QMapIterator<QString,KFileMetaInfoGroup> it = d->groups.find( key ); + TQMapIterator<TQString,KFileMetaInfoGroup> it = d->groups.find( key ); if ( it != d->groups.end() ) return it.data(); else return KFileMetaInfoGroup(); } -bool KFileMetaInfo::addGroup( const QString& name ) +bool KFileMetaInfo::addGroup( const TQString& name ) { assert(isValid()); if ( d->mimeTypeInfo->supportedGroups().contains(name) && @@ -460,8 +460,8 @@ bool KFileMetaInfo::addGroup( const QString& name ) Q_ASSERT(ginfo); if (!ginfo) return false; - QStringList keys = ginfo->supportedKeys(); - for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) + TQStringList keys = ginfo->supportedKeys(); + for (TQStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { const KFileMimeTypeInfo::ItemInfo* iteminfo = ginfo->itemInfo(*it); Q_ASSERT(ginfo); @@ -471,7 +471,7 @@ bool KFileMetaInfo::addGroup( const QString& name ) (iteminfo->attributes() & KFileMimeTypeInfo::Modifiable)) { // append it now or never - group.appendItem(iteminfo->key(), QVariant()); + group.appendItem(iteminfo->key(), TQVariant()); } } @@ -484,9 +484,9 @@ bool KFileMetaInfo::addGroup( const QString& name ) return false; } -bool KFileMetaInfo::removeGroup( const QString& name ) +bool KFileMetaInfo::removeGroup( const TQString& name ) { - QMapIterator<QString, KFileMetaInfoGroup> it = d->groups.find(name); + TQMapIterator<TQString, KFileMetaInfoGroup> it = d->groups.find(name); if ( (it==d->groups.end()) || !((*it).attributes() & KFileMimeTypeInfo::Removable)) return false; @@ -496,7 +496,7 @@ bool KFileMetaInfo::removeGroup( const QString& name ) return true; } -QStringList KFileMetaInfo::removedGroups() +TQStringList KFileMetaInfo::removedGroups() { return d->removedGroups; } @@ -522,7 +522,7 @@ bool KFileMetaInfo::isValid() const bool KFileMetaInfo::isEmpty() const { - for (QMapIterator<QString, KFileMetaInfoGroup> it = d->groups.begin(); + for (TQMapIterator<TQString, KFileMetaInfoGroup> it = d->groups.begin(); it!=d->groups.end(); ++it) if (!(*it).isEmpty()) return false; @@ -534,14 +534,14 @@ bool KFileMetaInfo::applyChanges() return applyChanges( path() ); } -bool KFileMetaInfo::applyChanges( const QString& path ) +bool KFileMetaInfo::applyChanges( const TQString& path ) { bool doit = false; // kdDebug(7033) << "KFileMetaInfo::applyChanges()\n"; // look up if we need to write to the file - QMapConstIterator<QString, KFileMetaInfoGroup> it; + TQMapConstIterator<TQString, KFileMetaInfoGroup> it; for (it = d->groups.begin(); it!=d->groups.end() && !doit; ++it) { if ( (*it).isModified() ) @@ -549,8 +549,8 @@ bool KFileMetaInfo::applyChanges( const QString& path ) else { - QStringList keys = it.data().keys(); - for (QStringList::Iterator it2 = keys.begin(); it2!=keys.end(); ++it2) + TQStringList keys = it.data().keys(); + for (TQStringList::Iterator it2 = keys.begin(); it2!=keys.end(); ++it2) { if ( (*it)[*it2].isModified() ) { @@ -589,16 +589,16 @@ KFilePlugin * const KFileMetaInfo::plugin() const return prov->plugin( d->mimeTypeInfo->mimeType(), d->url.protocol() ); } -QString KFileMetaInfo::mimeType() const +TQString KFileMetaInfo::mimeType() const { assert(isValid()); return d->mimeTypeInfo->mimeType(); } -bool KFileMetaInfo::contains(const QString& key) const +bool KFileMetaInfo::contains(const TQString& key) const { - QStringList glist = groups(); - for (QStringList::Iterator it = glist.begin(); it != glist.end(); ++it) + TQStringList glist = groups(); + for (TQStringList::Iterator it = glist.begin(); it != glist.end(); ++it) { KFileMetaInfoGroup g = d->groups[*it]; if (g.contains(key)) return true; @@ -606,15 +606,15 @@ bool KFileMetaInfo::contains(const QString& key) const return false; } -bool KFileMetaInfo::containsGroup(const QString& key) const +bool KFileMetaInfo::containsGroup(const TQString& key) const { return groups().contains(key); } -KFileMetaInfoItem KFileMetaInfo::item( const QString& key) const +KFileMetaInfoItem KFileMetaInfo::item( const TQString& key) const { - QStringList groups = preferredGroups(); - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + TQStringList groups = preferredGroups(); + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { KFileMetaInfoItem i = d->groups[*it][key]; if (i.isValid()) return i; @@ -624,8 +624,8 @@ KFileMetaInfoItem KFileMetaInfo::item( const QString& key) const KFileMetaInfoItem KFileMetaInfo::item(const KFileMetaInfoItem::Hint hint) const { - QStringList groups = preferredGroups(); - QStringList::ConstIterator it; + TQStringList groups = preferredGroups(); + TQStringList::ConstIterator it; for (it = groups.begin(); it != groups.end(); ++it) { KFileMetaInfoItem i = d->groups[*it].item(hint); @@ -634,14 +634,14 @@ KFileMetaInfoItem KFileMetaInfo::item(const KFileMetaInfoItem::Hint hint) const return KFileMetaInfoItem(); } -KFileMetaInfoItem KFileMetaInfo::saveItem( const QString& key, - const QString& preferredGroup, +KFileMetaInfoItem KFileMetaInfo::saveItem( const TQString& key, + const TQString& preferredGroup, bool createGroup ) { assert(isValid()); // try the preferred groups first if ( !preferredGroup.isEmpty() ) { - QMapIterator<QString,KFileMetaInfoGroup> it = + TQMapIterator<TQString,KFileMetaInfoGroup> it = d->groups.find( preferredGroup ); // try to create the preferred group, if necessary @@ -661,14 +661,14 @@ KFileMetaInfoItem KFileMetaInfo::saveItem( const QString& key, } } - QStringList groups = preferredGroups(); + TQStringList groups = preferredGroups(); KFileMetaInfoItem item; - QStringList::ConstIterator groupIt = groups.begin(); + TQStringList::ConstIterator groupIt = groups.begin(); for ( ; groupIt != groups.end(); ++groupIt ) { - QMapIterator<QString,KFileMetaInfoGroup> it = d->groups.find( *groupIt ); + TQMapIterator<TQString,KFileMetaInfoGroup> it = d->groups.find( *groupIt ); if ( it != d->groups.end() ) { KFileMetaInfoGroup group = it.data(); @@ -701,7 +701,7 @@ KFileMetaInfoItem KFileMetaInfo::saveItem( const QString& key, } KFileMetaInfoItem KFileMetaInfo::findEditableItem( KFileMetaInfoGroup& group, - const QString& key ) + const TQString& key ) { assert(isValid()); KFileMetaInfoItem item = group.addItem( key ); @@ -714,7 +714,7 @@ KFileMetaInfoItem KFileMetaInfo::findEditableItem( KFileMetaInfoGroup& group, return KFileMetaInfoItem(); } -KFileMetaInfoGroup KFileMetaInfo::appendGroup(const QString& name) +KFileMetaInfoGroup KFileMetaInfo::appendGroup(const TQString& name) { assert(isValid()); if ( d->mimeTypeInfo->supportedGroups().contains(name) && @@ -731,9 +731,9 @@ KFileMetaInfoGroup KFileMetaInfo::appendGroup(const QString& name) } } -QString KFileMetaInfo::path() const +TQString KFileMetaInfo::path() const { - return d->url.isLocalFile() ? d->url.path() : QString::null; + return d->url.isLocalFile() ? d->url.path() : TQString::null; } KURL KFileMetaInfo::url() const @@ -778,9 +778,9 @@ KFileMetaInfo::Data* KFileMetaInfo::Data::makeNull() /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// -KFilePlugin::KFilePlugin( QObject *parent, const char *name, - const QStringList& /*args*/) - : QObject( parent, name ) +KFilePlugin::KFilePlugin( TQObject *parent, const char *name, + const TQStringList& /*args*/) + : TQObject( parent, name ) { // kdDebug(7033) << "loaded a plugin for " << name << endl; } @@ -790,7 +790,7 @@ KFilePlugin::~KFilePlugin() // kdDebug(7033) << "unloaded a plugin for " << name() << endl; } -KFileMimeTypeInfo * KFilePlugin::addMimeTypeInfo( const QString& mimeType ) +KFileMimeTypeInfo * KFilePlugin::addMimeTypeInfo( const TQString& mimeType ) { return KFileMetaInfoProvider::self()->addMimeTypeInfo( mimeType ); } @@ -800,7 +800,7 @@ void KFilePlugin::virtual_hook( int, void* ) KFileMimeTypeInfo::GroupInfo* KFilePlugin::addGroupInfo(KFileMimeTypeInfo* info, - const QString& key, const QString& translatedKey) const + const TQString& key, const TQString& translatedKey) const { return info->addGroupInfo(key, translatedKey); } @@ -811,15 +811,15 @@ void KFilePlugin::setAttributes(KFileMimeTypeInfo::GroupInfo* gi, uint attr) con } void KFilePlugin::addVariableInfo(KFileMimeTypeInfo::GroupInfo* gi, - QVariant::Type type, uint attr) const + TQVariant::Type type, uint attr) const { gi->addVariableInfo(type, attr); } KFileMimeTypeInfo::ItemInfo* KFilePlugin::addItemInfo(KFileMimeTypeInfo::GroupInfo* gi, - const QString& key, - const QString& translatedKey, - QVariant::Type type) + const TQString& key, + const TQString& translatedKey, + TQVariant::Type type) { return gi->addItemInfo(key, translatedKey, type); } @@ -881,22 +881,22 @@ void KFilePlugin::setUnit(KFileMimeTypeInfo::ItemInfo* item, uint unit) } } -void KFilePlugin::setPrefix(KFileMimeTypeInfo::ItemInfo* item, const QString& prefix) +void KFilePlugin::setPrefix(KFileMimeTypeInfo::ItemInfo* item, const TQString& prefix) { item->m_prefix = prefix; } -void KFilePlugin::setSuffix(KFileMimeTypeInfo::ItemInfo* item, const QString& suffix) +void KFilePlugin::setSuffix(KFileMimeTypeInfo::ItemInfo* item, const TQString& suffix) { item->m_suffix = suffix; } -KFileMetaInfoGroup KFilePlugin::appendGroup(KFileMetaInfo& info, const QString& key) +KFileMetaInfoGroup KFilePlugin::appendGroup(KFileMetaInfo& info, const TQString& key) { return info.appendGroup(key); } -void KFilePlugin::appendItem(KFileMetaInfoGroup& group, const QString& key, QVariant value) +void KFilePlugin::appendItem(KFileMetaInfoGroup& group, const TQString& key, TQVariant value) { group.appendItem(key, value); } @@ -927,22 +927,22 @@ KFileMetaInfoProvider::~KFileMetaInfoProvider() sd.setObject( 0 ); } -KFilePlugin* KFileMetaInfoProvider::loadPlugin( const QString& mimeType, const QString& protocol ) +KFilePlugin* KFileMetaInfoProvider::loadPlugin( const TQString& mimeType, const TQString& protocol ) { //kdDebug() << "loadPlugin: mimeType=" << mimeType << " protocol=" << protocol << endl; // Currently the idea is: either the mimetype is set or the protocol, but not both. // We need PNG fileinfo, and trash: fileinfo, but not "PNG in the trash". - QString queryMimeType, query; + TQString queryMimeType, query; if ( !mimeType.isEmpty() ) { query = "(not exist [X-KDE-Protocol])"; queryMimeType = mimeType; } else { - query = QString::fromLatin1( "[X-KDE-Protocol] == '%1'" ).arg(protocol); + query = TQString::fromLatin1( "[X-KDE-Protocol] == '%1'" ).arg(protocol); // querying for a protocol: we have no mimetype, so we need to use KFilePlugin as one queryMimeType = "KFilePlugin"; // hopefully using KFilePlugin as genericMimeType too isn't a problem } - const KTrader::OfferList offers = KTrader::self()->query( queryMimeType, "KFilePlugin", query, QString::null ); + const KTrader::OfferList offers = KTrader::self()->query( queryMimeType, "KFilePlugin", query, TQString::null ); if ( offers.isEmpty() ) return 0; KService::Ptr service = *(offers.begin()); @@ -958,7 +958,7 @@ KFilePlugin* KFileMetaInfoProvider::loadPlugin( const QString& mimeType, const Q return plugin; } -KFilePlugin* KFileMetaInfoProvider::loadAndRegisterPlugin( const QString& mimeType, const QString& protocol ) +KFilePlugin* KFileMetaInfoProvider::loadAndRegisterPlugin( const TQString& mimeType, const TQString& protocol ) { Q_ASSERT( m_pendingMimetypeInfos.isEmpty() ); m_pendingMimetypeInfos.clear(); @@ -979,7 +979,7 @@ KFilePlugin* KFileMetaInfoProvider::loadAndRegisterPlugin( const QString& mimeTy } else { // Mimetype-metainfo: the plugin can register itself for multiple mimetypes, remember them all bool first = true; - QDictIterator<KFileMimeTypeInfo> it( m_pendingMimetypeInfos ); + TQDictIterator<KFileMimeTypeInfo> it( m_pendingMimetypeInfos ); for( ; it.current(); ++it ) { KFileMimeTypeInfo* info = it.current(); m_plugins.insert( it.currentKey(), new CachedPluginInfo( plugin, info, first ) ); @@ -993,12 +993,12 @@ KFilePlugin* KFileMetaInfoProvider::loadAndRegisterPlugin( const QString& mimeTy return plugin; } -KFilePlugin * KFileMetaInfoProvider::plugin(const QString& mimeType) +KFilePlugin * KFileMetaInfoProvider::plugin(const TQString& mimeType) { - return plugin( mimeType, QString::null ); + return plugin( mimeType, TQString::null ); } -KFilePlugin * KFileMetaInfoProvider::plugin(const QString& mimeType, const QString& protocol) +KFilePlugin * KFileMetaInfoProvider::plugin(const TQString& mimeType, const TQString& protocol) { //kdDebug(7033) << "plugin() : looking for plugin for protocol=" << protocol << " mimeType=" << mimeType << endl; @@ -1008,7 +1008,7 @@ KFilePlugin * KFileMetaInfoProvider::plugin(const QString& mimeType, const QStri return cache->plugin; } if ( !cache ) { - KFilePlugin* plugin = loadAndRegisterPlugin( QString::null, protocol ); + KFilePlugin* plugin = loadAndRegisterPlugin( TQString::null, protocol ); if ( plugin ) return plugin; } @@ -1019,12 +1019,12 @@ KFilePlugin * KFileMetaInfoProvider::plugin(const QString& mimeType, const QStri return cache->plugin; } - KFilePlugin* plugin = loadAndRegisterPlugin( mimeType, QString::null ); + KFilePlugin* plugin = loadAndRegisterPlugin( mimeType, TQString::null ); #if 0 kdDebug(7033) << "currently loaded plugins:\n"; - QDictIterator<CachedPluginInfo> it( m_plugins ); + TQDictIterator<CachedPluginInfo> it( m_plugins ); for( ; it.current(); ++it ) { CachedPluginInfo* cache = it.current(); kdDebug(7033) @@ -1037,7 +1037,7 @@ KFilePlugin * KFileMetaInfoProvider::plugin(const QString& mimeType, const QStri return plugin; } -QStringList KFileMetaInfoProvider::preferredKeys( const QString& mimeType ) const +TQStringList KFileMetaInfoProvider::preferredKeys( const TQString& mimeType ) const { KService::Ptr service = KServiceTypeProfile::preferredService( mimeType, "KFilePlugin"); @@ -1045,12 +1045,12 @@ QStringList KFileMetaInfoProvider::preferredKeys( const QString& mimeType ) cons if ( !service || !service->isValid() ) { // kdDebug(7033) << "no valid service found\n"; - return QStringList(); + return TQStringList(); } return service->property("PreferredItems").toStringList(); } -QStringList KFileMetaInfoProvider::preferredGroups( const QString& mimeType ) const +TQStringList KFileMetaInfoProvider::preferredGroups( const TQString& mimeType ) const { KService::Ptr service = KServiceTypeProfile::preferredService( mimeType, "KFilePlugin"); @@ -1058,17 +1058,17 @@ QStringList KFileMetaInfoProvider::preferredGroups( const QString& mimeType ) co if ( !service || !service->isValid() ) { // kdDebug(7033) << "no valid service found\n"; - return QStringList(); + return TQStringList(); } return service->property("PreferredGroups").toStringList(); } -const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const QString& mimeType ) +const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const TQString& mimeType ) { - return mimeTypeInfo( mimeType, QString::null ); + return mimeTypeInfo( mimeType, TQString::null ); } -const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const QString& mimeType, const QString& protocol ) +const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const TQString& mimeType, const TQString& protocol ) { //kdDebug(7033) << "mimeTypeInfo() : looking for plugin for protocol=" << protocol << " mimeType=" << mimeType << endl; if ( !protocol.isEmpty() ) { @@ -1078,7 +1078,7 @@ const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const QString& mi } if ( !cache ) { - loadAndRegisterPlugin( QString::null, protocol ); + loadAndRegisterPlugin( TQString::null, protocol ); cache = m_plugins.find( protocol ); if ( cache && cache->mimeTypeInfo ) { return cache->mimeTypeInfo; @@ -1091,7 +1091,7 @@ const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const QString& mi return cache->mimeTypeInfo; } - loadAndRegisterPlugin( mimeType, QString::null ); + loadAndRegisterPlugin( mimeType, TQString::null ); cache = m_plugins.find( mimeType ); if ( cache ) { return cache->mimeTypeInfo; @@ -1100,7 +1100,7 @@ const KFileMimeTypeInfo * KFileMetaInfoProvider::mimeTypeInfo( const QString& mi } KFileMimeTypeInfo * KFileMetaInfoProvider::addMimeTypeInfo( - const QString& mimeType ) + const TQString& mimeType ) { KFileMimeTypeInfo *info = m_pendingMimetypeInfos.find( mimeType ); @@ -1117,17 +1117,17 @@ KFileMimeTypeInfo * KFileMetaInfoProvider::addMimeTypeInfo( return info; } -QStringList KFileMetaInfoProvider::supportedMimeTypes() const +TQStringList KFileMetaInfoProvider::supportedMimeTypes() const { - QStringList allMimeTypes; - QString kfilePlugin = "KFilePlugin"; + TQStringList allMimeTypes; + TQString kfilePlugin = "KFilePlugin"; KTrader::OfferList offers = KTrader::self()->query( "KFilePlugin" ); KTrader::OfferListIterator it = offers.begin(); for ( ; it != offers.end(); ++it ) { - const QStringList mimeTypes = (*it)->serviceTypes(); - QStringList::ConstIterator it2 = mimeTypes.begin(); + const TQStringList mimeTypes = (*it)->serviceTypes(); + TQStringList::ConstIterator it2 = mimeTypes.begin(); for ( ; it2 != mimeTypes.end(); ++it2 ) if ( allMimeTypes.find( *it2 ) == allMimeTypes.end() && *it2 != kfilePlugin ) // also in serviceTypes() @@ -1147,7 +1147,7 @@ QStringList KFileMetaInfoProvider::supportedMimeTypes() const class KFileMetaInfoGroup::Data : public QShared { public: - Data(const QString& _name) + Data(const TQString& _name) : QShared(), name(_name), mimeTypeInfo(0L), @@ -1162,10 +1162,10 @@ public: delete mimeTypeInfo; }; - QString name; - QMap<QString, KFileMetaInfoItem> items; + TQString name; + TQMap<TQString, KFileMetaInfoItem> items; const KFileMimeTypeInfo* mimeTypeInfo; - QStringList removedItems; + TQStringList removedItems; bool dirty :1; bool added :1; @@ -1174,7 +1174,7 @@ public: }; -KFileMetaInfoGroup::KFileMetaInfoGroup( const QString& name, +KFileMetaInfoGroup::KFileMetaInfoGroup( const TQString& name, const KFileMimeTypeInfo* info ) : d(new Data( name ) ) { @@ -1222,20 +1222,20 @@ bool KFileMetaInfoGroup::isEmpty() const return d->items.isEmpty(); } -QStringList KFileMetaInfoGroup::preferredKeys() const +TQStringList KFileMetaInfoGroup::preferredKeys() const { assert(isValid()); - QStringList list = keys(); - QStringList newlist; - QStringList preferredKeys = d->mimeTypeInfo->preferredKeys(); - QStringList::Iterator pref; - QStringList::Iterator begin = preferredKeys.begin(); - QStringList::Iterator end = preferredKeys.end(); + TQStringList list = keys(); + TQStringList newlist; + TQStringList preferredKeys = d->mimeTypeInfo->preferredKeys(); + TQStringList::Iterator pref; + TQStringList::Iterator begin = preferredKeys.begin(); + TQStringList::Iterator end = preferredKeys.end(); // move all keys from the preferred keys that are in our list to a new list for ( pref = begin; pref!=end; ++pref ) { - QStringList::Iterator item = list.find(*pref); + TQStringList::Iterator item = list.find(*pref); if ( item != list.end() ) { newlist.append( *item ); @@ -1250,16 +1250,16 @@ QStringList KFileMetaInfoGroup::preferredKeys() const return newlist; } -QStringList KFileMetaInfoGroup::keys() const +TQStringList KFileMetaInfoGroup::keys() const { if (d == Data::makeNull()) kdWarning(7033) << "attempt to get the keys of " "an invalid metainfo group"; - QStringList list; + TQStringList list; - // make a QStringList with all available keys - QMapConstIterator<QString, KFileMetaInfoItem> it; + // make a TQStringList with all available keys + TQMapConstIterator<TQString, KFileMetaInfoItem> it; for (it = d->items.begin(); it!=d->items.end(); ++it) { list.append(it.data().key()); @@ -1268,13 +1268,13 @@ QStringList KFileMetaInfoGroup::keys() const return list; } -QString KFileMetaInfoGroup::translatedName() const +TQString KFileMetaInfoGroup::translatedName() const { assert(isValid()); return d->mimeTypeInfo->groupInfo(d->name)->translatedName(); } -QStringList KFileMetaInfoGroup::supportedKeys() const +TQStringList KFileMetaInfoGroup::supportedKeys() const { assert(isValid()); return d->mimeTypeInfo->groupInfo(d->name)->supportedKeys(); @@ -1286,14 +1286,14 @@ bool KFileMetaInfoGroup::supportsVariableKeys() const return d->mimeTypeInfo->groupInfo(d->name)->supportsVariableKeys(); } -bool KFileMetaInfoGroup::contains( const QString& key ) const +bool KFileMetaInfoGroup::contains( const TQString& key ) const { return d->items.contains(key); } -KFileMetaInfoItem KFileMetaInfoGroup::item( const QString& key) const +KFileMetaInfoItem KFileMetaInfoGroup::item( const TQString& key) const { - QMapIterator<QString,KFileMetaInfoItem> it = d->items.find( key ); + TQMapIterator<TQString,KFileMetaInfoItem> it = d->items.find( key ); if ( it != d->items.end() ) return it.data(); @@ -1302,7 +1302,7 @@ KFileMetaInfoItem KFileMetaInfoGroup::item( const QString& key) const KFileMetaInfoItem KFileMetaInfoGroup::item(uint hint) const { - QMapIterator<QString, KFileMetaInfoItem> it; + TQMapIterator<TQString, KFileMetaInfoItem> it; for (it = d->items.begin(); it!=d->items.end(); ++it) if (it.data().hint() == hint) @@ -1311,7 +1311,7 @@ KFileMetaInfoItem KFileMetaInfoGroup::item(uint hint) const return KFileMetaInfoItem(); } -QString KFileMetaInfoGroup::name() const +TQString KFileMetaInfoGroup::name() const { return d->name; } @@ -1353,10 +1353,10 @@ void KFileMetaInfoGroup::deref() } -KFileMetaInfoItem KFileMetaInfoGroup::addItem( const QString& key ) +KFileMetaInfoItem KFileMetaInfoGroup::addItem( const TQString& key ) { assert(isValid()); - QMapIterator<QString,KFileMetaInfoItem> it = d->items.find( key ); + TQMapIterator<TQString,KFileMetaInfoItem> it = d->items.find( key ); if ( it != d->items.end() ) return it.data(); @@ -1377,9 +1377,9 @@ KFileMetaInfoItem KFileMetaInfoGroup::addItem( const QString& key ) KFileMetaInfoItem item; if (info->isVariableItem()) - item = KFileMetaInfoItem(ginfo->variableItemInfo(), key, QVariant()); + item = KFileMetaInfoItem(ginfo->variableItemInfo(), key, TQVariant()); else - item = KFileMetaInfoItem(info, key, QVariant()); + item = KFileMetaInfoItem(info, key, TQVariant()); d->items.insert(key, item); item.setAdded(); // mark as added @@ -1387,7 +1387,7 @@ KFileMetaInfoItem KFileMetaInfoGroup::addItem( const QString& key ) return item; } -bool KFileMetaInfoGroup::removeItem( const QString& key ) +bool KFileMetaInfoGroup::removeItem( const TQString& key ) { if (!isValid()) { @@ -1395,7 +1395,7 @@ bool KFileMetaInfoGroup::removeItem( const QString& key ) return false; } - QMapIterator<QString, KFileMetaInfoItem> it = d->items.find(key); + TQMapIterator<TQString, KFileMetaInfoItem> it = d->items.find(key); if ( it==d->items.end() ) { kdDebug(7033) << "trying to remove the non existant item " << key << "\n"; @@ -1415,13 +1415,13 @@ bool KFileMetaInfoGroup::removeItem( const QString& key ) return true; } -QStringList KFileMetaInfoGroup::removedItems() +TQStringList KFileMetaInfoGroup::removedItems() { return d->removedItems; } -KFileMetaInfoItem KFileMetaInfoGroup::appendItem(const QString& key, - const QVariant& value) +KFileMetaInfoItem KFileMetaInfoGroup::appendItem(const TQString& key, + const TQVariant& value) { //KDE4 enforce (value.type() == d->mimeTypeInfo->type()) assert(isValid()); @@ -1459,7 +1459,7 @@ KFileMetaInfoGroup::Data* KFileMetaInfoGroup::Data::makeNull() // We deliberately do not reset "null" after it has been destroyed! // Otherwise we will run into problems later in ~KFileMetaInfoItem // where the d-pointer is compared against null. - null = new Data(QString::null); + null = new Data(TQString::null); null->mimeTypeInfo = new KFileMimeTypeInfo(); sd_KFileMetaInfoGroupData.setObject( null ); } @@ -1470,7 +1470,7 @@ KFileMetaInfoGroup::Data* KFileMetaInfoGroup::Data::makeNull() /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// -KFileMimeTypeInfo::KFileMimeTypeInfo( const QString& mimeType ) +KFileMimeTypeInfo::KFileMimeTypeInfo( const TQString& mimeType ) : m_mimeType( mimeType ) { m_groups.setAutoDelete( true ); @@ -1480,48 +1480,48 @@ KFileMimeTypeInfo::~KFileMimeTypeInfo() { } -const KFileMimeTypeInfo::GroupInfo * KFileMimeTypeInfo::groupInfo( const QString& group ) const +const KFileMimeTypeInfo::GroupInfo * KFileMimeTypeInfo::groupInfo( const TQString& group ) const { return m_groups.find( group ); } KFileMimeTypeInfo::GroupInfo * KFileMimeTypeInfo::addGroupInfo( - const QString& name, const QString& translatedName ) + const TQString& name, const TQString& translatedName ) { GroupInfo* group = new GroupInfo( name, translatedName ); m_groups.insert(name, group); return group; } -QStringList KFileMimeTypeInfo::supportedGroups() const +TQStringList KFileMimeTypeInfo::supportedGroups() const { - QStringList list; - QDictIterator<GroupInfo> it( m_groups ); + TQStringList list; + TQDictIterator<GroupInfo> it( m_groups ); for ( ; it.current(); ++it ) list.append( it.current()->name() ); return list; } -QStringList KFileMimeTypeInfo::translatedGroups() const +TQStringList KFileMimeTypeInfo::translatedGroups() const { - QStringList list; - QDictIterator<GroupInfo> it( m_groups ); + TQStringList list; + TQDictIterator<GroupInfo> it( m_groups ); for ( ; it.current(); ++it ) list.append( it.current()->translatedName() ); return list; } -QStringList KFileMimeTypeInfo::supportedKeys() const +TQStringList KFileMimeTypeInfo::supportedKeys() const { // not really efficient, but not those are not large lists, probably. // maybe cache the result? - QStringList keys; - QStringList::ConstIterator lit; - QDictIterator<GroupInfo> it( m_groups ); + TQStringList keys; + TQStringList::ConstIterator lit; + TQDictIterator<GroupInfo> it( m_groups ); for ( ; it.current(); ++it ) { // need to nuke dupes - QStringList list = it.current()->supportedKeys(); + TQStringList list = it.current()->supportedKeys(); for ( lit = list.begin(); lit != list.end(); ++lit ) { if ( keys.find( *lit ) == keys.end() ) keys.append( *lit ); @@ -1531,9 +1531,9 @@ QStringList KFileMimeTypeInfo::supportedKeys() const return keys; } -QValidator * KFileMimeTypeInfo::createValidator(const QString& group, - const QString& key, - QObject *parent, +TQValidator * KFileMimeTypeInfo::createValidator(const TQString& group, + const TQString& key, + TQObject *parent, const char *name) const { KFilePlugin* plugin = KFileMetaInfoProvider::self()->plugin(m_mimeType); @@ -1546,8 +1546,8 @@ QValidator * KFileMimeTypeInfo::createValidator(const QString& group, /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// -KFileMimeTypeInfo::GroupInfo::GroupInfo( const QString& name, - const QString& translatedName ) +KFileMimeTypeInfo::GroupInfo::GroupInfo( const TQString& name, + const TQString& translatedName ) : m_name( name ), m_translatedName( translatedName ), m_attr( 0 ), @@ -1562,7 +1562,7 @@ KFileMimeTypeInfo::GroupInfo::~GroupInfo() delete m_variableItemInfo; } -const KFileMimeTypeInfo::ItemInfo * KFileMimeTypeInfo::GroupInfo::itemInfo( const QString& key ) const +const KFileMimeTypeInfo::ItemInfo * KFileMimeTypeInfo::GroupInfo::itemInfo( const TQString& key ) const { ItemInfo* item = m_itemDict.find( key ); @@ -1576,10 +1576,10 @@ const KFileMimeTypeInfo::ItemInfo * KFileMimeTypeInfo::GroupInfo::itemInfo( cons } KFileMimeTypeInfo::ItemInfo* KFileMimeTypeInfo::GroupInfo::addItemInfo( - const QString& key, const QString& translatedKey, - QVariant::Type type) + const TQString& key, const TQString& translatedKey, + TQVariant::Type type) { -// kdDebug(7034) << key << "(" << translatedKey << ") -> " << QVariant::typeToName(type) << endl; +// kdDebug(7034) << key << "(" << translatedKey << ") -> " << TQVariant::typeToName(type) << endl; ItemInfo* item = new ItemInfo(key, translatedKey, type); m_supportedKeys.append(key); @@ -1588,39 +1588,39 @@ KFileMimeTypeInfo::ItemInfo* KFileMimeTypeInfo::GroupInfo::addItemInfo( } -void KFileMimeTypeInfo::GroupInfo::addVariableInfo( QVariant::Type type, +void KFileMimeTypeInfo::GroupInfo::addVariableInfo( TQVariant::Type type, uint attr ) { // just make sure that it's not already there delete m_variableItemInfo; - m_variableItemInfo = new ItemInfo(QString::null, QString::null, type); + m_variableItemInfo = new ItemInfo(TQString::null, TQString::null, type); m_variableItemInfo->m_attr = attr; } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// -QString KFileMimeTypeInfo::ItemInfo::string(const QVariant& value, bool mangle) const +TQString KFileMimeTypeInfo::ItemInfo::string(const TQVariant& value, bool mangle) const { - QString s; + TQString s; switch (value.type()) { - case QVariant::Invalid : + case TQVariant::Invalid : return "---"; - case QVariant::Bool : + case TQVariant::Bool : s = value.toBool() ? i18n("Yes") : i18n("No"); break; - case QVariant::Int : + case TQVariant::Int : if (unit() == KFileMimeTypeInfo::Seconds) { int seconds = value.toInt() % 60; int minutes = value.toInt() / 60 % 60; int hours = value.toInt() / 3600; - s = hours ? QString().sprintf("%d:%02d:%02d",hours, minutes, seconds) - : QString().sprintf("%02d:%02d", minutes, seconds); + s = hours ? TQString().sprintf("%d:%02d:%02d",hours, minutes, seconds) + : TQString().sprintf("%02d:%02d", minutes, seconds); return s; // no suffix wanted } else if (unit() == KFileMimeTypeInfo::Bytes) @@ -1637,11 +1637,11 @@ QString KFileMimeTypeInfo::ItemInfo::string(const QVariant& value, bool mangle) s = KGlobal::locale()->formatNumber( value.toInt() , 0); break; - case QVariant::LongLong : + case TQVariant::LongLong : s = KGlobal::locale()->formatNumber( value.toLongLong(), 0 ); break; - case QVariant::ULongLong : + case TQVariant::ULongLong : if ( unit() == KFileMimeTypeInfo::Bytes ) return KIO::convertSize( value.toULongLong() ); else if ( unit() == KFileMimeTypeInfo::KiloBytes ) @@ -1650,34 +1650,34 @@ QString KFileMimeTypeInfo::ItemInfo::string(const QVariant& value, bool mangle) s = KGlobal::locale()->formatNumber( value.toULongLong(), 0 ); break; - case QVariant::UInt : + case TQVariant::UInt : s = KGlobal::locale()->formatNumber( value.toUInt() , 0); break; - case QVariant::Double : + case TQVariant::Double : s = KGlobal::locale()->formatNumber( value.toDouble(), 3); break; - case QVariant::Date : + case TQVariant::Date : s = KGlobal::locale()->formatDate( value.toDate(), true ); break; - case QVariant::Time : + case TQVariant::Time : s = KGlobal::locale()->formatTime( value.toTime(), true ); break; - case QVariant::DateTime : + case TQVariant::DateTime : s = KGlobal::locale()->formatDateTime( value.toDateTime(), true, true ); break; - case QVariant::Size : - s = QString("%1 x %2").arg(value.toSize().width()) + case TQVariant::Size : + s = TQString("%1 x %2").arg(value.toSize().width()) .arg(value.toSize().height()); break; - case QVariant::Point : - s = QString("%1/%2").arg(value.toSize().width()) + case TQVariant::Point : + s = TQString("%1/%2").arg(value.toSize().width()) .arg(value.toSize().height()); break; @@ -1705,7 +1705,7 @@ QString KFileMimeTypeInfo::ItemInfo::string(const QVariant& value, bool mangle) first a bool that says if the items is valid, and if yes, all the elements of the Data */ -KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfoItem& item ) +KIO_EXPORT TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfoItem& item ) { KFileMetaInfoItem::Data* d = item.d; @@ -1725,7 +1725,7 @@ KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfoItem& ite } -KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoItem& item ) +KIO_EXPORT TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoItem& item ) { bool isValid; s >> isValid; @@ -1758,7 +1758,7 @@ KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoItem& item ) // serialization of a KFileMetaInfoGroup // we serialize the name of the mimetype here instead of the mimetype info // on the other side, we can simply use this to ask the provider for the info -KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfoGroup& group ) +KIO_EXPORT TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfoGroup& group ) { KFileMetaInfoGroup::Data* d = group.d; @@ -1775,9 +1775,9 @@ KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfoGroup& gr return s; } -KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoGroup& group ) +KIO_EXPORT TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoGroup& group ) { - QString mimeType; + TQString mimeType; bool isValid; s >> isValid; @@ -1799,7 +1799,7 @@ KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoGroup& group ) group.d->mimeTypeInfo = KFileMetaInfoProvider::self()->mimeTypeInfo(mimeType); // we need to set the item info for the items here - QMapIterator<QString, KFileMetaInfoItem> it = group.d->items.begin(); + TQMapIterator<TQString, KFileMetaInfoItem> it = group.d->items.begin(); for ( ; it != group.d->items.end(); ++it) { (*it).d->mimeTypeInfo = group.d->mimeTypeInfo->groupInfo(group.d->name) @@ -1812,7 +1812,7 @@ KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoGroup& group ) // serialization of a KFileMetaInfo object // we serialize the name of the mimetype here instead of the mimetype info // on the other side, we can simply use this to ask the provider for the info -KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfo& info ) +KIO_EXPORT TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfo& info ) { KFileMetaInfo::Data* d = info.d; @@ -1830,9 +1830,9 @@ KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfo& info ) return s; } -KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfo& info ) +KIO_EXPORT TQDataStream& operator >>(TQDataStream& s, KFileMetaInfo& info ) { - QString mimeType; + TQString mimeType; bool isValid; s >> isValid; diff --git a/kio/kio/kfilemetainfo.h b/kio/kio/kfilemetainfo.h index 911ada26f..0bc97df70 100644 --- a/kio/kio/kfilemetainfo.h +++ b/kio/kio/kfilemetainfo.h @@ -24,10 +24,10 @@ m_unit is a define in <sys/sysmacros.h> */ #define m_unit outouftheway_m_unit -#include <qdict.h> -#include <qvariant.h> -#include <qobject.h> -#include <qstring.h> +#include <tqdict.h> +#include <tqvariant.h> +#include <tqobject.h> +#include <tqstring.h> #include <kurl.h> #undef m_unit @@ -151,7 +151,7 @@ public: * * @return the list of keys supported for this mimetype **/ - QStringList supportedKeys() const + TQStringList supportedKeys() const { return m_supportedKeys; } @@ -162,7 +162,7 @@ public: * * @return the group name */ - const QString& name() const + const TQString& name() const { return m_name; } @@ -174,7 +174,7 @@ public: * * @return the translated group name */ - const QString& translatedName() const + const TQString& translatedName() const { return m_translatedName; } @@ -186,7 +186,7 @@ public: * * @return a pointer to the item info. Don't delete this object! */ - const ItemInfo * itemInfo( const QString& key ) const; + const ItemInfo * itemInfo( const TQString& key ) const; /** * Get the attributes of this group (see Attributes) @@ -223,22 +223,22 @@ public: ~GroupInfo(); private: /** @internal */ - GroupInfo( const QString& name, const QString& translatedName); + GroupInfo( const TQString& name, const TQString& translatedName); /** @internal */ - KFileMimeTypeInfo::ItemInfo* addItemInfo( const QString& key, - const QString& translatedKey, - QVariant::Type type); + KFileMimeTypeInfo::ItemInfo* addItemInfo( const TQString& key, + const TQString& translatedKey, + TQVariant::Type type); /** @internal */ - void addVariableInfo( QVariant::Type type, uint attr ); + void addVariableInfo( TQVariant::Type type, uint attr ); - QString m_name; - QString m_translatedName; - QStringList m_supportedKeys; + TQString m_name; + TQString m_translatedName; + TQStringList m_supportedKeys; uint m_attr; ItemInfo* m_variableItemInfo; - QDict<ItemInfo> m_itemDict; + TQDict<ItemInfo> m_itemDict; }; @@ -262,7 +262,7 @@ public: * * @return the prefix */ - const QString& prefix() const + const TQString& prefix() const { return m_prefix; } @@ -273,18 +273,18 @@ public: * * @return the prefix */ - const QString& suffix() const + const TQString& suffix() const { return m_suffix; } /** - * The items for a file are stored as a QVariant and this method + * The items for a file are stored as a TQVariant and this method * can be used to get the data type of this item. * - * @return the QVariant type + * @return the TQVariant type */ - QVariant::Type type() const + TQVariant::Type type() const { return m_type; } @@ -293,23 +293,23 @@ public: * Returns the name of the item. * @return the name of the item */ - const QString& key() const + const TQString& key() const { return m_key; } /** * Returns a string for the specified @p value, if possible. If not, - * QString::null is returned. This can be used by programs if they want + * TQString::null is returned. This can be used by programs if they want * to display a sum or an average of some item for a list of files. * * @param value the value to convert * @param mangle if true, the string will already contain prefix and * suffix - * @return the converted string, or QString::null if not possible + * @return the converted string, or TQString::null if not possible * @since 3.1 */ - QString string( const QVariant& value, bool mangle = true ) const; + TQString string( const TQVariant& value, bool mangle = true ) const; /** * Is this item the variable item? @@ -328,7 +328,7 @@ public: * language. * @return the translated key */ - const QString& translatedKey() const + const TQString& translatedKey() const { return m_translatedKey; } @@ -365,22 +365,22 @@ public: private: /** @internal */ - ItemInfo(const QString& key, const QString& translatedKey, - QVariant::Type type) + ItemInfo(const TQString& key, const TQString& translatedKey, + TQVariant::Type type) : m_key(key), m_translatedKey(translatedKey), m_type(type), m_attr(0), m_unit(NoUnit), m_hint(NoHint), - m_prefix(QString::null), m_suffix(QString::null) + m_prefix(TQString::null), m_suffix(TQString::null) {} - QString m_key; - QString m_translatedKey; - QVariant::Type m_type; + TQString m_key; + TQString m_translatedKey; + TQVariant::Type m_type; uint m_attr; uint m_unit; uint m_hint; - QString m_prefix; - QString m_suffix; + TQString m_prefix; + TQString m_suffix; }; // ### could it be made private? Would this be BC? @@ -392,13 +392,13 @@ public: * * @param group the group of the item * @param key the key of the item - * @param parent the parent of the QObject, or 0 for a parent-less object - * @param name the name of the QObject, can be 0 + * @param parent the parent of the TQObject, or 0 for a parent-less object + * @param name the name of the TQObject, can be 0 * @return the validator. You are responsible for deleting it. 0 if * creation failed */ - QValidator * createValidator(const QString& group, const QString& key, - QObject *parent = 0, const char *name = 0) const; + TQValidator * createValidator(const TQString& group, const TQString& key, + TQObject *parent = 0, const char *name = 0) const; /** * Returns the list of all groups that the plugin for this mimetype @@ -406,7 +406,7 @@ public: * * @return the list of groups */ - QStringList supportedGroups() const; + TQStringList supportedGroups() const; /** * Same as the above function, but returns the strings to display to the @@ -414,7 +414,7 @@ public: * * @return the list of groups */ - QStringList translatedGroups() const; + TQStringList translatedGroups() const; /** * This returns the list of groups in the preferred order that's specified @@ -422,7 +422,7 @@ public: * * @return the list of groups */ - QStringList preferredGroups() const + TQStringList preferredGroups() const { return m_preferredGroups; } @@ -432,7 +432,7 @@ public: * * @return the mimetype of this info */ - QString mimeType() const {return m_mimeType;} + TQString mimeType() const {return m_mimeType;} /** * Get the group info for a specific group. @@ -441,7 +441,7 @@ public: * @return a pointer to the info. 0 if it does not * exist. Don't delete this object! */ - const GroupInfo * groupInfo( const QString& group ) const; + const GroupInfo * groupInfo( const TQString& group ) const; // always returning stringlists which the user has to iterate and use them // to look up the real items sounds strange to me. I think we should add @@ -453,37 +453,37 @@ public: * * @return the list of keys */ - QStringList supportedKeys() const; + TQStringList supportedKeys() const; /** * Return a list of all supported keys in preference order * * @return the list of keys */ - QStringList preferredKeys() const + TQStringList preferredKeys() const { return m_preferredKeys; } // ### shouldn't this be private? BC? - GroupInfo * addGroupInfo( const QString& name, - const QString& translatedName); + GroupInfo * addGroupInfo( const TQString& name, + const TQString& translatedName); - QString m_translatedName; - QStringList m_supportedKeys; + TQString m_translatedName; + TQStringList m_supportedKeys; uint m_attr; // bool m_supportsVariableKeys : 1; - QDict<ItemInfo> m_itemDict; + TQDict<ItemInfo> m_itemDict; // ### this should be made private instead, but this would be BIC protected: /** @internal */ - KFileMimeTypeInfo( const QString& mimeType ); + KFileMimeTypeInfo( const TQString& mimeType ); - QDict<GroupInfo> m_groups; - QString m_mimeType; - QStringList m_preferredKeys; // same as KFileMetaInfoProvider::preferredKeys() - QStringList m_preferredGroups; // same as KFileMetaInfoProvider::preferredKeys() + TQDict<GroupInfo> m_groups; + TQString m_mimeType; + TQStringList m_preferredKeys; // same as KFileMetaInfoProvider::preferredKeys() + TQStringList m_preferredGroups; // same as KFileMetaInfoProvider::preferredKeys() }; @@ -508,7 +508,7 @@ public: **/ // ### hmm, then it should be private KFileMetaInfoItem( const KFileMimeTypeInfo::ItemInfo* mti, - const QString& key, const QVariant& value); + const TQString& key, const TQVariant& value); /** * Copy constructor @@ -538,7 +538,7 @@ public: * * @return the key of this item */ - QString key() const; + TQString key() const; /** * Returns a translation of the key for displaying to the user. If the @@ -546,24 +546,24 @@ public: * * @return the translated key */ - QString translatedKey() const; + TQString translatedKey() const; /** * Returns the value of the item. * * @return the value of the item. */ - const QVariant& value() const; + const TQVariant& value() const; /** * Returns a string containing the value, if possible. If not, - * QString::null is returned. + * TQString::null is returned. * * @param mangle if true, the string will already contain prefix and * suffix - * @return the value string, or QString::null if not possible + * @return the value string, or TQString::null if not possible */ - QString string( bool mangle = true ) const; + TQString string( bool mangle = true ) const; /** * Changes the value of the item. @@ -571,14 +571,14 @@ public: * @param value the new value * @return true if successful, false otherwise */ - bool setValue( const QVariant& value ); + bool setValue( const TQVariant& value ); /** * Return the type of the item. * * @return the type of the item */ - QVariant::Type type() const; + TQVariant::Type type() const; /** * You can query if the application can edit the item and write it back to @@ -617,7 +617,7 @@ public: * * @return the prefix */ - QString prefix() const; + TQString prefix() const; /** * This method returns a translated suffix to be displayed after the @@ -625,7 +625,7 @@ public: * * @return the suffix */ - QString suffix() const; + TQString suffix() const; /** * Returns the hint for this item. See KFileMimeTypeInfo::Hint. @@ -660,9 +660,9 @@ public: */ bool isValid() const; - KIO_EXPORT friend QDataStream& operator >>(QDataStream& s, KFileMetaInfoItem& ); - KIO_EXPORT friend QDataStream& operator >>(QDataStream& s, KFileMetaInfoGroup& ); - KIO_EXPORT friend QDataStream& operator <<(QDataStream& s, const KFileMetaInfoItem& ); + KIO_EXPORT friend TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoItem& ); + KIO_EXPORT friend TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoGroup& ); + KIO_EXPORT friend TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfoItem& ); friend class KFileMetaInfoGroup; protected: @@ -685,8 +685,8 @@ class KIO_EXPORT KFileMetaInfoGroup { friend class KFilePlugin; friend class KFileMetaInfo; - KIO_EXPORT friend QDataStream& operator >>(QDataStream& s, KFileMetaInfoGroup& ); - KIO_EXPORT friend QDataStream& operator <<(QDataStream& s, const KFileMetaInfoGroup& ); + KIO_EXPORT friend TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoGroup& ); + KIO_EXPORT friend TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfoGroup& ); public: class Data; @@ -696,7 +696,7 @@ public: * KFileMetaInfo do it for you. **/ // ### hmm, then it should be private - KFileMetaInfoGroup( const QString& name, const KFileMimeTypeInfo* info ); + KFileMetaInfoGroup( const TQString& name, const KFileMimeTypeInfo* info ); /** * Copy constructor @@ -755,7 +755,7 @@ public: * Operator for convenience. It does the same as item(), * but you cannot specify a group to search in */ - KFileMetaInfoItem operator[]( const QString& key ) const + KFileMetaInfoItem operator[]( const TQString& key ) const { return item( key ); } /** @@ -764,7 +764,7 @@ public: * @param key the key of the item to search * @return the specified item if found, an invalid item, if not **/ - KFileMetaInfoItem item( const QString& key ) const; + KFileMetaInfoItem item( const TQString& key ) const; /** * Returns the item with the given @p hint. @@ -781,7 +781,7 @@ public: * @param key the key of the item to search * @return the value with the given key */ - const QVariant value( const QString& key ) const + const TQVariant value( const TQString& key ) const { const KFileMetaInfoItem &i = item( key ); return i.value(); @@ -797,7 +797,7 @@ public: * * @return the list of keys supported for this mimetype **/ - QStringList supportedKeys() const; + TQStringList supportedKeys() const; /** * Returns true if this group supports adding or removing arbitrary @@ -812,21 +812,21 @@ public: * * @return true if an item for this @p key exists. */ - bool contains( const QString& key ) const; + bool contains( const TQString& key ) const; /** * Returns a list of all keys. * * @return a list of all keys in the order they were inserted. **/ - QStringList keys() const; + TQStringList keys() const; /** * Returns a list of all keys in preference order. * * @return a list of all keys in preference order. **/ - QStringList preferredKeys() const; + TQStringList preferredKeys() const; /** * @return the list of possible types that the value for the specified key @@ -837,7 +837,7 @@ public: // ### do we really want to support that? // let's not waste time on thinking about it. Let's just kick it for now // and add it in 4.0 if needed ;) -// const QMemArray<QVariant::Type>& types( const QString& key ) const; +// const TQMemArray<TQVariant::Type>& types( const TQString& key ) const; /** * Add an item to the info. This is only possible if the specified @p key @@ -847,7 +847,7 @@ public: * @param key the key of the item * @return the KFileMetaInfoItem for the given @p key **/ - KFileMetaInfoItem addItem( const QString& key ); + KFileMetaInfoItem addItem( const TQString& key ); /** * Remove this item from the meta info of the file. You cannot query @@ -858,21 +858,21 @@ public: * @param key the key of the removed item * @return true if successful, false otherwise */ - bool removeItem(const QString& key); + bool removeItem(const TQString& key); /** * Returns a list of all removed items. * * @return a list of all removed items */ - QStringList removedItems(); + TQStringList removedItems(); /** * The name of this group. * * @return the name of this group */ - QString name() const; + TQString name() const; /** * The translated name of this group. @@ -881,7 +881,7 @@ public: * * @since 3.2 */ - QString translatedName() const; + TQString translatedName() const; /** * Returns the attributes of this item. @@ -892,7 +892,7 @@ public: protected: void setAdded(); - KFileMetaInfoItem appendItem( const QString& key, const QVariant& value); + KFileMetaInfoItem appendItem( const TQString& key, const TQVariant& value); Data* d; void ref(); @@ -976,8 +976,8 @@ public: * @note This version will @b only work for @b local (file:/) files. * **/ - KFileMetaInfo( const QString& path, - const QString& mimeType = QString::null, + KFileMetaInfo( const TQString& path, + const TQString& mimeType = TQString::null, uint what = Fastest); /** @@ -988,7 +988,7 @@ public: * **/ KFileMetaInfo( const KURL& url, - const QString& mimeType = QString::null, + const TQString& mimeType = TQString::null, uint what = Fastest); /** @@ -1025,42 +1025,42 @@ public: * * @return the keys of the groups that the file has. */ - QStringList groups() const; + TQStringList groups() const; /** * Returns a list of all supported groups. * * @return the supported keys of the groups that the file has. */ - QStringList supportedGroups() const; + TQStringList supportedGroups() const; /** * Returns a list of the preferred groups. * * @return the keys of the preferred groups that the file has. */ - QStringList preferredGroups() const; + TQStringList preferredGroups() const; /** * Returns a list of all preferred keys. * * @return a list of all preferred keys. */ - QStringList preferredKeys() const; + TQStringList preferredKeys() const; /** * Returns a list of supported keys. * * @return a list of supported keys */ - QStringList supportedKeys() const; + TQStringList supportedKeys() const; /** * Returns the list of groups that you can add or remove from the file. * * @return the groups can be added or removed */ - QStringList editableGroups() const; + TQStringList editableGroups() const; // I'd like to keep those for lookup without group, at least the hint // version @@ -1070,7 +1070,7 @@ public: * @param key the key of the item * @return the item. Invalid if there is no item with the given @p key. */ - KFileMetaInfoItem item(const QString& key) const; + KFileMetaInfoItem item(const TQString& key) const; /** * Returns the KFileMetaInfoItem with the given @p hint. * @@ -1083,12 +1083,12 @@ public: * Saves the item with the given @p key. * * @param key the key of the item - * @param preferredGroup the preferred group, or QString::null + * @param preferredGroup the preferred group, or TQString::null * @param createGroup true to create the group if necessary * @return the saved item */ - KFileMetaInfoItem saveItem( const QString& key, - const QString& preferredGroup = QString::null, + KFileMetaInfoItem saveItem( const TQString& key, + const TQString& preferredGroup = TQString::null, bool createGroup = true ); /** @@ -1097,7 +1097,7 @@ public: * @param key the key of the item * @return the group. Invalid if there is no group with the given @p key. */ - KFileMetaInfoGroup group(const QString& key) const; + KFileMetaInfoGroup group(const TQString& key) const; /** * Returns the KFileMetaInfoGroup with the given @p key. @@ -1105,7 +1105,7 @@ public: * @param key the key of the item * @return the group. Invalid if there is no group with the given @p key. */ - KFileMetaInfoGroup operator[] (const QString& key) const + KFileMetaInfoGroup operator[] (const TQString& key) const { return group(key); } @@ -1120,7 +1120,7 @@ public: * @param name the name of the group to add * @return true if successful, false if not */ - bool addGroup( const QString& name ); + bool addGroup( const TQString& name ); /** * Remove the specified group. This will only succeed if it is @@ -1131,14 +1131,14 @@ public: * @param name the name of the group to remove * @return true if successful, false if not */ - bool removeGroup( const QString& name ); + bool removeGroup( const TQString& name ); /** * Returns a list of removed groups. * * @return a list of removed groups. */ - QStringList removedGroups(); + TQStringList removedGroups(); /** * This method writes all pending changes of the meta info back to the file. @@ -1156,7 +1156,7 @@ public: * * @return true if successful, false if not */ - bool applyChanges(const QString& path); + bool applyChanges(const TQString& path); /** * Checks whether an item with the given @p key exists. @@ -1164,7 +1164,7 @@ public: * @param key the key to check * @return whether an item for this @p key exists. */ - bool contains( const QString& key ) const; + bool contains( const TQString& key ) const; /** * Checks whether a group with the given @p key exists. @@ -1172,7 +1172,7 @@ public: * @param key the key to check * @return whether a group with this name exists. */ - bool containsGroup( const QString& key ) const; + bool containsGroup( const TQString& key ) const; /** * Returns the value with the given @p key. @@ -1180,7 +1180,7 @@ public: * @param key the key to retrieve * @return the value. Invalid if it does not exist */ - const QVariant value( const QString& key ) const + const TQVariant value( const TQString& key ) const { return item(key).value(); } @@ -1207,14 +1207,14 @@ public: * * @return the file's mime type */ - QString mimeType() const; + TQString mimeType() const; /** - * Returns the path of file - or QString::null if file is non-local + * Returns the path of file - or TQString::null if file is non-local * - * @return the file's path - or QString::null if file is non-local + * @return the file's path - or TQString::null if file is non-local */ - QString path() const; + TQString path() const; /** * Returns the url of file @@ -1223,12 +1223,12 @@ public: */ KURL url() const; - KIO_EXPORT friend QDataStream& operator >>(QDataStream& s, KFileMetaInfo& ); - KIO_EXPORT friend QDataStream& operator <<(QDataStream& s, const KFileMetaInfo& ); + KIO_EXPORT friend TQDataStream& operator >>(TQDataStream& s, KFileMetaInfo& ); + KIO_EXPORT friend TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfo& ); friend class KFilePlugin; protected: - KFileMetaInfoGroup appendGroup(const QString& name); + KFileMetaInfoGroup appendGroup(const TQString& name); /** * @return a pointer to the plugin that belogs to this object's mimetype. @@ -1243,10 +1243,10 @@ protected: private: KFileMetaInfoItem findEditableItem( KFileMetaInfoGroup& group, - const QString& key ); + const TQString& key ); void init( const KURL& url, - const QString& mimeType = QString::null, + const TQString& mimeType = TQString::null, uint what = Fastest); }; @@ -1276,8 +1276,8 @@ private: * * Example: * @code - * FooPlugin::FooPlugin(QObject *parent, const char *name, - * const QStringList &args) + * FooPlugin::FooPlugin(TQObject *parent, const char *name, + * const TQStringList &args) * : KFilePlugin(parent, name, args) * { * KFileMimeTypeInfo* info = addMimeTypeInfo( "application/x-foo" ); @@ -1289,12 +1289,12 @@ private: * KFileMimeTypeInfo::ItemInfo* item; * * // our new items in the group - * item = addItemInfo(group, "Items", i18n("Items"), QVariant::Int); - * item = addItemInfo(group, "Size", i18n("Size"), QVariant::Int); + * item = addItemInfo(group, "Items", i18n("Items"), TQVariant::Int); + * item = addItemInfo(group, "Size", i18n("Size"), TQVariant::Int); * setUnit(item, KFileMimeTypeInfo::KiloBytes); * * // strings are possible, too: - * //addItemInfo(group, "Document Type", i18n("Document type"), QVariant::String); + * //addItemInfo(group, "Document Type", i18n("Document type"), TQVariant::String); * } * @endcode * @@ -1311,7 +1311,7 @@ private: * achieve this task. This might be the best way for binary files, since a * change in the file format is likely to be supported by subsequent releases * of that library. Alternatively, for text-based file formats, you can use - * QTextStream to parse the file. For simple file formats, QRegExp can be of + * TQTextStream to parse the file. For simple file formats, TQRegExp can be of * great help, too. * * After you extracted the relevant information, use appendGroup() and @@ -1343,8 +1343,8 @@ private: * * If you want to define mutable meta information items, you need to overwrite * the writeInfo() method. In this method, you can use third-party library - * (appropriate mostly for binary files, see above) or QTextStream to write the - * information back to the file. If you use QTextStream, be sure to write all + * (appropriate mostly for binary files, see above) or TQTextStream to write the + * information back to the file. If you use TQTextStream, be sure to write all * file contents back. * * For some items, it might be that not all possible values are allowed. You @@ -1400,17 +1400,17 @@ public: * Creates a new KFilePlugin instance. You need to implement a constructor * with the same argument list as this is required by KGenericFactory * - * @param parent the parent of the QObject, can be @c 0 - * @param name the name of the QObject, can be @c 0 + * @param parent the parent of the TQObject, can be @c 0 + * @param name the name of the TQObject, can be @c 0 * @param args currently ignored * * @see addMimeTypeInfo() * @see addGroupInfo() * @see addItemInfo() - * @see QObject() + * @see TQObject() **/ - KFilePlugin( QObject *parent, const char *name, - const QStringList& args ); + KFilePlugin( TQObject *parent, const char *name, + const TQStringList& args ); /** * Destructor @@ -1456,13 +1456,13 @@ public: * @param mimeType the mime type * @param group the group name of the validator item * @param key the key name of the validator item - * @param parent the QObject parent, can be @c 0 - * @param name the name of the QObject, can be @c 0 + * @param parent the TQObject parent, can be @c 0 + * @param name the name of the TQObject, can be @c 0 **/ - virtual QValidator* createValidator( const QString& mimeType, - const QString& group, - const QString& key, - QObject* parent, + virtual TQValidator* createValidator( const TQString& mimeType, + const TQString& group, + const TQString& key, + TQObject* parent, const char* name) const { Q_UNUSED(mimeType); Q_UNUSED(group);Q_UNUSED(key); @@ -1479,7 +1479,7 @@ protected: * @param mimeType a string containing the mimetype, e.g. @c "text/html" * @return a KFileMimeTypeInfo object, to be used with addGroupInfo() **/ - KFileMimeTypeInfo * addMimeTypeInfo( const QString& mimeType ); + KFileMimeTypeInfo * addMimeTypeInfo( const TQString& mimeType ); // ### do we need this, if it only calls the provider? // IMHO the Plugin shouldn't call its provider. // DF: yes we need this. A plugin can create more than one mimetypeinfo. @@ -1504,7 +1504,7 @@ protected: * @see addItemInfo() **/ KFileMimeTypeInfo::GroupInfo* addGroupInfo(KFileMimeTypeInfo* info, - const QString& key, const QString& translatedKey) const; + const TQString& key, const TQString& translatedKey) const; /** * Sets attributes of the GroupInfo object returned by addGroupInfo(). @@ -1515,7 +1515,7 @@ protected: **/ void setAttributes(KFileMimeTypeInfo::GroupInfo* gi, uint attr) const; - void addVariableInfo(KFileMimeTypeInfo::GroupInfo* gi, QVariant::Type type, + void addVariableInfo(KFileMimeTypeInfo::GroupInfo* gi, TQVariant::Type type, uint attr) const; /** @@ -1528,14 +1528,14 @@ protected: * parameter * @param translatedKey the translated version of the key string for * displaying in user interfaces. Use i18n() to translate the string - * @param type the type of the meta information item, e.g. QVariant::Int - * or QVariant::String. + * @param type the type of the meta information item, e.g. TQVariant::Int + * or TQVariant::String. * @return an ItemInfo object. Pass this object to setAttributes() **/ KFileMimeTypeInfo::ItemInfo* addItemInfo(KFileMimeTypeInfo::GroupInfo* gi, - const QString& key, - const QString& translatedKey, - QVariant::Type type); + const TQString& key, + const TQString& translatedKey, + TQVariant::Type type); /** * Sets some attributes for a meta information item. The attributes @@ -1579,7 +1579,7 @@ protected: * @param item the ItemInfo object as returned by addItemInfo() * @param prefix the prefix string to display **/ - void setPrefix(KFileMimeTypeInfo::ItemInfo* item, const QString& prefix); + void setPrefix(KFileMimeTypeInfo::ItemInfo* item, const TQString& prefix); /** * Sets a suffix string which is displayed before the item's value. Use @@ -1589,7 +1589,7 @@ protected: * @param item the ItemInfo object as returned by addItemInfo() * @param suffix the suffix string to display **/ - void setSuffix(KFileMimeTypeInfo::ItemInfo* item, const QString& suffix); + void setSuffix(KFileMimeTypeInfo::ItemInfo* item, const TQString& suffix); /** * Call this method from within readInfo() to indicate that you wish to @@ -1602,7 +1602,7 @@ protected: * defined in your class' constructor * @return a KFileMetaInfoGroup object, to be used in appendItem() **/ - KFileMetaInfoGroup appendGroup(KFileMetaInfo& info, const QString& key); + KFileMetaInfoGroup appendGroup(KFileMetaInfo& info, const TQString& key); /** * Call this method from within readInfo() to fill the meta information item @@ -1612,10 +1612,10 @@ protected: * @param key the key string to identify the item. * @param value the value of the meta information item **/ - void appendItem(KFileMetaInfoGroup& group, const QString& key, QVariant value); + void appendItem(KFileMetaInfoGroup& group, const TQString& key, TQVariant value); - QStringList m_preferredKeys; - QStringList m_preferredGroups; + TQStringList m_preferredKeys; + TQStringList m_preferredGroups; protected: /** @@ -1657,23 +1657,23 @@ public: * @return a pointer to the plugin that belongs to the specified mimetype, * which means also load the plugin if it's not in memory */ - KFilePlugin * plugin( const QString& mimeType ); // KDE4: merge with method below + KFilePlugin * plugin( const TQString& mimeType ); // KDE4: merge with method below /** * @return a pointer to the plugin that belongs to the specified mimetype, * for the given protocol. * This loads the plugin if it's not in memory yet. */ - KFilePlugin * plugin( const QString& mimeType, const QString& protocol ); + KFilePlugin * plugin( const TQString& mimeType, const TQString& protocol ); - const KFileMimeTypeInfo * mimeTypeInfo( const QString& mimeType ); // KDE4: merge with below - const KFileMimeTypeInfo * mimeTypeInfo( const QString& mimeType, const QString& protocol ); + const KFileMimeTypeInfo * mimeTypeInfo( const TQString& mimeType ); // KDE4: merge with below + const KFileMimeTypeInfo * mimeTypeInfo( const TQString& mimeType, const TQString& protocol ); - QStringList preferredKeys( const QString& mimeType ) const; - QStringList preferredGroups( const QString& mimeType ) const; + TQStringList preferredKeys( const TQString& mimeType ) const; + TQStringList preferredGroups( const TQString& mimeType ) const; /// @since 3.1 - QStringList supportedMimeTypes() const; + TQStringList supportedMimeTypes() const; protected: // ## should be private, right? KFileMetaInfoProvider(); @@ -1705,34 +1705,34 @@ private: // The key is either a mimetype or a protocol. Those things don't look the same // so there's no need for two QDicts. - QDict<CachedPluginInfo> m_plugins; + TQDict<CachedPluginInfo> m_plugins; // This data is aggregated during the creation of a plugin, // before being moved to the appropriate CachedPluginInfo(s) // At any other time than during the loading of a plugin, this dict is EMPTY. // Same key as in m_plugins: mimetype or protocol - QDict<KFileMimeTypeInfo> m_pendingMimetypeInfos; + TQDict<KFileMimeTypeInfo> m_pendingMimetypeInfos; private: static KFileMetaInfoProvider * s_self; - KFilePlugin* loadPlugin( const QString& mimeType, const QString& protocol ); - KFilePlugin* loadAndRegisterPlugin( const QString& mimeType, const QString& protocol ); - KFileMimeTypeInfo * addMimeTypeInfo( const QString& mimeType ); + KFilePlugin* loadPlugin( const TQString& mimeType, const TQString& protocol ); + KFilePlugin* loadAndRegisterPlugin( const TQString& mimeType, const TQString& protocol ); + KFileMimeTypeInfo * addMimeTypeInfo( const TQString& mimeType ); class KFileMetaInfoProviderPrivate; KFileMetaInfoProviderPrivate *d; }; -KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfoItem& ); -KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoItem& ); +KIO_EXPORT TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfoItem& ); +KIO_EXPORT TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoItem& ); -KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfoGroup& ); -KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfoGroup& ); +KIO_EXPORT TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfoGroup& ); +KIO_EXPORT TQDataStream& operator >>(TQDataStream& s, KFileMetaInfoGroup& ); -KIO_EXPORT QDataStream& operator <<(QDataStream& s, const KFileMetaInfo& ); -KIO_EXPORT QDataStream& operator >>(QDataStream& s, KFileMetaInfo& ); +KIO_EXPORT TQDataStream& operator <<(TQDataStream& s, const KFileMetaInfo& ); +KIO_EXPORT TQDataStream& operator >>(TQDataStream& s, KFileMetaInfo& ); #endif // KILEMETAINFO_H diff --git a/kio/kio/kfileshare.cpp b/kio/kio/kfileshare.cpp index f381f7be6..6b9bf361d 100644 --- a/kio/kio/kfileshare.cpp +++ b/kio/kio/kfileshare.cpp @@ -18,8 +18,8 @@ */ #include "kfileshare.h" -#include <qdir.h> -#include <qfile.h> +#include <tqdir.h> +#include <tqfile.h> #include <kprocess.h> #include <kprocio.h> #include <klocale.h> @@ -35,14 +35,14 @@ #include <kuser.h> KFileShare::Authorization KFileShare::s_authorization = NotInitialized; -QStringList* KFileShare::s_shareList = 0L; -static KStaticDeleter<QStringList> sdShareList; +TQStringList* KFileShare::s_shareList = 0L; +static KStaticDeleter<TQStringList> sdShareList; KFileShare::ShareMode KFileShare::s_shareMode; bool KFileShare::s_sambaEnabled; bool KFileShare::s_nfsEnabled; bool KFileShare::s_restricted; -QString KFileShare::s_fileShareGroup; +TQString KFileShare::s_fileShareGroup; bool KFileShare::s_sharingEnabled; @@ -51,12 +51,12 @@ bool KFileShare::s_sharingEnabled; KFileSharePrivate::KFileSharePrivate() { KDirWatch::self()->addFile(FILESHARECONF); - connect(KDirWatch::self(), SIGNAL(dirty (const QString&)),this, - SLOT(slotFileChange(const QString &))); - connect(KDirWatch::self(), SIGNAL(created(const QString&)),this, - SLOT(slotFileChange(const QString &))); - connect(KDirWatch::self(), SIGNAL(deleted(const QString&)),this, - SLOT(slotFileChange(const QString &))); + connect(KDirWatch::self(), TQT_SIGNAL(dirty (const TQString&)),this, + TQT_SLOT(slotFileChange(const TQString &))); + connect(KDirWatch::self(), TQT_SIGNAL(created(const TQString&)),this, + TQT_SLOT(slotFileChange(const TQString &))); + connect(KDirWatch::self(), TQT_SIGNAL(deleted(const TQString&)),this, + TQT_SLOT(slotFileChange(const TQString &))); } KFileSharePrivate::~KFileSharePrivate() @@ -75,7 +75,7 @@ KFileSharePrivate* KFileSharePrivate::self() return _self; } -void KFileSharePrivate::slotFileChange(const QString &file) +void KFileSharePrivate::slotFileChange(const TQString &file) { if(file==FILESHARECONF) { KFileShare::readConfig(); @@ -87,7 +87,7 @@ void KFileShare::readConfig() // static { // Create KFileSharePrivate instance KFileSharePrivate::self(); - KSimpleConfig config(QString::fromLatin1(FILESHARECONF),true); + KSimpleConfig config(TQString::fromLatin1(FILESHARECONF),true); s_sharingEnabled = config.readEntry("FILESHARING", "yes") == "yes"; s_restricted = config.readEntry("RESTRICT", "yes") == "yes"; @@ -139,7 +139,7 @@ bool KFileShare::isRestricted() { return s_restricted; } -QString KFileShare::fileShareGroup() { +TQString KFileShare::fileShareGroup() { if ( s_authorization == NotInitialized ) readConfig(); @@ -166,12 +166,12 @@ void KFileShare::readShareList() { KFileSharePrivate::self(); if ( !s_shareList ) - sdShareList.setObject( s_shareList, new QStringList ); + sdShareList.setObject( s_shareList, new TQStringList ); else s_shareList->clear(); // /usr/sbin on Mandrake, $PATH allows flexibility for other distributions - QString exe = findExe( "filesharelist" ); + TQString exe = findExe( "filesharelist" ); if (exe.isEmpty()) { s_authorization = ErrorNotFound; return; @@ -185,7 +185,7 @@ void KFileShare::readShareList() } // Reading code shamelessly stolen from khostname.cpp ;) - QString line; + TQString line; int length; do { length = proc.readln(line, true); @@ -200,12 +200,12 @@ void KFileShare::readShareList() } -bool KFileShare::isDirectoryShared( const QString& _path ) +bool KFileShare::isDirectoryShared( const TQString& _path ) { if ( ! s_shareList ) readShareList(); - QString path( _path ); + TQString path( _path ); if ( path[path.length()-1] != '/' ) path += '/'; return s_shareList && s_shareList->contains( path ); @@ -219,24 +219,24 @@ KFileShare::Authorization KFileShare::authorization() return s_authorization; } -QString KFileShare::findExe( const char* exeName ) +TQString KFileShare::findExe( const char* exeName ) { // /usr/sbin on Mandrake, $PATH allows flexibility for other distributions - QString path = QString::fromLocal8Bit(getenv("PATH")) + QString::fromLatin1(":/usr/sbin"); - QString exe = KStandardDirs::findExe( exeName, path ); + TQString path = TQString::fromLocal8Bit(getenv("PATH")) + TQString::fromLatin1(":/usr/sbin"); + TQString exe = KStandardDirs::findExe( exeName, path ); if (exe.isEmpty()) kdError() << exeName << " not found in " << path << endl; return exe; } -bool KFileShare::setShared( const QString& path, bool shared ) +bool KFileShare::setShared( const TQString& path, bool shared ) { if (! KFileShare::sharingEnabled() || KFileShare::shareMode() == Advanced) return false; kdDebug(7000) << "KFileShare::setShared " << path << "," << shared << endl; - QString exe = KFileShare::findExe( "fileshareset" ); + TQString exe = KFileShare::findExe( "fileshareset" ); if (exe.isEmpty()) return false; diff --git a/kio/kio/kfileshare.h b/kio/kio/kfileshare.h index d95e9764f..6753e055a 100644 --- a/kio/kio/kfileshare.h +++ b/kio/kio/kfileshare.h @@ -19,7 +19,7 @@ #ifndef kfileshare_h #define kfileshare_h -#include <qobject.h> +#include <tqobject.h> #include <kdelibs_export.h> @@ -40,7 +40,7 @@ public: static KFileSharePrivate *self(); static KFileSharePrivate *_self; protected slots: // this is why this class needs to be in the .h - void slotFileChange(const QString &); + void slotFileChange(const TQString &); }; /** @@ -67,7 +67,7 @@ public: /** * Call this to know if a directory is currently shared */ - static bool isDirectoryShared( const QString& path ); + static bool isDirectoryShared( const TQString& path ); enum Authorization { NotInitialized, ErrorNotFound, Authorized, UserNotAllowed }; /** @@ -75,7 +75,7 @@ public: */ static Authorization authorization(); - static QString findExe( const char* exeName ); + static TQString findExe( const char* exeName ); /** * Uses a suid perl script to share the given path @@ -84,7 +84,7 @@ public: * @param shared whether the path should be shared or not * @returns whether the perl script was successful */ - static bool setShared( const QString& path, bool shared ); + static bool setShared( const TQString& path, bool shared ); /** * The used share mode. @@ -115,7 +115,7 @@ public: * That is, all users in that group are allowed to * share files if file sharing is restricted. */ - static QString fileShareGroup(); + static TQString fileShareGroup(); /** * Returns the configured share mode @@ -134,12 +134,12 @@ public: private: static Authorization s_authorization; - static QStringList* s_shareList; + static TQStringList* s_shareList; static ShareMode s_shareMode; static bool s_sambaEnabled; static bool s_nfsEnabled; static bool s_restricted; - static QString s_fileShareGroup; + static TQString s_fileShareGroup; static bool s_sharingEnabled; }; diff --git a/kio/kio/kfilterbase.cpp b/kio/kio/kfilterbase.cpp index ae973c57f..50ff5498a 100644 --- a/kio/kio/kfilterbase.cpp +++ b/kio/kio/kfilterbase.cpp @@ -33,23 +33,23 @@ KFilterBase::~KFilterBase() delete m_dev; } -void KFilterBase::setDevice( QIODevice * dev, bool autodelete ) +void KFilterBase::setDevice( TQIODevice * dev, bool autodelete ) { m_dev = dev; m_bAutoDel = autodelete; } -KFilterBase * KFilterBase::findFilterByFileName( const QString & fileName ) +KFilterBase * KFilterBase::findFilterByFileName( const TQString & fileName ) { KMimeType::Ptr mime = KMimeType::findByPath( fileName ); kdDebug(7005) << "KFilterBase::findFilterByFileName mime=" << mime->name() << endl; return findFilterByMimeType(mime->name()); } -KFilterBase * KFilterBase::findFilterByMimeType( const QString & mimeType ) +KFilterBase * KFilterBase::findFilterByMimeType( const TQString & mimeType ) { KTrader::OfferList offers = KTrader::self()->query( "KDECompressionFilter", - QString("'") + mimeType + "' in ServiceTypes" ); + TQString("'") + mimeType + "' in ServiceTypes" ); KTrader::OfferList::ConstIterator it = offers.begin(); KTrader::OfferList::ConstIterator end = offers.end(); diff --git a/kio/kio/kfilterbase.h b/kio/kio/kfilterbase.h index fb2451f27..cfc037fe5 100644 --- a/kio/kio/kfilterbase.h +++ b/kio/kio/kfilterbase.h @@ -19,8 +19,8 @@ #ifndef __kfilterbase__h #define __kfilterbase__h -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <kdelibs_export.h> @@ -35,7 +35,7 @@ class QIODevice; * such as gzip and bzip2. It's pretty much internal. * Don't use directly, use KFilterDev instead. */ -class KIO_EXPORT KFilterBase : public QObject // needs to inherit QObject for KLibFactory::create +class KIO_EXPORT KFilterBase : public TQObject // needs to inherit TQObject for KLibFactory::create { Q_OBJECT public: @@ -47,7 +47,7 @@ public: * @param dev the device on which the filter will work * @param autodelete if true, @p dev is deleted when the filter is deleted */ - void setDevice( QIODevice * dev, bool autodelete = false ); + void setDevice( TQIODevice * dev, bool autodelete = false ); // Note that this isn't in the constructor, because of KLibFactory::create, // but it should be called before using the filterbase ! @@ -55,7 +55,7 @@ public: * Returns the device on which the filter will work. * @returns the device on which the filter will work */ - QIODevice * device() { return m_dev; } + TQIODevice * device() { return m_dev; } /** \internal */ virtual void init( int mode ) = 0; /** \internal */ @@ -67,7 +67,7 @@ public: /** \internal */ virtual bool readHeader() = 0; /** \internal */ - virtual bool writeHeader( const QCString & filename ) = 0; + virtual bool writeHeader( const TQCString & filename ) = 0; /** \internal */ virtual void setOutBuffer( char * data, uint maxlen ) = 0; /** \internal */ @@ -94,7 +94,7 @@ public: * @param fileName the name of the file to filter * @return the filter for the @p fileName, or 0 if not found */ - static KFilterBase * findFilterByFileName( const QString & fileName ); + static KFilterBase * findFilterByFileName( const TQString & fileName ); /** * Call this to create the appropriate filter for the mimetype @@ -102,10 +102,10 @@ public: * @param mimeType the mime type of the file to filter * @return the filter for the @p mimeType, or 0 if not found */ - static KFilterBase * findFilterByMimeType( const QString & mimeType ); + static KFilterBase * findFilterByMimeType( const TQString & mimeType ); protected: - QIODevice * m_dev; + TQIODevice * m_dev; bool m_bAutoDel; protected: virtual void virtual_hook( int id, void* data ); diff --git a/kio/kio/kfilterdev.cpp b/kio/kio/kfilterdev.cpp index d1f361d58..224d68761 100644 --- a/kio/kio/kfilterdev.cpp +++ b/kio/kio/kfilterdev.cpp @@ -22,7 +22,7 @@ #include <stdio.h> // for EOF #include <stdlib.h> #include <assert.h> -#include <qfile.h> +#include <tqfile.h> #define BUFFER_SIZE 8*1024 @@ -37,9 +37,9 @@ public: bool autoDeleteFilterBase; bool bOpenedUnderlyingDevice; bool bIgnoreData; - QByteArray buffer; // Used as 'input buffer' when reading, as 'output buffer' when writing - QCString ungetchBuffer; - QCString origFileName; + TQByteArray buffer; // Used as 'input buffer' when reading, as 'output buffer' when writing + TQCString ungetchBuffer; + TQCString origFileName; KFilterBase::Result result; }; @@ -63,14 +63,14 @@ KFilterDev::~KFilterDev() #ifndef KDE_NO_COMPAT //this one is static // Cumbersome API. To be removed in KDE 3.0. -QIODevice* KFilterDev::createFilterDevice(KFilterBase* base, QFile* file) +TQIODevice* KFilterDev::createFilterDevice(KFilterBase* base, TQFile* file) { if (file==0) return 0; //we don't need a filter if (base==0) - return new QFile(file->name()); // A bit strange IMHO. We ask for a QFile but we create another one !?! (DF) + return new TQFile(file->name()); // A bit strange IMHO. We ask for a TQFile but we create another one !?! (DF) base->setDevice(file); return new KFilterDev(base); @@ -78,10 +78,10 @@ QIODevice* KFilterDev::createFilterDevice(KFilterBase* base, QFile* file) #endif //static -QIODevice * KFilterDev::deviceForFile( const QString & fileName, const QString & mimetype, +TQIODevice * KFilterDev::deviceForFile( const TQString & fileName, const TQString & mimetype, bool forceFilter ) { - QFile * f = new QFile( fileName ); + TQFile * f = new TQFile( fileName ); KFilterBase * base = mimetype.isEmpty() ? KFilterBase::findFilterByFileName( fileName ) : KFilterBase::findFilterByMimeType( mimetype ); if ( base ) @@ -98,12 +98,12 @@ QIODevice * KFilterDev::deviceForFile( const QString & fileName, const QString & } } -QIODevice * KFilterDev::device( QIODevice* inDevice, const QString & mimetype) +TQIODevice * KFilterDev::device( TQIODevice* inDevice, const TQString & mimetype) { return device( inDevice, mimetype, true ); } -QIODevice * KFilterDev::device( QIODevice* inDevice, const QString & mimetype, bool autoDeleteInDevice ) +TQIODevice * KFilterDev::device( TQIODevice* inDevice, const TQString & mimetype, bool autoDeleteInDevice ) { if (inDevice==0) return 0; @@ -169,7 +169,7 @@ void KFilterDev::flush() // Hmm, might not be enough... } -QIODevice::Offset KFilterDev::size() const +TQIODevice::Offset KFilterDev::size() const { // Well, hmm, Houston, we have a problem. // We can't know the size of the uncompressed data @@ -182,12 +182,12 @@ QIODevice::Offset KFilterDev::size() const return (uint)-1; } -QIODevice::Offset KFilterDev::at() const +TQIODevice::Offset KFilterDev::at() const { return ioIndex; } -bool KFilterDev::at( QIODevice::Offset pos ) +bool KFilterDev::at( TQIODevice::Offset pos ) { //kdDebug(7005) << "KFilterDev::at " << pos << " currently at " << ioIndex << endl; @@ -219,9 +219,9 @@ bool KFilterDev::at( QIODevice::Offset pos ) } //kdDebug(7005) << "KFilterDev::at : reading " << pos << " dummy bytes" << endl; - QByteArray dummy( QMIN( pos, 3*BUFFER_SIZE ) ); + TQByteArray dummy( QMIN( pos, 3*BUFFER_SIZE ) ); d->bIgnoreData = true; - bool result = ( (QIODevice::Offset)readBlock( dummy.data(), pos ) == pos ); + bool result = ( (TQIODevice::Offset)readBlock( dummy.data(), pos ) == pos ); d->bIgnoreData = false; return result; } @@ -440,12 +440,12 @@ int KFilterDev::getch() int ch = d->ungetchBuffer[ len-1 ]; d->ungetchBuffer.truncate( len - 1 ); ioIndex++; - //kdDebug(7005) << "KFilterDev::getch from ungetch: " << QString(QChar(ch)) << endl; + //kdDebug(7005) << "KFilterDev::getch from ungetch: " << TQString(TQChar(ch)) << endl; return ch; } char buf[1]; int ret = readBlock( buf, 1 ) == 1 ? buf[0] : EOF; - //kdDebug(7005) << "KFilterDev::getch ret=" << QString(QChar(ret)) << endl; + //kdDebug(7005) << "KFilterDev::getch ret=" << TQString(TQChar(ret)) << endl; return ret; } @@ -459,7 +459,7 @@ int KFilterDev::putch( int c ) int KFilterDev::ungetch( int ch ) { - //kdDebug(7005) << "KFilterDev::ungetch " << QString(QChar(ch)) << endl; + //kdDebug(7005) << "KFilterDev::ungetch " << TQString(TQChar(ch)) << endl; if ( ch == EOF ) // cannot unget EOF return ch; @@ -469,7 +469,7 @@ int KFilterDev::ungetch( int ch ) return ch; } -void KFilterDev::setOrigFileName( const QCString & fileName ) +void KFilterDev::setOrigFileName( const TQCString & fileName ) { d->origFileName = fileName; } diff --git a/kio/kio/kfilterdev.h b/kio/kio/kfilterdev.h index d1a2d0315..9e3bf508c 100644 --- a/kio/kio/kfilterdev.h +++ b/kio/kio/kfilterdev.h @@ -18,8 +18,8 @@ #ifndef __kfilterdev_h #define __kfilterdev_h -#include <qiodevice.h> -#include <qstring.h> +#include <tqiodevice.h> +#include <tqstring.h> #include <kdelibs_export.h> class QFile; @@ -66,7 +66,7 @@ public: * set the name of the original file, to be used in the gzip header. * @param fileName the name of the original file */ - void setOrigFileName( const QCString & fileName ); + void setOrigFileName( const TQCString & fileName ); /** * Call this let this device skip the gzip headers when reading/writing. @@ -77,13 +77,13 @@ public: void setSkipHeaders(); // Not implemented - virtual QIODevice::Offset size() const; + virtual TQIODevice::Offset size() const; - virtual QIODevice::Offset at() const; + virtual TQIODevice::Offset at() const; /** * That one can be quite slow, when going back. Use with care. */ - virtual bool at( QIODevice::Offset ); + virtual bool at( TQIODevice::Offset ); virtual bool atEnd() const; @@ -100,12 +100,12 @@ private: #endif /** * Call this to create the appropriate filter device for @p base - * working on @p file . The returned QIODevice has to be deleted + * working on @p file . The returned TQIODevice has to be deleted * after using. * @deprecated. Use deviceForFile instead. * To be removed in KDE 3.0 */ - static QIODevice* createFilterDevice(KFilterBase* base, QFile* file) KDE_DEPRECATED; + static TQIODevice* createFilterDevice(KFilterBase* base, TQFile* file) KDE_DEPRECATED; public: /** @@ -118,27 +118,27 @@ public: * to force the corresponding decompression filter, if available. * * Warning: application/x-bzip2 may not be available. - * In that case a QFile opened on the compressed data will be returned ! + * In that case a TQFile opened on the compressed data will be returned ! * Use KFilterBase::findFilterByMimeType and code similar to what * deviceForFile is doing, to better control what's happening. * - * The returned QIODevice has to be deleted after using. + * The returned TQIODevice has to be deleted after using. * * @param fileName the name of the file to filter - * @param mimetype the mime type of the file to filter, or QString::null if unknown + * @param mimetype the mime type of the file to filter, or TQString::null if unknown * @param forceFilter if true, the function will either find a compression filter, or return 0. - * If false, it will always return a QIODevice. If no - * filter is available it will return a simple QFile. + * If false, it will always return a TQIODevice. If no + * filter is available it will return a simple TQFile. * This can be useful if the file is usable without a filter. - * @return if a filter has been found, the QIODevice for the filter. If the + * @return if a filter has been found, the TQIODevice for the filter. If the * filter does not exist, the return value depends on @p forceFilter. - * The returned QIODevice has to be deleted after using. + * The returned TQIODevice has to be deleted after using. */ - static QIODevice * deviceForFile( const QString & fileName, const QString & mimetype = QString::null, + static TQIODevice * deviceForFile( const TQString & fileName, const TQString & mimetype = TQString::null, bool forceFilter = false ); /** - * Creates an i/o device that is able to read from the QIODevice @p inDevice, + * Creates an i/o device that is able to read from the TQIODevice @p inDevice, * whether the data is compressed or not. Available compression filters * (gzip/bzip2 etc.) will automatically be used. * @@ -149,17 +149,17 @@ public: * Warning: application/x-bzip2 may not be available. * In that case 0 will be returned ! * - * The returned QIODevice has to be deleted after using. + * The returned TQIODevice has to be deleted after using. * @param inDevice input device, becomes owned by this device! Automatically deleted! * @param mimetype the mime type for the filter - * @return a QIODevice that filters the original stream. Must be deleted after + * @return a TQIODevice that filters the original stream. Must be deleted after * using */ - static QIODevice * device( QIODevice* inDevice, const QString & mimetype); + static TQIODevice * device( TQIODevice* inDevice, const TQString & mimetype); // BIC: merge with device() method below, using default value for autoDeleteInDevice /** - * Creates an i/o device that is able to read from the QIODevice @p inDevice, + * Creates an i/o device that is able to read from the TQIODevice @p inDevice, * whether the data is compressed or not. Available compression filters * (gzip/bzip2 etc.) will automatically be used. * @@ -170,15 +170,15 @@ public: * Warning: application/x-bzip2 may not be available. * In that case 0 will be returned ! * - * The returned QIODevice has to be deleted after using. + * The returned TQIODevice has to be deleted after using. * @param inDevice input device. Won't be deleted if @p autoDeleteInDevice = false * @param mimetype the mime type for the filter * @param autoDeleteInDevice if true, @p inDevice will be deleted automatically - * @return a QIODevice that filters the original stream. Must be deleted after + * @return a TQIODevice that filters the original stream. Must be deleted after * using * @since 3.1 */ - static QIODevice * device( QIODevice* inDevice, const QString & mimetype, bool autoDeleteInDevice ); + static TQIODevice * device( TQIODevice* inDevice, const TQString & mimetype, bool autoDeleteInDevice ); private: KFilterBase *filter; diff --git a/kio/kio/kimageio.cpp b/kio/kio/kimageio.cpp index 342b2554d..8d4a45db4 100644 --- a/kio/kio/kimageio.cpp +++ b/kio/kio/kimageio.cpp @@ -10,12 +10,12 @@ #include"config.h" -#include <qdir.h> +#include <tqdir.h> #include <kapplication.h> #include <kstandarddirs.h> -#include <qstring.h> -#include <qregexp.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqregexp.h> +#include <tqvaluelist.h> #include <ltdl.h> #include "kimageio.h" @@ -29,9 +29,9 @@ #include <kdebug.h> #include <kstaticdeleter.h> -#include <qimage.h> +#include <tqimage.h> -KImageIOFormat::KImageIOFormat( const QString &path) +KImageIOFormat::KImageIOFormat( const TQString &path) : KSycocaEntry(path) { bLibLoaded = false; @@ -52,7 +52,7 @@ KImageIOFormat::KImageIOFormat( const QString &path) rPaths = config.readPathListEntry("rPaths"); } -KImageIOFormat::KImageIOFormat( QDataStream& _str, int offset) : +KImageIOFormat::KImageIOFormat( TQDataStream& _str, int offset) : KSycocaEntry( _str, offset) { bLibLoaded = false; @@ -66,7 +66,7 @@ KImageIOFormat::~KImageIOFormat() } void -KImageIOFormat::load( QDataStream& _str) +KImageIOFormat::load( TQDataStream& _str) { Q_INT8 iRead, iWrite; KSycocaEntry::read(_str, mType); @@ -83,7 +83,7 @@ KImageIOFormat::load( QDataStream& _str) } void -KImageIOFormat::save( QDataStream& _str) +KImageIOFormat::save( TQDataStream& _str) { KSycocaEntry::save( _str ); Q_INT8 iRead = bRead ? 1 : 0; @@ -94,7 +94,7 @@ KImageIOFormat::save( QDataStream& _str) } void -KImageIOFormat::callLibFunc( bool read, QImageIO *iio) +KImageIOFormat::callLibFunc( bool read, TQImageIO *iio) { if (!bLibLoaded) { @@ -103,20 +103,20 @@ KImageIOFormat::callLibFunc( bool read, QImageIO *iio) iio->setStatus(1); // Error return; } - QString libpath = KLibLoader::findLibrary(mLib.ascii()); + TQString libpath = KLibLoader::findLibrary(mLib.ascii()); if ( libpath.isEmpty()) { iio->setStatus(1); // Error return; } - lt_dlhandle libhandle = lt_dlopen( QFile::encodeName(libpath) ); + lt_dlhandle libhandle = lt_dlopen( TQFile::encodeName(libpath) ); if (libhandle == 0) { iio->setStatus(1); // error kdWarning() << "KImageIOFormat::callLibFunc: couldn't dlopen " << mLib << "(" << lt_dlerror() << ")" << endl; return; } bLibLoaded = true; - QString funcName; + TQString funcName; if (bRead) { funcName = "kimgio_"+mType.lower()+"_read"; @@ -126,7 +126,7 @@ KImageIOFormat::callLibFunc( bool read, QImageIO *iio) iio->setStatus(1); // error kdWarning() << "couln't find " << funcName << " (" << lt_dlerror() << ")" << endl; } - mReadFunc = (void (*)(QImageIO *))func; + mReadFunc = (void (*)(TQImageIO *))func; } if (bWrite) { @@ -137,7 +137,7 @@ KImageIOFormat::callLibFunc( bool read, QImageIO *iio) iio->setStatus(1); // error kdWarning() << "couln't find " << funcName << " (" << lt_dlerror() << ")" << endl; } - mWriteFunc = (void (*)(QImageIO *))func; + mWriteFunc = (void (*)(TQImageIO *))func; } } @@ -173,9 +173,9 @@ KImageIOFactory::KImageIOFactory() : KSycocaFactory( KST_KImageIO ) kiioflsd.setObject( formatList, new KImageIOFormatList()); lt_dlinit(); // Do this only once! // Add rPaths. - for(QStringList::Iterator it = rPath.begin(); + for(TQStringList::Iterator it = rPath.begin(); it != rPath.end(); ++it) - lt_dladdsearchdir( QFile::encodeName(*it) ); + lt_dladdsearchdir( TQFile::encodeName(*it) ); } load(); } @@ -196,10 +196,10 @@ KImageIOFactory::KImageIOFactory() : KSycocaFactory( KST_KImageIO ) QString KImageIOFactory::createPattern( KImageIO::Mode _mode) { - QStringList patterns; - QString allPatterns; - QString wildCard("*."); - QString separator("|"); + TQStringList patterns; + TQString allPatterns; + TQString wildCard("*."); + TQString separator("|"); for( KImageIOFormatList::ConstIterator it = formatList->begin(); it != formatList->end(); ++it ) @@ -208,9 +208,9 @@ KImageIOFactory::createPattern( KImageIO::Mode _mode) if (((_mode == KImageIO::Reading) && format->bRead) || ((_mode == KImageIO::Writing) && format->bWrite)) { - QString pattern; - QStringList suffices = format->mSuffices; - for( QStringList::ConstIterator it = suffices.begin(); + TQString pattern; + TQStringList suffices = format->mSuffices; + for( TQStringList::ConstIterator it = suffices.begin(); it != suffices.end(); ++it) { @@ -232,17 +232,17 @@ KImageIOFactory::createPattern( KImageIO::Mode _mode) patterns.sort(); patterns.prepend(allPatterns); - QString pattern = patterns.join(QString::fromLatin1("\n")); + TQString pattern = patterns.join(TQString::fromLatin1("\n")); return pattern; } void -KImageIOFactory::readImage( QImageIO *iio) +KImageIOFactory::readImage( TQImageIO *iio) { (void) self(); // Make sure we exist const char *fm = iio->format(); if (!fm) - fm = QImageIO::imageFormat( iio->ioDevice()); + fm = TQImageIO::imageFormat( iio->ioDevice()); kdDebug() << "KImageIO: readImage() format = " << fm << endl; KImageIOFormat *format = 0; @@ -264,12 +264,12 @@ KImageIOFactory::readImage( QImageIO *iio) } void -KImageIOFactory::writeImage( QImageIO *iio) +KImageIOFactory::writeImage( TQImageIO *iio) { (void) self(); // Make sure we exist const char *fm = iio->format(); if (!fm) - fm = QImageIO::imageFormat( iio->ioDevice()); + fm = TQImageIO::imageFormat( iio->ioDevice()); kdDebug () << "KImageIO: writeImage() format = "<< fm << endl; KImageIOFormat *format = 0; @@ -321,8 +321,8 @@ KImageIOFactory::load() continue; if (!format->mHeader.isEmpty() && !format->mLib.isEmpty()) { - void (*readFunc)(QImageIO *); - void (*writeFunc)(QImageIO *); + void (*readFunc)(TQImageIO *); + void (*writeFunc)(TQImageIO *); if (format->bRead) readFunc = readImage; else @@ -331,7 +331,7 @@ KImageIOFactory::load() writeFunc = writeImage; else writeFunc = 0; - QImageIO::defineIOHandler( format->mType.ascii(), + TQImageIO::defineIOHandler( format->mType.ascii(), format->mHeader.ascii(), format->mFlags.ascii(), readFunc, writeFunc); @@ -358,7 +358,7 @@ KImageIOFactory::createEntry(int offset) { KImageIOFormat *format = 0; KSycocaType type; - QDataStream *str = KSycoca::self()->findEntry(offset, type); + TQDataStream *str = KSycoca::self()->findEntry(offset, type); switch (type) { case KST_KImageIOFormat: @@ -389,7 +389,7 @@ KImageIO::pattern(Mode _mode) return KImageIOFactory::self()->mWritePattern; } -bool KImageIO::canWrite(const QString& type) +bool KImageIO::canWrite(const TQString& type) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; @@ -408,7 +408,7 @@ bool KImageIO::canWrite(const QString& type) return false; } -bool KImageIO::canRead(const QString& type) +bool KImageIO::canRead(const TQString& type) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; @@ -427,9 +427,9 @@ bool KImageIO::canRead(const QString& type) return false; } -QStringList KImageIO::types(Mode _mode ) { +TQStringList KImageIO::types(Mode _mode ) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; - QStringList types; + TQStringList types; if(formatList) { @@ -447,7 +447,7 @@ QStringList KImageIO::types(Mode _mode ) { return types; } -QString KImageIO::suffix(const QString& type) +TQString KImageIO::suffix(const TQString& type) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; @@ -463,10 +463,10 @@ QString KImageIO::suffix(const QString& type) } } - return QString::null; + return TQString::null; } -QString KImageIO::typeForMime(const QString& mimeType) +TQString KImageIO::typeForMime(const TQString& mimeType) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; @@ -482,13 +482,13 @@ QString KImageIO::typeForMime(const QString& mimeType) } } - return QString::null; + return TQString::null; } -QString KImageIO::type(const QString& filename) +TQString KImageIO::type(const TQString& filename) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; - QString suffix = filename; + TQString suffix = filename; int dot = suffix.findRev('.'); if (dot >= 0) suffix = suffix.mid(dot + 1); @@ -505,13 +505,13 @@ QString KImageIO::type(const QString& filename) } } - return QString::null; + return TQString::null; } -QStringList KImageIO::mimeTypes( Mode _mode ) +TQStringList KImageIO::mimeTypes( Mode _mode ) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; - QStringList mimeList; + TQStringList mimeList; if(formatList) { @@ -530,7 +530,7 @@ QStringList KImageIO::mimeTypes( Mode _mode ) return mimeList; } -bool KImageIO::isSupported( const QString& _mimeType, Mode _mode ) +bool KImageIO::isSupported( const TQString& _mimeType, Mode _mode ) { KImageIOFormatList *formatList = KImageIOFactory::self()->formatList; @@ -553,7 +553,7 @@ bool KImageIO::isSupported( const QString& _mimeType, Mode _mode ) return false; } -QString KImageIO::mimeType( const QString& _filename ) +TQString KImageIO::mimeType( const TQString& _filename ) { return KMimeType::findByURL( KURL( _filename ) )->name(); } diff --git a/kio/kio/kimageio.h b/kio/kio/kimageio.h index 882ad9172..dba18c8fd 100644 --- a/kio/kio/kimageio.h +++ b/kio/kio/kimageio.h @@ -8,7 +8,7 @@ #ifndef SSK_KIMGIO_H #define SSK_KIMGIO_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdelibs_export.h> @@ -16,11 +16,11 @@ * Interface to the KDE Image IO plugin architecture. * * This library allows KDE applications to read and write images in a - * variety of formats, transparently via the QImage and QPixmap load + * variety of formats, transparently via the TQImage and TQPixmap load * and save methods. * * The image processing backends are written as image handlers compatible - * with the QImageIO handler format. The backends are loaded on demand + * with the TQImageIO handler format. The backends are loaded on demand * when a particular format is requested. Each format can be identified * by a unique type id string. * @@ -52,7 +52,7 @@ * \b Example: * * \code - * #include<qpixmap.h> + * #include<tqpixmap.h> * #include<kimageio.h> * * int main( int argc, char **argv ) @@ -63,7 +63,7 @@ * } * \endcode * - * @see KImageIO, QPixmap, QImage, QImageIO + * @see KImageIO, TQPixmap, TQImage, QImageIO * @author Sirtaj Singh Kang */ class KIO_EXPORT KImageIO @@ -86,14 +86,14 @@ public: * @param type the type id of the image type * @return true if the image format can be written */ - static bool canWrite(const QString& type); + static bool canWrite(const TQString& type); /** * Checks if a special type is supported for reading. * @param type the type id of the image type * @return true if the image format can be read */ - static bool canRead(const QString& type); + static bool canRead(const TQString& type); /** * Returns a list of all KImageIO supported formats. @@ -101,7 +101,7 @@ public: * @param mode Tells whether to retrieve modes that can be read or written. * @return a list of the type ids */ - static QStringList types(Mode mode = Writing); + static TQStringList types(Mode mode = Writing); /** @@ -114,32 +114,32 @@ public: * @return a space-separated list of file globs that describe the * supported formats */ - static QString pattern(Mode mode = Reading); + static TQString pattern(Mode mode = Reading); /** * Returns the suffix of an image type. * @param type the type id of the file format - * @return the suffix of the file format or QString::null if it does not + * @return the suffix of the file format or TQString::null if it does not * exist */ - static QString suffix(const QString& type); + static TQString suffix(const TQString& type); /** * Returns the type of a MIME type. * @param mimeType the MIME type to search - * @return type id of the MIME type or QString::null if the MIME type + * @return type id of the MIME type or TQString::null if the MIME type * is not supported * @since 3.1 */ - static QString typeForMime(const QString& mimeType); + static TQString typeForMime(const TQString& mimeType); /** * Returns the type of given filename. * @param filename the filename to check * @return if the file name's suffix is known the type id of the - * file type, otherwise QString::null + * file type, otherwise TQString::null */ - static QString type(const QString& filename); + static TQString type(const TQString& filename); /** * Returns a list of MIME types for all KImageIO supported formats. @@ -147,7 +147,7 @@ public: * @param mode Tells whether to retrieve modes that can be read or written. * @return a list if MIME types of the supported formats */ - static QStringList mimeTypes( Mode mode = Writing ); + static TQStringList mimeTypes( Mode mode = Writing ); /** * Test to see whether a MIME type is supported to reading/writing. @@ -155,14 +155,14 @@ public: * @param _mode Tells whether to check for reading or writing capabilities * @return true if the type is supported **/ - static bool isSupported( const QString& _mimeType, Mode _mode = Writing ); + static bool isSupported( const TQString& _mimeType, Mode _mode = Writing ); /** * Returns the MIME type of @p _filename. * @param _filename the filename to check - * @return the MIME type of the file, or QString::null + * @return the MIME type of the file, or TQString::null **/ - static QString mimeType( const QString& _filename ); + static TQString mimeType( const TQString& _filename ); }; diff --git a/kio/kio/kimageiofactory.h b/kio/kio/kimageiofactory.h index 1154ee586..2ffe58e60 100644 --- a/kio/kio/kimageiofactory.h +++ b/kio/kio/kimageiofactory.h @@ -21,21 +21,21 @@ class KIO_EXPORT KImageIOFormat : public KSycocaEntry public: typedef KSharedPtr<KImageIOFormat> Ptr; - typedef QValueList<Ptr> List; + typedef TQValueList<Ptr> List; public: // KDoc seems to barf on those typedefs and generates no docs after them /** * Read a KImageIOFormat description file */ - KImageIOFormat( const QString & path); + KImageIOFormat( const TQString & path); /** * @internal construct a ImageIOFormat from a stream */ - KImageIOFormat( QDataStream& _str, int offset); + KImageIOFormat( TQDataStream& _str, int offset); virtual ~KImageIOFormat(); - virtual QString name() const { return mType; } + virtual TQString name() const { return mType; } virtual bool isValid() const { return true; } @@ -43,34 +43,34 @@ public: // KDoc seems to barf on those typedefs and generates no docs after them * @internal * Load the image format from a stream. */ - virtual void load(QDataStream& ); + virtual void load(TQDataStream& ); /** * @internal * Save the image format to a stream. */ - virtual void save(QDataStream& ); + virtual void save(TQDataStream& ); /** * @internal * Calls image IO function */ - void callLibFunc( bool read, QImageIO *); + void callLibFunc( bool read, TQImageIO *); public: - QString mType; - QString mHeader; - QString mFlags; + TQString mType; + TQString mHeader; + TQString mFlags; bool bRead; bool bWrite; - QStringList mSuffices; - QString mPattern; - QString mMimetype; - QString mLib; - QStringList rPaths; + TQStringList mSuffices; + TQString mPattern; + TQString mMimetype; + TQString mLib; + TQStringList rPaths; bool bLibLoaded; - void (*mReadFunc)(QImageIO *); - void (*mWriteFunc)(QImageIO *); + void (*mReadFunc)(TQImageIO *); + void (*mWriteFunc)(TQImageIO *); protected: virtual void virtual_hook( int id, void* data ); }; @@ -105,12 +105,12 @@ protected: // Internal stuff /** * @internal Create pattern string **/ - QString createPattern( KImageIO::Mode _mode); + TQString createPattern( KImageIO::Mode _mode); /** * @internal Not used. */ - virtual KSycocaEntry *createEntry(const QString &, const char *) + virtual KSycocaEntry *createEntry(const TQString &, const char *) { return 0; } /** @@ -121,19 +121,19 @@ protected: // Internal stuff /** * @internal Read an image **/ - static void readImage( QImageIO *iio); + static void readImage( TQImageIO *iio); /** * @internal Write an image **/ - static void writeImage( QImageIO *iio); + static void writeImage( TQImageIO *iio); protected: static KImageIOFactory *_self; static KImageIOFormatList *formatList; - QString mReadPattern; - QString mWritePattern; - QStringList rPath; + TQString mReadPattern; + TQString mWritePattern; + TQStringList rPath; protected: virtual void virtual_hook( int id, void* data ); }; diff --git a/kio/kio/klimitediodevice.h b/kio/kio/klimitediodevice.h index f2bc1b908..035a3cd15 100644 --- a/kio/kio/klimitediodevice.h +++ b/kio/kio/klimitediodevice.h @@ -20,7 +20,7 @@ #define klimitediodevice_h #include <kdebug.h> -#include <qiodevice.h> +#include <tqiodevice.h> /** * A readonly device that reads from an underlying device * from a given point to another (e.g. to give access to a single @@ -38,7 +38,7 @@ public: * @param start where to start reading (position in bytes) * @param length the length of the data to read (in bytes) */ - KLimitedIODevice( QIODevice *dev, int start, int length ) + KLimitedIODevice( TQIODevice *dev, int start, int length ) : m_dev( dev ), m_start( start ), m_length( length ) { //kdDebug(7005) << "KLimitedIODevice::KLimitedIODevice start=" << start << " length=" << length << endl; @@ -93,7 +93,7 @@ public: } virtual bool atEnd() const { return m_dev->atEnd() || m_dev->at() >= m_start + m_length; } private: - QIODevice* m_dev; + TQIODevice* m_dev; Q_ULONG m_start; Q_ULONG m_length; }; diff --git a/kio/kio/kmessageboxwrapper.h b/kio/kio/kmessageboxwrapper.h index 4a9dc2d76..94a960135 100644 --- a/kio/kio/kmessageboxwrapper.h +++ b/kio/kio/kmessageboxwrapper.h @@ -30,9 +30,9 @@ class KIO_EXPORT KMessageBoxWrapper : public KMessageBox { public: - static void error(QWidget *parent, - const QString &text, - const QString &caption = QString::null) + static void error(TQWidget *parent, + const TQString &text, + const TQString &caption = TQString::null) { if (KApplication::guiEnabled()) { kapp->enableStyles(); @@ -41,9 +41,9 @@ public: kdWarning() << text << endl; } - static void sorry(QWidget *parent, - const QString &text, - const QString &caption = QString::null) + static void sorry(TQWidget *parent, + const TQString &text, + const TQString &caption = TQString::null) { if (KApplication::guiEnabled()) { kapp->enableStyles(); diff --git a/kio/kio/kmimemagic.cpp b/kio/kio/kmimemagic.cpp index 971dfd251..72b249249 100644 --- a/kio/kio/kmimemagic.cpp +++ b/kio/kio/kmimemagic.cpp @@ -19,7 +19,7 @@ #include "kmimemagic.h" #include <kdebug.h> #include <kapplication.h> -#include <qfile.h> +#include <tqfile.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> #include <kstaticdeleter.h> @@ -27,7 +27,7 @@ #include <assert.h> static int fsmagic(struct config_rec* conf, const char *fn, KDE_struct_stat *sb); -static void process(struct config_rec* conf, const QString &); +static void process(struct config_rec* conf, const TQString &); static int ascmagic(struct config_rec* conf, unsigned char *buf, int nbytes); static int tagmagic(unsigned char *buf, int nbytes); static int textmagic(struct config_rec* conf, unsigned char *, int); @@ -63,8 +63,8 @@ void KMimeMagic::initStatic() #include <time.h> #include <utime.h> #include <stdarg.h> -#include <qregexp.h> -#include <qstring.h> +#include <tqregexp.h> +#include <tqstring.h> //#define MIME_MAGIC_DEBUG_TABLE // untested @@ -525,15 +525,15 @@ class KMimeMagicUtimeConf public: KMimeMagicUtimeConf() { - tmpDirs << QString::fromLatin1("/tmp"); // default value + tmpDirs << TQString::fromLatin1("/tmp"); // default value // The trick is that we also don't want the user to override globally set // directories. So we have to misuse KStandardDirs :} - QStringList confDirs = KGlobal::dirs()->resourceDirs( "config" ); + TQStringList confDirs = KGlobal::dirs()->resourceDirs( "config" ); if ( !confDirs.isEmpty() ) { - QString globalConf = confDirs.last() + "kmimemagicrc"; - if ( QFile::exists( globalConf ) ) + TQString globalConf = confDirs.last() + "kmimemagicrc"; + if ( TQFile::exists( globalConf ) ) { KSimpleConfig cfg( globalConf ); cfg.setGroup( "Settings" ); @@ -541,42 +541,42 @@ public: } if ( confDirs.count() > 1 ) { - QString localConf = confDirs.first() + "kmimemagicrc"; - if ( QFile::exists( localConf ) ) + TQString localConf = confDirs.first() + "kmimemagicrc"; + if ( TQFile::exists( localConf ) ) { KSimpleConfig cfg( localConf ); cfg.setGroup( "Settings" ); tmpDirs += cfg.readListEntry( "atimeDirs" ); } } - for ( QStringList::Iterator it = tmpDirs.begin() ; it != tmpDirs.end() ; ++it ) + for ( TQStringList::Iterator it = tmpDirs.begin() ; it != tmpDirs.end() ; ++it ) { - QString dir = *it; + TQString dir = *it; if ( !dir.isEmpty() && dir[ dir.length()-1 ] != '/' ) (*it) += '/'; } } #if 0 // debug code - for ( QStringList::Iterator it = tmpDirs.begin() ; it != tmpDirs.end() ; ++it ) + for ( TQStringList::Iterator it = tmpDirs.begin() ; it != tmpDirs.end() ; ++it ) kdDebug(7018) << " atimeDir: " << *it << endl; #endif } - bool restoreAccessTime( const QString & file ) const + bool restoreAccessTime( const TQString & file ) const { - QString dir = file.left( file.findRev( '/' ) ); + TQString dir = file.left( file.findRev( '/' ) ); bool res = tmpDirs.contains( dir ); //kdDebug(7018) << "restoreAccessTime " << file << " dir=" << dir << " result=" << res << endl; return res; } - QStringList tmpDirs; + TQStringList tmpDirs; }; /* current config */ struct config_rec { bool followLinks; - QString resultBuf; + TQString resultBuf; int accuracy; struct magic *magic, /* head of magic config list */ @@ -646,18 +646,18 @@ int KMimeMagic::parse_line(char *line, int *rule, int lineno) /* * apprentice - load configuration from the magic file. */ -int KMimeMagic::apprentice( const QString& magicfile ) +int KMimeMagic::apprentice( const TQString& magicfile ) { FILE *f; char line[BUFSIZ + 1]; int errs = 0; int lineno; int rule = 0; - QCString fname; + TQCString fname; if (magicfile.isEmpty()) return -1; - fname = QFile::encodeName(magicfile); + fname = TQFile::encodeName(magicfile); f = fopen(fname, "r"); if (f == NULL) { kdError(7018) << "can't read magic file " << fname.data() << ": " << strerror(errno) << endl; @@ -1351,14 +1351,14 @@ mcheck(union VALUETYPE *p, struct magic *m) * fixed-size buffer to begin processing the contents. */ -void process(struct config_rec* conf, const QString & fn) +void process(struct config_rec* conf, const TQString & fn) { int fd = 0; unsigned char buf[HOWMANY + 1]; /* one extra for terminating '\0' */ KDE_struct_stat sb; int nbytes = 0; /* number of bytes read from a datafile */ int tagbytes = 0; /* size of prefixed tag */ - QCString fileName = QFile::encodeName( fn ); + TQCString fileName = TQFile::encodeName( fn ); /* * first try judging the file based on its filesystem status @@ -1518,7 +1518,7 @@ fsmagic(struct config_rec* conf, const char *fn, KDE_struct_stat *sb) strcpy(buf, tmp); } if (conf->followLinks) - process( conf, QFile::decodeName( buf ) ); + process( conf, TQFile::decodeName( buf ) ); else conf->resultBuf = MIME_INODE_LINK; return 1; @@ -1898,27 +1898,27 @@ static int ascmagic(struct config_rec* conf, unsigned char *buf, int nbytes) #endif if (jonly > 1 && foundClass) { // At least two java-only tokens have matched, including "class" - conf->resultBuf = QString(types[P_JAVA].type); + conf->resultBuf = TQString(types[P_JAVA].type); return 1; } if (jconly > 1) { // At least two non-C (only C++ or Java) token have matched. if (typecount[P_JAVA] < typecount[P_CPP]) - conf->resultBuf = QString(types[P_CPP].type); + conf->resultBuf = TQString(types[P_CPP].type); else - conf->resultBuf = QString(types[P_JAVA].type); + conf->resultBuf = TQString(types[P_JAVA].type); return 1; } if (conly + cpponly > 1) { // Either C or C++. if (cpponly > 0) - conf->resultBuf = QString(types[P_CPP].type); + conf->resultBuf = TQString(types[P_CPP].type); else - conf->resultBuf = QString(types[P_C].type); + conf->resultBuf = TQString(types[P_C].type); return 1; } if (objconly > 0) { - conf->resultBuf = QString(types[P_OBJC].type); + conf->resultBuf = TQString(types[P_OBJC].type); return 1; } } @@ -1952,7 +1952,7 @@ static int ascmagic(struct config_rec* conf, unsigned char *buf, int nbytes) #ifdef DEBUG_MIMEMAGIC kdDebug(7018) << "mostaccurate=" << mostaccurate << " pcts=" << pcts[mostaccurate] << " pctsum=" << pctsum << " accuracy=" << conf->accuracy << endl; #endif - conf->resultBuf = QString(types[mostaccurate].type); + conf->resultBuf = TQString(types[mostaccurate].type); return 1; } } @@ -2118,21 +2118,21 @@ from_oct(int digs, char *where) KMimeMagic::KMimeMagic() { // Magic file detection init - QString mimefile = locate( "mime", "magic" ); + TQString mimefile = locate( "mime", "magic" ); init( mimefile ); // Add snippets from share/config/magic/* - QStringList snippets = KGlobal::dirs()->findAllResources( "config", "magic/*.magic", true ); - for ( QStringList::Iterator it = snippets.begin() ; it != snippets.end() ; ++it ) + TQStringList snippets = KGlobal::dirs()->findAllResources( "config", "magic/*.magic", true ); + for ( TQStringList::Iterator it = snippets.begin() ; it != snippets.end() ; ++it ) if ( !mergeConfig( *it ) ) kdWarning() << k_funcinfo << "Failed to parse " << *it << endl; } -KMimeMagic::KMimeMagic(const QString & _configfile) +KMimeMagic::KMimeMagic(const TQString & _configfile) { init( _configfile ); } -void KMimeMagic::init( const QString& _configfile ) +void KMimeMagic::init( const TQString& _configfile ) { int result; conf = new config_rec; @@ -2173,7 +2173,7 @@ KMimeMagic::~KMimeMagic() } bool -KMimeMagic::mergeConfig(const QString & _configfile) +KMimeMagic::mergeConfig(const TQString & _configfile) { kdDebug(7018) << k_funcinfo << _configfile << endl; int result; @@ -2214,11 +2214,11 @@ KMimeMagic::setFollowLinks( bool _enable ) } KMimeMagicResult * -KMimeMagic::findBufferType(const QByteArray &array) +KMimeMagic::findBufferType(const TQByteArray &array) { unsigned char buf[HOWMANY + 1]; /* one extra for terminating '\0' */ - conf->resultBuf = QString::null; + conf->resultBuf = TQString::null; if ( !magicResult ) magicResult = new KMimeMagicResult(); magicResult->setInvalid(); @@ -2242,9 +2242,9 @@ KMimeMagic::findBufferType(const QByteArray &array) } static void -refineResult(KMimeMagicResult *r, const QString & _filename) +refineResult(KMimeMagicResult *r, const TQString & _filename) { - QString tmp = r->mimeType(); + TQString tmp = r->mimeType(); if (tmp.isEmpty()) return; if ( tmp == "text/x-c" || tmp == "text/x-objc" ) @@ -2279,8 +2279,8 @@ refineResult(KMimeMagicResult *r, const QString & _filename) } KMimeMagicResult * -KMimeMagic::findBufferFileType( const QByteArray &data, - const QString &fn) +KMimeMagic::findBufferFileType( const TQByteArray &data, + const TQString &fn) { KMimeMagicResult * r = findBufferType( data ); refineResult(r, fn); @@ -2290,12 +2290,12 @@ KMimeMagic::findBufferFileType( const QByteArray &data, /* * Find the content-type of the given file. */ -KMimeMagicResult* KMimeMagic::findFileType(const QString & fn) +KMimeMagicResult* KMimeMagic::findFileType(const TQString & fn) { #ifdef DEBUG_MIMEMAGIC kdDebug(7018) << "KMimeMagic::findFileType " << fn << endl; #endif - conf->resultBuf = QString::null; + conf->resultBuf = TQString::null; if ( !magicResult ) magicResult = new KMimeMagicResult(); diff --git a/kio/kio/kmimemagic.h b/kio/kio/kmimemagic.h index 377594043..d73dd306a 100644 --- a/kio/kio/kmimemagic.h +++ b/kio/kio/kmimemagic.h @@ -30,7 +30,7 @@ #ifndef KMIMEMAGIC_H #define KMIMEMAGIC_H -#include <qstring.h> +#include <tqstring.h> #include <kdelibs_export.h> class KMimeMagic; // see below (read this one first) @@ -52,7 +52,7 @@ public: /** * Retrieve the mimetype (e.g. "text/html") of the file or buffer parsed. */ - QString mimeType() const { return m_strMimeType; } + TQString mimeType() const { return m_strMimeType; } /** * Retrieve the accuracy of the matching. */ @@ -65,12 +65,12 @@ public: ///////////////// // Internal functions only ///////////////// - void setMimeType( const QString& _mime ) { m_strMimeType = _mime; } + void setMimeType( const TQString& _mime ) { m_strMimeType = _mime; } void setAccuracy( int _accuracy ) { m_iAccuracy = _accuracy; } - void setInvalid() { m_strMimeType = QString::null; } + void setInvalid() { m_strMimeType = TQString::null; } protected: - QString m_strMimeType; + TQString m_strMimeType; int m_iAccuracy; }; @@ -111,7 +111,7 @@ public: /** * Create a parser and initialize it with the given config file. */ - KMimeMagic( const QString & configFile ); + KMimeMagic( const TQString & configFile ); /** * Destroy the parser. @@ -124,7 +124,7 @@ public: * * @return @p true on success. */ - bool mergeConfig( const QString & configFile ); + bool mergeConfig( const TQString & configFile ); /** * Merge an existing parse table with the data from the @@ -153,7 +153,7 @@ public: * the returned result object changes its value * since it is reused by KMimeMagic. */ - KMimeMagicResult* findFileType( const QString & _filename ); + KMimeMagicResult* findFileType( const TQString & _filename ); /** * Same functionality as above, except data is not @@ -167,7 +167,7 @@ public: * the returned result object changes its value * since it is reused by KMimeMagic. */ - KMimeMagicResult* findBufferType( const QByteArray &p ); + KMimeMagicResult* findBufferType( const TQByteArray &p ); /** * Same functionality as findBufferType() but with @@ -183,7 +183,7 @@ public: * the returned result object changes its value * since it is reused by KMimeMagic. */ - KMimeMagicResult * findBufferFileType( const QByteArray &, const QString & filename ); + KMimeMagicResult * findBufferFileType( const TQByteArray &, const TQString & filename ); /** * Returns a pointer to the unique KMimeMagic instance in this process. @@ -200,15 +200,15 @@ protected: static KMimeMagic* s_pSelf; private: - void init( const QString& configFile ); + void init( const TQString& configFile ); bool bunused; - QString sunused; + TQString sunused; int parse_line(char *line, int *rule, int lineno); int parse(char *, int); int buff_apprentice(char*buff); - int apprentice(const QString &configFile); + int apprentice(const TQString &configFile); struct config_rec *conf; // this is also our "d pointer" int iunused; diff --git a/kio/kio/kmimetype.cpp b/kio/kio/kmimetype.cpp index c6f0aaea9..af4243a53 100644 --- a/kio/kio/kmimetype.cpp +++ b/kio/kio/kmimetype.cpp @@ -40,8 +40,8 @@ #include "kautomount.h" #include <kdirnotify_stub.h> -#include <qstring.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqfile.h> #include <kmessageboxwrapper.h> #include <dcopclient.h> @@ -60,7 +60,7 @@ #include <kde_file.h> template class KSharedPtr<KMimeType>; -template class QValueList<KMimeType::Ptr>; +template class TQValueList<KMimeType::Ptr>; KMimeType::Ptr KMimeType::s_pDefaultType = 0L; bool KMimeType::s_bChecked = false; @@ -80,9 +80,9 @@ void KMimeType::buildDefaultType() { errorMissingMimeType( defaultMimeType() ); KStandardDirs stdDirs; - QString sDefaultMimeType = stdDirs.resourceDirs("mime").first()+defaultMimeType()+".desktop"; + TQString sDefaultMimeType = stdDirs.resourceDirs("mime").first()+defaultMimeType()+".desktop"; s_pDefaultType = new KMimeType( sDefaultMimeType, defaultMimeType(), - "unknown", "mime", QStringList() ); + "unknown", "mime", TQStringList() ); } } @@ -131,14 +131,14 @@ void KMimeType::checkEssentialMimeTypes() errorMissingMimeType( "application/x-desktop" ); } -void KMimeType::errorMissingMimeType( const QString& _type ) +void KMimeType::errorMissingMimeType( const TQString& _type ) { - QString tmp = i18n( "Could not find mime type\n%1" ).arg( _type ); + TQString tmp = i18n( "Could not find mime type\n%1" ).arg( _type ); KMessageBoxWrapper::sorry( 0, tmp ); } -KMimeType::Ptr KMimeType::mimeType( const QString& _name ) +KMimeType::Ptr KMimeType::mimeType( const TQString& _name ) { KServiceType * mime = KServiceTypeFactory::self()->findServiceTypeByName( _name ); @@ -166,7 +166,7 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, bool _is_local_file, bool _fast_mode ) { checkEssentialMimeTypes(); - QString path = _url.path(); + TQString path = _url.path(); if ( !_fast_mode && !_is_local_file && _url.isLocalFile() ) _is_local_file = true; @@ -174,7 +174,7 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, if ( !_fast_mode && _is_local_file && (_mode == 0 || _mode == (mode_t)-1) ) { KDE_struct_stat buff; - if ( KDE_stat( QFile::encodeName(path), &buff ) != -1 ) + if ( KDE_stat( TQFile::encodeName(path), &buff ) != -1 ) _mode = buff.st_mode; } @@ -185,7 +185,7 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, // are allowed to enter the directory if ( _is_local_file ) { - if ( access( QFile::encodeName(path), R_OK ) == -1 ) + if ( access( TQFile::encodeName(path), R_OK ) == -1 ) return mimeType( "inode/directory-locked" ); } return mimeType( "inode/directory" ); @@ -202,9 +202,9 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, if ( !_is_local_file && S_ISREG( _mode ) && ( _mode & ( S_IXUSR | S_IXGRP | S_IXOTH ) ) ) return mimeType( "application/x-executable" ); - QString fileName ( _url.fileName() ); + TQString fileName ( _url.fileName() ); - static const QString& slash = KGlobal::staticQString("/"); + static const TQString& slash = KGlobal::staticQString("/"); if ( ! fileName.isNull() && !path.endsWith( slash ) ) { // Try to find it out by looking at the filename @@ -230,9 +230,9 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, } } - static const QString& dotdesktop = KGlobal::staticQString(".desktop"); - static const QString& dotkdelnk = KGlobal::staticQString(".kdelnk"); - static const QString& dotdirectory = KGlobal::staticQString(".directory"); + static const TQString& dotdesktop = KGlobal::staticQString(".desktop"); + static const TQString& dotkdelnk = KGlobal::staticQString(".kdelnk"); + static const TQString& dotdirectory = KGlobal::staticQString(".directory"); // Another filename binding, hardcoded, is .desktop: if ( fileName.endsWith( dotdesktop ) ) @@ -249,7 +249,7 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, if ( !_is_local_file || _fast_mode ) { - QString def = KProtocolInfo::defaultMimetype( _url ); + TQString def = KProtocolInfo::defaultMimetype( _url ); if ( !def.isEmpty() && def != defaultMimeType() ) { // The protocol says it always returns a given mimetype (e.g. text/html for "man:") @@ -265,7 +265,7 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, { // Assume inode/directory, if the protocol supports listing. if ( KProtocolInfo::supportsListing( _url ) ) - return mimeType( QString::fromLatin1("inode/directory") ); + return mimeType( TQString::fromLatin1("inode/directory") ); else return defaultMimeTypePtr(); // == 'no idea', e.g. for "data:,foo/" } @@ -276,7 +276,7 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, } // Do some magic for local files - //kdDebug(7009) << QString("Mime Type finding for '%1'").arg(path) << endl; + //kdDebug(7009) << TQString("Mime Type finding for '%1'").arg(path) << endl; KMimeMagicResult* result = KMimeMagic::self()->findFileType( path ); // If we still did not find it, we must assume the default mime type @@ -296,19 +296,19 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, return mime; } -KMimeType::Ptr KMimeType::diagnoseFileName(const QString &fileName, QString &pattern) +KMimeType::Ptr KMimeType::diagnoseFileName(const TQString &fileName, TQString &pattern) { return KServiceTypeFactory::self()->findFromPattern( fileName, &pattern ); } -KMimeType::Ptr KMimeType::findByPath( const QString& path, mode_t mode, bool fast_mode ) +KMimeType::Ptr KMimeType::findByPath( const TQString& path, mode_t mode, bool fast_mode ) { KURL u; u.setPath(path); return findByURL( u, mode, true, fast_mode ); } -KMimeType::Ptr KMimeType::findByContent( const QByteArray &data, int *accuracy ) +KMimeType::Ptr KMimeType::findByContent( const TQByteArray &data, int *accuracy ) { KMimeMagicResult *result = KMimeMagic::self()->findBufferType(data); if (accuracy) @@ -316,7 +316,7 @@ KMimeType::Ptr KMimeType::findByContent( const QByteArray &data, int *accuracy ) return mimeType( result->mimeType() ); } -KMimeType::Ptr KMimeType::findByFileContent( const QString &fileName, int *accuracy ) +KMimeType::Ptr KMimeType::findByFileContent( const TQString &fileName, int *accuracy ) { KMimeMagicResult *result = KMimeMagic::self()->findFileType(fileName); if (accuracy) @@ -327,21 +327,21 @@ KMimeType::Ptr KMimeType::findByFileContent( const QString &fileName, int *accur #define GZIP_MAGIC1 0x1f #define GZIP_MAGIC2 0x8b -KMimeType::Format KMimeType::findFormatByFileContent( const QString &fileName ) +KMimeType::Format KMimeType::findFormatByFileContent( const TQString &fileName ) { KMimeType::Format result; result.compression = Format::NoCompression; KMimeType::Ptr mime = findByPath(fileName); result.text = mime->name().startsWith("text/"); - QVariant v = mime->property("X-KDE-text"); + TQVariant v = mime->property("X-KDE-text"); if (v.isValid()) result.text = v.toBool(); if (mime->name().startsWith("inode/")) return result; - QFile f(fileName); + TQFile f(fileName); if (f.open(IO_ReadOnly)) { unsigned char buf[10+1]; @@ -352,14 +352,14 @@ KMimeType::Format KMimeType::findFormatByFileContent( const QString &fileName ) return result; } -KMimeType::KMimeType( const QString & _fullpath, const QString& _type, const QString& _icon, - const QString& _comment, const QStringList& _patterns ) +KMimeType::KMimeType( const TQString & _fullpath, const TQString& _type, const TQString& _icon, + const TQString& _comment, const TQStringList& _patterns ) : KServiceType( _fullpath, _type, _icon, _comment ) { m_lstPatterns = _patterns; } -KMimeType::KMimeType( const QString & _fullpath ) : KServiceType( _fullpath ) +KMimeType::KMimeType( const TQString & _fullpath ) : KServiceType( _fullpath ) { KDesktopFile _cfg( _fullpath, true ); init ( &_cfg ); @@ -382,47 +382,47 @@ void KMimeType::init( KDesktopFile * config ) m_lstPatterns = config->readListEntry( "Patterns", ';' ); // Read the X-KDE-AutoEmbed setting and store it in the properties map - QString XKDEAutoEmbed = QString::fromLatin1("X-KDE-AutoEmbed"); + TQString XKDEAutoEmbed = TQString::fromLatin1("X-KDE-AutoEmbed"); if ( config->hasKey( XKDEAutoEmbed ) ) - m_mapProps.insert( XKDEAutoEmbed, QVariant( config->readBoolEntry( XKDEAutoEmbed ), 0 ) ); + m_mapProps.insert( XKDEAutoEmbed, TQVariant( config->readBoolEntry( XKDEAutoEmbed ), 0 ) ); - QString XKDEText = QString::fromLatin1("X-KDE-text"); + TQString XKDEText = TQString::fromLatin1("X-KDE-text"); if ( config->hasKey( XKDEText ) ) m_mapProps.insert( XKDEText, config->readBoolEntry( XKDEText ) ); - QString XKDEIsAlso = QString::fromLatin1("X-KDE-IsAlso"); + TQString XKDEIsAlso = TQString::fromLatin1("X-KDE-IsAlso"); if ( config->hasKey( XKDEIsAlso ) ) { - QString inherits = config->readEntry( XKDEIsAlso ); + TQString inherits = config->readEntry( XKDEIsAlso ); if ( inherits != name() ) m_mapProps.insert( XKDEIsAlso, inherits ); else kdWarning(7009) << "Error: " << inherits << " inherits from itself!!!!" << endl; } - QString XKDEPatternsAccuracy = QString::fromLatin1("X-KDE-PatternsAccuracy"); + TQString XKDEPatternsAccuracy = TQString::fromLatin1("X-KDE-PatternsAccuracy"); if ( config->hasKey( XKDEPatternsAccuracy ) ) m_mapProps.insert( XKDEPatternsAccuracy, config->readEntry( XKDEPatternsAccuracy ) ); } -KMimeType::KMimeType( QDataStream& _str, int offset ) : KServiceType( _str, offset ) +KMimeType::KMimeType( TQDataStream& _str, int offset ) : KServiceType( _str, offset ) { loadInternal( _str ); // load our specific stuff } -void KMimeType::load( QDataStream& _str ) +void KMimeType::load( TQDataStream& _str ) { KServiceType::load( _str ); loadInternal( _str ); } -void KMimeType::loadInternal( QDataStream& _str ) +void KMimeType::loadInternal( TQDataStream& _str ) { - // kdDebug(7009) << "KMimeType::load( QDataStream& ) : loading list of patterns" << endl; + // kdDebug(7009) << "KMimeType::load( TQDataStream& ) : loading list of patterns" << endl; _str >> m_lstPatterns; } -void KMimeType::save( QDataStream& _str ) +void KMimeType::save( TQDataStream& _str ) { KServiceType::save( _str ); // Warning adding/removing fields here involves a binary incompatible change - update version @@ -430,17 +430,17 @@ void KMimeType::save( QDataStream& _str ) _str << m_lstPatterns; } -QVariant KMimeType::property( const QString& _name ) const +TQVariant KMimeType::property( const TQString& _name ) const { if ( _name == "Patterns" ) - return QVariant( m_lstPatterns ); + return TQVariant( m_lstPatterns ); return KServiceType::property( _name ); } -QStringList KMimeType::propertyNames() const +TQStringList KMimeType::propertyNames() const { - QStringList res = KServiceType::propertyNames(); + TQStringList res = KServiceType::propertyNames(); res.append( "Patterns" ); return res; @@ -450,14 +450,14 @@ KMimeType::~KMimeType() { } -QPixmap KMimeType::pixmap( KIcon::Group _group, int _force_size, int _state, - QString * _path ) const +TQPixmap KMimeType::pixmap( KIcon::Group _group, int _force_size, int _state, + TQString * _path ) const { KIconLoader *iconLoader=KGlobal::iconLoader(); - QString iconName=icon( QString::null, false ); + TQString iconName=icon( TQString::null, false ); if (!iconLoader->extraDesktopThemesAdded()) { - QPixmap pixmap=iconLoader->loadIcon( iconName, _group, _force_size, _state, _path, true ); + TQPixmap pixmap=iconLoader->loadIcon( iconName, _group, _force_size, _state, _path, true ); if (!pixmap.isNull() ) return pixmap; iconLoader->addExtraDesktopThemes(); @@ -466,14 +466,14 @@ QPixmap KMimeType::pixmap( KIcon::Group _group, int _force_size, int _state, return iconLoader->loadIcon( iconName , _group, _force_size, _state, _path, false ); } -QPixmap KMimeType::pixmap( const KURL& _url, KIcon::Group _group, int _force_size, - int _state, QString * _path ) const +TQPixmap KMimeType::pixmap( const KURL& _url, KIcon::Group _group, int _force_size, + int _state, TQString * _path ) const { KIconLoader *iconLoader=KGlobal::iconLoader(); - QString iconName=icon( _url, _url.isLocalFile() ); + TQString iconName=icon( _url, _url.isLocalFile() ); if (!iconLoader->extraDesktopThemesAdded()) { - QPixmap pixmap=iconLoader->loadIcon( iconName, _group, _force_size, _state, _path, true ); + TQPixmap pixmap=iconLoader->loadIcon( iconName, _group, _force_size, _state, _path, true ); if (!pixmap.isNull() ) return pixmap; iconLoader->addExtraDesktopThemes(); @@ -482,15 +482,15 @@ QPixmap KMimeType::pixmap( const KURL& _url, KIcon::Group _group, int _force_siz return iconLoader->loadIcon( iconName , _group, _force_size, _state, _path, false ); } -QPixmap KMimeType::pixmapForURL( const KURL & _url, mode_t _mode, KIcon::Group _group, - int _force_size, int _state, QString * _path ) +TQPixmap KMimeType::pixmapForURL( const KURL & _url, mode_t _mode, KIcon::Group _group, + int _force_size, int _state, TQString * _path ) { KIconLoader *iconLoader=KGlobal::iconLoader(); - QString iconName = iconForURL( _url, _mode ); + TQString iconName = iconForURL( _url, _mode ); if (!iconLoader->extraDesktopThemesAdded()) { - QPixmap pixmap=iconLoader->loadIcon( iconName, _group, _force_size, _state, _path, true ); + TQPixmap pixmap=iconLoader->loadIcon( iconName, _group, _force_size, _state, _path, true ); if (!pixmap.isNull() ) return pixmap; iconLoader->addExtraDesktopThemes(); @@ -500,13 +500,13 @@ QPixmap KMimeType::pixmapForURL( const KURL & _url, mode_t _mode, KIcon::Group _ } -QString KMimeType::iconForURL( const KURL & _url, mode_t _mode ) +TQString KMimeType::iconForURL( const KURL & _url, mode_t _mode ) { const KMimeType::Ptr mt = findByURL( _url, _mode, _url.isLocalFile(), false /*HACK*/); - static const QString& unknown = KGlobal::staticQString("unknown"); - const QString mimeTypeIcon = mt->icon( _url, _url.isLocalFile() ); - QString i = mimeTypeIcon; + static const TQString& unknown = KGlobal::staticQString("unknown"); + const TQString mimeTypeIcon = mt->icon( _url, _url.isLocalFile() ); + TQString i = mimeTypeIcon; // if we don't find an icon, maybe we can use the one for the protocol if ( i == unknown || i.isEmpty() || mt == defaultMimeTypePtr() @@ -525,7 +525,7 @@ QString KMimeType::iconForURL( const KURL & _url, mode_t _mode ) return i; } -QString KMimeType::favIconForURL( const KURL& url ) +TQString KMimeType::favIconForURL( const KURL& url ) { // this method will be called quite often, so better not read the config // again and again. @@ -540,27 +540,27 @@ QString KMimeType::favIconForURL( const KURL& url ) if ( url.isLocalFile() || !url.protocol().startsWith("http") || !useFavIcons ) - return QString::null; + return TQString::null; DCOPRef kded( "kded", "favicons" ); DCOPReply result = kded.call( "iconForURL(KURL)", url ); if ( result.isValid() ) return result; - return QString::null; + return TQString::null; } -QString KMimeType::parentMimeType() const +TQString KMimeType::parentMimeType() const { - QVariant v = property("X-KDE-IsAlso"); + TQVariant v = property("X-KDE-IsAlso"); return v.toString(); } -bool KMimeType::is( const QString& mimeTypeName ) const +bool KMimeType::is( const TQString& mimeTypeName ) const { if ( name() == mimeTypeName ) return true; - QString st = parentMimeType(); + TQString st = parentMimeType(); //if (st.isEmpty()) kdDebug(7009)<<"Parent mimetype is empty"<<endl; while ( !st.isEmpty() ) { @@ -575,7 +575,7 @@ bool KMimeType::is( const QString& mimeTypeName ) const } int KMimeType::patternsAccuracy() const { - QVariant v = property("X-KDE-PatternsAccuracy"); + TQVariant v = property("X-KDE-PatternsAccuracy"); if (!v.isValid()) return 100; else return v.toInt(); @@ -588,7 +588,7 @@ int KMimeType::patternsAccuracy() const { * ******************************************************/ -QString KFolderType::icon( const QString& _url, bool _is_local ) const +TQString KFolderType::icon( const TQString& _url, bool _is_local ) const { if ( !_is_local || _url.isEmpty() ) return KMimeType::icon( _url, _is_local ); @@ -596,7 +596,7 @@ QString KFolderType::icon( const QString& _url, bool _is_local ) const return KFolderType::icon( KURL(_url), _is_local ); } -QString KFolderType::icon( const KURL& _url, bool _is_local ) const +TQString KFolderType::icon( const KURL& _url, bool _is_local ) const { if ( !_is_local ) return KMimeType::icon( _url, _is_local ); @@ -604,7 +604,7 @@ QString KFolderType::icon( const KURL& _url, bool _is_local ) const KURL u( _url ); u.addPath( ".directory" ); - QString icon; + TQString icon; // using KStandardDirs as this one checks for path being // a file instead of a directory if ( KStandardDirs::exists( u.path() ) ) @@ -612,17 +612,17 @@ QString KFolderType::icon( const KURL& _url, bool _is_local ) const KSimpleConfig cfg( u.path(), true ); cfg.setDesktopGroup(); icon = cfg.readEntry( "Icon" ); - QString empty_icon = cfg.readEntry( "EmptyIcon" ); + TQString empty_icon = cfg.readEntry( "EmptyIcon" ); if ( !empty_icon.isEmpty() ) { bool isempty = false; DIR *dp = 0L; struct dirent *ep; - dp = opendir( QFile::encodeName(_url.path()) ); + dp = opendir( TQFile::encodeName(_url.path()) ); if ( dp ) { - QValueList<QCString> entries; + TQValueList<TQCString> entries; // Note that readdir isn't guaranteed to return "." and ".." first (#79826) ep=readdir( dp ); if ( ep ) entries.append( ep->d_name ); ep=readdir( dp ); if ( ep ) entries.append( ep->d_name ); @@ -661,7 +661,7 @@ QString KFolderType::icon( const KURL& _url, bool _is_local ) const return icon; } -QString KFolderType::comment( const QString& _url, bool _is_local ) const +TQString KFolderType::comment( const TQString& _url, bool _is_local ) const { if ( !_is_local || _url.isEmpty() ) return KMimeType::comment( _url, _is_local ); @@ -669,7 +669,7 @@ QString KFolderType::comment( const QString& _url, bool _is_local ) const return KFolderType::comment( KURL(_url), _is_local ); } -QString KFolderType::comment( const KURL& _url, bool _is_local ) const +TQString KFolderType::comment( const KURL& _url, bool _is_local ) const { if ( !_is_local ) return KMimeType::comment( _url, _is_local ); @@ -679,7 +679,7 @@ QString KFolderType::comment( const KURL& _url, bool _is_local ) const KSimpleConfig cfg( u.path(), true ); cfg.setDesktopGroup(); - QString comment = cfg.readEntry( "Comment" ); + TQString comment = cfg.readEntry( "Comment" ); if ( comment.isEmpty() ) return KMimeType::comment( _url, _is_local ); @@ -692,7 +692,7 @@ QString KFolderType::comment( const KURL& _url, bool _is_local ) const * ******************************************************/ -QString KDEDesktopMimeType::icon( const QString& _url, bool _is_local ) const +TQString KDEDesktopMimeType::icon( const TQString& _url, bool _is_local ) const { if ( !_is_local || _url.isEmpty() ) return KMimeType::icon( _url, _is_local ); @@ -701,32 +701,32 @@ QString KDEDesktopMimeType::icon( const QString& _url, bool _is_local ) const return icon( u, _is_local ); } -QString KDEDesktopMimeType::icon( const KURL& _url, bool _is_local ) const +TQString KDEDesktopMimeType::icon( const KURL& _url, bool _is_local ) const { if ( !_is_local ) return KMimeType::icon( _url, _is_local ); KSimpleConfig cfg( _url.path(), true ); cfg.setDesktopGroup(); - QString icon = cfg.readEntry( "Icon" ); - QString type = cfg.readEntry( "Type" ); + TQString icon = cfg.readEntry( "Icon" ); + TQString type = cfg.readEntry( "Type" ); if ( type == "FSDevice" || type == "FSDev") // need to provide FSDev for // backwards compatibility { - QString unmount_icon = cfg.readEntry( "UnmountIcon" ); - QString dev = cfg.readEntry( "Dev" ); + TQString unmount_icon = cfg.readEntry( "UnmountIcon" ); + TQString dev = cfg.readEntry( "Dev" ); if ( !icon.isEmpty() && !unmount_icon.isEmpty() && !dev.isEmpty() ) { - QString mp = KIO::findDeviceMountPoint( dev ); + TQString mp = KIO::findDeviceMountPoint( dev ); // Is the device not mounted ? if ( mp.isNull() ) return unmount_icon; } } else if ( type == "Link" ) { - const QString emptyIcon = cfg.readEntry( "EmptyIcon" ); + const TQString emptyIcon = cfg.readEntry( "EmptyIcon" ); if ( !emptyIcon.isEmpty() ) { - const QString u = cfg.readPathEntry( "URL" ); + const TQString u = cfg.readPathEntry( "URL" ); const KURL url( u ); if ( url.protocol() == "trash" ) { // We need to find if the trash is empty, preferrably without using a KIO job. @@ -746,11 +746,11 @@ QString KDEDesktopMimeType::icon( const KURL& _url, bool _is_local ) const return icon; } -QPixmap KDEDesktopMimeType::pixmap( const KURL& _url, KIcon::Group _group, int _force_size, - int _state, QString * _path ) const +TQPixmap KDEDesktopMimeType::pixmap( const KURL& _url, KIcon::Group _group, int _force_size, + int _state, TQString * _path ) const { - QString _icon = icon( _url, _url.isLocalFile() ); - QPixmap pix = KGlobal::iconLoader()->loadIcon( _icon, _group, + TQString _icon = icon( _url, _url.isLocalFile() ); + TQPixmap pix = KGlobal::iconLoader()->loadIcon( _icon, _group, _force_size, _state, _path, false ); if ( pix.isNull() ) pix = KGlobal::iconLoader()->loadIcon( "unknown", _group, @@ -758,7 +758,7 @@ QPixmap KDEDesktopMimeType::pixmap( const KURL& _url, KIcon::Group _group, int _ return pix; } -QString KDEDesktopMimeType::comment( const QString& _url, bool _is_local ) const +TQString KDEDesktopMimeType::comment( const TQString& _url, bool _is_local ) const { if ( !_is_local || _url.isEmpty() ) return KMimeType::comment( _url, _is_local ); @@ -767,14 +767,14 @@ QString KDEDesktopMimeType::comment( const QString& _url, bool _is_local ) const return comment( u, _is_local ); } -QString KDEDesktopMimeType::comment( const KURL& _url, bool _is_local ) const +TQString KDEDesktopMimeType::comment( const KURL& _url, bool _is_local ) const { if ( !_is_local ) return KMimeType::comment( _url, _is_local ); KSimpleConfig cfg( _url.path(), true ); cfg.setDesktopGroup(); - QString comment = cfg.readEntry( "Comment" ); + TQString comment = cfg.readEntry( "Comment" ); if ( comment.isEmpty() ) return KMimeType::comment( _url, _is_local ); @@ -790,10 +790,10 @@ pid_t KDEDesktopMimeType::run( const KURL& u, bool _is_local ) KSimpleConfig cfg( u.path(), true ); cfg.setDesktopGroup(); - QString type = cfg.readEntry( "Type" ); + TQString type = cfg.readEntry( "Type" ); if ( type.isEmpty() ) { - QString tmp = i18n("The desktop entry file %1 " + TQString tmp = i18n("The desktop entry file %1 " "has no Type=... entry.").arg(u.path() ); KMessageBoxWrapper::error( 0, tmp); return 0; @@ -814,7 +814,7 @@ pid_t KDEDesktopMimeType::run( const KURL& u, bool _is_local ) return runMimeType( u, cfg ); - QString tmp = i18n("The desktop entry of type\n%1\nis unknown.").arg( type ); + TQString tmp = i18n("The desktop entry of type\n%1\nis unknown.").arg( type ); KMessageBoxWrapper::error( 0, tmp); return 0; @@ -824,31 +824,31 @@ pid_t KDEDesktopMimeType::runFSDevice( const KURL& _url, const KSimpleConfig &cf { pid_t retval = 0; - QString dev = cfg.readEntry( "Dev" ); + TQString dev = cfg.readEntry( "Dev" ); if ( dev.isEmpty() ) { - QString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.").arg( _url.path() ); + TQString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.").arg( _url.path() ); KMessageBoxWrapper::error( 0, tmp); return retval; } - QString mp = KIO::findDeviceMountPoint( dev ); + TQString mp = KIO::findDeviceMountPoint( dev ); // Is the device already mounted ? if ( !mp.isNull() ) { KURL mpURL; mpURL.setPath( mp ); // Open a new window - retval = KRun::runURL( mpURL, QString::fromLatin1("inode/directory") ); + retval = KRun::runURL( mpURL, TQString::fromLatin1("inode/directory") ); } else { bool ro = cfg.readBoolEntry( "ReadOnly", false ); - QString fstype = cfg.readEntry( "FSType" ); + TQString fstype = cfg.readEntry( "FSType" ); if ( fstype == "Default" ) // KDE-1 thing - fstype = QString::null; - QString point = cfg.readEntry( "MountPoint" ); + fstype = TQString::null; + TQString point = cfg.readEntry( "MountPoint" ); #ifndef Q_WS_WIN (void) new KAutoMount( ro, fstype, dev, point, _url.path() ); #endif @@ -858,7 +858,7 @@ pid_t KDEDesktopMimeType::runFSDevice( const KURL& _url, const KSimpleConfig &cf return retval; } -pid_t KDEDesktopMimeType::runApplication( const KURL& , const QString & _serviceFile ) +pid_t KDEDesktopMimeType::runApplication( const KURL& , const TQString & _serviceFile ) { KService s( _serviceFile ); if ( !s.isValid() ) @@ -871,10 +871,10 @@ pid_t KDEDesktopMimeType::runApplication( const KURL& , const QString & _service pid_t KDEDesktopMimeType::runLink( const KURL& _url, const KSimpleConfig &cfg ) { - QString u = cfg.readPathEntry( "URL" ); + TQString u = cfg.readPathEntry( "URL" ); if ( u.isEmpty() ) { - QString tmp = i18n("The desktop entry file\n%1\nis of type Link but has no URL=... entry.").arg( _url.prettyURL() ); + TQString tmp = i18n("The desktop entry file\n%1\nis of type Link but has no URL=... entry.").arg( _url.prettyURL() ); KMessageBoxWrapper::error( 0, tmp ); return 0; } @@ -885,7 +885,7 @@ pid_t KDEDesktopMimeType::runLink( const KURL& _url, const KSimpleConfig &cfg ) // X-KDE-LastOpenedWith holds the service desktop entry name that // was should be preferred for opening this URL if possible. // This is used by the Recent Documents menu for instance. - QString lastOpenedWidth = cfg.readEntry( "X-KDE-LastOpenedWith" ); + TQString lastOpenedWidth = cfg.readEntry( "X-KDE-LastOpenedWith" ); if ( !lastOpenedWidth.isEmpty() ) run->setPreferredService( lastOpenedWidth ); @@ -897,7 +897,7 @@ pid_t KDEDesktopMimeType::runMimeType( const KURL& url , const KSimpleConfig & ) // Hmm, can't really use keditfiletype since we might be looking // at the global file, or at a file not in share/mimelnk... - QStringList args; + TQStringList args; args << "openProperties"; args << url.path(); @@ -911,31 +911,31 @@ pid_t KDEDesktopMimeType::runMimeType( const KURL& url , const KSimpleConfig & ) return p.pid(); } -QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::builtinServices( const KURL& _url ) +TQValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::builtinServices( const KURL& _url ) { - QValueList<Service> result; + TQValueList<Service> result; if ( !_url.isLocalFile() ) return result; KSimpleConfig cfg( _url.path(), true ); cfg.setDesktopGroup(); - QString type = cfg.readEntry( "Type" ); + TQString type = cfg.readEntry( "Type" ); if ( type.isEmpty() ) return result; if ( type == "FSDevice" ) { - QString dev = cfg.readEntry( "Dev" ); + TQString dev = cfg.readEntry( "Dev" ); if ( dev.isEmpty() ) { - QString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.").arg( _url.path() ); + TQString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.").arg( _url.path() ); KMessageBoxWrapper::error( 0, tmp); } else { - QString mp = KIO::findDeviceMountPoint( dev ); + TQString mp = KIO::findDeviceMountPoint( dev ); // not mounted ? if ( mp.isEmpty() ) { @@ -964,20 +964,20 @@ QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::builtinServices( con return result; } -QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( const QString& path, bool bLocalFiles ) +TQValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( const TQString& path, bool bLocalFiles ) { KSimpleConfig cfg( path, true ); return userDefinedServices( path, cfg, bLocalFiles ); } -QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( const QString& path, KConfig& cfg, bool bLocalFiles ) +TQValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( const TQString& path, KConfig& cfg, bool bLocalFiles ) { return userDefinedServices( path, cfg, bLocalFiles, KURL::List() ); } -QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( const QString& path, KConfig& cfg, bool bLocalFiles, const KURL::List & file_list ) +TQValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( const TQString& path, KConfig& cfg, bool bLocalFiles, const KURL::List & file_list ) { - QValueList<Service> result; + TQValueList<Service> result; cfg.setDesktopGroup(); @@ -986,35 +986,35 @@ QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( if ( cfg.hasKey( "TryExec" ) ) { - QString tryexec = cfg.readPathEntry( "TryExec" ); - QString exe = KStandardDirs::findExe( tryexec ); + TQString tryexec = cfg.readPathEntry( "TryExec" ); + TQString exe = KStandardDirs::findExe( tryexec ); if (exe.isEmpty()) { return result; } } - QStringList keys; + TQStringList keys; if( cfg.hasKey( "X-KDE-GetActionMenu" )) { - QString dcopcall = cfg.readEntry( "X-KDE-GetActionMenu" ); - const QCString app = dcopcall.section(' ', 0,0).utf8(); + TQString dcopcall = cfg.readEntry( "X-KDE-GetActionMenu" ); + const TQCString app = dcopcall.section(' ', 0,0).utf8(); - QByteArray dataToSend; - QDataStream dataStream(dataToSend, IO_WriteOnly); + TQByteArray dataToSend; + TQDataStream dataStream(dataToSend, IO_WriteOnly); dataStream << file_list; - QCString replyType; - QByteArray replyData; - QCString object = dcopcall.section(' ', 1,-2).utf8(); - QString function = dcopcall.section(' ', -1); + TQCString replyType; + TQByteArray replyData; + TQCString object = dcopcall.section(' ', 1,-2).utf8(); + TQString function = dcopcall.section(' ', -1); if(!function.endsWith("(KURL::List)")) { kdWarning() << "Desktop file " << path << " contains an invalid X-KDE-ShowIfDcopCall - the function must take the exact parameter (KURL::List) and must be specified." << endl; } else { if(kapp->dcopClient()->call( app, object, function.utf8(), dataToSend, replyType, replyData, true, -1) - && replyType == "QStringList" ) { + && replyType == "TQStringList" ) { - QDataStream dataStreamIn(replyData, IO_ReadOnly); + TQDataStream dataStreamIn(replyData, IO_ReadOnly); dataStreamIn >> keys; } } @@ -1025,13 +1025,13 @@ QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( if ( keys.count() == 0 ) return result; - QStringList::ConstIterator it = keys.begin(); - QStringList::ConstIterator end = keys.end(); + TQStringList::ConstIterator it = keys.begin(); + TQStringList::ConstIterator end = keys.end(); for ( ; it != end; ++it ) { //kdDebug(7009) << "CURRENT KEY = " << (*it) << endl; - QString group = *it; + TQString group = *it; if (group == "_SEPARATOR_") { @@ -1052,7 +1052,7 @@ QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( bInvalidMenu = true; else { - QString exec = cfg.readPathEntry( "Exec" ); + TQString exec = cfg.readPathEntry( "Exec" ); if ( bLocalFiles || exec.contains("%U") || exec.contains("%u") ) { Service s; @@ -1070,7 +1070,7 @@ QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( if ( bInvalidMenu ) { - QString tmp = i18n("The desktop entry file\n%1\n has an invalid menu entry\n%2.").arg( path ).arg( *it ); + TQString tmp = i18n("The desktop entry file\n%1\n has an invalid menu entry\n%2.").arg( path ).arg( *it ); KMessageBoxWrapper::error( 0, tmp ); } } @@ -1078,7 +1078,7 @@ QValueList<KDEDesktopMimeType::Service> KDEDesktopMimeType::userDefinedServices( return result; } -void KDEDesktopMimeType::executeService( const QString& _url, KDEDesktopMimeType::Service& _service ) +void KDEDesktopMimeType::executeService( const TQString& _url, KDEDesktopMimeType::Service& _service ) { KURL u; u.setPath(_url); @@ -1104,19 +1104,19 @@ void KDEDesktopMimeType::executeService( const KURL::List& urls, KDEDesktopMimeT else if ( _service.m_type == ST_MOUNT || _service.m_type == ST_UNMOUNT ) { Q_ASSERT( urls.count() == 1 ); - QString path = urls.first().path(); + TQString path = urls.first().path(); //kdDebug(7009) << "MOUNT&UNMOUNT" << endl; KSimpleConfig cfg( path, true ); cfg.setDesktopGroup(); - QString dev = cfg.readEntry( "Dev" ); + TQString dev = cfg.readEntry( "Dev" ); if ( dev.isEmpty() ) { - QString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.").arg( path ); + TQString tmp = i18n("The desktop entry file\n%1\nis of type FSDevice but has no Dev=... entry.").arg( path ); KMessageBoxWrapper::error( 0, tmp ); return; } - QString mp = KIO::findDeviceMountPoint( dev ); + TQString mp = KIO::findDeviceMountPoint( dev ); if ( _service.m_type == ST_MOUNT ) { @@ -1128,10 +1128,10 @@ void KDEDesktopMimeType::executeService( const KURL::List& urls, KDEDesktopMimeT } bool ro = cfg.readBoolEntry( "ReadOnly", false ); - QString fstype = cfg.readEntry( "FSType" ); + TQString fstype = cfg.readEntry( "FSType" ); if ( fstype == "Default" ) // KDE-1 thing - fstype = QString::null; - QString point = cfg.readEntry( "MountPoint" ); + fstype = TQString::null; + TQString point = cfg.readEntry( "MountPoint" ); #ifndef Q_WS_WIN (void)new KAutoMount( ro, fstype, dev, point, path, false ); #endif @@ -1151,9 +1151,9 @@ void KDEDesktopMimeType::executeService( const KURL::List& urls, KDEDesktopMimeT assert( 0 ); } -const QString & KMimeType::defaultMimeType() +const TQString & KMimeType::defaultMimeType() { - static const QString & s_strDefaultMimeType = + static const TQString & s_strDefaultMimeType = KGlobal::staticQString( "application/octet-stream" ); return s_strDefaultMimeType; } diff --git a/kio/kio/kmimetype.h b/kio/kio/kmimetype.h index 0e1477c64..22f9b72ef 100644 --- a/kio/kio/kmimetype.h +++ b/kio/kio/kmimetype.h @@ -23,9 +23,9 @@ #include <sys/types.h> #include <sys/stat.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qpixmap.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqpixmap.h> #include <kicontheme.h> #include <kurl.h> @@ -50,7 +50,7 @@ class KIO_EXPORT KMimeType : public KServiceType public: typedef KSharedPtr<KMimeType> Ptr; - typedef QValueList<Ptr> List; + typedef TQValueList<Ptr> List; public: /** * Constructor. @@ -65,14 +65,14 @@ public: * @param _patterns a list of file globs that describes the names (or * extensions) of the files with this mime type */ - KMimeType( const QString & _fullpath, const QString& _type, const QString& _icon, - const QString& _comment, const QStringList& _patterns ); + KMimeType( const TQString & _fullpath, const TQString& _type, const TQString& _icon, + const TQString& _comment, const TQStringList& _patterns ); /** * Construct a mimetype and take all information from a config file. * @param _fullpath the path to the configuration file (.desktop) */ - KMimeType( const QString & _fullpath ); + KMimeType( const TQString & _fullpath ); /** * Construct a mimetype and take all information from a desktop file. @@ -85,7 +85,7 @@ public: * * The stream must already be positionned at the correct offset */ - KMimeType( QDataStream& _str, int offset ); + KMimeType( TQDataStream& _str, int offset ); virtual ~KMimeType(); @@ -97,7 +97,7 @@ public: * * @return The path to the icon associated with this MIME type. */ - virtual QString icon( const QString& , bool ) const { return m_strIcon; } + virtual TQString icon( const TQString& , bool ) const { return m_strIcon; } /** * Return the filename of the icon associated with the mimetype. @@ -107,7 +107,7 @@ public: * * @return The path to the icon associated with this MIME type. */ - virtual QString icon( const KURL& , bool ) const { return m_strIcon; } + virtual TQString icon( const KURL& , bool ) const { return m_strIcon; } /** * Use this function only if you don't have a special URL @@ -126,8 +126,8 @@ public: * Ignored if 0 * @return the pixmap of the mime type, can be a default icon if not found */ - virtual QPixmap pixmap( KIcon::Group group, int force_size = 0, int state = 0, - QString * path = 0L ) const; + virtual TQPixmap pixmap( KIcon::Group group, int force_size = 0, int state = 0, + TQString * path = 0L ) const; /** * Find the pixmap for a given file of this mimetype. @@ -145,8 +145,8 @@ public: * Ignored if 0 * @return the pixmap of the URL, can be a default icon if not found */ - virtual QPixmap pixmap( const KURL& _url, KIcon::Group _group, int _force_size = 0, - int _state = 0, QString * _path = 0L ) const; + virtual TQPixmap pixmap( const KURL& _url, KIcon::Group _group, int _force_size = 0, + int _state = 0, TQString * _path = 0L ) const; /** * Convenience method to find the pixmap for a URL. @@ -166,8 +166,8 @@ public: * Ignored if 0 * @return the pixmap of the URL, can be a default icon if not found */ - static QPixmap pixmapForURL( const KURL & _url, mode_t _mode = 0, KIcon::Group _group = KIcon::Desktop, - int _force_size = 0, int _state = 0, QString * _path = 0L ); + static TQPixmap pixmapForURL( const KURL & _url, mode_t _mode = 0, KIcon::Group _group = KIcon::Desktop, + int _force_size = 0, int _state = 0, TQString * _path = 0L ); /** @@ -182,24 +182,24 @@ public: * @return the name of the icon. The name of a default icon if there is no icon * for the mime type */ - static QString iconForURL( const KURL & _url, mode_t _mode = 0 ); + static TQString iconForURL( const KURL & _url, mode_t _mode = 0 ); /** * Return the "favicon" (see http://www.favicon.com) for the given @p url, * if available. Does NOT attempt to download the favicon, it only returns * one that is already available. * - * If unavailable, returns QString::null. + * If unavailable, returns TQString::null. * @param url the URL of the favicon - * @return the name of the favicon, or QString::null + * @return the name of the favicon, or TQString::null */ - static QString favIconForURL( const KURL& url ); + static TQString favIconForURL( const KURL& url ); /** * Returns the descriptive comment associated with the MIME type. * @return the descriptive comment associated with the MIME type */ - QString comment() const { return m_strComment; } + TQString comment() const { return m_strComment; } /** * Returns the descriptive comment associated with the MIME type. @@ -208,7 +208,7 @@ public: * * @return The descriptive comment associated with the MIME type, if any. */ - virtual QString comment( const QString&, bool ) const { return m_strComment; } + virtual TQString comment( const TQString&, bool ) const { return m_strComment; } /** * Returns the descriptive comment associated with the MIME type. @@ -217,26 +217,26 @@ public: * * @return The descriptive comment associated with the MIME type, if any. */ - virtual QString comment( const KURL&, bool ) const { return m_strComment; } + virtual TQString comment( const KURL&, bool ) const { return m_strComment; } /** * Retrieve the list of patterns associated with the MIME Type. * @return a list of file globs that describe the file names * (or, usually, the extensions) of files with this mime type */ - const QStringList& patterns() const { return m_lstPatterns; } + const TQStringList& patterns() const { return m_lstPatterns; } /** * Load the mimetype from a stream. * @param qs the stream to load from */ - virtual void load( QDataStream &qs ); + virtual void load( TQDataStream &qs ); /** * Save the mimetype to a stream. * @param qs the stream to save to */ - virtual void save( QDataStream &qs ); + virtual void save( TQDataStream &qs ); /** * Returns the property with the given @p _name. @@ -244,7 +244,7 @@ public: * @return the value of the property * @see propertyNames() */ - virtual QVariant property( const QString& _name ) const; + virtual TQVariant property( const TQString& _name ) const; /** * Retrieves a list of all properties associated with this @@ -252,7 +252,7 @@ public: * @return a list of all property names * @see property() */ - virtual QStringList propertyNames() const; + virtual TQStringList propertyNames() const; /** * Retrieve a pointer to the mime type @p _name or a pointer to the default @@ -268,7 +268,7 @@ public: * not found * @see KServiceType::serviceType */ - static Ptr mimeType( const QString& _name ); + static Ptr mimeType( const TQString& _name ); /** * Finds a KMimeType with the given @p _url. @@ -330,7 +330,7 @@ public: * it is @em fast. * @return A pointer to the matching mimetype. 0L is never returned. */ - static Ptr findByPath( const QString& path, mode_t mode = 0, bool fast_mode = false ); + static Ptr findByPath( const TQString& path, mode_t mode = 0, bool fast_mode = false ); /** * Tries to find out the MIME type of a data chunk by looking for @@ -342,7 +342,7 @@ public: * @return a pointer to the KMimeType. application/octet-stream's KMimeType of the * type can not be found this way. */ - static Ptr findByContent( const QByteArray &data, int *accuracy=0 ); + static Ptr findByContent( const TQByteArray &data, int *accuracy=0 ); /** * Tries to find out the MIME type of a file by looking for @@ -357,7 +357,7 @@ public: * @return a pointer to the KMimeType. application/octet-stream's KMimeType of the * type can not be found this way. */ - static Ptr findByFileContent( const QString &fileName, int *accuracy=0 ); + static Ptr findByFileContent( const TQString &fileName, int *accuracy=0 ); struct Format{ bool text : 1; @@ -370,7 +370,7 @@ public: * or that would be human readable after decompression. * @since 3.2 */ - static Format findFormatByFileContent( const QString &fileName ); + static Format findFormatByFileContent( const TQString &fileName ); /** * Get all the mimetypes. @@ -390,7 +390,7 @@ public: * @return the name of the default mime type, always * "application/octet-stream" */ - static const QString & defaultMimeType(); + static const TQString & defaultMimeType(); /** * Returns the default mimetype. @@ -414,10 +414,10 @@ public: * since an application that handles the specific type doesn't necessarily handle * the base type. The opposite is true though. * - * @return the parent mime type, or QString::null if not set + * @return the parent mime type, or TQString::null if not set * @since 3.2 */ - QString parentMimeType() const; + TQString parentMimeType() const; /** * Do not use name()=="somename" anymore, to check for a given mimetype. @@ -425,24 +425,24 @@ public: * Warning, do not use inherits(), that's the servicetype inheritance concept! * @since 3.2 */ - bool is( const QString& mimeTypeName ) const; + bool is( const TQString& mimeTypeName ) const; /** * @internal * Determines the mimetype of file based on it's name and returns the * matching pattern if any. */ - static KMimeType::Ptr diagnoseFileName(const QString &file, QString &pattern); + static KMimeType::Ptr diagnoseFileName(const TQString &file, TQString &pattern); protected: - void loadInternal( QDataStream& ); + void loadInternal( TQDataStream& ); void init( KDesktopFile * ); /** * Signal a missing mime type. * @param _type the missinf mime type */ - static void errorMissingMimeType( const QString& _type ); + static void errorMissingMimeType( const TQString& _type ); /** * This function makes sure that the default mime type exists. @@ -458,7 +458,7 @@ protected: */ static bool s_bChecked; - QStringList m_lstPatterns; + TQStringList m_lstPatterns; static Ptr s_pDefaultType; @@ -479,21 +479,21 @@ class KIO_EXPORT KFolderType : public KMimeType K_SYCOCATYPE( KST_KFolderType, KMimeType ) public: -// KFolderType( const QString & _fullpath, const QString& _type, const QString& _icon, const QString& _comment, -// const QStringList& _patterns ); -// KFolderType( const QString & _fullpath ) : KMimeType( _fullpath ) { } +// KFolderType( const TQString & _fullpath, const TQString& _type, const TQString& _icon, const TQString& _comment, +// const TQStringList& _patterns ); +// KFolderType( const TQString & _fullpath ) : KMimeType( _fullpath ) { } /** * Construct a folder mimetype and take all information from a desktop file. * @param config the desktop configuration file that describes the mime type */ KFolderType( KDesktopFile *config) : KMimeType( config ) { } /** \internal */ - KFolderType( QDataStream& _str, int offset ) : KMimeType( _str, offset ) { } + KFolderType( TQDataStream& _str, int offset ) : KMimeType( _str, offset ) { } - virtual QString icon( const QString& _url, bool _is_local ) const; - virtual QString icon( const KURL& _url, bool _is_local ) const; - virtual QString comment( const QString& _url, bool _is_local ) const; - virtual QString comment( const KURL& _url, bool _is_local ) const; + virtual TQString icon( const TQString& _url, bool _is_local ) const; + virtual TQString icon( const KURL& _url, bool _is_local ) const; + virtual TQString comment( const TQString& _url, bool _is_local ) const; + virtual TQString comment( const KURL& _url, bool _is_local ) const; protected: virtual void virtual_hook( int id, void* data ); }; @@ -518,36 +518,36 @@ public: { Service() { m_display = true; } bool isEmpty() const { return m_strName.isEmpty(); } - QString m_strName; - QString m_strIcon; - QString m_strExec; + TQString m_strName; + TQString m_strIcon; + TQString m_strExec; ServiceType m_type; bool m_display; }; - // KDEDesktopMimeType( const QString & _fullpath, const QString& _type, const QString& _icon, - // const QString& _comment, const QStringList& _patterns ); - // KDEDesktopMimeType( const QString & _fullpath ) : KMimeType( _fullpath ) { } + // KDEDesktopMimeType( const TQString & _fullpath, const TQString& _type, const TQString& _icon, + // const TQString& _comment, const TQStringList& _patterns ); + // KDEDesktopMimeType( const TQString & _fullpath ) : KMimeType( _fullpath ) { } /** * Construct a desktop mimetype and take all information from a desktop file. * @param config the desktop configuration file that describes the mime type */ KDEDesktopMimeType( KDesktopFile *config) : KMimeType( config ) { } /** \internal */ - KDEDesktopMimeType( QDataStream& _str, int offset ) : KMimeType( _str, offset ) { } + KDEDesktopMimeType( TQDataStream& _str, int offset ) : KMimeType( _str, offset ) { } - virtual QString icon( const QString& _url, bool _is_local ) const; - virtual QString icon( const KURL& _url, bool _is_local ) const; - virtual QPixmap pixmap( const KURL& _url, KIcon::Group _group, int _force_size = 0, - int _state = 0, QString * _path = 0L ) const; - virtual QString comment( const QString& _url, bool _is_local ) const; - virtual QString comment( const KURL& _url, bool _is_local ) const; + virtual TQString icon( const TQString& _url, bool _is_local ) const; + virtual TQString icon( const KURL& _url, bool _is_local ) const; + virtual TQPixmap pixmap( const KURL& _url, KIcon::Group _group, int _force_size = 0, + int _state = 0, TQString * _path = 0L ) const; + virtual TQString comment( const TQString& _url, bool _is_local ) const; + virtual TQString comment( const KURL& _url, bool _is_local ) const; /** * Returns a list of services for the given .desktop file that are handled * by kio itself. Namely mount/unmount for FSDevice files. * @return the list of services */ - static QValueList<Service> builtinServices( const KURL& _url ); + static TQValueList<Service> builtinServices( const KURL& _url ); /** * Returns a list of services defined by the user as possible actions * on the given .desktop file. May include empty actions which represent where @@ -558,14 +558,14 @@ public: * (if false, services that don't have %u or %U in the Exec line won't be taken into account). * @return the list of user deviced actions */ - static QValueList<Service> userDefinedServices( const QString& path, bool bLocalFiles ); + static TQValueList<Service> userDefinedServices( const TQString& path, bool bLocalFiles ); /** * Overload of userDefinedServices for speed purposes: it takes a KConfig* so that * the caller can check things in the file without having it parsed twice. * @since 3.4 */ - static QValueList<Service> userDefinedServices( const QString& path, KConfig& config, bool bLocalFiles ); + static TQValueList<Service> userDefinedServices( const TQString& path, KConfig& config, bool bLocalFiles ); /** * Overload of userDefinedServices but also allows you to pass a list of urls for this file. @@ -573,14 +573,14 @@ public: * the X-KDE-GetActionMenu extension. * @since 3.5 */ - static QValueList<Service> userDefinedServices( const QString& path, KConfig& config, bool bLocalFiles, const KURL::List & file_list); + static TQValueList<Service> userDefinedServices( const TQString& path, KConfig& config, bool bLocalFiles, const KURL::List & file_list); /** * @param path is the path of the desktop entry. * @param service the service to execute * @deprecated, see the other executeService */ - static void executeService( const QString& path, KDEDesktopMimeType::Service& service ) KDE_DEPRECATED; + static void executeService( const TQString& path, KDEDesktopMimeType::Service& service ) KDE_DEPRECATED; /** * Execute @p service on the list of @p urls. @@ -603,12 +603,12 @@ public: static pid_t run( const KURL& _url, bool _is_local ); protected: - virtual QPixmap pixmap( KIcon::Group group, int force_size = 0, int state = 0, - QString * path = 0L ) const + virtual TQPixmap pixmap( KIcon::Group group, int force_size = 0, int state = 0, + TQString * path = 0L ) const { return KMimeType::pixmap( group, force_size, state, path ); } static pid_t runFSDevice( const KURL& _url, const KSimpleConfig &cfg ); - static pid_t runApplication( const KURL& _url, const QString & _serviceFile ); + static pid_t runApplication( const KURL& _url, const TQString & _serviceFile ); static pid_t runLink( const KURL& _url, const KSimpleConfig &cfg ); static pid_t runMimeType( const KURL& _url, const KSimpleConfig &cfg ); protected: @@ -624,16 +624,16 @@ class KIO_EXPORT KExecMimeType : public KMimeType K_SYCOCATYPE( KST_KExecMimeType, KMimeType ) public: - // KExecMimeType( const QString & _fullpath, const QString& _type, const QString& _icon, - // const QString& _comment, const QStringList& _patterns ); - // KExecMimeType( const QString & _fullpath ) : KMimeType( _fullpath ) { } + // KExecMimeType( const TQString & _fullpath, const TQString& _type, const TQString& _icon, + // const TQString& _comment, const TQStringList& _patterns ); + // KExecMimeType( const TQString & _fullpath ) : KMimeType( _fullpath ) { } /** * Construct a executable mimetype and take all information from a desktop file. * @param config the desktop configuration file that describes the mime type */ KExecMimeType( KDesktopFile *config) : KMimeType( config ) { } /** \internal */ - KExecMimeType( QDataStream& _str, int offset ) : KMimeType( _str, offset ) { } + KExecMimeType( TQDataStream& _str, int offset ) : KMimeType( _str, offset ) { } protected: virtual void virtual_hook( int id, void* data ); }; diff --git a/kio/kio/kmimetypechooser.cpp b/kio/kio/kmimetypechooser.cpp index d06861e1f..d8ceb930b 100644 --- a/kio/kio/kmimetypechooser.cpp +++ b/kio/kio/kmimetypechooser.cpp @@ -27,34 +27,34 @@ #include <krun.h> #include <ksycoca.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> //BEGIN KMimeTypeChooserPrivate class KMimeTypeChooserPrivate { public: KListView *lvMimeTypes; - QPushButton *btnEditMimeType; + TQPushButton *btnEditMimeType; - QString defaultgroup; - QStringList groups; + TQString defaultgroup; + TQStringList groups; int visuals; }; //END //BEGIN KMimeTypeChooser -KMimeTypeChooser::KMimeTypeChooser( const QString &text, - const QStringList &selMimeTypes, - const QString &defaultGroup, - const QStringList &groupsToShow, +KMimeTypeChooser::KMimeTypeChooser( const TQString &text, + const TQStringList &selMimeTypes, + const TQString &defaultGroup, + const TQStringList &groupsToShow, int visuals, - QWidget *parent, + TQWidget *parent, const char *name ) - : QVBox( parent, name ) + : TQVBox( parent, name ) { d = new KMimeTypeChooserPrivate(); d->lvMimeTypes = 0; @@ -67,18 +67,18 @@ KMimeTypeChooser::KMimeTypeChooser( const QString &text, if ( !text.isEmpty() ) { - new QLabel( text, this ); + new TQLabel( text, this ); } d->lvMimeTypes = new KListView( this ); d->lvMimeTypes->addColumn( i18n("Mime Type") ); -// d->lvMimeTypes->setColumnWidthMode( 0, QListView::Manual ); +// d->lvMimeTypes->setColumnWidthMode( 0, TQListView::Manual ); if ( visuals & Comments ) { d->lvMimeTypes->addColumn( i18n("Comment") ); - d->lvMimeTypes->setColumnWidthMode( 1, QListView::Manual ); + d->lvMimeTypes->setColumnWidthMode( 1, TQListView::Manual ); } if ( visuals & Patterns ) d->lvMimeTypes->addColumn( i18n("Patterns") ); @@ -89,18 +89,18 @@ KMimeTypeChooser::KMimeTypeChooser( const QString &text, if (visuals & KMimeTypeChooser::EditButton) { - QHBox *btns = new QHBox( this ); - ((QBoxLayout*)btns->layout())->addStretch(1); - d->btnEditMimeType = new QPushButton( i18n("&Edit..."), btns ); + TQHBox *btns = new TQHBox( this ); + ((TQBoxLayout*)btns->layout())->addStretch(1); + d->btnEditMimeType = new TQPushButton( i18n("&Edit..."), btns ); - connect( d->btnEditMimeType, SIGNAL(clicked()), this, SLOT(editMimeType()) ); + connect( d->btnEditMimeType, TQT_SIGNAL(clicked()), this, TQT_SLOT(editMimeType()) ); d->btnEditMimeType->setEnabled( false ); - connect( d->lvMimeTypes, SIGNAL( doubleClicked ( QListViewItem * )), - this, SLOT( editMimeType())); - connect( d->lvMimeTypes, SIGNAL(currentChanged(QListViewItem*)), - this, SLOT(slotCurrentChanged(QListViewItem*)) ); + connect( d->lvMimeTypes, TQT_SIGNAL( doubleClicked ( TQListViewItem * )), + this, TQT_SLOT( editMimeType())); + connect( d->lvMimeTypes, TQT_SIGNAL(currentChanged(TQListViewItem*)), + this, TQT_SLOT(slotCurrentChanged(TQListViewItem*)) ); - QWhatsThis::add( d->btnEditMimeType, i18n( + TQWhatsThis::add( d->btnEditMimeType, i18n( "Click this button to display the familiar KDE mime type editor.") ); } } @@ -110,9 +110,9 @@ KMimeTypeChooser::~KMimeTypeChooser() delete d; } -void KMimeTypeChooser::loadMimeTypes( const QStringList &_selectedMimeTypes ) +void KMimeTypeChooser::loadMimeTypes( const TQStringList &_selectedMimeTypes ) { - QStringList selMimeTypes; + TQStringList selMimeTypes; if ( !_selectedMimeTypes.isEmpty() ) selMimeTypes = _selectedMimeTypes; @@ -121,31 +121,31 @@ void KMimeTypeChooser::loadMimeTypes( const QStringList &_selectedMimeTypes ) d->lvMimeTypes->clear(); - QMap<QString,QListViewItem*> groups; + TQMap<TQString,TQListViewItem*> groups; // thanks to kdebase/kcontrol/filetypes/filetypesview KMimeType::List mimetypes = KMimeType::allMimeTypes(); - QValueListIterator<KMimeType::Ptr> it(mimetypes.begin()); + TQValueListIterator<KMimeType::Ptr> it(mimetypes.begin()); - QListViewItem *groupItem; + TQListViewItem *groupItem; bool agroupisopen = false; - QListViewItem *idefault = 0; //open this, if all other fails - QListViewItem *firstChecked = 0; // make this one visible after the loop + TQListViewItem *idefault = 0; //open this, if all other fails + TQListViewItem *firstChecked = 0; // make this one visible after the loop for (; it != mimetypes.end(); ++it) { - QString mimetype = (*it)->name(); + TQString mimetype = (*it)->name(); int index = mimetype.find("/"); - QString maj = mimetype.left(index); + TQString maj = mimetype.left(index); if ( d->groups.count() && !d->groups.contains( maj ) ) continue; - QString min = mimetype.right(mimetype.length() - (index+1)); + TQString min = mimetype.right(mimetype.length() - (index+1)); - QMapIterator<QString,QListViewItem*> mit = groups.find( maj ); + TQMapIterator<TQString,TQListViewItem*> mit = groups.find( maj ); if ( mit == groups.end() ) { - groupItem = new QListViewItem( d->lvMimeTypes, maj ); + groupItem = new TQListViewItem( d->lvMimeTypes, maj ); groups.insert( maj, groupItem ); if ( maj == d->defaultgroup ) idefault = groupItem; @@ -153,14 +153,14 @@ void KMimeTypeChooser::loadMimeTypes( const QStringList &_selectedMimeTypes ) else groupItem = mit.data(); - QCheckListItem *item = new QCheckListItem( groupItem, min, QCheckListItem::CheckBox ); - item->setPixmap( 0, SmallIcon( (*it)->icon(QString::null,false) ) ); + TQCheckListItem *item = new TQCheckListItem( groupItem, min, TQCheckListItem::CheckBox ); + item->setPixmap( 0, SmallIcon( (*it)->icon(TQString::null,false) ) ); int cl = 1; if ( d->visuals & Comments ) { - item->setText( cl, (*it)->comment(QString::null, false) ); + item->setText( cl, (*it)->comment(TQString::null, false) ); cl++; } @@ -191,18 +191,18 @@ void KMimeTypeChooser::editMimeType() { if ( !(d->lvMimeTypes->currentItem() && (d->lvMimeTypes->currentItem())->parent()) ) return; - QString mt = (d->lvMimeTypes->currentItem()->parent())->text( 0 ) + "/" + (d->lvMimeTypes->currentItem())->text( 0 ); + TQString mt = (d->lvMimeTypes->currentItem()->parent())->text( 0 ) + "/" + (d->lvMimeTypes->currentItem())->text( 0 ); // thanks to libkonq/konq_operations.cc - connect( KSycoca::self(), SIGNAL(databaseChanged()), - this, SLOT(slotSycocaDatabaseChanged()) ); - QString keditfiletype = QString::fromLatin1("keditfiletype"); + connect( KSycoca::self(), TQT_SIGNAL(databaseChanged()), + this, TQT_SLOT(slotSycocaDatabaseChanged()) ); + TQString keditfiletype = TQString::fromLatin1("keditfiletype"); KRun::runCommand( keditfiletype - + " --parent " + QString::number( (ulong)topLevelWidget()->winId()) + + " --parent " + TQString::number( (ulong)topLevelWidget()->winId()) + " " + KProcess::quote(mt), keditfiletype, keditfiletype /*unused*/); } -void KMimeTypeChooser::slotCurrentChanged(QListViewItem* i) +void KMimeTypeChooser::slotCurrentChanged(TQListViewItem* i) { if ( d->btnEditMimeType ) d->btnEditMimeType->setEnabled( i->parent() ); @@ -214,27 +214,27 @@ void KMimeTypeChooser::slotSycocaDatabaseChanged() loadMimeTypes(); } -QStringList KMimeTypeChooser::mimeTypes() const +TQStringList KMimeTypeChooser::mimeTypes() const { - QStringList l; - QListViewItemIterator it( d->lvMimeTypes ); + TQStringList l; + TQListViewItemIterator it( d->lvMimeTypes ); for (; it.current(); ++it) { - if ( it.current()->parent() && ((QCheckListItem*)it.current())->isOn() ) + if ( it.current()->parent() && ((TQCheckListItem*)it.current())->isOn() ) l << it.current()->parent()->text(0) + "/" + it.current()->text(0); // FIXME uncecked, should be Ok unless someone changes mimetypes during this! } return l; } -QStringList KMimeTypeChooser::patterns() const +TQStringList KMimeTypeChooser::patterns() const { - QStringList l; + TQStringList l; KMimeType::Ptr p; - QString defMT = KMimeType::defaultMimeType(); - QListViewItemIterator it( d->lvMimeTypes ); + TQString defMT = KMimeType::defaultMimeType(); + TQListViewItemIterator it( d->lvMimeTypes ); for (; it.current(); ++it) { - if ( it.current()->parent() && ((QCheckListItem*)it.current())->isOn() ) + if ( it.current()->parent() && ((TQCheckListItem*)it.current())->isOn() ) { p = KMimeType::mimeType( it.current()->parent()->text(0) + "/" + it.current()->text(0) ); if ( p->name() != defMT ) @@ -247,13 +247,13 @@ QStringList KMimeTypeChooser::patterns() const //BEGIN KMimeTypeChooserDialog KMimeTypeChooserDialog::KMimeTypeChooserDialog( - const QString &caption, - const QString& text, - const QStringList &selMimeTypes, - const QString &defaultGroup, - const QStringList &groupsToShow, + const TQString &caption, + const TQString& text, + const TQStringList &selMimeTypes, + const TQString &defaultGroup, + const TQStringList &groupsToShow, int visuals, - QWidget *parent, const char *name ) + TQWidget *parent, const char *name ) : KDialogBase(parent, name, true, caption, Cancel|Ok, Ok) { m_chooser = new KMimeTypeChooser( text, selMimeTypes, @@ -262,26 +262,26 @@ KMimeTypeChooserDialog::KMimeTypeChooserDialog( setMainWidget(m_chooser); KConfigGroup group( KGlobal::config(), "KMimeTypeChooserDialog"); - QSize defaultSize( 400, 300 ); + TQSize defaultSize( 400, 300 ); resize( group.readSizeEntry("size", &defaultSize) ); } KMimeTypeChooserDialog::KMimeTypeChooserDialog( - const QString &caption, - const QString& text, - const QStringList &selMimeTypes, - const QString &defaultGroup, - QWidget *parent, const char *name ) + const TQString &caption, + const TQString& text, + const TQStringList &selMimeTypes, + const TQString &defaultGroup, + TQWidget *parent, const char *name ) : KDialogBase(parent, name, true, caption, Cancel|Ok, Ok) { m_chooser = new KMimeTypeChooser( text, selMimeTypes, - defaultGroup, QStringList(), + defaultGroup, TQStringList(), KMimeTypeChooser::Comments|KMimeTypeChooser::Patterns|KMimeTypeChooser::EditButton, this, "chooser" ); setMainWidget(m_chooser); KConfigGroup group( KGlobal::config(), "KMimeTypeChooserDialog"); - QSize defaultSize( 400, 300 ); + TQSize defaultSize( 400, 300 ); resize( group.readSizeEntry("size", &defaultSize) ); } diff --git a/kio/kio/kmimetypechooser.h b/kio/kio/kmimetypechooser.h index 6fe7b3190..0827d5b30 100644 --- a/kio/kio/kmimetypechooser.h +++ b/kio/kio/kmimetypechooser.h @@ -19,7 +19,7 @@ #ifndef _KMIMETYPE_CHOOSER_H_ #define _KMIMETYPE_CHOOSER_H_ -#include <qvbox.h> +#include <tqvbox.h> #include <kdialogbase.h> @@ -59,22 +59,22 @@ class KIO_EXPORT KMimeTypeChooser : public QVBox * @param parent The parent widget to use * @param name The internal name of this object */ - KMimeTypeChooser( const QString& text=QString::null, - const QStringList &selectedMimeTypes=0, - const QString &defaultGroup=QString::null, - const QStringList &groupsToShow=QStringList(), + KMimeTypeChooser( const TQString& text=TQString::null, + const TQStringList &selectedMimeTypes=0, + const TQString &defaultGroup=TQString::null, + const TQStringList &groupsToShow=TQStringList(), int visuals=Comments|Patterns|EditButton, - QWidget *parent=0, const char *name=0 ); + TQWidget *parent=0, const char *name=0 ); ~KMimeTypeChooser(); /** * @return a list of all selected selected mimetypes represented by their name. */ - QStringList mimeTypes() const; + TQStringList mimeTypes() const; /** * @return a list of the fileame patterns associated with all selected mimetypes. */ - QStringList patterns() const; + TQStringList patterns() const; public slots: /** @@ -88,7 +88,7 @@ class KIO_EXPORT KMimeTypeChooser : public QVBox /** * @internal disables the "edit" button for groups */ - void slotCurrentChanged(QListViewItem* i); + void slotCurrentChanged(TQListViewItem* i); /** * @internal called when the sycoca database has changed after @@ -102,7 +102,7 @@ class KIO_EXPORT KMimeTypeChooser : public QVBox * If @p selected is empty, selectedMimeTypesStringList() is called * to fill it in. */ - void loadMimeTypes( const QStringList &selected=QStringList() ); + void loadMimeTypes( const TQStringList &selected=TQStringList() ); class KMimeTypeChooserPrivate *d; }; @@ -116,8 +116,8 @@ class KIO_EXPORT KMimeTypeChooser : public QVBox * Here is an example, using the dialog to set the text of two lineedits: * * @code - * QString text = i18n("Select the MimeTypes you want for this file type."); - * QStringList list = QStringList::split( QRegExp("\\s*;\\s*"), leMimetypes->text() ); + * TQString text = i18n("Select the MimeTypes you want for this file type."); + * TQStringList list = TQStringList::split( TQRegExp("\\s*;\\s*"), leMimetypes->text() ); * KMimeTypeChooserDialog *d = new KMimeTypeChooserDialog( this, 0, * i18n("Select Mime Types"), text, list, "text" ); * if ( d->exec() == KDialogBase::Accepted ) { @@ -149,22 +149,22 @@ class KIO_EXPORT KMimeTypeChooserDialog : public KDialogBase * @param parent The parent widget to use * @param name The internal name of this object */ - KMimeTypeChooserDialog( const QString &caption=QString::null, - const QString& text=QString::null, - const QStringList &selectedMimeTypes=QStringList(), - const QString &defaultGroup=QString::null, - const QStringList &groupsToShow=QStringList(), + KMimeTypeChooserDialog( const TQString &caption=TQString::null, + const TQString& text=TQString::null, + const TQStringList &selectedMimeTypes=TQStringList(), + const TQString &defaultGroup=TQString::null, + const TQStringList &groupsToShow=TQStringList(), int visuals=KMimeTypeChooser::Comments|KMimeTypeChooser::Patterns|KMimeTypeChooser::EditButton, - QWidget *parent=0, const char *name=0 ); + TQWidget *parent=0, const char *name=0 ); /** * @overload */ - KMimeTypeChooserDialog( const QString &caption, - const QString& text, - const QStringList &selectedMimeTypes, - const QString &defaultGroup, - QWidget *parent=0, const char *name=0 ); + KMimeTypeChooserDialog( const TQString &caption, + const TQString& text, + const TQStringList &selectedMimeTypes, + const TQString &defaultGroup, + TQWidget *parent=0, const char *name=0 ); ~KMimeTypeChooserDialog(); diff --git a/kio/kio/kmimetyperesolver.h b/kio/kio/kmimetyperesolver.h index 8f9e2dcc0..4ac6347f2 100644 --- a/kio/kio/kmimetyperesolver.h +++ b/kio/kio/kmimetyperesolver.h @@ -21,9 +21,9 @@ #ifndef __kmimetyperesolver_h #define __kmimetyperesolver_h -#include <qscrollview.h> -#include <qptrlist.h> -#include <qtimer.h> +#include <tqscrollview.h> +#include <tqptrlist.h> +#include <tqtimer.h> #include <kdebug.h> /** @@ -52,16 +52,16 @@ class KIO_EXPORT KMimeTypeResolverHelper : public QObject public: KMimeTypeResolverHelper( KMimeTypeResolverBase *resolver, - QScrollView *view ) + TQScrollView *view ) : m_resolver( resolver ), - m_timer( new QTimer( this ) ) + m_timer( new TQTimer( this ) ) { - connect( m_timer, SIGNAL( timeout() ), SLOT( slotProcessMimeIcons() )); + connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotProcessMimeIcons() )); - connect( view->horizontalScrollBar(), SIGNAL( sliderMoved(int) ), - SLOT( slotAdjust() ) ); - connect( view->verticalScrollBar(), SIGNAL( sliderMoved(int) ), - SLOT( slotAdjust() ) ); + connect( view->horizontalScrollBar(), TQT_SIGNAL( sliderMoved(int) ), + TQT_SLOT( slotAdjust() ) ); + connect( view->verticalScrollBar(), TQT_SIGNAL( sliderMoved(int) ), + TQT_SLOT( slotAdjust() ) ); view->viewport()->installEventFilter( this ); } @@ -72,11 +72,11 @@ public: } protected: - virtual bool eventFilter( QObject *o, QEvent *e ) + virtual bool eventFilter( TQObject *o, TQEvent *e ) { - bool ret = QObject::eventFilter( o, e ); + bool ret = TQObject::eventFilter( o, e ); - if ( e->type() == QEvent::Resize ) + if ( e->type() == TQEvent::Resize ) m_resolver->slotViewportAdjusted(); return ret; @@ -95,7 +95,7 @@ private slots: private: KMimeTypeResolverBase *m_resolver; - QTimer *m_timer; + TQTimer *m_timer; }; /** @@ -106,16 +106,16 @@ private: * preferrence to the visible icons. * * It is implemented as a template, so that it can work with both QPtrListViewItem - * and QIconViewItem, without requiring hacks such as void * or QPtrDict lookups. + * and TQIconViewItem, without requiring hacks such as void * or TQPtrDict lookups. * * Here's what the parent must implement : * @li void mimeTypeDeterminationFinished(); - * @li QScrollView * scrollWidget(); + * @li TQScrollView * scrollWidget(); * @li void determineIcon( IconItem * item ), which should call * @li KFileItem::determineMimeType on the fileItem, and update the icon, etc. */ template<class IconItem, class Parent> -class KMimeTypeResolver : public KMimeTypeResolverBase // if only this could be a QObject.... +class KMimeTypeResolver : public KMimeTypeResolverBase // if only this could be a TQObject.... { public: /** @@ -149,7 +149,7 @@ public: * clear it, insert new items into it, remove items, etc. * @return the list of items to process */ - QPtrList<IconItem> m_lstPendingMimeIconItems; + TQPtrList<IconItem> m_lstPendingMimeIconItems; /** * "Connected" to the viewportAdjusted signal of the scrollview @@ -231,17 +231,17 @@ inline IconItem * KMimeTypeResolver<IconItem, Parent>::findVisibleIcon() { // Find an icon that's visible and whose mimetype we don't know. - QPtrListIterator<IconItem> it(m_lstPendingMimeIconItems); + TQPtrListIterator<IconItem> it(m_lstPendingMimeIconItems); if ( m_lstPendingMimeIconItems.count()<20) // for few items, it's faster to not bother return m_lstPendingMimeIconItems.first(); - QScrollView * view = m_parent->scrollWidget(); - QRect visibleContentsRect + TQScrollView * view = m_parent->scrollWidget(); + TQRect visibleContentsRect ( - view->viewportToContents(QPoint(0, 0)), + view->viewportToContents(TQPoint(0, 0)), view->viewportToContents ( - QPoint(view->visibleWidth(), view->visibleHeight()) + TQPoint(view->visibleWidth(), view->visibleHeight()) ) ); diff --git a/kio/kio/knfsshare.cpp b/kio/kio/knfsshare.cpp index eaadae603..f0fdfce6d 100644 --- a/kio/kio/knfsshare.cpp +++ b/kio/kio/knfsshare.cpp @@ -16,9 +16,9 @@ Boston, MA 02110-1301, USA. */ -#include <qdict.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <kdirwatch.h> #include <kstaticdeleter.h> @@ -35,8 +35,8 @@ public: bool readExportsFile(); bool findExportsFile(); - QDict<bool> sharedPaths; - QString exportsFile; + TQDict<bool> sharedPaths; + TQString exportsFile; }; KNFSSharePrivate::KNFSSharePrivate() @@ -56,10 +56,10 @@ bool KNFSSharePrivate::findExportsFile() { config.setGroup("General"); exportsFile = config.readPathEntry("exportsFile"); - if ( QFile::exists(exportsFile) ) + if ( TQFile::exists(exportsFile) ) return true; - if ( QFile::exists("/etc/exports") ) + if ( TQFile::exists("/etc/exports") ) exportsFile = "/etc/exports"; else { kdDebug(7000) << "KNFSShare: Could not found exports file!" << endl; @@ -75,7 +75,7 @@ bool KNFSSharePrivate::findExportsFile() { * and fills the sharedPaths dict with the values */ bool KNFSSharePrivate::readExportsFile() { - QFile f(exportsFile); + TQFile f(exportsFile); kdDebug(7000) << "KNFSShare::readExportsFile " << exportsFile << endl; @@ -87,14 +87,14 @@ bool KNFSSharePrivate::readExportsFile() { sharedPaths.clear(); - QTextStream s( &f ); + TQTextStream s( &f ); bool continuedLine = false; // is true if the line before ended with a backslash - QString completeLine; + TQString completeLine; while ( !s.eof() ) { - QString currentLine = s.readLine().stripWhiteSpace(); + TQString currentLine = s.readLine().stripWhiteSpace(); if (continuedLine) { completeLine += currentLine; @@ -119,7 +119,7 @@ bool KNFSSharePrivate::readExportsFile() { continue; } - QString path; + TQString path; // Handle quotation marks if ( completeLine[0] == '"' ) { @@ -160,45 +160,45 @@ bool KNFSSharePrivate::readExportsFile() { KNFSShare::KNFSShare() { d = new KNFSSharePrivate(); - if (QFile::exists(d->exportsFile)) { + if (TQFile::exists(d->exportsFile)) { KDirWatch::self()->addFile(d->exportsFile); - connect(KDirWatch::self(), SIGNAL(dirty (const QString&)),this, - SLOT(slotFileChange(const QString&))); + connect(KDirWatch::self(), TQT_SIGNAL(dirty (const TQString&)),this, + TQT_SLOT(slotFileChange(const TQString&))); } } KNFSShare::~KNFSShare() { - if (QFile::exists(d->exportsFile)) { + if (TQFile::exists(d->exportsFile)) { KDirWatch::self()->removeFile(d->exportsFile); } delete d; } -bool KNFSShare::isDirectoryShared( const QString & path ) const { - QString fixedPath = path; +bool KNFSShare::isDirectoryShared( const TQString & path ) const { + TQString fixedPath = path; if ( path[path.length()-1] != '/' ) fixedPath += '/'; return d->sharedPaths.find(fixedPath) != 0; } -QStringList KNFSShare::sharedDirectories() const { - QStringList result; - QDictIterator<bool> it(d->sharedPaths); +TQStringList KNFSShare::sharedDirectories() const { + TQStringList result; + TQDictIterator<bool> it(d->sharedPaths); for( ; it.current(); ++it ) result << it.currentKey(); return result; } -QString KNFSShare::exportsPath() const { +TQString KNFSShare::exportsPath() const { return d->exportsFile; } -void KNFSShare::slotFileChange( const QString & path ) { +void KNFSShare::slotFileChange( const TQString & path ) { if (path == d->exportsFile) d->readExportsFile(); diff --git a/kio/kio/knfsshare.h b/kio/kio/knfsshare.h index 228cedffd..d1852d0f2 100644 --- a/kio/kio/knfsshare.h +++ b/kio/kio/knfsshare.h @@ -19,7 +19,7 @@ #ifndef knfsshare_h #define knfsshare_h -#include <qobject.h> +#include <tqobject.h> #include <kdelibs_export.h> @@ -32,7 +32,7 @@ class KNFSSharePrivate; * It parses the /etc/exports file to get its information. * Singleton class, call instance() to get an instance. */ -class KIO_EXPORT KNFSShare : public QObject +class KIO_EXPORT KNFSShare : public TQObject { Q_OBJECT public: @@ -46,14 +46,14 @@ public: * @param path the path to check if it is shared by NFS. * @return wether the given path is shared by NFS. */ - bool isDirectoryShared( const QString & path ) const; + bool isDirectoryShared( const TQString & path ) const; /** * Returns a list of all directories shared by NFS. * The resulting list is not sorted. * @return a list of all directories shared by NFS. */ - QStringList sharedDirectories() const; + TQStringList sharedDirectories() const; /** * KNFSShare destructor. @@ -66,7 +66,7 @@ public: * Returns the path to the used exports file, * or null if no exports file was found */ - QString exportsPath() const; + TQString exportsPath() const; signals: /** @@ -80,7 +80,7 @@ private: KNFSSharePrivate* d; private slots: - void slotFileChange(const QString&); + void slotFileChange(const TQString&); }; #endif diff --git a/kio/kio/kprotocolinfo.cpp b/kio/kio/kprotocolinfo.cpp index ce854a3a9..01e3e6c18 100644 --- a/kio/kio/kprotocolinfo.cpp +++ b/kio/kio/kprotocolinfo.cpp @@ -35,11 +35,11 @@ KProtocolInfo* KProtocolInfo::findProtocol(const KURL &url) #ifdef MAKE_KDECORE_LIB return 0; #else - QString protocol = url.protocol(); + TQString protocol = url.protocol(); if ( !KProtocolInfo::proxiedBy( protocol ).isEmpty() ) { - QString dummy; + TQString dummy; protocol = KProtocolManager::slaveProtocol(url, dummy); } @@ -81,9 +81,9 @@ bool KProtocolInfo::isFilterProtocol( const KURL &url ) return isFilterProtocol (url.protocol()); } -bool KProtocolInfo::isFilterProtocol( const QString &protocol ) +bool KProtocolInfo::isFilterProtocol( const TQString &protocol ) { - // We call the findProtocol (const QString&) to bypass any proxy settings. + // We call the findProtocol (const TQString&) to bypass any proxy settings. KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(protocol); if ( !prot ) return false; @@ -96,9 +96,9 @@ bool KProtocolInfo::isHelperProtocol( const KURL &url ) return isHelperProtocol (url.protocol()); } -bool KProtocolInfo::isHelperProtocol( const QString &protocol ) +bool KProtocolInfo::isHelperProtocol( const TQString &protocol ) { - // We call the findProtocol (const QString&) to bypass any proxy settings. + // We call the findProtocol (const TQString&) to bypass any proxy settings. KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(protocol); if ( !prot ) return false; @@ -111,9 +111,9 @@ bool KProtocolInfo::isKnownProtocol( const KURL &url ) return isKnownProtocol (url.protocol()); } -bool KProtocolInfo::isKnownProtocol( const QString &protocol ) +bool KProtocolInfo::isKnownProtocol( const TQString &protocol ) { - // We call the findProtocol (const QString&) to bypass any proxy settings. + // We call the findProtocol (const TQString&) to bypass any proxy settings. KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(protocol); return ( prot != 0); } @@ -127,11 +127,11 @@ bool KProtocolInfo::supportsListing( const KURL &url ) return prot->m_supportsListing; } -QStringList KProtocolInfo::listing( const KURL &url ) +TQStringList KProtocolInfo::listing( const KURL &url ) { KProtocolInfo::Ptr prot = findProtocol(url); if ( !prot ) - return QStringList(); + return TQStringList(); return prot->m_listing; } @@ -246,11 +246,11 @@ KProtocolInfo::FileNameUsedForCopying KProtocolInfo::fileNameUsedForCopying( con return prot->fileNameUsedForCopying(); } -QString KProtocolInfo::defaultMimetype( const KURL &url ) +TQString KProtocolInfo::defaultMimetype( const KURL &url ) { KProtocolInfo::Ptr prot = findProtocol(url); if ( !prot ) - return QString::null; + return TQString::null; return prot->m_defaultMimetype; } diff --git a/kio/kio/kprotocolinfo.h b/kio/kio/kprotocolinfo.h index 3a0f05272..dba4694db 100644 --- a/kio/kio/kprotocolinfo.h +++ b/kio/kio/kprotocolinfo.h @@ -19,9 +19,9 @@ #ifndef __kprotocolinfo_h__ #define __kprotocolinfo_h__ -#include <qstring.h> -#include <qstringlist.h> -#include <qdatastream.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdatastream.h> #include <kurl.h> #include <ksycocaentry.h> @@ -54,7 +54,7 @@ public: * Read a protocol description file * @param path the path of the description file */ - KProtocolInfo( const QString & path); // KDE4: make private and add friend class KProtocolInfoBuildFactory + KProtocolInfo( const TQString & path); // KDE4: make private and add friend class KProtocolInfoBuildFactory // Then we can get rid of the d pointer /** @@ -71,7 +71,7 @@ public: * @return the name of the protocol * @see KURL::protocol() */ - virtual QString name() const { return m_name; } + virtual TQString name() const { return m_name; } // // Static functions: @@ -81,7 +81,7 @@ public: * Returns list of all known protocols. * @return a list of all known protocols */ - static QStringList protocols(); + static TQStringList protocols(); /** * Returns whether a protocol is installed that is able to handle @p url. @@ -96,7 +96,7 @@ public: * Same as above except you can supply just the protocol instead of * the whole URL. */ - static bool isKnownProtocol( const QString& protocol ) + static bool isKnownProtocol( const TQString& protocol ) #ifdef KPROTOCOLINFO_KDECORE KDE_WEAK_SYMBOL #endif @@ -109,11 +109,11 @@ public: * * This corresponds to the "exec=" field in the protocol description file. * @param protocol the protocol to check - * @return the executable of library to open, or QString::null for + * @return the executable of library to open, or TQString::null for * unsupported protocols * @see KURL::protocol() */ - static QString exec( const QString& protocol ); + static TQString exec( const TQString& protocol ); /** * Describes the type of a protocol. @@ -160,27 +160,27 @@ public: * @param url the url to check * @return a list of field names */ - static QStringList listing( const KURL &url ); + static TQStringList listing( const KURL &url ); /** * Definition of an extra field in the UDS entries, returned by a listDir operation. * * The name is the name of the column, translated. * - * The type name comes from QVariant::typeName() - * Currently supported types: "QString", "QDateTime" (ISO-8601 format) + * The type name comes from TQVariant::typeName() + * Currently supported types: "TQString", "TQDateTime" (ISO-8601 format) * * @since 3.2 */ struct ExtraField { ExtraField() {} // for QValueList - ExtraField(const QString& _name, const QString& _type ) + ExtraField(const TQString& _name, const TQString& _type ) : name(_name), type(_type) { } - QString name; - QString type; // KDE4: make it QVariant::Type + TQString name; + TQString type; // KDE4: make it TQVariant::Type }; - typedef QValueList<ExtraField > ExtraFieldList; + typedef TQValueList<ExtraField > ExtraFieldList; /** * Definition of extra fields in the UDS entries, returned by a listDir operation. * @@ -225,7 +225,7 @@ public: * Same as above except you can supply just the protocol instead of * the whole URL. */ - static bool isHelperProtocol( const QString& protocol ) + static bool isHelperProtocol( const TQString& protocol ) #ifdef KPROTOCOLINFO_KDECORE KDE_WEAK_SYMBOL #endif @@ -253,7 +253,7 @@ public: * Same as above except you can supply just the protocol instead of * the whole URL. */ - static bool isFilterProtocol( const QString& protocol ) + static bool isFilterProtocol( const TQString& protocol ) #ifdef KPROTOCOLINFO_KDECORE KDE_WEAK_SYMBOL #endif @@ -443,7 +443,7 @@ public: * @param url the url to check * @return the default mime type of the protocol, or null if unknown */ - static QString defaultMimetype( const KURL& url ); + static TQString defaultMimetype( const KURL& url ); /** * Returns the name of the icon, associated with the specified protocol. @@ -453,7 +453,7 @@ public: * @param protocol the protocol to check * @return the icon of the protocol, or null if unknown */ - static QString icon( const QString& protocol ); + static TQString icon( const TQString& protocol ); /** * Returns the name of the config file associated with the @@ -466,7 +466,7 @@ public: * @param protocol the protocol to check * @return the config file, or null if unknown */ - static QString config( const QString& protocol ); + static TQString config( const TQString& protocol ); /** * Returns the soft limit on the number of slaves for this protocol. @@ -480,7 +480,7 @@ public: * @param protocol the protocol to check * @return the maximum number of slaves, or 1 if unknown */ - static int maxSlaves( const QString& protocol ); + static int maxSlaves( const TQString& protocol ); /** * Returns whether mimetypes can be determined based on extension for this @@ -493,7 +493,7 @@ public: * @param protocol the protocol to check * @return true if the mime types can be determined by extension */ - static bool determineMimetypeFromExtension( const QString &protocol ); + static bool determineMimetypeFromExtension( const TQString &protocol ); /** * Returns the documentation path for the specified protocol. @@ -504,7 +504,7 @@ public: * @return the docpath of the protocol, or null if unknown * @since 3.2 */ - static QString docPath( const QString& protocol ); + static TQString docPath( const TQString& protocol ); /** * Returns the protocol class for the specified protocol. @@ -522,7 +522,7 @@ public: * @return the class of the protocol, or null if unknown * @since 3.2 */ - static QString protocolClass( const QString& protocol ); + static TQString protocolClass( const TQString& protocol ); /** * Returns whether file previews should be shown for the specified protocol. @@ -535,7 +535,7 @@ public: * @return true if previews should be shown by default, false otherwise * @since 3.2 */ - static bool showFilePreview( const QString& protocol ); + static bool showFilePreview( const TQString& protocol ); /** * Returns the suggested URI parsing mode for the KURL parser. @@ -552,7 +552,7 @@ public: * * @since 3.2 */ - static KURL::URIMode uriParseMode( const QString& protocol ); + static KURL::URIMode uriParseMode( const TQString& protocol ); /** * Returns the list of capabilities provided by the kioslave implementing @@ -572,7 +572,7 @@ public: * * @since 3.3 */ - static QStringList capabilities( const QString& protocol ); + static TQStringList capabilities( const TQString& protocol ); /** * Returns the name of the protocol through which the request @@ -585,14 +585,14 @@ public: * * @since 3.3 */ - static QString proxiedBy( const QString& protocol ); + static TQString proxiedBy( const TQString& protocol ); public: // Internal functions: /** * @internal construct a KProtocolInfo from a stream */ - KProtocolInfo( QDataStream& _str, int offset); + KProtocolInfo( TQDataStream& _str, int offset); virtual ~KProtocolInfo(); @@ -600,58 +600,58 @@ public: * @internal * Load the protocol info from a stream. */ - virtual void load(QDataStream& ); + virtual void load(TQDataStream& ); /** * @internal * Save the protocol info to a stream. */ - virtual void save(QDataStream& ); + virtual void save(TQDataStream& ); ////////////////////////// DEPRECATED ///////////////////////// // The following methods are deprecated: /// @deprecated - static Type inputType( const QString& protocol ) KDE_DEPRECATED; + static Type inputType( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static Type outputType( const QString& protocol ) KDE_DEPRECATED; + static Type outputType( const TQString& protocol ) KDE_DEPRECATED; /** * @deprecated * Returns the list of fields this protocol returns when listing * The current possibilities are * Name, Type, Size, Date, AccessDate, Access, Owner, Group, Link, URL, MimeType */ - static QStringList listing( const QString& protocol ) KDE_DEPRECATED; + static TQStringList listing( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool isSourceProtocol( const QString& protocol ) KDE_DEPRECATED; + static bool isSourceProtocol( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsListing( const QString& protocol ) KDE_DEPRECATED; + static bool supportsListing( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsReading( const QString& protocol ) KDE_DEPRECATED; + static bool supportsReading( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsWriting( const QString& protocol ) KDE_DEPRECATED; + static bool supportsWriting( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsMakeDir( const QString& protocol ) KDE_DEPRECATED; + static bool supportsMakeDir( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsDeleting( const QString& protocol ) KDE_DEPRECATED; + static bool supportsDeleting( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsLinking( const QString& protocol ) KDE_DEPRECATED; + static bool supportsLinking( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool supportsMoving( const QString& protocol ) KDE_DEPRECATED; + static bool supportsMoving( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool canCopyFromFile( const QString& protocol ) KDE_DEPRECATED; + static bool canCopyFromFile( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static bool canCopyToFile( const QString& protocol ) KDE_DEPRECATED; + static bool canCopyToFile( const TQString& protocol ) KDE_DEPRECATED; /// @deprecated - static QString defaultMimetype( const QString& protocol) KDE_DEPRECATED; + static TQString defaultMimetype( const TQString& protocol) KDE_DEPRECATED; //////////////////////// END DEPRECATED /////////////////////// protected: - QString m_name; - QString m_exec; + TQString m_name; + TQString m_exec; Type m_inputType; Type m_outputType; - QStringList m_listing; + TQStringList m_listing; bool m_isSourceProtocol; bool m_isHelperProtocol; bool m_supportsListing; @@ -661,12 +661,12 @@ protected: bool m_supportsDeleting; bool m_supportsLinking; bool m_supportsMoving; - QString m_defaultMimetype; + TQString m_defaultMimetype; bool m_determineMimetypeFromExtension; - QString m_icon; + TQString m_icon; bool m_canCopyFromFile; bool m_canCopyToFile; - QString m_config; + TQString m_config; int m_maxSlaves; bool canRenameFromFile() const; // for kprotocolinfo_kdecore @@ -682,7 +682,7 @@ private: KProtocolInfoPrivate* d; }; -KIO_EXPORT QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field ); -KIO_EXPORT QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field ); +KIO_EXPORT TQDataStream& operator>>( TQDataStream& s, KProtocolInfo::ExtraField& field ); +KIO_EXPORT TQDataStream& operator<<( TQDataStream& s, const KProtocolInfo::ExtraField& field ); #endif diff --git a/kio/kio/kprotocolmanager.cpp b/kio/kio/kprotocolmanager.cpp index 840ebacb4..8fb8b3227 100644 --- a/kio/kio/kprotocolmanager.cpp +++ b/kio/kio/kprotocolmanager.cpp @@ -48,10 +48,10 @@ public: KConfig *http_config; bool init_busy; KURL url; - QString protocol; - QString proxy; - QString modifiers; - QString useragent; + TQString protocol; + TQString proxy; + TQString modifiers; + TQString useragent; }; static KProtocolManagerPrivate* d = 0; @@ -72,7 +72,7 @@ KProtocolManagerPrivate::~KProtocolManagerPrivate() // DEFAULT USERAGENT STRING #define CFG_DEFAULT_UAGENT(X) \ -QString("Mozilla/5.0 (compatible; Konqueror/%1.%2%3) KHTML/%4.%5.%6 (like Gecko)") \ +TQString("Mozilla/5.0 (compatible; Konqueror/%1.%2%3) KHTML/%4.%5.%6 (like Gecko)") \ .arg(KDE_VERSION_MAJOR).arg(KDE_VERSION_MINOR).arg(X).arg(KDE_VERSION_MAJOR).arg(KDE_VERSION_MINOR).arg(KDE_VERSION_RELEASE) void KProtocolManager::reparseConfiguration() @@ -112,7 +112,7 @@ KConfig *KProtocolManager::http_config() int KProtocolManager::readTimeout() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); int val = cfg->readNumEntry( "ReadTimeout", DEFAULT_READ_TIMEOUT ); return QMAX(MIN_TIMEOUT_VALUE, val); } @@ -120,7 +120,7 @@ int KProtocolManager::readTimeout() int KProtocolManager::connectTimeout() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); int val = cfg->readNumEntry( "ConnectTimeout", DEFAULT_CONNECT_TIMEOUT ); return QMAX(MIN_TIMEOUT_VALUE, val); } @@ -128,7 +128,7 @@ int KProtocolManager::connectTimeout() int KProtocolManager::proxyConnectTimeout() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); int val = cfg->readNumEntry( "ProxyConnectTimeout", DEFAULT_PROXY_CONNECT_TIMEOUT ); return QMAX(MIN_TIMEOUT_VALUE, val); } @@ -136,7 +136,7 @@ int KProtocolManager::proxyConnectTimeout() int KProtocolManager::responseTimeout() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); int val = cfg->readNumEntry( "ResponseTimeout", DEFAULT_RESPONSE_TIMEOUT ); return QMAX(MIN_TIMEOUT_VALUE, val); } @@ -180,13 +180,13 @@ bool KProtocolManager::useCache() KIO::CacheControl KProtocolManager::cacheControl() { KConfig *cfg = http_config(); - QString tmp = cfg->readEntry("cache"); + TQString tmp = cfg->readEntry("cache"); if (tmp.isEmpty()) return DEFAULT_CACHE_CONTROL; return KIO::parseCacheControl(tmp); } -QString KProtocolManager::cacheDir() +TQString KProtocolManager::cacheDir() { KConfig *cfg = http_config(); return cfg->readPathEntry("CacheDir", KGlobal::dirs()->saveLocation("cache","http")); @@ -204,7 +204,7 @@ int KProtocolManager::maxCacheSize() return cfg->readNumEntry( "MaxCacheSize", DEFAULT_MAX_CACHE_SIZE ); // 5 MB } -QString KProtocolManager::noProxyForRaw() +TQString KProtocolManager::noProxyForRaw() { KConfig *cfg = config(); cfg->setGroup( "Proxy Settings" ); @@ -212,18 +212,18 @@ QString KProtocolManager::noProxyForRaw() return cfg->readEntry( "NoProxyFor" ); } -QString KProtocolManager::noProxyFor() +TQString KProtocolManager::noProxyFor() { - QString noProxy = noProxyForRaw(); + TQString noProxy = noProxyForRaw(); if (proxyType() == EnvVarProxy) - noProxy = QString::fromLocal8Bit(getenv(noProxy.local8Bit())); + noProxy = TQString::fromLocal8Bit(getenv(noProxy.local8Bit())); return noProxy; } -QString KProtocolManager::proxyFor( const QString& protocol ) +TQString KProtocolManager::proxyFor( const TQString& protocol ) { - QString scheme = protocol.lower(); + TQString scheme = protocol.lower(); if (scheme == "webdav") scheme = "http"; @@ -235,9 +235,9 @@ QString KProtocolManager::proxyFor( const QString& protocol ) return cfg->readEntry( scheme + "Proxy" ); } -QString KProtocolManager::proxyForURL( const KURL &url ) +TQString KProtocolManager::proxyForURL( const KURL &url ) { - QString proxy; + TQString proxy; ProxyType pt = proxyType(); switch (pt) @@ -247,7 +247,7 @@ QString KProtocolManager::proxyForURL( const KURL &url ) if (!url.host().isEmpty()) { KURL u (url); - QString p = u.protocol().lower(); + TQString p = u.protocol().lower(); // webdav is a KDE specific protocol. Look up proxy // information using HTTP instead... @@ -267,7 +267,7 @@ QString KProtocolManager::proxyForURL( const KURL &url ) } break; case EnvVarProxy: - proxy = QString::fromLocal8Bit(getenv(proxyFor(url.protocol()).local8Bit())).stripWhiteSpace(); + proxy = TQString::fromLocal8Bit(getenv(proxyFor(url.protocol()).local8Bit())).stripWhiteSpace(); break; case ManualProxy: proxy = proxyFor( url.protocol() ); @@ -277,10 +277,10 @@ QString KProtocolManager::proxyForURL( const KURL &url ) break; } - return (proxy.isEmpty() ? QString::fromLatin1("DIRECT") : proxy); + return (proxy.isEmpty() ? TQString::fromLatin1("DIRECT") : proxy); } -void KProtocolManager::badProxy( const QString &proxy ) +void KProtocolManager::badProxy( const TQString &proxy ) { DCOPRef( "kded", "proxyscout" ).send( "blackListProxy", proxy ); } @@ -326,7 +326,7 @@ static bool revmatch(const char *host, const char *nplist) return false; } -QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy) +TQString KProtocolManager::slaveProtocol(const KURL &url, TQString &proxy) { if (url.hasSubURL()) // We don't want the suburl's protocol { @@ -353,7 +353,7 @@ QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy) KProtocolManager::ProxyType type = proxyType(); bool useRevProxy = ((type == ManualProxy) && useReverseProxy()); - QString noProxy; + TQString noProxy; // Check no proxy information iff the proxy type is either // ManualProxy or EnvVarProxy if ( (type == ManualProxy) || (type == EnvVarProxy) ) @@ -361,9 +361,9 @@ QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy) if (!noProxy.isEmpty()) { - QString qhost = url.host().lower(); + TQString qhost = url.host().lower(); const char *host = qhost.latin1(); - QString qno_proxy = noProxy.stripWhiteSpace().lower(); + TQString qno_proxy = noProxy.stripWhiteSpace().lower(); const char *no_proxy = qno_proxy.latin1(); isRevMatch = revmatch(host, no_proxy); @@ -372,7 +372,7 @@ QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy) // users to enter host:port in the No-proxy-For list. if (!isRevMatch && url.port() > 0) { - qhost += ':' + QString::number (url.port()); + qhost += ':' + TQString::number (url.port()); host = qhost.latin1(); isRevMatch = revmatch (host, no_proxy); } @@ -390,7 +390,7 @@ QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy) { // The idea behind slave protocols is not applicable to http // and webdav protocols. - QString protocol = url.protocol().lower(); + TQString protocol = url.protocol().lower(); if (protocol.startsWith("http") || protocol.startsWith("webdav")) d->protocol = protocol; else @@ -408,20 +408,20 @@ QString KProtocolManager::slaveProtocol(const KURL &url, QString &proxy) } d->url = url; - d->proxy = proxy = QString::null; + d->proxy = proxy = TQString::null; d->protocol = url.protocol(); return d->protocol; } /*================================= USER-AGENT SETTINGS =====================*/ -QString KProtocolManager::userAgentForHost( const QString& hostname ) +TQString KProtocolManager::userAgentForHost( const TQString& hostname ) { - QString sendUserAgent = KIO::SlaveConfig::self()->configData("http", hostname.lower(), "SendUserAgent").lower(); + TQString sendUserAgent = KIO::SlaveConfig::self()->configData("http", hostname.lower(), "SendUserAgent").lower(); if (sendUserAgent == "false") - return QString::null; + return TQString::null; - QString useragent = KIO::SlaveConfig::self()->configData("http", hostname.lower(), "UserAgent"); + TQString useragent = KIO::SlaveConfig::self()->configData("http", hostname.lower(), "UserAgent"); // Return the default user-agent if none is specified // for the requested host. @@ -431,56 +431,56 @@ QString KProtocolManager::userAgentForHost( const QString& hostname ) return useragent; } -QString KProtocolManager::defaultUserAgent( ) +TQString KProtocolManager::defaultUserAgent( ) { - QString modifiers = KIO::SlaveConfig::self()->configData("http", QString::null, "UserAgentKeys"); + TQString modifiers = KIO::SlaveConfig::self()->configData("http", TQString::null, "UserAgentKeys"); return defaultUserAgent(modifiers); } -QString KProtocolManager::defaultUserAgent( const QString &_modifiers ) +TQString KProtocolManager::defaultUserAgent( const TQString &_modifiers ) { if (!d) d = new KProtocolManagerPrivate; - QString modifiers = _modifiers.lower(); + TQString modifiers = _modifiers.lower(); if (modifiers.isEmpty()) modifiers = DEFAULT_USER_AGENT_KEYS; if (d->modifiers == modifiers) return d->useragent; - QString supp; + TQString supp; struct utsname nam; if( uname(&nam) >= 0 ) { if( modifiers.contains('o') ) { - supp += QString("; %1").arg(nam.sysname); + supp += TQString("; %1").arg(nam.sysname); if ( modifiers.contains('v') ) - supp += QString(" %1").arg(nam.release); + supp += TQString(" %1").arg(nam.release); } if( modifiers.contains('p') ) { // TODO: determine this value instead of hardcoding it... - supp += QString::fromLatin1("; X11"); + supp += TQString::fromLatin1("; X11"); } if( modifiers.contains('m') ) { - supp += QString("; %1").arg(nam.machine); + supp += TQString("; %1").arg(nam.machine); } if( modifiers.contains('l') ) { - QStringList languageList = KGlobal::locale()->languageList(); - QStringList::Iterator it = languageList.find( QString::fromLatin1("C") ); + TQStringList languageList = KGlobal::locale()->languageList(); + TQStringList::Iterator it = languageList.find( TQString::fromLatin1("C") ); if( it != languageList.end() ) { - if( languageList.contains( QString::fromLatin1("en") ) > 0 ) + if( languageList.contains( TQString::fromLatin1("en") ) > 0 ) languageList.remove( it ); else - (*it) = QString::fromLatin1("en"); + (*it) = TQString::fromLatin1("en"); } if( languageList.count() ) - supp += QString("; %1").arg(languageList.join(", ")); + supp += TQString("; %1").arg(languageList.join(", ")); } } d->modifiers = modifiers; @@ -493,14 +493,14 @@ QString KProtocolManager::defaultUserAgent( const QString &_modifiers ) bool KProtocolManager::markPartial() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); return cfg->readBoolEntry( "MarkPartial", true ); } int KProtocolManager::minimumKeepSize() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); return cfg->readNumEntry( "MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE ); // 5000 byte } @@ -508,25 +508,25 @@ int KProtocolManager::minimumKeepSize() bool KProtocolManager::autoResume() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); return cfg->readBoolEntry( "AutoResume", false ); } bool KProtocolManager::persistentConnections() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); return cfg->readBoolEntry( "PersistentConnections", true ); } bool KProtocolManager::persistentProxyConnection() { KConfig *cfg = config(); - cfg->setGroup( QString::null ); + cfg->setGroup( TQString::null ); return cfg->readBoolEntry( "PersistentProxyConnection", false ); } -QString KProtocolManager::proxyConfigScript() +TQString KProtocolManager::proxyConfigScript() { KConfig *cfg = config(); cfg->setGroup( "Proxy Settings" ); diff --git a/kio/kio/kprotocolmanager.h b/kio/kio/kprotocolmanager.h index 7529bcdc4..ec59342af 100644 --- a/kio/kio/kprotocolmanager.h +++ b/kio/kio/kprotocolmanager.h @@ -20,7 +20,7 @@ #ifndef __kprotocolmanager_h__ #define __kprotocolmanager_h__ -#include <qstringlist.h> +#include <tqstringlist.h> #include <kapplication.h> #include <kio/global.h> @@ -64,7 +64,7 @@ public: * * @return the default user-agent string */ - static QString defaultUserAgent(); + static TQString defaultUserAgent(); /** * Returns the default user-agent value. @@ -77,20 +77,20 @@ public: * @li 'l' Show language * @return the default user-agent value with the given @p keys */ - static QString defaultUserAgent(const QString &keys); + static TQString defaultUserAgent(const TQString &keys); /** * Returns the userAgent string configured for the * specified host. * * If hostname is not found or is empty (i.e. "" or - * QString::null) this function will return the default + * TQString::null) this function will return the default * user agent. * * @param hostname name of the host * @return specified userAgent string */ - static QString userAgentForHost( const QString &hostname ); + static TQString userAgentForHost( const TQString &hostname ); /*=========================== TIMEOUT CONFIG ================================*/ @@ -213,7 +213,7 @@ public: * * @see useReverseProxy, proxyFor, proxyForURL, slaveProtocol */ - static QString noProxyFor(); + static TQString noProxyFor(); /** * Same as above except the environment variable name @@ -223,7 +223,7 @@ public: * @see noProxyFor * @since 3.5.x */ - static QString noProxyForRaw(); + static TQString noProxyForRaw(); /** * Returns the proxy server address for a given protocol. @@ -234,9 +234,9 @@ public: * @see useReverseProxy, slaveProtocol * @param protocol the protocol whose proxy info is needed * @returns the proxy server address if one is available, - * or QString::null if not available + * or TQString::null if not available */ - static QString proxyFor( const QString& protocol ); + static TQString proxyFor( const TQString& protocol ); /** * Returns the proxy server address for a given URL. @@ -254,20 +254,20 @@ public: * @returns the proxy server address or the text "DIRECT" * if no proxying is needed for the given address. */ - static QString proxyForURL( const KURL& url ); + static TQString proxyForURL( const KURL& url ); /** * Marks this proxy as bad (down). It will not be used for the * next 30 minutes. (The script may supply an alternate proxy) * @param proxy the proxy to mark as bad (as URL) */ - static void badProxy( const QString & proxy ); + static void badProxy( const TQString & proxy ); /** * Returns the URL of the script for automatic proxy configuration. * @return the proxy configuration script */ - static QString proxyConfigScript(); + static TQString proxyConfigScript(); /*========================== CACHE CONFIG ===================================*/ @@ -305,7 +305,7 @@ public: * The directory which contains the cache files. * @return the directory that contains the cache files */ - static QString cacheDir(); + static TQString cacheDir(); /** * Returns the Cache control directive to be used. @@ -376,7 +376,7 @@ public: * @param proxy the URL of the proxy to use * @return the slave protocol (e.g. 'http'), can be null if unknown */ - static QString slaveProtocol(const KURL &url, QString &proxy); + static TQString slaveProtocol(const KURL &url, TQString &proxy); /** * @internal diff --git a/kio/kio/kremoteencoding.cpp b/kio/kio/kremoteencoding.cpp index 449af8945..ebd7fda74 100644 --- a/kio/kio/kremoteencoding.cpp +++ b/kio/kio/kremoteencoding.cpp @@ -33,43 +33,43 @@ KRemoteEncoding::~KRemoteEncoding() // delete d; // not necessary yet } -QString KRemoteEncoding::decode(const QCString& name) const +TQString KRemoteEncoding::decode(const TQCString& name) const { #ifdef CHECK_UTF8 if (codec->mibEnum() == 106 && !KStringHandler::isUtf8(name)) - return QString::fromLatin1(name); + return TQString::fromLatin1(name); #endif - QString result = codec->toUnicode(name); + TQString result = codec->toUnicode(name); if (codec->fromUnicode(result) != name) // fallback in case of decoding failure - return QString::fromLatin1(name); + return TQString::fromLatin1(name); return result; } -QCString KRemoteEncoding::encode(const QString& name) const +TQCString KRemoteEncoding::encode(const TQString& name) const { - QCString result = codec->fromUnicode(name); + TQCString result = codec->fromUnicode(name); if (codec->toUnicode(result) != name) return name.latin1(); return result; } -QCString KRemoteEncoding::encode(const KURL& url) const +TQCString KRemoteEncoding::encode(const KURL& url) const { return encode(url.path()); } -QCString KRemoteEncoding::directory(const KURL& url, bool ignore_trailing_slash) const +TQCString KRemoteEncoding::directory(const KURL& url, bool ignore_trailing_slash) const { - QString dir = url.directory(true, ignore_trailing_slash); + TQString dir = url.directory(true, ignore_trailing_slash); return encode(dir); } -QCString KRemoteEncoding::fileName(const KURL& url) const +TQCString KRemoteEncoding::fileName(const KURL& url) const { return encode(url.fileName()); } @@ -79,10 +79,10 @@ void KRemoteEncoding::setEncoding(const char *name) // don't delete codecs if (name) - codec = QTextCodec::codecForName(name); + codec = TQTextCodec::codecForName(name); if (codec == 0L) - codec = QTextCodec::codecForMib(1); + codec = TQTextCodec::codecForMib(1); kdDebug() << k_funcinfo << "setting encoding " << codec->name() << " for name=" << name << endl; diff --git a/kio/kio/kremoteencoding.h b/kio/kio/kremoteencoding.h index 4440091ba..35191d8e5 100644 --- a/kio/kio/kremoteencoding.h +++ b/kio/kio/kremoteencoding.h @@ -20,9 +20,9 @@ #define KREMOTEENCODING_H #include <kurl.h> -#include <qstring.h> -#include <qcstring.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqtextcodec.h> class KRemoteEncodingPrivate; /** @@ -62,19 +62,19 @@ public: * This function is supposed to work for dirnames, filenames * or a full pathname. */ - QString decode(const QCString& name) const; + TQString decode(const TQCString& name) const; /** * Converts the given name from Unicode. * This function is supposed to work for dirnames, filenames * or a full pathname. */ - QCString encode(const QString& name) const; + TQCString encode(const TQString& name) const; /** * Converts the given URL into its 8-bit components */ - QCString encode(const KURL& url) const; + TQCString encode(const KURL& url) const; /** * Converts the given URL into 8-bit form and separate the @@ -83,12 +83,12 @@ public: * * The dirname is returned with the final slash always stripped */ - QCString directory(const KURL& url, bool ignore_trailing_slash = true) const; + TQCString directory(const KURL& url, bool ignore_trailing_slash = true) const; /** * Converts the given URL into 8-bit form and retrieve the filename. */ - QCString fileName(const KURL& url) const; + TQCString fileName(const KURL& url) const; /** * Returns the encoding being used. @@ -112,7 +112,7 @@ public: void setEncoding(const char* name); protected: - QTextCodec *codec; + TQTextCodec *codec; virtual void virtual_hook(int id, void* data); diff --git a/kio/kio/krun.cpp b/kio/kio/krun.cpp index 8da71c8a0..199a6b5b9 100644 --- a/kio/kio/krun.cpp +++ b/kio/kio/krun.cpp @@ -26,8 +26,8 @@ #include <unistd.h> #include <typeinfo> -#include <qwidget.h> -#include <qguardedptr.h> +#include <tqwidget.h> +#include <tqguardedptr.h> #include "kuserprofile.h" #include "kmimetype.h" @@ -49,11 +49,11 @@ #include <kstandarddirs.h> #include <kprocess.h> #include <dcopclient.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> -#include <qdatetime.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> +#include <tqdatetime.h> +#include <tqregexp.h> #include <kdesktopfile.h> #include <kstartupinfo.h> #include <kmacroexpander.h> @@ -72,34 +72,34 @@ public: bool m_showingError; bool m_runExecutables; - QString m_preferredService; - QString m_externalBrowser; - QString m_localPath; - QString m_suggestedFileName; - QGuardedPtr <QWidget> m_window; - QCString m_asn; + TQString m_preferredService; + TQString m_externalBrowser; + TQString m_localPath; + TQString m_suggestedFileName; + TQGuardedPtr <TQWidget> m_window; + TQCString m_asn; }; -pid_t KRun::runURL( const KURL& u, const QString& _mimetype ) +pid_t KRun::runURL( const KURL& u, const TQString& _mimetype ) { - return runURL( u, _mimetype, false, true, QString::null ); + return runURL( u, _mimetype, false, true, TQString::null ); } -pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile ) +pid_t KRun::runURL( const KURL& u, const TQString& _mimetype, bool tempFile ) { - return runURL( u, _mimetype, tempFile, true, QString::null ); + return runURL( u, _mimetype, tempFile, true, TQString::null ); } -pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile, bool runExecutables ) +pid_t KRun::runURL( const KURL& u, const TQString& _mimetype, bool tempFile, bool runExecutables ) { - return runURL( u, _mimetype, tempFile, runExecutables, QString::null ); + return runURL( u, _mimetype, tempFile, runExecutables, TQString::null ); } -bool KRun::isExecutableFile( const KURL& url, const QString &mimetype ) +bool KRun::isExecutableFile( const KURL& url, const TQString &mimetype ) { if ( !url.isLocalFile() ) return false; - QFileInfo file( url.path() ); + TQFileInfo file( url.path() ); if ( file.isExecutable() ) // Got a prospective file to run { KMimeType::Ptr mimeType = KMimeType::mimeType( mimetype ); @@ -110,14 +110,14 @@ bool KRun::isExecutableFile( const KURL& url, const QString &mimetype ) return false; } -pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile, bool runExecutables, const QString& suggestedFileName ) +pid_t KRun::runURL( const KURL& u, const TQString& _mimetype, bool tempFile, bool runExecutables, const TQString& suggestedFileName ) { return runURL( u, _mimetype, NULL, "", tempFile, runExecutables, suggestedFileName ); } // This is called by foundMimeType, since it knows the mimetype of the URL -pid_t KRun::runURL( const KURL& u, const QString& _mimetype, QWidget* window, const QCString& asn, - bool tempFile, bool runExecutables, const QString& suggestedFileName ) +pid_t KRun::runURL( const KURL& u, const TQString& _mimetype, TQWidget* window, const TQCString& asn, + bool tempFile, bool runExecutables, const TQString& suggestedFileName ) { bool noRun = false; bool noAuth = false; @@ -138,9 +138,9 @@ pid_t KRun::runURL( const KURL& u, const QString& _mimetype, QWidget* window, co { if (kapp->authorize("shell_access")) { - QString path = u.path(); + TQString path = u.path(); shellQuote( path ); - return (KRun::runCommand(path, QString::null, QString::null, window, asn)); // just execute the url as a command + return (KRun::runCommand(path, TQString::null, TQString::null, window, asn)); // just execute the url as a command // ## TODO implement deleting the file if tempFile==true } else @@ -177,7 +177,7 @@ pid_t KRun::runURL( const KURL& u, const QString& _mimetype, QWidget* window, co KURL::List lst; lst.append( u ); - static const QString& app_str = KGlobal::staticQString("Application"); + static const TQString& app_str = KGlobal::staticQString("Application"); KService::Ptr offer = KServiceTypeProfile::preferredService( _mimetype, app_str ); @@ -194,15 +194,15 @@ pid_t KRun::runURL( const KURL& u, const QString& _mimetype, QWidget* window, co bool KRun::displayOpenWithDialog( const KURL::List& lst ) { - return displayOpenWithDialog( lst, false, QString::null ); + return displayOpenWithDialog( lst, false, TQString::null ); } bool KRun::displayOpenWithDialog( const KURL::List& lst, bool tempFiles ) { - return displayOpenWithDialog( lst, tempFiles, QString::null ); + return displayOpenWithDialog( lst, tempFiles, TQString::null ); } -bool KRun::displayOpenWithDialog( const KURL::List& lst, bool tempFiles, const QString& suggestedFileName ) +bool KRun::displayOpenWithDialog( const KURL::List& lst, bool tempFiles, const TQString& suggestedFileName ) { if (kapp && !kapp->authorizeKAction("openwith")) { @@ -211,7 +211,7 @@ bool KRun::displayOpenWithDialog( const KURL::List& lst, bool tempFiles, const Q return false; } - KOpenWithDlg l( lst, i18n("Open with:"), QString::null, 0L ); + KOpenWithDlg l( lst, i18n("Open with:"), TQString::null, 0L ); if ( l.exec() ) { KService::Ptr service = l.service(); @@ -224,12 +224,12 @@ bool KRun::displayOpenWithDialog( const KURL::List& lst, bool tempFiles, const Q return false; } -void KRun::shellQuote( QString &_str ) +void KRun::shellQuote( TQString &_str ) { // Credits to Walter, says Bernd G. :) if (_str.isEmpty()) // Don't create an explicit empty parameter return; - QChar q('\''); + TQChar q('\''); _str.replace(q, "'\\''").prepend(q).append(q); } @@ -241,14 +241,14 @@ public: bool hasUrls:1, hasSpec:1; protected: - virtual int expandEscapedMacro( const QString &str, uint pos, QStringList &ret ); + virtual int expandEscapedMacro( const TQString &str, uint pos, TQStringList &ret ); private: const KService &service; }; int -KRunMX1::expandEscapedMacro( const QString &str, uint pos, QStringList &ret ) +KRunMX1::expandEscapedMacro( const TQString &str, uint pos, TQStringList &ret ) { uint option = str[pos + 1]; switch( option ) { @@ -290,16 +290,16 @@ public: bool ignFile:1; protected: - virtual int expandEscapedMacro( const QString &str, uint pos, QStringList &ret ); + virtual int expandEscapedMacro( const TQString &str, uint pos, TQStringList &ret ); private: - void subst( int option, const KURL &url, QStringList &ret ); + void subst( int option, const KURL &url, TQStringList &ret ); const KURL::List &urls; }; void -KRunMX2::subst( int option, const KURL &url, QStringList &ret ) +KRunMX2::subst( int option, const KURL &url, TQStringList &ret ) { switch( option ) { case 'u': @@ -315,7 +315,7 @@ KRunMX2::subst( int option, const KURL &url, QStringList &ret ) ret << url.fileName(); break; case 'v': - if (url.isLocalFile() && QFile::exists( url.path() ) ) + if (url.isLocalFile() && TQFile::exists( url.path() ) ) ret << KDesktopFile( url.path(), true ).readEntry( "Dev" ); break; } @@ -323,7 +323,7 @@ KRunMX2::subst( int option, const KURL &url, QStringList &ret ) } int -KRunMX2::expandEscapedMacro( const QString &str, uint pos, QStringList &ret ) +KRunMX2::expandEscapedMacro( const TQString &str, uint pos, TQStringList &ret ) { uint option = str[pos + 1]; switch( option ) { @@ -358,36 +358,36 @@ KRunMX2::expandEscapedMacro( const QString &str, uint pos, QStringList &ret ) } // BIC: merge methods below -QStringList KRun::processDesktopExec(const KService &_service, const KURL::List& _urls, bool has_shell) { - return processDesktopExec( _service, _urls, has_shell, false, QString::null ); +TQStringList KRun::processDesktopExec(const KService &_service, const KURL::List& _urls, bool has_shell) { + return processDesktopExec( _service, _urls, has_shell, false, TQString::null ); } -QStringList KRun::processDesktopExec(const KService &_service, const KURL::List& _urls, bool has_shell /* KDE4: remove */, bool tempFiles) +TQStringList KRun::processDesktopExec(const KService &_service, const KURL::List& _urls, bool has_shell /* KDE4: remove */, bool tempFiles) { - return processDesktopExec( _service, _urls, has_shell, tempFiles, QString::null ); + return processDesktopExec( _service, _urls, has_shell, tempFiles, TQString::null ); } -QStringList KRun::processDesktopExec(const KService &_service, const KURL::List& _urls, bool has_shell /* KDE4: remove */, bool tempFiles, const QString& suggestedFileName) +TQStringList KRun::processDesktopExec(const KService &_service, const KURL::List& _urls, bool has_shell /* KDE4: remove */, bool tempFiles, const TQString& suggestedFileName) { - QString exec = _service.exec(); - QStringList result; + TQString exec = _service.exec(); + TQStringList result; bool appHasTempFileOption; KRunMX1 mx1( _service ); KRunMX2 mx2( _urls ); /// compatibility hack -- KDE 4: remove - QRegExp re("^\\s*(?:/bin/)?sh\\s+-c\\s+(.*)$"); + TQRegExp re("^\\s*(?:/bin/)?sh\\s+-c\\s+(.*)$"); if (!re.search( exec )) { exec = re.cap( 1 ).stripWhiteSpace(); for (uint pos = 0; pos < exec.length(); ) { - QChar c = exec.unicode()[pos]; + TQChar c = exec.unicode()[pos]; if (c != '\'' && c != '"') goto synerr; // what else can we do? after normal parsing the substs would be insecure int pos2 = exec.find( c, pos + 1 ) - 1; if (pos2 < 0) goto synerr; // quoting error - memcpy( (void *)(exec.unicode() + pos), exec.unicode() + pos + 1, (pos2 - pos) * sizeof(QChar)); + memcpy( (void *)(exec.unicode() + pos), exec.unicode() + pos + 1, (pos2 - pos) * sizeof(TQChar)); pos = pos2; exec.remove( pos, 2 ); } @@ -470,14 +470,14 @@ QStringList KRun::processDesktopExec(const KService &_service, const KURL::List& if (_service.terminal()) { KConfigGroupSaver gs(KGlobal::config(), "General"); - QString terminal = KGlobal::config()->readPathEntry("TerminalApplication", "konsole"); + TQString terminal = KGlobal::config()->readPathEntry("TerminalApplication", "konsole"); if (terminal == "konsole") terminal += " -caption=%c %i %m"; terminal += " "; terminal += _service.terminalOptions(); if( !mx1.expandMacrosShellQuote( terminal ) ) { kdWarning() << "KRun: syntax error in command `" << terminal << "', service `" << _service.name() << "'" << endl; - return QStringList(); + return TQStringList(); } mx2.expandMacrosShellQuote( terminal ); if (has_shell) @@ -527,23 +527,23 @@ QStringList KRun::processDesktopExec(const KService &_service, const KURL::List& synerr: kdWarning() << "KRun: syntax error in command `" << _service.exec() << "', service `" << _service.name() << "'" << endl; - return QStringList(); + return TQStringList(); } //static -QString KRun::binaryName( const QString & execLine, bool removePath ) +TQString KRun::binaryName( const TQString & execLine, bool removePath ) { // Remove parameters and/or trailing spaces. - QStringList args = KShell::splitArgs( execLine ); - for (QStringList::ConstIterator it = args.begin(); it != args.end(); ++it) + TQStringList args = KShell::splitArgs( execLine ); + for (TQStringList::ConstIterator it = args.begin(); it != args.end(); ++it) if (!(*it).contains('=')) // Remove path if wanted return removePath ? (*it).mid((*it).findRev('/') + 1) : *it; - return QString::null; + return TQString::null; } -static pid_t runCommandInternal( KProcess* proc, const KService* service, const QString& binName, - const QString &execName, const QString & iconName, QWidget* window, QCString asn ) +static pid_t runCommandInternal( KProcess* proc, const KService* service, const TQString& binName, + const TQString &execName, const TQString & iconName, TQWidget* window, TQCString asn ) { if (service && !service->desktopEntryPath().isEmpty() && !KDesktopFile::isAuthorizedDesktopFile( service->desktopEntryPath() )) @@ -552,10 +552,10 @@ static pid_t runCommandInternal( KProcess* proc, const KService* service, const KMessageBox::sorry(window, i18n("You are not authorized to execute this file.")); return 0; } - QString bin = KRun::binaryName( binName, true ); + TQString bin = KRun::binaryName( binName, true ); #ifdef Q_WS_X11 // Startup notification doesn't work with QT/E, service isn't needed without Startup notification bool silent; - QCString wmclass; + TQCString wmclass; KStartupInfoId id; bool startup_notify = ( asn != "0" && KRun::checkStartupNotify( binName, service, &silent, &wmclass )); if( startup_notify ) @@ -600,10 +600,10 @@ static pid_t runCommandInternal( KProcess* proc, const KService* service, const } // This code is also used in klauncher. -bool KRun::checkStartupNotify( const QString& /*binName*/, const KService* service, bool* silent_arg, QCString* wmclass_arg ) +bool KRun::checkStartupNotify( const TQString& /*binName*/, const KService* service, bool* silent_arg, TQCString* wmclass_arg ) { bool silent = false; - QCString wmclass; + TQCString wmclass; if( service && service->property( "StartupNotify" ).isValid()) { silent = !service->property( "StartupNotify" ).toBool(); @@ -644,14 +644,14 @@ bool KRun::checkStartupNotify( const QString& /*binName*/, const KService* servi return true; } -static pid_t runTempService( const KService& _service, const KURL::List& _urls, QWidget* window, - const QCString& asn, bool tempFiles, const QString& suggestedFileName ) +static pid_t runTempService( const KService& _service, const KURL::List& _urls, TQWidget* window, + const TQCString& asn, bool tempFiles, const TQString& suggestedFileName ) { if (!_urls.isEmpty()) { kdDebug(7010) << "runTempService: first url " << _urls.first().url() << endl; } - QStringList args; + TQStringList args; if ((_urls.count() > 1) && !_service.allowMultipleFiles()) { // We need to launch the application N times. That sucks. @@ -691,16 +691,16 @@ static KURL::List resolveURLs( const KURL::List& _urls, const KService& _service { // Check which protocols the application supports. // This can be a list of actual protocol names, or just KIO for KDE apps. - QStringList supportedProtocols = _service.property("X-KDE-Protocols").toStringList(); + TQStringList supportedProtocols = _service.property("X-KDE-Protocols").toStringList(); KRunMX1 mx1( _service ); - QString exec = _service.exec(); + TQString exec = _service.exec(); if ( mx1.expandMacrosShellQuote( exec ) && !mx1.hasUrls ) { Q_ASSERT( supportedProtocols.isEmpty() ); // huh? If you support protocols you need %u or %U... } else { if ( supportedProtocols.isEmpty() ) { // compat mode: assume KIO if not set and it's a KDE app - QStringList categories = _service.property("Categories").toStringList(); + TQStringList categories = _service.property("Categories").toStringList(); if ( categories.find("KDE") != categories.end() ) supportedProtocols.append( "KIO" ); else { // if no KDE app, be a bit over-generic @@ -734,31 +734,31 @@ static KURL::List resolveURLs( const KURL::List& _urls, const KService& _service // BIC merge methods below pid_t KRun::run( const KService& _service, const KURL::List& _urls ) { - return run( _service, _urls, 0, false, QString::null ); + return run( _service, _urls, 0, false, TQString::null ); } pid_t KRun::run( const KService& _service, const KURL::List& _urls, bool tempFiles ) { - return run( _service, _urls, 0, tempFiles, QString::null ); + return run( _service, _urls, 0, tempFiles, TQString::null ); } -pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles ) +pid_t KRun::run( const KService& _service, const KURL::List& _urls, TQWidget* window, bool tempFiles ) { - return run( _service, _urls, window, "", tempFiles, QString::null ); + return run( _service, _urls, window, "", tempFiles, TQString::null ); } -pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, const QCString& asn, bool tempFiles ) +pid_t KRun::run( const KService& _service, const KURL::List& _urls, TQWidget* window, const TQCString& asn, bool tempFiles ) { - return run( _service, _urls, window, asn, tempFiles, QString::null ); + return run( _service, _urls, window, asn, tempFiles, TQString::null ); } -pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles, const QString& suggestedFileName ) +pid_t KRun::run( const KService& _service, const KURL::List& _urls, TQWidget* window, bool tempFiles, const TQString& suggestedFileName ) { return run( _service, _urls, window, "", tempFiles, suggestedFileName ); } -pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, const QCString& asn, - bool tempFiles, const QString& suggestedFileName ) +pid_t KRun::run( const KService& _service, const KURL::List& _urls, TQWidget* window, const TQCString& asn, + bool tempFiles, const TQString& suggestedFileName ) { if (!_service.desktopEntryPath().isEmpty() && !KDesktopFile::isAuthorizedDesktopFile( _service.desktopEntryPath())) @@ -792,11 +792,11 @@ pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* win // Resolve urls if needed, depending on what the app supports const KURL::List urls = resolveURLs( _urls, _service ); - QString error; + TQString error; int pid = 0; - QCString myasn = asn; - // startServiceByDesktopPath() doesn't take QWidget*, add it to the startup info now + TQCString myasn = asn; + // startServiceByDesktopPath() doesn't take TQWidget*, add it to the startup info now if( window != NULL ) { if( myasn.isEmpty()) @@ -827,33 +827,33 @@ pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* win } -pid_t KRun::run( const QString& _exec, const KURL::List& _urls, const QString& _name, - const QString& _icon, const QString&, const QString&) +pid_t KRun::run( const TQString& _exec, const KURL::List& _urls, const TQString& _name, + const TQString& _icon, const TQString&, const TQString&) { KService::Ptr service = new KService(_name, _exec, _icon); return run(*service, _urls); } -pid_t KRun::runCommand( QString cmd ) +pid_t KRun::runCommand( TQString cmd ) { - return KRun::runCommand( cmd, QString::null, QString::null, NULL, "" ); + return KRun::runCommand( cmd, TQString::null, TQString::null, NULL, "" ); } -pid_t KRun::runCommand( const QString& cmd, const QString &execName, const QString & iconName ) +pid_t KRun::runCommand( const TQString& cmd, const TQString &execName, const TQString & iconName ) { return KRun::runCommand( cmd, execName, iconName, NULL, "" ); } -pid_t KRun::runCommand( const QString& cmd, const QString &execName, const QString & iconName, - QWidget* window, const QCString& asn ) +pid_t KRun::runCommand( const TQString& cmd, const TQString &execName, const TQString & iconName, + TQWidget* window, const TQCString& asn ) { kdDebug(7010) << "runCommand " << cmd << "," << execName << endl; KProcess * proc = new KProcess; proc->setUseShell(true); *proc << cmd; KService::Ptr service = KService::serviceByDesktopName( binaryName( execName, true ) ); - QString bin = binaryName( cmd, false ); + TQString bin = binaryName( cmd, false ); int pos = bin.findRev( '/' ); if (pos != -1) { proc->setWorkingDirectory( bin.mid(0, pos) ); @@ -867,21 +867,21 @@ KRun::KRun( const KURL& url, mode_t mode, bool isLocalFile, bool showProgressInf init (url, 0, "", mode, isLocalFile, showProgressInfo); } -KRun::KRun( const KURL& url, QWidget* window, mode_t mode, bool isLocalFile, +KRun::KRun( const KURL& url, TQWidget* window, mode_t mode, bool isLocalFile, bool showProgressInfo ) :m_timer(0,"KRun::timer") { init (url, window, "", mode, isLocalFile, showProgressInfo); } -KRun::KRun( const KURL& url, QWidget* window, const QCString& asn, mode_t mode, bool isLocalFile, +KRun::KRun( const KURL& url, TQWidget* window, const TQCString& asn, mode_t mode, bool isLocalFile, bool showProgressInfo ) :m_timer(0,"KRun::timer") { init (url, window, asn, mode, isLocalFile, showProgressInfo); } -void KRun::init ( const KURL& url, QWidget* window, const QCString& asn, mode_t mode, bool isLocalFile, +void KRun::init ( const KURL& url, TQWidget* window, const TQCString& asn, mode_t mode, bool isLocalFile, bool showProgressInfo ) { m_bFault = false; @@ -904,7 +904,7 @@ void KRun::init ( const KURL& url, QWidget* window, const QCString& asn, mode_t // loop and do initialization afterwards. // Reason: We must complete the constructor before we do anything else. m_bInit = true; - connect( &m_timer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) ); + connect( &m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimeout() ) ); m_timer.start( 0, true ); kdDebug(7010) << " new KRun " << this << " " << url.prettyURL() << " timer=" << &m_timer << endl; @@ -926,7 +926,7 @@ void KRun::init() } if ( !kapp->authorizeURLAction( "open", KURL(), m_strURL)) { - QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, m_strURL.prettyURL()); + TQString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, m_strURL.prettyURL()); d->m_showingError = true; KMessageBoxWrapper::error( d->m_window, msg ); d->m_showingError = false; @@ -939,7 +939,7 @@ void KRun::init() if ( !m_bIsLocalFile && m_strURL.isLocalFile() ) m_bIsLocalFile = true; - QString exec; + TQString exec; if (m_strURL.protocol().startsWith("http")) { exec = d->m_externalBrowser; @@ -950,7 +950,7 @@ void KRun::init() if ( m_mode == 0 ) { KDE_struct_stat buff; - if ( KDE_stat( QFile::encodeName(m_strURL.path()), &buff ) == -1 ) + if ( KDE_stat( TQFile::encodeName(m_strURL.path()), &buff ) == -1 ) { d->m_showingError = true; KMessageBoxWrapper::error( d->m_window, i18n( "<qt>Unable to run the command specified. The file or folder <b>%1</b> does not exist.</qt>" ).arg( m_strURL.htmlURL() ) ); @@ -1034,8 +1034,8 @@ void KRun::init() // It may be a directory or a file, let's stat KIO::StatJob *job = KIO::stat( m_strURL, true, 0 /* no details */, m_bProgressInfo ); job->setWindow (d->m_window); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotStatResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotStatResult( KIO::Job * ) ) ); m_job = job; kdDebug(7010) << " Job " << job << " is about stating " << m_strURL.url() << endl; } @@ -1083,10 +1083,10 @@ void KRun::scanFile() KIO::TransferJob *job = KIO::get( m_strURL, false /*reload*/, m_bProgressInfo ); job->setWindow (d->m_window); - connect(job, SIGNAL( result(KIO::Job *)), - this, SLOT( slotScanFinished(KIO::Job *))); - connect(job, SIGNAL( mimetype(KIO::Job *, const QString &)), - this, SLOT( slotScanMimeType(KIO::Job *, const QString &))); + connect(job, TQT_SIGNAL( result(KIO::Job *)), + this, TQT_SLOT( slotScanFinished(KIO::Job *))); + connect(job, TQT_SIGNAL( mimetype(KIO::Job *, const TQString &)), + this, TQT_SLOT( slotScanMimeType(KIO::Job *, const TQString &))); m_job = job; kdDebug(7010) << " Job " << job << " is about getting from " << m_strURL.url() << endl; } @@ -1153,7 +1153,7 @@ void KRun::slotStatResult( KIO::Job * job ) if(!dynamic_cast<KIO::StatJob*>(job)) kdFatal() << "job is a " << typeid(*job).name() << " should be a StatJob" << endl; - QString knownMimeType; + TQString knownMimeType; KIO::UDSEntry entry = ((KIO::StatJob*)job)->statResult(); KIO::UDSEntry::ConstIterator it = entry.begin(); for( ; it != entry.end(); it++ ) { @@ -1190,7 +1190,7 @@ void KRun::slotStatResult( KIO::Job * job ) } } -void KRun::slotScanMimeType( KIO::Job *, const QString &mimetype ) +void KRun::slotScanMimeType( KIO::Job *, const TQString &mimetype ) { if ( mimetype.isEmpty() ) kdWarning(7010) << "KRun::slotScanFinished : MimetypeJob didn't find a mimetype! Probably a kioslave bug." << endl; @@ -1217,7 +1217,7 @@ void KRun::slotScanFinished( KIO::Job *job ) } } -void KRun::foundMimeType( const QString& type ) +void KRun::foundMimeType( const TQString& type ) { kdDebug(7010) << "Resulting mime type is " << type << endl; @@ -1233,7 +1233,7 @@ void KRun::foundMimeType( const QString& type ) KURL::List lst = KURL::split( m_strURL ); if ( lst.isEmpty() ) { - QString tmp = i18n( "Malformed URL" ); + TQString tmp = i18n( "Malformed URL" ); tmp += "\n"; tmp += m_strURL.url(); KMessageBoxWrapper::error( 0L, tmp ); @@ -1253,7 +1253,7 @@ void KRun::foundMimeType( const QString& type ) KURL::List::Iterator it = lst.begin(); ++it; (*lst.begin()).setRef( (*it).ref() ); - (*it).setRef( QString::null ); + (*it).setRef( TQString::null ); // Create the new URL m_strURL = KURL::join( lst ); @@ -1266,8 +1266,8 @@ void KRun::foundMimeType( const QString& type ) // (For instance a tar.gz is a directory contained inside a file) // It may be a directory or a file, let's stat KIO::StatJob *job = KIO::stat( m_strURL, m_bProgressInfo ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotStatResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotStatResult( KIO::Job * ) ) ); m_job = job; return; @@ -1349,10 +1349,10 @@ void KRun::setEnableExternalBrowser(bool b) if (b) d->m_externalBrowser = KConfigGroup(KGlobal::config(), "General").readEntry("BrowserApplication"); else - d->m_externalBrowser = QString::null; + d->m_externalBrowser = TQString::null; } -void KRun::setPreferredService( const QString& desktopEntryName ) +void KRun::setPreferredService( const TQString& desktopEntryName ) { d->m_preferredService = desktopEntryName; } @@ -1362,12 +1362,12 @@ void KRun::setRunExecutables(bool b) d->m_runExecutables = b; } -void KRun::setSuggestedFileName( const QString& fileName ) +void KRun::setSuggestedFileName( const TQString& fileName ) { d->m_suggestedFileName = fileName; } -bool KRun::isExecutable( const QString& serviceType ) +bool KRun::isExecutable( const TQString& serviceType ) { return ( serviceType == "application/x-desktop" || serviceType == "application/x-executable" || @@ -1378,27 +1378,27 @@ bool KRun::isExecutable( const QString& serviceType ) /****************/ pid_t -KProcessRunner::run(KProcess * p, const QString & binName) +KProcessRunner::run(KProcess * p, const TQString & binName) { return (new KProcessRunner(p, binName))->pid(); } #ifdef Q_WS_X11 pid_t -KProcessRunner::run(KProcess * p, const QString & binName, const KStartupInfoId& id ) +KProcessRunner::run(KProcess * p, const TQString & binName, const KStartupInfoId& id ) { return (new KProcessRunner(p, binName, id))->pid(); } #endif -KProcessRunner::KProcessRunner(KProcess * p, const QString & _binName ) - : QObject(), +KProcessRunner::KProcessRunner(KProcess * p, const TQString & _binName ) + : TQObject(), process_(p), binName( _binName ) { - QObject::connect( - process_, SIGNAL(processExited(KProcess *)), - this, SLOT(slotProcessExited(KProcess *))); + TQObject::connect( + process_, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(slotProcessExited(KProcess *))); process_->start(); if ( !process_->pid() ) @@ -1406,15 +1406,15 @@ KProcessRunner::KProcessRunner(KProcess * p, const QString & _binName ) } #ifdef Q_WS_X11 -KProcessRunner::KProcessRunner(KProcess * p, const QString & _binName, const KStartupInfoId& id ) - : QObject(), +KProcessRunner::KProcessRunner(KProcess * p, const TQString & _binName, const KStartupInfoId& id ) + : TQObject(), process_(p), binName( _binName ), id_( id ) { - QObject::connect( - process_, SIGNAL(processExited(KProcess *)), - this, SLOT(slotProcessExited(KProcess *))); + TQObject::connect( + process_, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT(slotProcessExited(KProcess *))); process_->start(); if ( !process_->pid() ) @@ -1450,7 +1450,7 @@ KProcessRunner::slotProcessExited(KProcess * p) // We can't just rely on that, but it's a good hint. // Before assuming its really so, we'll try to find the binName // relatively to current directory, and then in the PATH. - if ( !QFile( binName ).exists() && KStandardDirs::findExe( binName ).isEmpty() ) + if ( !TQFile( binName ).exists() && KStandardDirs::findExe( binName ).isEmpty() ) { kapp->ref(); KMessageBox::sorry( 0L, i18n("Could not find the program '%1'").arg( binName ) ); diff --git a/kio/kio/krun.h b/kio/kio/krun.h index 385b227af..17fa434e3 100644 --- a/kio/kio/krun.h +++ b/kio/kio/krun.h @@ -24,9 +24,9 @@ #include <sys/stat.h> #include <sys/types.h> -#include <qobject.h> -#include <qtimer.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqtimer.h> +#include <tqstring.h> #include <kurl.h> #include <kstartupinfo.h> @@ -109,9 +109,9 @@ public: * a very slow FTP server... * It is always better to provide progress info in such cases. */ - KRun( const KURL& url, QWidget* window, mode_t mode = 0, + KRun( const KURL& url, TQWidget* window, mode_t mode = 0, bool isLocalFile = false, bool showProgressInfo = true ); - KRun( const KURL& url, QWidget* window, const QCString& asn, mode_t mode = 0, + KRun( const KURL& url, TQWidget* window, const TQCString& asn, mode_t mode = 0, bool isLocalFile = false, bool showProgressInfo = true ); /** @@ -169,7 +169,7 @@ public: * the recent documents list. * @param desktopEntryName the desktopEntryName of the service, e.g. "kate". */ - void setPreferredService( const QString& desktopEntryName ); + void setPreferredService( const TQString& desktopEntryName ); /** * Sets whether executables, .desktop files or shell scripts should @@ -197,7 +197,7 @@ public: * file name. * @since 3.5.3 */ - void setSuggestedFileName( const QString& fileName ); + void setSuggestedFileName( const TQString& fileName ); /** * Open a list of URLs with a certain service (application). @@ -211,9 +211,9 @@ public: * @return the process id, or 0 on error * @since 3.5.2 */ - static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles = false ); - static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window, - const QCString& asn, bool tempFiles = false ); + static pid_t run( const KService& _service, const KURL::List& _urls, TQWidget* window, bool tempFiles = false ); + static pid_t run( const KService& _service, const KURL::List& _urls, TQWidget* window, + const TQCString& asn, bool tempFiles = false ); /** * Open a list of URLs with a certain service (application). * @@ -229,9 +229,9 @@ public: static pid_t run( const KService& _service, const KURL::List& _urls ); /// @since 3.5.3 /// @internal - static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles, const QString& suggestedFileName ); - static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window, - const QCString& asn, bool tempFiles, const QString& suggestedFileName ); + static pid_t run( const KService& _service, const KURL::List& _urls, TQWidget* window, bool tempFiles, const TQString& suggestedFileName ); + static pid_t run( const KService& _service, const KURL::List& _urls, TQWidget* window, + const TQCString& asn, bool tempFiles, const TQString& suggestedFileName ); /** * Open a list of URLs with. @@ -246,11 +246,11 @@ public: * @param _obsolete2 Do not use! * @return the process id, or 0 on error */ - static pid_t run( const QString& _exec, const KURL::List& _urls, - const QString& _name = QString::null, - const QString& _icon = QString::null, - const QString& _obsolete1 = QString::null, - const QString& _obsolete2 = QString::null ); + static pid_t run( const TQString& _exec, const KURL::List& _urls, + const TQString& _name = TQString::null, + const TQString& _icon = TQString::null, + const TQString& _obsolete1 = TQString::null, + const TQString& _obsolete2 = TQString::null ); /** * Open the given URL. @@ -270,13 +270,13 @@ public: // BIC Merge second overload with first one using runExecutables=true, and // merge third overload with first one as well using tempFiles=false and // runExecutables=true - static pid_t runURL( const KURL& _url, const QString& _mimetype, bool tempFile, bool runExecutables); - static pid_t runURL( const KURL& _url, const QString& _mimetype, bool tempFile); - static pid_t runURL( const KURL& _url, const QString& _mimetype ); + static pid_t runURL( const KURL& _url, const TQString& _mimetype, bool tempFile, bool runExecutables); + static pid_t runURL( const KURL& _url, const TQString& _mimetype, bool tempFile); + static pid_t runURL( const KURL& _url, const TQString& _mimetype ); /// @since 3.5.3 /// @internal - static pid_t runURL( const KURL& _url, const QString& _mimetype, QWidget* window, const QCString& asn, bool tempFile, bool runExecutables, const QString& suggestedFileName ); - static pid_t runURL( const KURL& _url, const QString& _mimetype, bool tempFile, bool runExecutables, const QString& suggestedFileName ); + static pid_t runURL( const KURL& _url, const TQString& _mimetype, TQWidget* window, const TQCString& asn, bool tempFile, bool runExecutables, const TQString& suggestedFileName ); + static pid_t runURL( const KURL& _url, const TQString& _mimetype, bool tempFile, bool runExecutables, const TQString& suggestedFileName ); /** * Run the given shell command and notifies kicker of the starting @@ -292,7 +292,7 @@ public: * @return PID of running command, 0 if it could not be started, 0 - (PID * of running command) if command was unsafe for map notification. */ - static pid_t runCommand( QString cmd ); + static pid_t runCommand( TQString cmd ); /** * Same as the other runCommand(), but it also takes the name of the @@ -305,9 +305,9 @@ public: * @return PID of running command, 0 if it could not be started, 0 - (PID * of running command) if command was unsafe for map notification. */ - static pid_t runCommand( const QString& cmd, const QString & execName, const QString & icon ); - static pid_t runCommand( const QString& cmd, const QString & execName, const QString & icon, - QWidget* window, const QCString& asn ); + static pid_t runCommand( const TQString& cmd, const TQString & execName, const TQString & icon ); + static pid_t runCommand( const TQString& cmd, const TQString & execName, const TQString & icon, + TQWidget* window, const TQCString& asn ); /** * Display the Open-With dialog for those URLs, and run the chosen application. @@ -321,13 +321,13 @@ public: static bool displayOpenWithDialog( const KURL::List& lst ); /// @since 3.5.3 /// @internal - static bool displayOpenWithDialog( const KURL::List& lst, bool tempFiles, const QString& suggestedFileName ); + static bool displayOpenWithDialog( const KURL::List& lst, bool tempFiles, const TQString& suggestedFileName ); /** * Quotes a string for the shell. * @param _str the string to quote. The quoted string will be written here */ - static void shellQuote( QString &_str ); + static void shellQuote( TQString &_str ); /** * Processes a Exec= line as found in .desktop files. @@ -343,11 +343,11 @@ public: * when the application exits. * @return a list of arguments suitable for either system() or exec(). */ - static QStringList processDesktopExec(const KService &_service, const KURL::List &_urls, bool has_shell, bool tempFiles); - static QStringList processDesktopExec(const KService &_service, const KURL::List &_urls, bool has_shell); + static TQStringList processDesktopExec(const KService &_service, const KURL::List &_urls, bool has_shell, bool tempFiles); + static TQStringList processDesktopExec(const KService &_service, const KURL::List &_urls, bool has_shell); /// @since 3.5.3 /// @internal - static QStringList processDesktopExec(const KService &_service, const KURL::List &_urls, bool has_shell, bool tempFiles, const QString& suggestedFileName); + static TQStringList processDesktopExec(const KService &_service, const KURL::List &_urls, bool has_shell, bool tempFiles, const TQString& suggestedFileName); /** * Given a full command line (e.g. the Exec= line from a .desktop file), @@ -357,14 +357,14 @@ public: * @return the name of the binary to run * @since 3.1 */ - static QString binaryName( const QString & execLine, bool removePath ); + static TQString binaryName( const TQString & execLine, bool removePath ); /** * Returns whether @p serviceType refers to an executable program instead * of a data file. * @since 3.2 */ - static bool isExecutable( const QString& serviceType ); + static bool isExecutable( const TQString& serviceType ); /** * Returns wether the @p url of @p mimetype is executable. @@ -379,13 +379,13 @@ public: * to the mimetype's desktop file. * @since 3.3 */ - static bool isExecutableFile( const KURL& url, const QString &mimetype ); + static bool isExecutableFile( const KURL& url, const TQString &mimetype ); /** * @internal * @since 3.4 */ - static bool checkStartupNotify( const QString& binName, const KService* service, bool* silent_arg, QCString* wmclass_arg ); + static bool checkStartupNotify( const TQString& binName, const KService* service, bool* silent_arg, TQCString* wmclass_arg ); signals: /** @@ -402,7 +402,7 @@ signals: protected slots: void slotTimeout(); void slotScanFinished( KIO::Job * ); - void slotScanMimeType( KIO::Job *, const QString &type ); + void slotScanMimeType( KIO::Job *, const TQString &type ); virtual void slotStatResult( KIO::Job * ); protected: @@ -415,7 +415,7 @@ protected: * whether the document and appends the gzip protocol to the * URL. Otherwise runURL is called to finish the job. */ - virtual void foundMimeType( const QString& _type ); + virtual void foundMimeType( const TQString& _type ); virtual void killJob(); @@ -425,7 +425,7 @@ protected: bool m_bProgressInfo; bool m_bFinished; KIO::Job * m_job; - QTimer m_timer; + TQTimer m_timer; /** * Used to indicate that the next action is to scan the file. @@ -447,7 +447,7 @@ protected: virtual void virtual_hook( int id, void* data ); private: - void init (const KURL& url, QWidget* window, const QCString& asn, mode_t mode, + void init (const KURL& url, TQWidget* window, const TQCString& asn, mode_t mode, bool isLocalFile, bool showProgressInfo); private: class KRunPrivate; @@ -481,9 +481,9 @@ class KIO_EXPORT KProcessRunner : public QObject public: - static pid_t run(KProcess *, const QString & binName); + static pid_t run(KProcess *, const TQString & binName); #ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded - static pid_t run(KProcess *, const QString & binName, const KStartupInfoId& id ); + static pid_t run(KProcess *, const TQString & binName, const KStartupInfoId& id ); #endif virtual ~KProcessRunner(); @@ -496,14 +496,14 @@ class KIO_EXPORT KProcessRunner : public QObject private: - KProcessRunner(KProcess *, const QString & binName); + KProcessRunner(KProcess *, const TQString & binName); #ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded - KProcessRunner(KProcess *, const QString & binName, const KStartupInfoId& id ); + KProcessRunner(KProcess *, const TQString & binName, const KStartupInfoId& id ); #endif KProcessRunner(); KProcess * process_; - QString binName; + TQString binName; #ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded KStartupInfoId id_; #endif diff --git a/kio/kio/ksambashare.cpp b/kio/kio/ksambashare.cpp index 11a1b4fde..defeae4a7 100644 --- a/kio/kio/ksambashare.cpp +++ b/kio/kio/ksambashare.cpp @@ -16,9 +16,9 @@ Boston, MA 02110-1301, USA. */ -#include <qdict.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <kdirwatch.h> #include <kstaticdeleter.h> @@ -36,8 +36,8 @@ public: bool findSmbConf(); bool load(); - QDict<bool> sharedPaths; - QString smbConf; + TQDict<bool> sharedPaths; + TQString smbConf; }; KSambaSharePrivate::KSambaSharePrivate() @@ -62,28 +62,28 @@ bool KSambaSharePrivate::load() { * @return wether a smb.conf was found. **/ bool KSambaSharePrivate::findSmbConf() { - KSimpleConfig config(QString::fromLatin1(FILESHARECONF),true); + KSimpleConfig config(TQString::fromLatin1(FILESHARECONF),true); smbConf = config.readEntry("SMBCONF"); - if ( QFile::exists(smbConf) ) + if ( TQFile::exists(smbConf) ) return true; - if ( QFile::exists("/etc/samba/smb.conf") ) + if ( TQFile::exists("/etc/samba/smb.conf") ) smbConf = "/etc/samba/smb.conf"; else - if ( QFile::exists("/etc/smb.conf") ) + if ( TQFile::exists("/etc/smb.conf") ) smbConf = "/etc/smb.conf"; else - if ( QFile::exists("/usr/local/samba/lib/smb.conf") ) + if ( TQFile::exists("/usr/local/samba/lib/smb.conf") ) smbConf = "/usr/local/samba/lib/smb.conf"; else - if ( QFile::exists("/usr/samba/lib/smb.conf") ) + if ( TQFile::exists("/usr/samba/lib/smb.conf") ) smbConf = "/usr/samba/lib/smb.conf"; else - if ( QFile::exists("/usr/lib/smb.conf") ) + if ( TQFile::exists("/usr/lib/smb.conf") ) smbConf = "/usr/lib/smb.conf"; else - if ( QFile::exists("/usr/local/lib/smb.conf") ) + if ( TQFile::exists("/usr/local/lib/smb.conf") ) smbConf = "/usr/local/lib/smb.conf"; else { kdDebug(7000) << "KSambaShare: Could not found smb.conf!" << endl; @@ -99,7 +99,7 @@ bool KSambaSharePrivate::findSmbConf() { * and fills the sharedPaths dict with the values */ bool KSambaSharePrivate::readSmbConf() { - QFile f(smbConf); + TQFile f(smbConf); kdDebug(7000) << "KSambaShare::readSmbConf " << smbConf << endl; @@ -110,14 +110,14 @@ bool KSambaSharePrivate::readSmbConf() { sharedPaths.clear(); - QTextStream s(&f); + TQTextStream s(&f); bool continuedLine = false; // is true if the line before ended with a backslash - QString completeLine; + TQString completeLine; while (!s.eof()) { - QString currentLine = s.readLine().stripWhiteSpace(); + TQString currentLine = s.readLine().stripWhiteSpace(); if (continuedLine) { completeLine += currentLine; @@ -148,8 +148,8 @@ bool KSambaSharePrivate::readSmbConf() { if (i>-1) { - QString name = completeLine.left(i).stripWhiteSpace().lower(); - QString value = completeLine.mid(i+1).stripWhiteSpace(); + TQString name = completeLine.left(i).stripWhiteSpace().lower(); + TQString value = completeLine.mid(i+1).stripWhiteSpace(); if (name == KGlobal::staticQString("path")) { // Handle quotation marks @@ -178,44 +178,44 @@ bool KSambaSharePrivate::readSmbConf() { KSambaShare::KSambaShare() { d = new KSambaSharePrivate(); - if (QFile::exists(d->smbConf)) { + if (TQFile::exists(d->smbConf)) { KDirWatch::self()->addFile(d->smbConf); KDirWatch::self()->addFile(FILESHARECONF); - connect(KDirWatch::self(), SIGNAL(dirty (const QString&)),this, - SLOT(slotFileChange(const QString&))); + connect(KDirWatch::self(), TQT_SIGNAL(dirty (const TQString&)),this, + TQT_SLOT(slotFileChange(const TQString&))); } } KSambaShare::~KSambaShare() { - if (QFile::exists(d->smbConf)) { + if (TQFile::exists(d->smbConf)) { KDirWatch::self()->removeFile(d->smbConf); KDirWatch::self()->removeFile(FILESHARECONF); } delete d; } -QString KSambaShare::smbConfPath() const { +TQString KSambaShare::smbConfPath() const { return d->smbConf; } -bool KSambaShare::isDirectoryShared( const QString & path ) const { - QString fixedPath = path; +bool KSambaShare::isDirectoryShared( const TQString & path ) const { + TQString fixedPath = path; if ( path[path.length()-1] != '/' ) fixedPath += '/'; return d->sharedPaths.find(fixedPath) != 0; } -QStringList KSambaShare::sharedDirectories() const { - QStringList result; - QDictIterator<bool> it(d->sharedPaths); +TQStringList KSambaShare::sharedDirectories() const { + TQStringList result; + TQDictIterator<bool> it(d->sharedPaths); for( ; it.current(); ++it ) result << it.currentKey(); return result; } -void KSambaShare::slotFileChange( const QString & path ) { +void KSambaShare::slotFileChange( const TQString & path ) { if (path == d->smbConf) d->readSmbConf(); else diff --git a/kio/kio/ksambashare.h b/kio/kio/ksambashare.h index 714353d76..383bd702f 100644 --- a/kio/kio/ksambashare.h +++ b/kio/kio/ksambashare.h @@ -19,7 +19,7 @@ #ifndef ksambashare_h #define ksambashare_h -#include <qobject.h> +#include <tqobject.h> #include <kdelibs_export.h> @@ -31,7 +31,7 @@ class KSambaSharePrivate; * any suid script. * Singleton class, call instance() to get an instance. */ -class KIO_EXPORT KSambaShare : public QObject +class KIO_EXPORT KSambaShare : public TQObject { Q_OBJECT public: @@ -45,14 +45,14 @@ public: * @param path the path to check if it is shared by Samba. * @return whether the given path is shared by Samba. */ - bool isDirectoryShared( const QString & path ) const; + bool isDirectoryShared( const TQString & path ) const; /** * Returns a list of all directories shared by Samba. * The resulting list is not sorted. * @return a list of all directories shared by Samba. */ - QStringList sharedDirectories() const; + TQStringList sharedDirectories() const; /** * KSambaShare destructor. @@ -65,7 +65,7 @@ public: * Returns the path to the used smb.conf file * or null if no file was found */ - QString smbConfPath() const; + TQString smbConfPath() const; signals: /** @@ -79,7 +79,7 @@ private: KSambaSharePrivate* d; private slots: - void slotFileChange(const QString&); + void slotFileChange(const TQString&); }; #endif diff --git a/kio/kio/kscan.cpp b/kio/kio/kscan.cpp index be49e5c14..21e8086b8 100644 --- a/kio/kio/kscan.cpp +++ b/kio/kio/kscan.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include <qfile.h> +#include <tqfile.h> #include <klocale.h> #include <ktrader.h> @@ -25,7 +25,7 @@ #include "kscan.h" // static factory method -KScanDialog * KScanDialog::getScanDialog( QWidget *parent, const char *name, +KScanDialog * KScanDialog::getScanDialog( TQWidget *parent, const char *name, bool modal ) { KTrader::OfferList offers = KTrader::self()->query("KScan/KScanDialog"); @@ -33,22 +33,22 @@ KScanDialog * KScanDialog::getScanDialog( QWidget *parent, const char *name, return 0L; KService::Ptr ptr = *(offers.begin()); - KLibFactory *factory = KLibLoader::self()->factory( QFile::encodeName(ptr->library()) ); + KLibFactory *factory = KLibLoader::self()->factory( TQFile::encodeName(ptr->library()) ); if ( !factory ) return 0; - QStringList args; - args << QString::number( (int)modal ); + TQStringList args; + args << TQString::number( (int)modal ); - QObject *res = factory->create( parent, name, "KScanDialog", args ); + TQObject *res = factory->create( parent, name, "KScanDialog", args ); return dynamic_cast<KScanDialog *>( res ); } KScanDialog::KScanDialog( int dialogFace, int buttonMask, - QWidget *parent, const char *name, bool modal ) + TQWidget *parent, const char *name, bool modal ) : KDialogBase( dialogFace, i18n("Acquire Image"), buttonMask, Close, parent, name, modal, true ), m_currentId( 1 ) @@ -68,7 +68,7 @@ bool KScanDialog::setup() // static factory method -KOCRDialog * KOCRDialog::getOCRDialog( QWidget *parent, const char *name, +KOCRDialog * KOCRDialog::getOCRDialog( TQWidget *parent, const char *name, bool modal ) { KTrader::OfferList offers = KTrader::self()->query("KScan/KOCRDialog"); @@ -76,22 +76,22 @@ KOCRDialog * KOCRDialog::getOCRDialog( QWidget *parent, const char *name, return 0L; KService::Ptr ptr = *(offers.begin()); - KLibFactory *factory = KLibLoader::self()->factory( QFile::encodeName(ptr->library()) ); + KLibFactory *factory = KLibLoader::self()->factory( TQFile::encodeName(ptr->library()) ); if ( !factory ) return 0; - QStringList args; - args << QString::number( (int)modal ); + TQStringList args; + args << TQString::number( (int)modal ); - QObject *res = factory->create( parent, name, "KOCRDialog", args ); + TQObject *res = factory->create( parent, name, "KOCRDialog", args ); return dynamic_cast<KOCRDialog *>( res ); } KOCRDialog::KOCRDialog( int dialogFace, int buttonMask, - QWidget *parent, const char *name, bool modal ) + TQWidget *parent, const char *name, bool modal ) : KDialogBase( dialogFace, i18n("OCR Image"), buttonMask, Close, parent, name, modal, true ), m_currentId( 1 ) @@ -107,7 +107,7 @@ KOCRDialog::~KOCRDialog() /////////////////////////////////////////////////////////////////// -KScanDialogFactory::KScanDialogFactory( QObject *parent, const char *name ) +KScanDialogFactory::KScanDialogFactory( TQObject *parent, const char *name ) : KLibFactory( parent, name ), m_instance( 0L ) { @@ -118,9 +118,9 @@ KScanDialogFactory::~KScanDialogFactory() delete m_instance; } -QObject *KScanDialogFactory::createObject( QObject *parent, const char *name, +TQObject *KScanDialogFactory::createObject( TQObject *parent, const char *name, const char *classname, - const QStringList &args ) + const TQStringList &args ) { if ( strcmp( classname, "KScanDialog" ) != 0 ) return 0; @@ -133,14 +133,14 @@ QObject *KScanDialogFactory::createObject( QObject *parent, const char *name, if ( args.count() == 1 ) modal = (bool)args[ 0 ].toInt(); - return createDialog( static_cast<QWidget *>( parent ), name, modal ); + return createDialog( static_cast<TQWidget *>( parent ), name, modal ); } /////////////////////////////////////////////////////////////////// -KOCRDialogFactory::KOCRDialogFactory( QObject *parent, const char *name ) +KOCRDialogFactory::KOCRDialogFactory( TQObject *parent, const char *name ) : KLibFactory( parent, name ), m_instance( 0L ) { @@ -151,9 +151,9 @@ KOCRDialogFactory::~KOCRDialogFactory() delete m_instance; } -QObject *KOCRDialogFactory::createObject( QObject *parent, const char *name, +TQObject *KOCRDialogFactory::createObject( TQObject *parent, const char *name, const char *classname, - const QStringList &args ) + const TQStringList &args ) { if ( strcmp( classname, "KOCRDialog" ) != 0 ) return 0; @@ -166,7 +166,7 @@ QObject *KOCRDialogFactory::createObject( QObject *parent, const char *name, if ( args.count() == 1 ) modal = (bool)args[ 0 ].toInt(); - return createDialog( static_cast<QWidget *>( parent ), name, modal ); + return createDialog( static_cast<TQWidget *>( parent ), name, modal ); } void KScanDialog::virtual_hook( int id, void* data ) diff --git a/kio/kio/kscan.h b/kio/kio/kscan.h index 97311a557..6ed5df667 100644 --- a/kio/kio/kscan.h +++ b/kio/kio/kscan.h @@ -43,8 +43,8 @@ class QImage; * if ( !m_scanDialog ) // no scanning support installed? * return; * - * connect( m_scanDialog, SIGNAL( finalImage( const QImage&, int )), - * SLOT( slotScanned( const QImage&, int ) )); + * connect( m_scanDialog, TQT_SIGNAL( finalImage( const TQImage&, int )), + * TQT_SLOT( slotScanned( const TQImage&, int ) )); * } * * if ( m_scanDialog->setup() ) // only if scanner configured/available @@ -71,11 +71,11 @@ public: * is available. Pass a suitable @p parent widget, if you like. If you * don't you have to 'delete' the returned pointer yourself. * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 * @param modal if true the dialog is model * @return the KScanDialog, or 0 if the function failed */ - static KScanDialog * getScanDialog( QWidget *parent=0L, + static KScanDialog * getScanDialog( TQWidget *parent=0L, const char *name=0, bool modal=false ); /** * Destructs the scan dialog. @@ -101,12 +101,12 @@ protected: * @param buttonMask a ORed mask of all buttons (see * KDialogBase::ButtonCode) * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 * @param modal if true the dialog is model * @see KDialogBase */ KScanDialog( int dialogFace=Tabbed, int buttonMask = Close|Help, - QWidget *parent=0L, const char *name=0, bool modal=false ); + TQWidget *parent=0L, const char *name=0, bool modal=false ); /** * Returns the current id for an image. You can use that in your subclass @@ -140,7 +140,7 @@ signals: * @param img the image * @param id the image's id */ - void preview( const QImage &img, int id ); + void preview( const TQImage &img, int id ); /** * Informs you that an image has scanned. @p id is the same as in the @@ -151,17 +151,17 @@ signals: * @param img the image * @param id the image's id */ - void finalImage( const QImage &img, int id ); + void finalImage( const TQImage &img, int id ); /** * Informs you that the image with the id @p id has been run through - * text-recognition. The text is in the QString parameter. In the future, + * text-recognition. The text is in the TQString parameter. In the future, * a compound document, using rich text will be used instead. * * @param text the text that has been recognized * @param id the id of the image */ - void textRecognized( const QString &text, int id ); + void textRecognized( const TQString &text, int id ); private: int m_currentId; @@ -188,30 +188,30 @@ public: * Your library should reimplement this method to return your KScanDialog * derived dialog. * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 * @param modal if true the dialog is model */ - virtual KScanDialog * createDialog( QWidget *parent=0, const char *name=0, + virtual KScanDialog * createDialog( TQWidget *parent=0, const char *name=0, bool modal=false ) = 0; protected: /** * Creates a new KScanDialogFactory. * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 */ - KScanDialogFactory( QObject *parent=0, const char *name=0 ); + KScanDialogFactory( TQObject *parent=0, const char *name=0 ); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", - const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* parent = 0, const char* name = 0, + const char* classname = "TQObject", + const TQStringList &args = TQStringList() ); /** * Creates a new instance with the given name. * @param instanceName the name of the instance */ - void setName( const QCString& instanceName ) { + void setName( const TQCString& instanceName ) { delete m_instance; m_instance = new KInstance( instanceName ); } @@ -244,11 +244,11 @@ public: * is available. Pass a suitable @p parent widget, if you like. If you * don't you have to 'delete' the returned pointer yourself. * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 * @param modal if true the dialog is model * @return the KOCRDialog, or 0 if the function failed */ - static KOCRDialog * getOCRDialog( QWidget *parent=0L, + static KOCRDialog * getOCRDialog( TQWidget *parent=0L, const char *name=0, bool modal=false ); ~KOCRDialog(); @@ -261,11 +261,11 @@ protected: * @param buttonMask a ORed mask of all buttons (see * KDialogBase::ButtonCode) * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 * @param modal if true the dialog is model */ KOCRDialog( int dialogFace=Tabbed, int buttonMask = Close|Help, - QWidget *parent=0L, const char *name=0, bool modal=false ); + TQWidget *parent=0L, const char *name=0, bool modal=false ); /** * Returns the current id for an image. You can use that in your subclass @@ -291,13 +291,13 @@ protected: signals: /** * Informs you that the image with the id @p id has been run through - * text-recognition. The text is in the QString parameter. In the future, + * text-recognition. The text is in the TQString parameter. In the future, * a compound document, using rich text will be used instead. * * @param text the text that has been recognized * @param id the id of the image */ - void textRecognized( const QString &text, int id ); + void textRecognized( const TQString &text, int id ); private: int m_currentId; @@ -324,30 +324,30 @@ public: * Your library should reimplement this method to return your KOCRDialog * derived dialog. * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 * @param modal if true the dialog is model */ - virtual KOCRDialog * createDialog( QWidget *parent=0, const char *name=0, + virtual KOCRDialog * createDialog( TQWidget *parent=0, const char *name=0, bool modal=false ) = 0; protected: /** * Creates a new KScanDialogFactory. * @param parent the QWidget's parent, or 0 - * @param name the name of the QObject, can be 0 + * @param name the name of the TQObject, can be 0 */ - KOCRDialogFactory( QObject *parent=0, const char *name=0 ); + KOCRDialogFactory( TQObject *parent=0, const char *name=0 ); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* className = "QObject", - const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* parent = 0, const char* name = 0, + const char* className = "TQObject", + const TQStringList &args = TQStringList() ); /** * Creates a new instance with the given name. * @param instanceName the name of the instance */ - void setName( const QCString& instanceName ) { + void setName( const TQCString& instanceName ) { delete m_instance; m_instance = new KInstance( instanceName ); } diff --git a/kio/kio/kservice.cpp b/kio/kio/kservice.cpp index d33e33530..2122010b2 100644 --- a/kio/kio/kservice.cpp +++ b/kio/kio/kservice.cpp @@ -31,10 +31,10 @@ #include <unistd.h> #include <stdlib.h> -#include <qstring.h> -#include <qfile.h> -#include <qdir.h> -#include <qtl.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqtl.h> #include <ksimpleconfig.h> #include <kapplication.h> @@ -56,12 +56,12 @@ class KService::KServicePrivate { public: - QStringList categories; - QString menuId; + TQStringList categories; + TQString menuId; }; -KService::KService( const QString & _name, const QString &_exec, const QString &_icon) - : KSycocaEntry( QString::null) +KService::KService( const TQString & _name, const TQString &_exec, const TQString &_icon) + : KSycocaEntry( TQString::null) { d = new KServicePrivate; m_bValid = true; @@ -76,7 +76,7 @@ KService::KService( const QString & _name, const QString &_exec, const QString & } -KService::KService( const QString & _fullpath ) +KService::KService( const TQString & _fullpath ) : KSycocaEntry( _fullpath) { KDesktopFile config( _fullpath ); @@ -96,12 +96,12 @@ KService::init( KDesktopFile *config ) d = new KServicePrivate; m_bValid = true; - bool absPath = !QDir::isRelativePath(entryPath()); + bool absPath = !TQDir::isRelativePath(entryPath()); bool kde4application = config->fileName().startsWith("/usr/share/applications/kde4/"); config->setDesktopGroup(); - QMap<QString, QString> entryMap = config->entryMap(config->group()); + TQMap<TQString, TQString> entryMap = config->entryMap(config->group()); entryMap.remove("Encoding"); // reserved as part of Desktop Entry Standard entryMap.remove("Version"); // reserved as part of Desktop Entry Standard @@ -162,7 +162,7 @@ KService::init( KDesktopFile *config ) return; } - QString resource = config->resource(); + TQString resource = config->resource(); if ( (m_strType == "Application") && (!resource.isEmpty()) && @@ -188,7 +188,7 @@ KService::init( KDesktopFile *config ) return; } - QString name = entryPath(); + TQString name = entryPath(); int pos = name.findRev('/'); if (pos != -1) name = name.mid(pos+1); @@ -204,7 +204,7 @@ KService::init( KDesktopFile *config ) if (space==-1) m_strExec = KStandardDirs::findExe(m_strExec); else { - const QString command = m_strExec.left(space); + const TQString command = m_strExec.left(space); m_strExec.replace(command,KStandardDirs::findExe(command)); } } @@ -213,9 +213,9 @@ KService::init( KDesktopFile *config ) m_strIcon = config->readEntry( "Icon", "unknown" ); if (kde4application) { - if (QFile::exists("/usr/share/icons/oxygen/22x22/apps/" + m_strIcon + ".png")) { + if (TQFile::exists("/usr/share/icons/oxygen/22x22/apps/" + m_strIcon + ".png")) { m_strIcon = "/usr/share/icons/oxygen/22x22/apps/" + m_strIcon + ".png"; - } else if (QFile::exists("/usr/share/icons/hicolor/22x22/apps/" + m_strIcon + ".png")) { + } else if (TQFile::exists("/usr/share/icons/hicolor/22x22/apps/" + m_strIcon + ".png")) { m_strIcon = "/usr/share/icons/hicolor/22x22/apps/" + m_strIcon + ".png"; } } @@ -233,7 +233,7 @@ KService::init( KDesktopFile *config ) m_strGenName += " [KDE4]"; } entryMap.remove("GenericName"); - QString untranslatedGenericName = config->readEntryUntranslated( "GenericName" ); + TQString untranslatedGenericName = config->readEntryUntranslated( "GenericName" ); if (!untranslatedGenericName.isEmpty()) entryMap.insert("UntranslatedGenericName", untranslatedGenericName); @@ -257,7 +257,7 @@ KService::init( KDesktopFile *config ) // Applications implement the service type "Application" ;-) m_lstServiceTypes += "Application"; - QString dcopServiceType = config->readEntry("X-DCOP-ServiceType").lower(); + TQString dcopServiceType = config->readEntry("X-DCOP-ServiceType").lower(); entryMap.remove("X-DCOP-ServiceType"); if (dcopServiceType == "unique") m_DCOPServiceType = DCOP_Unique; @@ -279,21 +279,21 @@ KService::init( KDesktopFile *config ) entryMap.remove("InitialPreference"); // Store all additional entries in the property map. - // A QMap<QString,QString> would be easier for this but we can't + // A TQMap<TQString,TQString> would be easier for this but we can't // brake BC, so we have to store it in m_mapProps. // qWarning("Path = %s", entryPath().latin1()); - QMap<QString,QString>::ConstIterator it = entryMap.begin(); + TQMap<TQString,TQString>::ConstIterator it = entryMap.begin(); for( ; it != entryMap.end();++it) { //qDebug(" Key = %s Data = %s", it.key().latin1(), it.data().latin1()); - QString key = it.key(); + TQString key = it.key(); if (kde4application && key=="OnlyShowIn" && it.data()=="KDE;") key = "NotShowIn"; - m_mapProps.insert( key, QVariant( it.data())); + m_mapProps.insert( key, TQVariant( it.data())); } } -KService::KService( QDataStream& _str, int offset ) : KSycocaEntry( _str, offset ) +KService::KService( TQDataStream& _str, int offset ) : KSycocaEntry( _str, offset ) { d = new KServicePrivate; load( _str ); @@ -305,12 +305,12 @@ KService::~KService() delete d; } -QPixmap KService::pixmap( KIcon::Group _group, int _force_size, int _state, QString * _path ) const +TQPixmap KService::pixmap( KIcon::Group _group, int _force_size, int _state, TQString * _path ) const { KIconLoader *iconLoader=KGlobal::iconLoader(); if (!iconLoader->extraDesktopThemesAdded()) { - QPixmap pixmap=iconLoader->loadIcon( m_strIcon, _group, _force_size, _state, _path, true ); + TQPixmap pixmap=iconLoader->loadIcon( m_strIcon, _group, _force_size, _state, _path, true ); if (!pixmap.isNull() ) return pixmap; iconLoader->addExtraDesktopThemes(); @@ -319,14 +319,14 @@ QPixmap KService::pixmap( KIcon::Group _group, int _force_size, int _state, QStr return iconLoader->loadIcon( m_strIcon, _group, _force_size, _state, _path ); } -void KService::load( QDataStream& s ) +void KService::load( TQDataStream& s ) { // dummies are here because of fields that were removed, to keep bin compat. // Feel free to re-use, but fields for Applications only (not generic services) // should rather be added to application.desktop Q_INT8 def, term, dummy1, dummy2; Q_INT8 dst, initpref; - QString dummyStr1, dummyStr2; + TQString dummyStr1, dummyStr2; int dummyI1, dummyI2; Q_UINT32 dummyUI32; @@ -352,14 +352,14 @@ void KService::load( QDataStream& s ) m_bValid = true; } -void KService::save( QDataStream& s ) +void KService::save( TQDataStream& s ) { KSycocaEntry::save( s ); Q_INT8 def = m_bAllowAsDefault, initpref = m_initialPreference; Q_INT8 term = m_bTerminal; Q_INT8 dst = (Q_INT8) m_DCOPServiceType; Q_INT8 dummy1 = 0, dummy2 = 0; // see ::load - QString dummyStr1, dummyStr2; + TQString dummyStr1, dummyStr2; int dummyI1 = 0, dummyI2 = 0; Q_UINT32 dummyUI32 = 0; @@ -378,7 +378,7 @@ void KService::save( QDataStream& s ) << d->categories << d->menuId; } -bool KService::hasServiceType( const QString& _servicetype ) const +bool KService::hasServiceType( const TQString& _servicetype ) const { if (!m_bValid) return false; // safety test @@ -391,7 +391,7 @@ bool KService::hasServiceType( const QString& _servicetype ) const bool isNumber; // For each service type we are associated with, if it doesn't // match then we try its parent service types. - QStringList::ConstIterator it = m_lstServiceTypes.begin(); + TQStringList::ConstIterator it = m_lstServiceTypes.begin(); for( ; it != m_lstServiceTypes.end(); ++it ) { (*it).toInt(&isNumber); @@ -411,14 +411,14 @@ bool KService::hasServiceType( const QString& _servicetype ) const return false; } -int KService::initialPreferenceForMimeType( const QString& mimeType ) const +int KService::initialPreferenceForMimeType( const TQString& mimeType ) const { if (!m_bValid) return 0; // safety test bool isNumber; // For each service type we are associated with - QStringList::ConstIterator it = m_lstServiceTypes.begin(); + TQStringList::ConstIterator it = m_lstServiceTypes.begin(); for( ; it != m_lstServiceTypes.end(); ++it ) { (*it).toInt(&isNumber); @@ -474,19 +474,19 @@ int KService::initialPreferenceForMimeType( const QString& mimeType ) const class KServiceReadProperty : public KConfigBase { public: - KServiceReadProperty(const QString &_key, const QCString &_value) + KServiceReadProperty(const TQString &_key, const TQCString &_value) : key(_key), value(_value) { } - bool internalHasGroup(const QCString &) const { /*qDebug("hasGroup(const QCString &)");*/ return false; } + bool internalHasGroup(const TQCString &) const { /*qDebug("hasGroup(const TQCString &)");*/ return false; } - QStringList groupList() const { return QStringList(); } + TQStringList groupList() const { return TQStringList(); } - QMap<QString,QString> entryMap(const QString &group) const - { Q_UNUSED(group); return QMap<QString,QString>(); } + TQMap<TQString,TQString> entryMap(const TQString &group) const + { Q_UNUSED(group); return TQMap<TQString,TQString>(); } void reparseConfiguration() { } - KEntryMap internalEntryMap( const QString &pGroup) const + KEntryMap internalEntryMap( const TQString &pGroup) const { Q_UNUSED(pGroup); return KEntryMap(); } KEntryMap internalEntryMap() const { return KEntryMap(); } @@ -497,37 +497,37 @@ public: KEntry lookupData(const KEntryKey &_key) const { Q_UNUSED(_key); KEntry entry; entry.mValue = value; return entry; } protected: - QString key; - QCString value; + TQString key; + TQCString value; }; -QVariant KService::property( const QString& _name) const +TQVariant KService::property( const TQString& _name) const { - return property( _name, QVariant::Invalid); + return property( _name, TQVariant::Invalid); } -// Return a string QVariant if string isn't null, and invalid variant otherwise +// Return a string TQVariant if string isn't null, and invalid variant otherwise // (the variant must be invalid if the field isn't in the .desktop file) // This allows trader queries like "exist Library" to work. -static QVariant makeStringVariant( const QString& string ) +static TQVariant makeStringVariant( const TQString& string ) { // Using isEmpty here would be wrong. // Empty is "specified but empty", null is "not specified" (in the .desktop file) - return string.isNull() ? QVariant() : QVariant( string ); + return string.isNull() ? TQVariant() : TQVariant( string ); } -QVariant KService::property( const QString& _name, QVariant::Type t ) const +TQVariant KService::property( const TQString& _name, TQVariant::Type t ) const { if ( _name == "Type" ) - return QVariant( m_strType ); // can't be null + return TQVariant( m_strType ); // can't be null else if ( _name == "Name" ) - return QVariant( m_strName ); // can't be null + return TQVariant( m_strName ); // can't be null else if ( _name == "Exec" ) return makeStringVariant( m_strExec ); else if ( _name == "Icon" ) return makeStringVariant( m_strIcon ); else if ( _name == "Terminal" ) - return QVariant( static_cast<int>(m_bTerminal) ); + return TQVariant( static_cast<int>(m_bTerminal) ); else if ( _name == "TerminalOptions" ) return makeStringVariant( m_strTerminalOptions ); else if ( _name == "Path" ) @@ -537,53 +537,53 @@ QVariant KService::property( const QString& _name, QVariant::Type t ) const else if ( _name == "GenericName" ) return makeStringVariant( m_strGenName ); else if ( _name == "ServiceTypes" ) - return QVariant( m_lstServiceTypes ); + return TQVariant( m_lstServiceTypes ); else if ( _name == "AllowAsDefault" ) - return QVariant( static_cast<int>(m_bAllowAsDefault) ); + return TQVariant( static_cast<int>(m_bAllowAsDefault) ); else if ( _name == "InitialPreference" ) - return QVariant( m_initialPreference ); + return TQVariant( m_initialPreference ); else if ( _name == "Library" ) return makeStringVariant( m_strLibrary ); else if ( _name == "DesktopEntryPath" ) // can't be null - return QVariant( entryPath() ); + return TQVariant( entryPath() ); else if ( _name == "DesktopEntryName") - return QVariant( m_strDesktopEntryName ); // can't be null + return TQVariant( m_strDesktopEntryName ); // can't be null else if ( _name == "Categories") - return QVariant( d->categories ); + return TQVariant( d->categories ); else if ( _name == "Keywords") - return QVariant( m_lstKeywords ); + return TQVariant( m_lstKeywords ); - // Ok we need to convert the property from a QString to its real type. + // Ok we need to convert the property from a TQString to its real type. // Maybe the caller helped us. - if (t == QVariant::Invalid) + if (t == TQVariant::Invalid) { // No luck, let's ask KServiceTypeFactory what the type of this property // is supposed to be. t = KServiceTypeFactory::self()->findPropertyTypeByName(_name); - if (t == QVariant::Invalid) + if (t == TQVariant::Invalid) { kdDebug(7012) << "Request for unknown property '" << _name << "'\n"; - return QVariant(); // Unknown property: Invalid variant. + return TQVariant(); // Unknown property: Invalid variant. } } - // Then we use a homebuild class based on KConfigBase to convert the QString. + // Then we use a homebuild class based on KConfigBase to convert the TQString. // For some often used property types we do the conversion ourselves. - QMap<QString,QVariant>::ConstIterator it = m_mapProps.find( _name ); + TQMap<TQString,TQVariant>::ConstIterator it = m_mapProps.find( _name ); if ( (it == m_mapProps.end()) || (!it.data().isValid())) { //kdDebug(7012) << "Property not found " << _name << endl; - return QVariant(); // No property set. + return TQVariant(); // No property set. } switch(t) { - case QVariant::String: + case TQVariant::String: return it.data(); - case QVariant::Bool: - case QVariant::Int: + case TQVariant::Bool: + case TQVariant::Int: { - QString aValue = it.data().toString(); + TQString aValue = it.data().toString(); int val = 0; if (aValue == "true" || aValue == "on" || aValue == "yes") val = 1; @@ -594,11 +594,11 @@ QVariant KService::property( const QString& _name, QVariant::Type t ) const if( !bOK ) val = 0; } - if (t == QVariant::Bool) + if (t == TQVariant::Bool) { - return QVariant((bool)val, 1); + return TQVariant((bool)val, 1); } - return QVariant(val); + return TQVariant(val); } default: // All others @@ -607,11 +607,11 @@ QVariant KService::property( const QString& _name, QVariant::Type t ) const } } -QStringList KService::propertyNames() const +TQStringList KService::propertyNames() const { - QStringList res; + TQStringList res; - QMap<QString,QVariant>::ConstIterator it = m_mapProps.begin(); + TQMap<TQString,TQVariant>::ConstIterator it = m_mapProps.begin(); for( ; it != m_mapProps.end(); ++it ) res.append( it.key() ); @@ -641,19 +641,19 @@ KService::List KService::allServices() return KServiceFactory::self()->allServices(); } -KService::Ptr KService::serviceByName( const QString& _name ) +KService::Ptr KService::serviceByName( const TQString& _name ) { KService * s = KServiceFactory::self()->findServiceByName( _name ); return KService::Ptr( s ); } -KService::Ptr KService::serviceByDesktopPath( const QString& _name ) +KService::Ptr KService::serviceByDesktopPath( const TQString& _name ) { KService * s = KServiceFactory::self()->findServiceByDesktopPath( _name ); return KService::Ptr( s ); } -KService::Ptr KService::serviceByDesktopName( const QString& _name ) +KService::Ptr KService::serviceByDesktopName( const TQString& _name ) { KService * s = KServiceFactory::self()->findServiceByDesktopName( _name.lower() ); if (!s && !_name.startsWith("kde-")) @@ -661,13 +661,13 @@ KService::Ptr KService::serviceByDesktopName( const QString& _name ) return KService::Ptr( s ); } -KService::Ptr KService::serviceByMenuId( const QString& _name ) +KService::Ptr KService::serviceByMenuId( const TQString& _name ) { KService * s = KServiceFactory::self()->findServiceByMenuId( _name ); return KService::Ptr( s ); } -KService::Ptr KService::serviceByStorageId( const QString& _storageId ) +KService::Ptr KService::serviceByStorageId( const TQString& _storageId ) { KService::Ptr service = KService::serviceByMenuId( _storageId ); if (service) @@ -677,10 +677,10 @@ KService::Ptr KService::serviceByStorageId( const QString& _storageId ) if (service) return service; - if (!QDir::isRelativePath(_storageId) && QFile::exists(_storageId)) + if (!TQDir::isRelativePath(_storageId) && TQFile::exists(_storageId)) return new KService(_storageId); - QString tmp = _storageId; + TQString tmp = _storageId; tmp = tmp.mid(tmp.findRev('/')+1); // Strip dir if (tmp.endsWith(".desktop")) @@ -700,15 +700,15 @@ KService::List KService::allInitServices() } bool KService::substituteUid() const { - QVariant v = property("X-KDE-SubstituteUID", QVariant::Bool); + TQVariant v = property("X-KDE-SubstituteUID", TQVariant::Bool); return v.isValid() && v.toBool(); } -QString KService::username() const { +TQString KService::username() const { // See also KDesktopFile::tryExec() - QString user; - QVariant v = property("X-KDE-Username", QVariant::String); - user = v.isValid() ? v.toString() : QString::null; + TQString user; + TQVariant v = property("X-KDE-Username", TQVariant::String); + user = v.isValid() ? v.toString() : TQString::null; if (user.isEmpty()) user = ::getenv("ADMIN_ACCOUNT"); if (user.isEmpty()) @@ -717,10 +717,10 @@ QString KService::username() const { } bool KService::noDisplay() const { - QMap<QString,QVariant>::ConstIterator it = m_mapProps.find( "NoDisplay" ); + TQMap<TQString,TQVariant>::ConstIterator it = m_mapProps.find( "NoDisplay" ); if ( (it != m_mapProps.end()) && (it.data().isValid())) { - QString aValue = it.data().toString().lower(); + TQString aValue = it.data().toString().lower(); if (aValue == "true" || aValue == "on" || aValue == "yes") return true; } @@ -728,8 +728,8 @@ bool KService::noDisplay() const { it = m_mapProps.find( "OnlyShowIn" ); if ( (it != m_mapProps.end()) && (it.data().isValid())) { - QString aValue = it.data().toString(); - QStringList aList = QStringList::split(';', aValue); + TQString aValue = it.data().toString(); + TQStringList aList = TQStringList::split(';', aValue); if (!aList.contains("KDE")) return true; } @@ -737,8 +737,8 @@ bool KService::noDisplay() const { it = m_mapProps.find( "NotShowIn" ); if ( (it != m_mapProps.end()) && (it.data().isValid())) { - QString aValue = it.data().toString(); - QStringList aList = QStringList::split(';', aValue); + TQString aValue = it.data().toString(); + TQStringList aList = TQStringList::split(';', aValue); if (aList.contains("KDE")) return true; } @@ -749,16 +749,16 @@ bool KService::noDisplay() const { return false; } -QString KService::untranslatedGenericName() const { - QVariant v = property("UntranslatedGenericName", QVariant::String); - return v.isValid() ? v.toString() : QString::null; +TQString KService::untranslatedGenericName() const { + TQVariant v = property("UntranslatedGenericName", TQVariant::String); + return v.isValid() ? v.toString() : TQString::null; } -QString KService::parentApp() const { - QMap<QString,QVariant>::ConstIterator it = m_mapProps.find( "X-KDE-ParentApp" ); +TQString KService::parentApp() const { + TQMap<TQString,TQVariant>::ConstIterator it = m_mapProps.find( "X-KDE-ParentApp" ); if ( (it == m_mapProps.end()) || (!it.data().isValid())) { - return QString::null; + return TQString::null; } return it.data().toString(); @@ -773,51 +773,51 @@ bool KService::allowMultipleFiles() const { return false; } -QStringList KService::categories() const +TQStringList KService::categories() const { return d->categories; } -QString KService::menuId() const +TQString KService::menuId() const { return d->menuId; } -void KService::setMenuId(const QString &menuId) +void KService::setMenuId(const TQString &menuId) { d->menuId = menuId; } -QString KService::storageId() const +TQString KService::storageId() const { if (!d->menuId.isEmpty()) return d->menuId; return entryPath(); } -QString KService::locateLocal() +TQString KService::locateLocal() { if (d->menuId.isEmpty() || desktopEntryPath().startsWith(".hidden") || - (QDir::isRelativePath(desktopEntryPath()) && d->categories.isEmpty())) + (TQDir::isRelativePath(desktopEntryPath()) && d->categories.isEmpty())) return KDesktopFile::locateLocal(desktopEntryPath()); return ::locateLocal("xdgdata-apps", d->menuId); } -QString KService::newServicePath(bool showInMenu, const QString &suggestedName, - QString *menuId, const QStringList *reservedMenuIds) +TQString KService::newServicePath(bool showInMenu, const TQString &suggestedName, + TQString *menuId, const TQStringList *reservedMenuIds) { - QString base = suggestedName; + TQString base = suggestedName; if (!showInMenu) base.prepend("kde-"); - QString result; + TQString result; for(int i = 1; true; i++) { if (i == 1) result = base + ".desktop"; else - result = base + QString("-%1.desktop").arg(i); + result = base + TQString("-%1.desktop").arg(i); if (reservedMenuIds && reservedMenuIds->contains(result)) continue; @@ -834,7 +834,7 @@ QString KService::newServicePath(bool showInMenu, const QString &suggestedName, } else { - QString file = result.mid(4); // Strip "kde-" + TQString file = result.mid(4); // Strip "kde-" if (!locate("apps", ".hidden/"+file).isEmpty()) continue; } @@ -850,7 +850,7 @@ QString KService::newServicePath(bool showInMenu, const QString &suggestedName, } else { - QString file = result.mid(4); // Strip "kde-" + TQString file = result.mid(4); // Strip "kde-" return ::locateLocal("apps", ".hidden/"+file); } } @@ -860,17 +860,17 @@ void KService::virtual_hook( int id, void* data ) { KSycocaEntry::virtual_hook( id, data ); } -void KService::rebuildKSycoca(QWidget *parent) +void KService::rebuildKSycoca(TQWidget *parent) { KServiceProgressDialog dlg(parent, "ksycoca_progress", i18n("Updating System Configuration"), i18n("Updating system configuration.")); - QByteArray data; + TQByteArray data; DCOPClient *client = kapp->dcopClient(); int result = client->callAsync("kded", "kbuildsycoca", "recreate()", - data, &dlg, SLOT(slotFinished())); + data, &dlg, TQT_SLOT(slotFinished())); if (result) { @@ -878,11 +878,11 @@ void KService::rebuildKSycoca(QWidget *parent) } } -KServiceProgressDialog::KServiceProgressDialog(QWidget *parent, const char *name, - const QString &caption, const QString &text) +KServiceProgressDialog::KServiceProgressDialog(TQWidget *parent, const char *name, + const TQString &caption, const TQString &text) : KProgressDialog(parent, name, caption, text, true) { - connect(&m_timer, SIGNAL(timeout()), this, SLOT(slotProgress())); + connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotProgress())); progressBar()->setTotalSteps(20); m_timeStep = 700; m_timer.start(m_timeStep); @@ -911,7 +911,7 @@ KServiceProgressDialog::slotFinished() { progressBar()->setProgress(20); m_timer.stop(); - QTimer::singleShot(1000, this, SLOT(close())); + TQTimer::singleShot(1000, this, TQT_SLOT(close())); } #include "kservice_p.moc" diff --git a/kio/kio/kservice.h b/kio/kio/kservice.h index 6798fa4bf..dd207b304 100644 --- a/kio/kio/kservice.h +++ b/kio/kio/kservice.h @@ -20,9 +20,9 @@ #ifndef __kservices_h__ #define __kservices_h__ -#include <qstringlist.h> -#include <qmap.h> -#include <qvariant.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqvariant.h> #include <kicontheme.h> #include "ksycocaentry.h" @@ -53,7 +53,7 @@ class KIO_EXPORT KService : public KSycocaEntry public: typedef KSharedPtr<KService> Ptr; - typedef QValueList<Ptr> List; + typedef TQValueList<Ptr> List; public: /** * Construct a temporary service with a given name, exec-line and icon. @@ -61,14 +61,14 @@ public: * @param _exec the executable * @param _icon the name of the icon */ - KService( const QString & _name, const QString &_exec, const QString &_icon); + KService( const TQString & _name, const TQString &_exec, const TQString &_icon); /** * Construct a service and take all information from a config file. * * @param _fullpath Full path to the config file. */ - explicit KService( const QString & _fullpath ); + explicit KService( const TQString & _fullpath ); /** * Construct a service and take all information from a desktop file. @@ -81,7 +81,7 @@ public: * Construct a service from a stream. * The stream must already be positionned at the correct offset. */ - KService( QDataStream& _str, int offset ); + KService( TQDataStream& _str, int offset ); virtual ~KService(); @@ -89,48 +89,48 @@ public: * Returns the type of the service. * @return the type of the service ("Application" or "Service") */ - virtual QString type() const { return m_strType; } + virtual TQString type() const { return m_strType; } /** * Returns the name of the service. * @return the name of the service, - * or QString::null if not set + * or TQString::null if not set */ - virtual QString name() const { return m_strName; } + virtual TQString name() const { return m_strName; } /** * Returns the executable. * @return the command that the service executes, - * or QString::null if not set + * or TQString::null if not set */ - QString exec() const { return m_strExec; } + TQString exec() const { return m_strExec; } /** * Returns the name of the service's library. * @return the name of the library that contains the services * implementation, - * or QString::null if not set + * or TQString::null if not set */ - QString library() const { return m_strLibrary; } + TQString library() const { return m_strLibrary; } /** * Returns the name of the init function to call (KControl modules). * @return the name of the init function to call in this service * during startup of KDE. (KControl modules only), - * or QString::null if not set + * or TQString::null if not set */ - QString init() const { return m_strInit; } + TQString init() const { return m_strInit; } /** * Returns the name of the icon. * @return the icon associated with the service, * or "unknown" if not set */ - QString icon() const { return m_strIcon; } + TQString icon() const { return m_strIcon; } /** * Returns the pixmap that represents the icon. * @return a pixmap for this service (finds and loads icon()), * null if not set * @see icon() */ - QPixmap pixmap( KIcon::Group _group, int _force_size = 0, int _state = 0, - QString * _path = 0L ) const; + TQPixmap pixmap( KIcon::Group _group, int _force_size = 0, int _state = 0, + TQString * _path = 0L ) const; /** * Checks whethe the service should be run in a terminal. * @return true if the service is to be run in a terminal. @@ -142,9 +142,9 @@ public: * * The service must be a tty-oriented program. * @return the terminal options, - * or QString::null if not set + * or TQString::null if not set */ - QString terminalOptions() const { return m_strTerminalOptions; } + TQString terminalOptions() const { return m_strTerminalOptions; } /** * Checks whether the service runs with a different user id. * @return true if the service has to be run under a different uid. @@ -155,10 +155,10 @@ public: * Returns the user name, if the service runs with a * different user id. * @return the username under which the service has to be run, - * or QString::null if not set + * or TQString::null if not set * @see substututeUid()a */ - QString username() const; + TQString username() const; /** * Returns the path to the location where the service desktop entry @@ -169,17 +169,17 @@ public: * It is a full path if the desktop entry originates from another * location. * @return the path of the service's desktop file, - * or QString::null if not set + * or TQString::null if not set */ - QString desktopEntryPath() const { return entryPath(); } + TQString desktopEntryPath() const { return entryPath(); } /** * Returns the filename of the service desktop entry without any * extension. E.g. "kppp" * @return the name of the desktop entry without path or extension, - * or QString::null if not set + * or TQString::null if not set */ - QString desktopEntryName() const { return m_strDesktopEntryName; } + TQString desktopEntryName() const { return m_strDesktopEntryName; } /** * Returns the menu ID of the service desktop entry. @@ -187,7 +187,7 @@ public: * @return the menu ID * @since 3.2 */ - QString menuId() const; + TQString menuId() const; /** * Returns a normalized ID suitable for storing in configuration files. @@ -196,7 +196,7 @@ public: * @return the storage ID * @since 3.2 */ - QString storageId() const; + TQString storageId() const; /** * Describes the DCOP type of the service. @@ -221,53 +221,53 @@ public: /** * Returns the working directory to run the program in. * @return the working directory to run the program in, - * or QString::null if not set + * or TQString::null if not set */ - QString path() const { return m_strPath; } + TQString path() const { return m_strPath; } /** * Returns the descriptive comment for the service, if there is one. - * @return the descriptive comment for the service, or QString::null + * @return the descriptive comment for the service, or TQString::null * if not set */ - QString comment() const { return m_strComment; } + TQString comment() const { return m_strComment; } /** * Returns the generic name for the service, if there is one * (e.g. "Mail Client"). * @return the generic name, - * or QString::null if not set + * or TQString::null if not set */ - QString genericName() const { return m_strGenName; } + TQString genericName() const { return m_strGenName; } /** * Returns the untranslated (US English) generic name * for the service, if there is one * (e.g. "Mail Client"). * @return the generic name, - * or QString::null if not set + * or TQString::null if not set * @since 3.2 */ - QString untranslatedGenericName() const; + TQString untranslatedGenericName() const; /** * Returns a list of descriptive keywords the service, if there are any. * @return the list of keywords */ - QStringList keywords() const { return m_lstKeywords; } + TQStringList keywords() const { return m_lstKeywords; } /** * Returns a list of VFolder categories. * @return the list of VFolder categories * @since 3.1 */ - QStringList categories() const; + TQStringList categories() const; /** * Returns the service types that this service supports. * @return the list of service types that are supported */ - QStringList serviceTypes() const { return m_lstServiceTypes; } + TQStringList serviceTypes() const { return m_lstServiceTypes; } /** * Checks whether the service supports this service type @@ -277,7 +277,7 @@ public: * @return true if the service you specified is supported, * otherwise false. */ - bool hasServiceType( const QString& _service ) const; + bool hasServiceType( const TQString& _service ) const; /** * Set to true if it is allowed to use this service as the default (main) @@ -315,7 +315,7 @@ public: * @return the service preference level of the service for * this mimetype */ - int initialPreferenceForMimeType( const QString& mimeType ) const; + int initialPreferenceForMimeType( const TQString& mimeType ) const; /** * @internal. Allows KServiceType::offers to tweak the initial preference. @@ -331,10 +331,10 @@ public: /** * Name of the application this service belongs to. * (Useful for e.g. plugins) - * @return the parent application, or QString::null if not set + * @return the parent application, or TQString::null if not set * @since 3.1 */ - QString parentApp() const; + TQString parentApp() const; /** * Returns the requested property. Some often used properties @@ -348,7 +348,7 @@ public: * @return the property, or invalid if not found * @see KServiceType */ - virtual QVariant property( const QString& _name ) const; + virtual TQVariant property( const TQString& _name ) const; /** * Returns the requested property. @@ -359,14 +359,14 @@ public: * @see KServiceType * @since 3.2 */ - QVariant property( const QString& _name, QVariant::Type t ) const; + TQVariant property( const TQString& _name, TQVariant::Type t ) const; /** * Returns the list of all properties that this service can have. * That means, that some of these properties may be empty. * @return the list of supported properties */ - virtual QStringList propertyNames() const; + virtual TQStringList propertyNames() const; /** * Checks whether the service is valid. @@ -380,23 +380,23 @@ public: * @return path that can be used for saving changes to this service * @since 3.2 */ - QString locateLocal(); + TQString locateLocal(); /** * @internal * Load the service from a stream. */ - virtual void load( QDataStream& ); + virtual void load( TQDataStream& ); /** * @internal * Save the service to a stream. */ - virtual void save( QDataStream& ); + virtual void save( TQDataStream& ); /** * @internal * Set the menu id */ - void setMenuId(const QString &menuId); + void setMenuId(const TQString &menuId); /** * @internal * Sets whether to use a terminal or not @@ -406,7 +406,7 @@ public: * @internal * Sets the terminal options to use */ - void setTerminalOptions(const QString &options) { m_strTerminalOptions = options; } + void setTerminalOptions(const TQString &options) { m_strTerminalOptions = options; } /** * Find a service by name, i.e. the translated Name field. You should @@ -417,7 +417,7 @@ public: * unknown. * @em Very @em important: Don't store the result in a KService* ! */ - static Ptr serviceByName( const QString& _name ); + static Ptr serviceByName( const TQString& _name ); /** * Find a service based on its path as returned by desktopEntryPath(). @@ -428,7 +428,7 @@ public: * unknown. * @em Very @em important: Don't store the result in a KService* ! */ - static Ptr serviceByDesktopPath( const QString& _path ); + static Ptr serviceByDesktopPath( const TQString& _path ); /** * Find a service by the name of its desktop file, not depending on @@ -444,7 +444,7 @@ public: * unknown. * @em Very @em important: Don't store the result in a KService* ! */ - static Ptr serviceByDesktopName( const QString& _name ); + static Ptr serviceByDesktopName( const TQString& _name ); /** * Find a service by its menu-id @@ -455,7 +455,7 @@ public: * @em Very @em important: Don't store the result in a KService* ! * @since 3.2 */ - static Ptr serviceByMenuId( const QString& _menuId ); + static Ptr serviceByMenuId( const TQString& _menuId ); /** * Find a service by its storage-id or desktop-file path. This @@ -467,7 +467,7 @@ public: * @em Very @em important: Don't store the result in a KService* ! * @since 3.2 */ - static Ptr serviceByStorageId( const QString& _storageId ); + static Ptr serviceByStorageId( const TQString& _storageId ); /** * Returns the whole list of services. @@ -503,9 +503,9 @@ public: * @return The path to use for the new KService. * @since 3.2 */ - static QString newServicePath(bool showInMenu, const QString &suggestedName, - QString *menuId = 0, - const QStringList *reservedMenuIds = 0); + static TQString newServicePath(bool showInMenu, const TQString &suggestedName, + TQString *menuId = 0, + const TQStringList *reservedMenuIds = 0); /** @@ -513,42 +513,42 @@ public: * @param parent Parent widget for the progress dialog * @since 3.2 */ - static void rebuildKSycoca(QWidget *parent); + static void rebuildKSycoca(TQWidget *parent); protected: void init(KDesktopFile *config); - QStringList &accessServiceTypes() { return m_lstServiceTypes; } + TQStringList &accessServiceTypes() { return m_lstServiceTypes; } private: KService( const KService& ); // forbidden KService& operator=(const KService&); - QString m_strType; - QString m_strName; - QString m_strExec; - QString m_strIcon; - QString m_strTerminalOptions; - QString m_strPath; - QString m_strComment; - QString m_strLibrary; - QStringList m_lstServiceTypes; + TQString m_strType; + TQString m_strName; + TQString m_strExec; + TQString m_strIcon; + TQString m_strTerminalOptions; + TQString m_strPath; + TQString m_strComment; + TQString m_strLibrary; + TQStringList m_lstServiceTypes; bool m_bAllowAsDefault; int m_initialPreference; bool m_bTerminal; //bool m_bSuid; - //QString m_strUsername; - QString m_strDesktopEntryName; - //QString m_docPath; + //TQString m_strUsername; + TQString m_strDesktopEntryName; + //TQString m_docPath; //bool m_bHideFromPanel; DCOPServiceType_t m_DCOPServiceType; - QMap<QString,QVariant> m_mapProps; + TQMap<TQString,TQVariant> m_mapProps; bool m_bValid; - QStringList m_lstKeywords; - QString m_strInit; - QString m_strGenName; + TQStringList m_lstKeywords; + TQString m_strInit; + TQString m_strGenName; protected: virtual void virtual_hook( int id, void* data ); private: diff --git a/kio/kio/kservice_p.h b/kio/kio/kservice_p.h index fb2b565a5..180ab8fc3 100644 --- a/kio/kio/kservice_p.h +++ b/kio/kio/kservice_p.h @@ -19,7 +19,7 @@ #ifndef __kservices_p_h__ #define __kservices_p_h__ -#include <qtimer.h> +#include <tqtimer.h> #include <kprogress.h> @@ -27,14 +27,14 @@ class KServiceProgressDialog : public KProgressDialog { Q_OBJECT public: - KServiceProgressDialog(QWidget *parent, const char *name, - const QString &caption, const QString &text); + KServiceProgressDialog(TQWidget *parent, const char *name, + const TQString &caption, const TQString &text); public slots: void slotProgress(); void slotFinished(); private: - QTimer m_timer; + TQTimer m_timer; int m_timeStep; }; diff --git a/kio/kio/kservicefactory.cpp b/kio/kio/kservicefactory.cpp index e13547876..1f79deb19 100644 --- a/kio/kio/kservicefactory.cpp +++ b/kio/kio/kservicefactory.cpp @@ -22,7 +22,7 @@ #include "ksycocadict.h" #include "kservice.h" -#include <qstring.h> +#include <tqstring.h> #include <klocale.h> #include <kdebug.h> @@ -87,7 +87,7 @@ KServiceFactory * KServiceFactory::self() return _self; } -KService * KServiceFactory::findServiceByName(const QString &_name) +KService * KServiceFactory::findServiceByName(const TQString &_name) { if (!m_sycocaDict) return 0; // Error! @@ -110,7 +110,7 @@ KService * KServiceFactory::findServiceByName(const QString &_name) return newService; } -KService * KServiceFactory::findServiceByDesktopName(const QString &_name) +KService * KServiceFactory::findServiceByDesktopName(const TQString &_name) { if (!m_nameDict) return 0; // Error! @@ -133,7 +133,7 @@ KService * KServiceFactory::findServiceByDesktopName(const QString &_name) return newService; } -KService * KServiceFactory::findServiceByDesktopPath(const QString &_name) +KService * KServiceFactory::findServiceByDesktopPath(const TQString &_name) { if (!m_relNameDict) return 0; // Error! @@ -156,7 +156,7 @@ KService * KServiceFactory::findServiceByDesktopPath(const QString &_name) return newService; } -KService * KServiceFactory::findServiceByMenuId(const QString &_menuId) +KService * KServiceFactory::findServiceByMenuId(const TQString &_menuId) { if (!m_menuIdDict) return 0; // Error! @@ -183,7 +183,7 @@ KService* KServiceFactory::createEntry(int offset) { KService * newEntry = 0L; KSycocaType type; - QDataStream *str = KSycoca::self()->findEntry(offset, type); + TQDataStream *str = KSycoca::self()->findEntry(offset, type); switch(type) { case KST_KService: @@ -191,7 +191,7 @@ KService* KServiceFactory::createEntry(int offset) break; default: - kdError(7011) << QString("KServiceFactory: unexpected object entry in KSycoca database (type = %1)").arg((int)type) << endl; + kdError(7011) << TQString("KServiceFactory: unexpected object entry in KSycoca database (type = %1)").arg((int)type) << endl; return 0; } if (!newEntry->isValid()) @@ -251,7 +251,7 @@ KService::List KServiceFactory::offers( int serviceTypeOffset ) { KService::List list; - QDataStream *str = m_str; + TQDataStream *str = m_str; // Jump to the offer list str->device()->at( m_offerListOffset ); diff --git a/kio/kio/kservicefactory.h b/kio/kio/kservicefactory.h index d266c4b87..1a828364e 100644 --- a/kio/kio/kservicefactory.h +++ b/kio/kio/kservicefactory.h @@ -20,7 +20,7 @@ #ifndef __kservicefactory_h__ #define __kservicefactory_h__ -#include <qstringlist.h> +#include <tqstringlist.h> #include "kservice.h" #include "ksycocafactory.h" @@ -48,28 +48,28 @@ public: /** * Construct a KService from a config file. */ - virtual KSycocaEntry *createEntry(const QString &, const char *) + virtual KSycocaEntry *createEntry(const TQString &, const char *) { assert(0); return 0; } /** * Find a service (by name, e.g. "Terminal") */ - KService * findServiceByName( const QString &_name ); + KService * findServiceByName( const TQString &_name ); /** * Find a service (by desktop file name, e.g. "konsole") */ - KService * findServiceByDesktopName( const QString &_name ); + KService * findServiceByDesktopName( const TQString &_name ); /** * Find a service ( by desktop path, e.g. "System/konsole.desktop") */ - KService * findServiceByDesktopPath( const QString &_name ); + KService * findServiceByDesktopPath( const TQString &_name ); /** * Find a service ( by menu id, e.g. "kde-konsole.desktop") */ - KService * findServiceByMenuId( const QString &_menuId ); + KService * findServiceByMenuId( const TQString &_menuId ); /** * @return the services supporting the given service type diff --git a/kio/kio/kservicegroup.cpp b/kio/kio/kservicegroup.cpp index c754fac0f..1531dc796 100644 --- a/kio/kio/kservicegroup.cpp +++ b/kio/kio/kservicegroup.cpp @@ -38,12 +38,12 @@ public: bool m_bInlineAlias; bool m_bAllowInline; int m_inlineValue; - QStringList suppressGenericNames; - QString directoryEntryPath; - QStringList sortOrder; + TQStringList suppressGenericNames; + TQString directoryEntryPath; + TQStringList sortOrder; }; -KServiceGroup::KServiceGroup( const QString & name ) +KServiceGroup::KServiceGroup( const TQString & name ) : KSycocaEntry(name), m_childCount(-1) { d = new KServiceGroup::Private; @@ -51,14 +51,14 @@ KServiceGroup::KServiceGroup( const QString & name ) m_bDeep = false; } -KServiceGroup::KServiceGroup( const QString &configFile, const QString & _relpath ) +KServiceGroup::KServiceGroup( const TQString &configFile, const TQString & _relpath ) : KSycocaEntry(_relpath), m_childCount(-1) { d = new KServiceGroup::Private; m_bDeleted = false; m_bDeep = false; - QString cfg = configFile; + TQString cfg = configFile; if (cfg.isEmpty()) cfg = _relpath+".directory"; @@ -73,7 +73,7 @@ KServiceGroup::KServiceGroup( const QString &configFile, const QString & _relpat m_strComment = config.readEntry( "Comment" ); m_bDeleted = config.readBoolEntry( "Hidden", false ); d->m_bNoDisplay = config.readBoolEntry( "NoDisplay", false ); - QStringList tmpList; + TQStringList tmpList; if (config.hasKey("OnlyShowIn")) { if (!config.readListEntry("OnlyShowIn", ';').contains("KDE")) @@ -103,7 +103,7 @@ KServiceGroup::KServiceGroup( const QString &configFile, const QString & _relpat m_strIcon = "folder"; } -KServiceGroup::KServiceGroup( QDataStream& _str, int offset, bool deep ) : +KServiceGroup::KServiceGroup( TQDataStream& _str, int offset, bool deep ) : KSycocaEntry( _str, offset ) { d = new KServiceGroup::Private; @@ -198,14 +198,14 @@ bool KServiceGroup::noDisplay() const return d->m_bNoDisplay || m_strCaption.startsWith("."); } -QStringList KServiceGroup::suppressGenericNames() const +TQStringList KServiceGroup::suppressGenericNames() const { return d->suppressGenericNames; } -void KServiceGroup::load( QDataStream& s ) +void KServiceGroup::load( TQDataStream& s ) { - QStringList groupList; + TQStringList groupList; Q_INT8 noDisplay; Q_INT8 _showEmptyMenu; Q_INT8 inlineHeader; @@ -224,10 +224,10 @@ void KServiceGroup::load( QDataStream& s ) if (m_bDeep) { - for(QStringList::ConstIterator it = groupList.begin(); + for(TQStringList::ConstIterator it = groupList.begin(); it != groupList.end(); it++) { - QString path = *it; + TQString path = *it; if (path[path.length()-1] == '/') { KServiceGroup *serviceGroup; @@ -251,11 +251,11 @@ void KServiceGroup::addEntry( KSycocaEntry *entry) m_serviceList.append(entry); } -void KServiceGroup::save( QDataStream& s ) +void KServiceGroup::save( TQDataStream& s ) { KSycocaEntry::save( s ); - QStringList groupList; + TQStringList groupList; for( List::ConstIterator it = m_serviceList.begin(); it != m_serviceList.end(); it++) { @@ -333,8 +333,8 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b // Sort the list alphabetically, according to locale. // Groups come first, then services. - KSortableValueList<SPtr,QCString> slist; - KSortableValueList<SPtr,QCString> glist; + KSortableValueList<SPtr,TQCString> slist; + KSortableValueList<SPtr,TQCString> glist; for (List::ConstIterator it(group->m_serviceList.begin()); it != group->m_serviceList.end(); ++it) { KSycocaEntry *p = (*it); @@ -344,8 +344,8 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b if (excludeNoDisplay && noDisplay) continue; // Choose the right list - KSortableValueList<SPtr,QCString> & list = p->isType(KST_KServiceGroup) ? glist : slist; - QString name; + KSortableValueList<SPtr,TQCString> & list = p->isType(KST_KServiceGroup) ? glist : slist; + TQString name; if (p->isType(KST_KServiceGroup)) name = static_cast<KServiceGroup *>(p)->caption(); else if (sortByGenericName) @@ -353,7 +353,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b else name = p->name() + " " + static_cast<KService *>(p)->genericName(); - QCString key( name.length() * 4 + 1 ); + TQCString key( name.length() * 4 + 1 ); // strxfrm() crashes on Solaris #ifndef USE_SOLARIS // maybe it'd be better to use wcsxfrm() where available @@ -385,20 +385,20 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b d->sortOrder << ":OIH IL[4]"; //just inline header } - QString rp = relPath(); - if(rp == "/") rp = QString::null; + TQString rp = relPath(); + if(rp == "/") rp = TQString::null; // Iterate through the sort spec list. // If an entry gets mentioned explicitly, we remove it from the sorted list - for (QStringList::ConstIterator it(d->sortOrder.begin()); it != d->sortOrder.end(); ++it) + for (TQStringList::ConstIterator it(d->sortOrder.begin()); it != d->sortOrder.end(); ++it) { - const QString &item = *it; + const TQString &item = *it; if (item.isEmpty()) continue; if (item[0] == '/') { - QString groupPath = rp + item.mid(1) + "/"; + TQString groupPath = rp + item.mid(1) + "/"; // Remove entry from sorted list of services. - for(KSortableValueList<SPtr,QCString>::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) + for(KSortableValueList<SPtr,TQCString>::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) { KServiceGroup *group = (KServiceGroup *)((KSycocaEntry *)((*it2).value())); if (group->relPath() == groupPath) @@ -413,7 +413,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b // Remove entry from sorted list of services. // TODO: Remove item from sortOrder-list if not found // TODO: This prevents duplicates - for(KSortableValueList<SPtr,QCString>::Iterator it2 = slist.begin(); it2 != slist.end(); ++it2) + for(KSortableValueList<SPtr,TQCString>::Iterator it2 = slist.begin(); it2 != slist.end(); ++it2) { KService *service = (KService *)((KSycocaEntry *)((*it2).value())); if (service->menuId() == item) @@ -430,9 +430,9 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b bool needSeparator = false; // Iterate through the sort spec list. // Add the entries to the list according to the sort spec. - for (QStringList::ConstIterator it(d->sortOrder.begin()); it != d->sortOrder.end(); ++it) + for (TQStringList::ConstIterator it(d->sortOrder.begin()); it != d->sortOrder.end(); ++it) { - const QString &item = *it; + const TQString &item = *it; if (item.isEmpty()) continue; if (item[0] == ':') { @@ -445,9 +445,9 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b else if ( item.contains( ":O" ) ) { //todo parse attribute: - QString tmp( item ); + TQString tmp( item ); tmp = tmp.remove(":O"); - QStringList optionAttribute = QStringList::split(" ",tmp); + TQStringList optionAttribute = TQStringList::split(" ",tmp); if( optionAttribute.count()==0) optionAttribute.append(tmp); bool showEmptyMenu = false; @@ -456,11 +456,11 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b bool showInlineAlias = false; int inlineValue = -1; - for ( QStringList::Iterator it3 = optionAttribute.begin(); it3 != optionAttribute.end(); ++it3 ) + for ( TQStringList::Iterator it3 = optionAttribute.begin(); it3 != optionAttribute.end(); ++it3 ) { parseAttribute( *it3, showEmptyMenu, showInline, showInlineHeader, showInlineAlias, inlineValue ); } - for(KSortableValueList<SPtr,QCString>::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) + for(KSortableValueList<SPtr,TQCString>::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) { KServiceGroup *group = (KServiceGroup *)((KSycocaEntry *)(*it2).value()); group->setShowEmptyMenu( showEmptyMenu ); @@ -474,7 +474,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b else if (item == ":M") { // Add sorted list of sub-menus - for(KSortableValueList<SPtr,QCString>::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) + for(KSortableValueList<SPtr,TQCString>::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) { addItem(sorted, (*it2).value(), needSeparator); } @@ -482,7 +482,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b else if (item == ":F") { // Add sorted list of services - for(KSortableValueList<SPtr,QCString>::Iterator it2 = slist.begin(); it2 != slist.end(); ++it2) + for(KSortableValueList<SPtr,TQCString>::Iterator it2 = slist.begin(); it2 != slist.end(); ++it2) { addItem(sorted, (*it2).value(), needSeparator); } @@ -490,8 +490,8 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b else if (item == ":A") { // Add sorted lists of services and submenus - KSortableValueList<SPtr,QCString>::Iterator it_s = slist.begin(); - KSortableValueList<SPtr,QCString>::Iterator it_g = glist.begin(); + KSortableValueList<SPtr,TQCString>::Iterator it_s = slist.begin(); + KSortableValueList<SPtr,TQCString>::Iterator it_g = glist.begin(); while(true) { @@ -527,7 +527,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b } else if (item[0] == '/') { - QString groupPath = rp + item.mid(1) + "/"; + TQString groupPath = rp + item.mid(1) + "/"; for (List::ConstIterator it2(group->m_serviceList.begin()); it2 != group->m_serviceList.end(); ++it2) { @@ -538,12 +538,12 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b { if (!excludeNoDisplay || !group->noDisplay()) { - const QString &nextItem = *( ++it ); + const TQString &nextItem = *( ++it ); if ( nextItem.startsWith( ":O" ) ) { - QString tmp( nextItem ); + TQString tmp( nextItem ); tmp = tmp.remove(":O"); - QStringList optionAttribute = QStringList::split(" ",tmp); + TQStringList optionAttribute = TQStringList::split(" ",tmp); if( optionAttribute.count()==0) optionAttribute.append(tmp); bool bShowEmptyMenu = false; @@ -551,7 +551,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b bool bShowInlineHeader = false; bool bShowInlineAlias = false; int inlineValue = -1; - for ( QStringList::Iterator it3 = optionAttribute.begin(); it3 != optionAttribute.end(); ++it3 ) + for ( TQStringList::Iterator it3 = optionAttribute.begin(); it3 != optionAttribute.end(); ++it3 ) { parseAttribute( *it3 , bShowEmptyMenu, bShowInline, bShowInlineHeader, bShowInlineAlias , inlineValue ); group->setShowEmptyMenu( bShowEmptyMenu ); @@ -590,7 +590,7 @@ KServiceGroup::entries(bool sort, bool excludeNoDisplay, bool allowSeparators, b return sorted; } -void KServiceGroup::parseAttribute( const QString &item , bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias , int &inlineValue ) +void KServiceGroup::parseAttribute( const TQString &item , bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias , int &inlineValue ) { if( item == "ME") //menu empty showEmptyMenu=true; @@ -610,7 +610,7 @@ void KServiceGroup::parseAttribute( const QString &item , bool &showEmptyMenu, showInlineAlias = false; else if( ( item ).contains( "IL" )) //inline limite! { - QString tmp( item ); + TQString tmp( item ); tmp = tmp.remove( "IL[" ); tmp = tmp.remove( "]" ); bool ok; @@ -623,18 +623,18 @@ void KServiceGroup::parseAttribute( const QString &item , bool &showEmptyMenu, kdDebug()<<" This attribute is not supported :"<<item<<endl; } -void KServiceGroup::setLayoutInfo(const QStringList &layout) +void KServiceGroup::setLayoutInfo(const TQStringList &layout) { d->sortOrder = layout; } -QStringList KServiceGroup::layoutInfo() const +TQStringList KServiceGroup::layoutInfo() const { return d->sortOrder; } KServiceGroup::Ptr -KServiceGroup::baseGroup( const QString & _baseGroupName ) +KServiceGroup::baseGroup( const TQString & _baseGroupName ) { return KServiceGroupFactory::self()->findBaseGroup(_baseGroupName, true); } @@ -646,14 +646,14 @@ KServiceGroup::root() } KServiceGroup::Ptr -KServiceGroup::group(const QString &relPath) +KServiceGroup::group(const TQString &relPath) { if (relPath.isEmpty()) return root(); return KServiceGroupFactory::self()->findGroupByDesktopPath(relPath, true); } KServiceGroup::Ptr -KServiceGroup::childGroup(const QString &parent) +KServiceGroup::childGroup(const TQString &parent) { return KServiceGroupFactory::self()->findGroupByDesktopPath("#parent#"+parent, true); } diff --git a/kio/kio/kservicegroup.h b/kio/kio/kservicegroup.h index e9457b394..de26a3ffb 100644 --- a/kio/kio/kservicegroup.h +++ b/kio/kio/kservicegroup.h @@ -19,11 +19,11 @@ #ifndef __kservicegroup_h__ #define __kservicegroup_h__ -#include <qptrlist.h> -#include <qstring.h> -#include <qshared.h> -#include <qdatastream.h> -#include <qvariant.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqshared.h> +#include <tqdatastream.h> +#include <tqvariant.h> #include <kdesktopfile.h> @@ -72,27 +72,27 @@ class KIO_EXPORT KServiceGroup : public KSycocaEntry public: typedef KSharedPtr<KServiceGroup> Ptr; typedef KSharedPtr<KSycocaEntry> SPtr; - typedef QValueList<SPtr> List; + typedef TQValueList<SPtr> List; public: /** * Construct a dummy servicegroup indexed with @p name. * @param name the name of the service group * @since 3.1 */ - KServiceGroup( const QString & name ); + KServiceGroup( const TQString & name ); /** * Construct a service and take all informations from a config file * @param _fullpath full path to the config file * @param _relpath relative path to the config file */ - KServiceGroup( const QString & _fullpath, const QString & _relpath ); + KServiceGroup( const TQString & _fullpath, const TQString & _relpath ); /** * @internal construct a service from a stream. * The stream must already be positionned at the correct offset */ - KServiceGroup( QDataStream& _str, int offset, bool deep ); + KServiceGroup( TQDataStream& _str, int offset, bool deep ); virtual ~KServiceGroup(); @@ -106,33 +106,33 @@ public: * Name used for indexing. * @return the service group's name */ - virtual QString name() const { return entryPath(); } + virtual TQString name() const { return entryPath(); } /** * Returns the relative path of the service group. * @return the service group's relative path */ - virtual QString relPath() const { return entryPath(); } + virtual TQString relPath() const { return entryPath(); } /** * Returns the caption of this group. * @return the caption of this group */ - QString caption() const { return m_strCaption; } + TQString caption() const { return m_strCaption; } /** * Returns the name of the icon associated with the group. * @return the name of the icon associated with the group, - * or QString::null if not set + * or TQString::null if not set */ - QString icon() const { return m_strIcon; } + TQString icon() const { return m_strIcon; } /** * Returns the comment about this service group. * @return the descriptive comment for the group, if there is one, - * or QString::null if not set + * or TQString::null if not set */ - QString comment() const { return m_strComment; } + TQString comment() const { return m_strComment; } /** * Returns the total number of displayable services in this group and @@ -192,30 +192,30 @@ public: * "Arcade Game" since it's redundant in this particular context. * @since 3.2 */ - QStringList suppressGenericNames() const; + TQStringList suppressGenericNames() const; /** * @internal * Sets information related to the layout of services in this group. */ - void setLayoutInfo(const QStringList &layout); + void setLayoutInfo(const TQStringList &layout); /** * @internal * Returns information related to the layout of services in this group. */ - QStringList layoutInfo() const; + TQStringList layoutInfo() const; /** * @internal * Load the service from a stream. */ - virtual void load( QDataStream& ); + virtual void load( TQDataStream& ); /** * @internal * Save the service to a stream. */ - virtual void save( QDataStream& ); + virtual void save( TQDataStream& ); /** * List of all Services and ServiceGroups within this @@ -248,21 +248,21 @@ public: * in the .directory file. * @return the base group name, or null if no base group */ - QString baseGroupName() const { return m_strBaseGroupName; } + TQString baseGroupName() const { return m_strBaseGroupName; } /** * Returns a path to the .directory file describing this service group. * The path is either absolute or relative to the "apps" resource. * @since 3.2 */ - QString directoryEntryPath() const; + TQString directoryEntryPath() const; /** * Returns the group for the given baseGroupName. * Can return 0L if the directory (or the .directory file) was deleted. * @return the base group with the given name, or 0 if not available. */ - static Ptr baseGroup( const QString &baseGroupName ); + static Ptr baseGroup( const TQString &baseGroupName ); /** * Returns the root service group. @@ -275,7 +275,7 @@ public: * @param relPath the path of the service group * @return the group with the given relative path name. */ - static Ptr group(const QString &relPath); + static Ptr group(const TQString &relPath); /** * Returns the group of services that have X-KDE-ParentApp equal @@ -284,13 +284,13 @@ public: * @return the services group * @since 3.1 */ - static Ptr childGroup(const QString &parent); + static Ptr childGroup(const TQString &parent); /** * This function parse attributes into menu * @since 3.5 */ - void parseAttribute( const QString &item , bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias ,int &inlineValue ); + void parseAttribute( const TQString &item , bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias ,int &inlineValue ); protected: /** @@ -299,13 +299,13 @@ protected: */ void addEntry( KSycocaEntry *entry); - QString m_strCaption; - QString m_strIcon; - QString m_strComment; + TQString m_strCaption; + TQString m_strIcon; + TQString m_strComment; List m_serviceList; bool m_bDeep; - QString m_strBaseGroupName; + TQString m_strBaseGroupName; int m_childCount; protected: virtual void virtual_hook( int id, void* data ); @@ -330,11 +330,11 @@ public: bool isValid() const { return true; } // Dummy - virtual QString name() const { return "separator"; } + virtual TQString name() const { return "separator"; } // Dummy - virtual void load( QDataStream& ) { }; + virtual void load( TQDataStream& ) { }; // Dummy - virtual void save( QDataStream& ) { }; + virtual void save( TQDataStream& ) { }; }; #endif diff --git a/kio/kio/kservicegroupfactory.cpp b/kio/kio/kservicegroupfactory.cpp index 105cf23d7..9bca4dc63 100644 --- a/kio/kio/kservicegroupfactory.cpp +++ b/kio/kio/kservicegroupfactory.cpp @@ -22,7 +22,7 @@ #include "ksycocadict.h" #include "kservice.h" -#include <qstring.h> +#include <tqstring.h> #include <klocale.h> #include <kdebug.h> @@ -66,7 +66,7 @@ KServiceGroupFactory * KServiceGroupFactory::self() return _self; } -KServiceGroup * KServiceGroupFactory::findGroupByDesktopPath(const QString &_name, bool deep) +KServiceGroup * KServiceGroupFactory::findGroupByDesktopPath(const TQString &_name, bool deep) { if (!m_sycocaDict) return 0; // Error! @@ -89,7 +89,7 @@ KServiceGroup * KServiceGroupFactory::findGroupByDesktopPath(const QString &_nam return newGroup; } -KServiceGroup * KServiceGroupFactory::findBaseGroup(const QString &_baseGroupName, bool deep) +KServiceGroup * KServiceGroupFactory::findBaseGroup(const TQString &_baseGroupName, bool deep) { if (!m_baseGroupDict) return 0; // Error! @@ -116,7 +116,7 @@ KServiceGroup* KServiceGroupFactory::createGroup(int offset, bool deep) { KServiceGroup * newEntry = 0L; KSycocaType type; - QDataStream *str = KSycoca::self()->findEntry(offset, type); + TQDataStream *str = KSycoca::self()->findEntry(offset, type); switch(type) { case KST_KServiceGroup: @@ -124,7 +124,7 @@ KServiceGroup* KServiceGroupFactory::createGroup(int offset, bool deep) break; default: - kdError(7011) << QString("KServiceGroupFactory: unexpected object entry in KSycoca database (type = %1)").arg((int)type) << endl; + kdError(7011) << TQString("KServiceGroupFactory: unexpected object entry in KSycoca database (type = %1)").arg((int)type) << endl; return 0; } if (!newEntry->isValid()) diff --git a/kio/kio/kservicegroupfactory.h b/kio/kio/kservicegroupfactory.h index 429748857..b1131b398 100644 --- a/kio/kio/kservicegroupfactory.h +++ b/kio/kio/kservicegroupfactory.h @@ -19,7 +19,7 @@ #ifndef __kservicegroupfactory_h__ #define __kservicegroupfactory_h__ -#include <qstringlist.h> +#include <tqstringlist.h> #include "kservicegroup.h" #include "ksycocafactory.h" @@ -46,18 +46,18 @@ public: /** * Construct a KServiceGroup from a config file. */ - virtual KSycocaEntry *createEntry(const QString &, const char *) + virtual KSycocaEntry *createEntry(const TQString &, const char *) { assert(0); return 0; } /** * Find a group ( by desktop path, e.g. "Applications/Editors") */ - KServiceGroup * findGroupByDesktopPath( const QString &_name, bool deep = true ); + KServiceGroup * findGroupByDesktopPath( const TQString &_name, bool deep = true ); /** * Find a base group by name, e.g. "settings" */ - KServiceGroup * findBaseGroup( const QString &_baseGroupName, bool deep = true ); + KServiceGroup * findBaseGroup( const TQString &_baseGroupName, bool deep = true ); /** * @return the unique service group factory, creating it if necessary diff --git a/kio/kio/kservicetype.cpp b/kio/kio/kservicetype.cpp index 1e0067661..48693aceb 100644 --- a/kio/kio/kservicetype.cpp +++ b/kio/kio/kservicetype.cpp @@ -27,8 +27,8 @@ #include <kdebug.h> #include <kdesktopfile.h> -template QDataStream& operator>> <QString, QVariant>(QDataStream&, QMap<QString, QVariant>&); -template QDataStream& operator<< <QString, QVariant>(QDataStream&, const QMap<QString, QVariant>&); +template TQDataStream& operator>> <TQString, TQVariant>(TQDataStream&, TQMap<TQString, TQVariant>&); +template TQDataStream& operator<< <TQString, TQVariant>(TQDataStream&, const TQMap<TQString, TQVariant>&); class KServiceType::KServiceTypePrivate { @@ -40,7 +40,7 @@ public: bool parentTypeLoaded; }; -KServiceType::KServiceType( const QString & _fullpath) +KServiceType::KServiceType( const TQString & _fullpath) : KSycocaEntry(_fullpath), d(0) { KDesktopFile config( _fullpath ); @@ -72,21 +72,21 @@ KServiceType::init( KDesktopFile *config) // We store this as property to preserve BC, we can't change that // because KSycoca needs to remain BC between KDE 2.x and KDE 3.x - QString sDerived = config->readEntry( "X-KDE-Derived" ); + TQString sDerived = config->readEntry( "X-KDE-Derived" ); m_bDerived = !sDerived.isEmpty(); if ( m_bDerived ) m_mapProps.insert( "X-KDE-Derived", sDerived ); - QStringList tmpList = config->groupList(); - QStringList::Iterator gIt = tmpList.begin(); + TQStringList tmpList = config->groupList(); + TQStringList::Iterator gIt = tmpList.begin(); for( ; gIt != tmpList.end(); ++gIt ) { if ( (*gIt).find( "Property::" ) == 0 ) { config->setGroup( *gIt ); - QVariant v = config->readPropertyEntry( "Value", - QVariant::nameToType( config->readEntry( "Type" ).ascii() ) ); + TQVariant v = config->readPropertyEntry( "Value", + TQVariant::nameToType( config->readEntry( "Type" ).ascii() ) ); if ( v.isValid() ) m_mapProps.insert( (*gIt).mid( 10 ), v ); } @@ -99,15 +99,15 @@ KServiceType::init( KDesktopFile *config) { config->setGroup( *gIt ); m_mapPropDefs.insert( (*gIt).mid( 13 ), - QVariant::nameToType( config->readEntry( "Type" ).ascii() ) ); + TQVariant::nameToType( config->readEntry( "Type" ).ascii() ) ); } } m_bValid = !m_strName.isEmpty(); } -KServiceType::KServiceType( const QString & _fullpath, const QString& _type, - const QString& _icon, const QString& _comment ) +KServiceType::KServiceType( const TQString & _fullpath, const TQString& _type, + const TQString& _icon, const TQString& _comment ) : KSycocaEntry(_fullpath), d(0) { m_strName = _type; @@ -116,14 +116,14 @@ KServiceType::KServiceType( const QString & _fullpath, const QString& _type, m_bValid = !m_strName.isEmpty(); } -KServiceType::KServiceType( QDataStream& _str, int offset ) +KServiceType::KServiceType( TQDataStream& _str, int offset ) : KSycocaEntry( _str, offset ), d(0) { load( _str); } void -KServiceType::load( QDataStream& _str ) +KServiceType::load( TQDataStream& _str ) { Q_INT8 b; _str >> m_strName >> m_strIcon >> m_strComment >> m_mapProps >> m_mapPropDefs @@ -133,7 +133,7 @@ KServiceType::load( QDataStream& _str ) } void -KServiceType::save( QDataStream& _str ) +KServiceType::save( TQDataStream& _str ) { KSycocaEntry::save( _str ); // !! This data structure should remain binary compatible at all times !! @@ -148,17 +148,17 @@ KServiceType::~KServiceType() delete d; } -QString KServiceType::parentServiceType() const +TQString KServiceType::parentServiceType() const { - QVariant v = property("X-KDE-Derived"); + TQVariant v = property("X-KDE-Derived"); return v.toString(); } -bool KServiceType::inherits( const QString& servTypeName ) const +bool KServiceType::inherits( const TQString& servTypeName ) const { if ( name() == servTypeName ) return true; - QString st = parentServiceType(); + TQString st = parentServiceType(); while ( !st.isEmpty() ) { KServiceType::Ptr ptr = KServiceType::serviceType( st ); @@ -171,18 +171,18 @@ bool KServiceType::inherits( const QString& servTypeName ) const } QVariant -KServiceType::property( const QString& _name ) const +KServiceType::property( const TQString& _name ) const { - QVariant v; + TQVariant v; if ( _name == "Name" ) - v = QVariant( m_strName ); + v = TQVariant( m_strName ); else if ( _name == "Icon" ) - v = QVariant( m_strIcon ); + v = TQVariant( m_strIcon ); else if ( _name == "Comment" ) - v = QVariant( m_strComment ); + v = TQVariant( m_strComment ); else { - QMap<QString,QVariant>::ConstIterator it = m_mapProps.find( _name ); + TQMap<TQString,TQVariant>::ConstIterator it = m_mapProps.find( _name ); if ( it != m_mapProps.end() ) v = it.data(); } @@ -193,9 +193,9 @@ KServiceType::property( const QString& _name ) const QStringList KServiceType::propertyNames() const { - QStringList res; + TQStringList res; - QMap<QString,QVariant>::ConstIterator it = m_mapProps.begin(); + TQMap<TQString,TQVariant>::ConstIterator it = m_mapProps.begin(); for( ; it != m_mapProps.end(); ++it ) res.append( it.key() ); @@ -206,36 +206,36 @@ KServiceType::propertyNames() const return res; } -QVariant::Type -KServiceType::propertyDef( const QString& _name ) const +TQVariant::Type +KServiceType::propertyDef( const TQString& _name ) const { - QMap<QString,QVariant::Type>::ConstIterator it = m_mapPropDefs.find( _name ); + TQMap<TQString,TQVariant::Type>::ConstIterator it = m_mapPropDefs.find( _name ); if ( it == m_mapPropDefs.end() ) - return QVariant::Invalid; + return TQVariant::Invalid; return it.data(); } QStringList KServiceType::propertyDefNames() const { - QStringList l; + TQStringList l; - QMap<QString,QVariant::Type>::ConstIterator it = m_mapPropDefs.begin(); + TQMap<TQString,TQVariant::Type>::ConstIterator it = m_mapPropDefs.begin(); for( ; it != m_mapPropDefs.end(); ++it ) l.append( it.key() ); return l; } -KServiceType::Ptr KServiceType::serviceType( const QString& _name ) +KServiceType::Ptr KServiceType::serviceType( const TQString& _name ) { KServiceType * p = KServiceTypeFactory::self()->findServiceTypeByName( _name ); return KServiceType::Ptr( p ); } -static void addUnique(KService::List &lst, QDict<KService> &dict, const KService::List &newLst, bool lowPrio) +static void addUnique(KService::List &lst, TQDict<KService> &dict, const KService::List &newLst, bool lowPrio) { - QValueListConstIterator<KService::Ptr> it = newLst.begin(); + TQValueListConstIterator<KService::Ptr> it = newLst.begin(); for( ; it != newLst.end(); ++it ) { KService *service = static_cast<KService*>(*it); @@ -248,9 +248,9 @@ static void addUnique(KService::List &lst, QDict<KService> &dict, const KService } } -KService::List KServiceType::offers( const QString& _servicetype ) +KService::List KServiceType::offers( const TQString& _servicetype ) { - QDict<KService> dict(53); + TQDict<KService> dict(53); KService::List lst; // Services associated directly with this servicetype (the normal case) @@ -267,7 +267,7 @@ KService::List KServiceType::offers( const QString& _servicetype ) { while(true) { - QString parent = mime->parentMimeType(); + TQString parent = mime->parentMimeType(); if (parent.isEmpty()) break; mime = dynamic_cast<KMimeType *>(KServiceTypeFactory::self()->findServiceTypeByName( parent )); @@ -279,7 +279,7 @@ KService::List KServiceType::offers( const QString& _servicetype ) } serv = mime = 0; - //QValueListIterator<KService::Ptr> it = lst.begin(); + //TQValueListIterator<KService::Ptr> it = lst.begin(); //for( ; it != lst.end(); ++it ) // kdDebug() << (*it).data() << " " << (*it)->name() << endl; @@ -330,7 +330,7 @@ KServiceType::Ptr KServiceType::parentType() if (!d) d = new KServiceTypePrivate; - QString parentSt = parentServiceType(); + TQString parentSt = parentServiceType(); if (!parentSt.isEmpty()) { d->parentType = KServiceTypeFactory::self()->findServiceTypeByName( parentSt ); diff --git a/kio/kio/kservicetype.h b/kio/kio/kservicetype.h index 368b9c540..27624e50b 100644 --- a/kio/kio/kservicetype.h +++ b/kio/kio/kservicetype.h @@ -24,13 +24,13 @@ #include "ksycocaentry.h" #include "kservice.h" -#include <qstring.h> -#include <qstringlist.h> -#include <qptrlist.h> -#include <qmap.h> -#include <qshared.h> -#include <qdatastream.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqptrlist.h> +#include <tqmap.h> +#include <tqshared.h> +#include <tqdatastream.h> +#include <tqvariant.h> #include <ksimpleconfig.h> @@ -48,7 +48,7 @@ class KIO_EXPORT KServiceType : public KSycocaEntry public: typedef KSharedPtr<KServiceType> Ptr; - typedef QValueList<Ptr> List; + typedef TQValueList<Ptr> List; public: /** @@ -59,15 +59,15 @@ public: * @param _icon the icon name of the service type (can be null) * @param _comment a comment (can be null) */ - KServiceType( const QString & _fullpath, const QString& _name, - const QString& _icon, const QString& _comment); + KServiceType( const TQString & _fullpath, const TQString& _name, + const TQString& _icon, const TQString& _comment); /** * Construct a service type and take all informations from a config file. * @param _fullpath path of the desktop file, set to "" if calling from * a inherited constructor. */ - KServiceType( const QString & _fullpath ); + KServiceType( const TQString & _fullpath ); /** * Construct a service type and take all informations from a deskop file. @@ -79,7 +79,7 @@ public: * @internal construct a service from a stream. * The stream must already be positionned at the correct offset */ - KServiceType( QDataStream& _str, int offset ); + KServiceType( TQDataStream& _str, int offset ); virtual ~KServiceType(); @@ -89,21 +89,21 @@ public: * example an URL and returns a special icon for this * URL. An example is KMimeType, KFolderType and * others. - * @return the name of the icon, can be QString::null. + * @return the name of the icon, can be TQString::null. */ - QString icon() const { return m_strIcon; } + TQString icon() const { return m_strIcon; } /** * Returns the descriptive comment associated, if any. - * @return the comment, or QString::null + * @return the comment, or TQString::null */ - QString comment() const { return m_strComment; } + TQString comment() const { return m_strComment; } /** * Returns the name of this service type. * @return the name of the service type */ - QString name() const { return m_strName; } + TQString name() const { return m_strName; } /** * Returns the relative path to the desktop entry file responsible for @@ -111,7 +111,7 @@ public: * For instance inode/directory.desktop, or kpart.desktop * @return the path of the desktop file */ - QString desktopEntryPath() const { return entryPath(); } + TQString desktopEntryPath() const { return entryPath(); } /** * Checks whether this service type inherits another one. @@ -123,17 +123,17 @@ public: /** * If this service type inherits from another service type, * return the name of the parent. - * @return the parent service type, or QString:: null if not set + * @return the parent service type, or TQString:: null if not set * @see isDerived() */ - QString parentServiceType() const; + TQString parentServiceType() const; /** * Checks whether this service type is or inherits from @p servTypeName. * @return true if this servicetype is or inherits from @p servTypeName * @since 3.1 */ - bool inherits( const QString& servTypeName ) const; + bool inherits( const TQString& servTypeName ) const; /** * Returns the requested property. Some often used properties @@ -143,13 +143,13 @@ public: * @param _name the name of the property * @return the property, or invalid if not found */ - virtual QVariant property( const QString& _name ) const; + virtual TQVariant property( const TQString& _name ) const; /** * Returns the list of all properties of this service type. * @return the list of properties */ - virtual QStringList propertyNames() const; + virtual TQStringList propertyNames() const; /** * Checks whether the service type is valid. @@ -163,22 +163,22 @@ public: * @param _name the name of the property * @return the property type, or null if not found */ - virtual QVariant::Type propertyDef( const QString& _name ) const; + virtual TQVariant::Type propertyDef( const TQString& _name ) const; - virtual QStringList propertyDefNames() const; - virtual const QMap<QString,QVariant::Type>& propertyDefs() const { return m_mapPropDefs; } + virtual TQStringList propertyDefNames() const; + virtual const TQMap<TQString,TQVariant::Type>& propertyDefs() const { return m_mapPropDefs; } /** * @internal * Save ourselves to the data stream. */ - virtual void save( QDataStream& ); + virtual void save( TQDataStream& ); /** * @internal * Load ourselves from the data stream. */ - virtual void load( QDataStream& ); + virtual void load( TQDataStream& ); /** * @internal @@ -204,7 +204,7 @@ public: * @param _name the name of the service type to search * @return the pointer to the service type, or 0 */ - static Ptr serviceType( const QString& _name ); + static Ptr serviceType( const TQString& _name ); /** * Returns all services supporting the given servicetype name. @@ -214,7 +214,7 @@ public: * @param _servicetype the name of the service type to search * @return the list of all services of the given type */ - static KService::List offers( const QString& _servicetype ); + static KService::List offers( const TQString& _servicetype ); /** * Returns a list of all the supported servicetypes. Useful for @@ -230,11 +230,11 @@ protected: void init( KDesktopFile *config ); protected: - QString m_strName; - QString m_strIcon; - QString m_strComment; - QMap<QString,QVariant> m_mapProps; - QMap<QString,QVariant::Type> m_mapPropDefs; + TQString m_strName; + TQString m_strIcon; + TQString m_strComment; + TQMap<TQString,TQVariant> m_mapProps; + TQMap<TQString,TQVariant::Type> m_mapPropDefs; bool m_bValid:1; bool m_bDerived:1; @@ -245,7 +245,7 @@ private: KServiceTypePrivate* d; }; -//QDataStream& operator>>( QDataStream& _str, KServiceType& s ); -//QDataStream& operator<<( QDataStream& _str, KServiceType& s ); +//TQDataStream& operator>>( TQDataStream& _str, KServiceType& s ); +//TQDataStream& operator<<( TQDataStream& _str, KServiceType& s ); #endif diff --git a/kio/kio/kservicetypefactory.cpp b/kio/kio/kservicetypefactory.cpp index bfe3121ca..8287bca44 100644 --- a/kio/kio/kservicetypefactory.cpp +++ b/kio/kio/kservicetypefactory.cpp @@ -28,7 +28,7 @@ #include <kdebug.h> #include <assert.h> #include <kstringhandler.h> -#include <qfile.h> +#include <tqfile.h> KServiceTypeFactory::KServiceTypeFactory() : KSycocaFactory( KST_KServiceTypeFactory ) @@ -52,7 +52,7 @@ KServiceTypeFactory::KServiceTypeFactory() } else { - QString str; + TQString str; for(;n;n--) { KSycocaEntry::read(*m_str, str); @@ -77,7 +77,7 @@ KServiceTypeFactory * KServiceTypeFactory::self() return _self; } -KServiceType * KServiceTypeFactory::findServiceTypeByName(const QString &_name) +KServiceType * KServiceTypeFactory::findServiceTypeByName(const TQString &_name) { if (!m_sycocaDict) return 0L; // Error! assert (!KSycoca::self()->isBuilding()); @@ -95,28 +95,28 @@ KServiceType * KServiceTypeFactory::findServiceTypeByName(const QString &_name) return newServiceType; } -QVariant::Type KServiceTypeFactory::findPropertyTypeByName(const QString &_name) +TQVariant::Type KServiceTypeFactory::findPropertyTypeByName(const TQString &_name) { if (!m_sycocaDict) - return QVariant::Invalid; // Error! + return TQVariant::Invalid; // Error! assert (!KSycoca::self()->isBuilding()); - QMapConstIterator<QString,int> it = m_propertyTypeDict.find(_name); + TQMapConstIterator<TQString,int> it = m_propertyTypeDict.find(_name); if (it != m_propertyTypeDict.end()) { - return (QVariant::Type)it.data(); + return (TQVariant::Type)it.data(); } - return QVariant::Invalid; + return TQVariant::Invalid; } -KMimeType * KServiceTypeFactory::findFromPattern(const QString &_filename, QString *match) +KMimeType * KServiceTypeFactory::findFromPattern(const TQString &_filename, TQString *match) { // Assume we're NOT building a database if (!m_str) return 0; // Get stream to the header - QDataStream *str = m_str; + TQDataStream *str = m_str; str->device()->at( m_fastPatternOffset ); @@ -138,10 +138,10 @@ KMimeType * KServiceTypeFactory::findFromPattern(const QString &_filename, QStri int ext_len = _filename.length() - lastDot - 1; if (lastDot != -1 && ext_len <= 4) // if no '.', skip the extension lookup { - QString extension = _filename.right( ext_len ); + TQString extension = _filename.right( ext_len ); extension = extension.leftJustify(4); - QString pattern; + TQString pattern; while (left <= right) { middle = (left + right) / 2; // read pattern at position "middle" @@ -168,7 +168,7 @@ KMimeType * KServiceTypeFactory::findFromPattern(const QString &_filename, QStri if ( m_patterns.isEmpty() ) { str->device()->at( m_otherPatternOffset ); - QString pattern; + TQString pattern; Q_INT32 mimetypeOffset; while (true) @@ -184,9 +184,9 @@ KMimeType * KServiceTypeFactory::findFromPattern(const QString &_filename, QStri assert( m_patterns.size() == m_pattern_offsets.size() ); - QStringList::const_iterator it = m_patterns.begin(); - QStringList::const_iterator end = m_patterns.end(); - QValueVector<Q_INT32>::const_iterator it_offset = m_pattern_offsets.begin(); + TQStringList::const_iterator it = m_patterns.begin(); + TQStringList::const_iterator end = m_patterns.end(); + TQValueVector<Q_INT32>::const_iterator it_offset = m_pattern_offsets.begin(); for ( ; it != end; ++it, ++it_offset ) { @@ -247,7 +247,7 @@ KServiceType::List KServiceTypeFactory::allServiceTypes() bool KServiceTypeFactory::checkMimeTypes() { - QDataStream *str = KSycoca::self()->findFactory( factoryId() ); + TQDataStream *str = KSycoca::self()->findFactory( factoryId() ); if (!str) return false; // check if there are mimetypes/servicetypes @@ -258,7 +258,7 @@ KServiceType * KServiceTypeFactory::createEntry(int offset) { KServiceType *newEntry = 0; KSycocaType type; - QDataStream *str = KSycoca::self()->findEntry(offset, type); + TQDataStream *str = KSycoca::self()->findEntry(offset, type); if (!str) return 0; switch(type) @@ -280,7 +280,7 @@ KServiceType * KServiceTypeFactory::createEntry(int offset) break; default: - kdError(7011) << QString("KServiceTypeFactory: unexpected object entry in KSycoca database (type = %1)").arg((int)type) << endl; + kdError(7011) << TQString("KServiceTypeFactory: unexpected object entry in KSycoca database (type = %1)").arg((int)type) << endl; break; } if (newEntry && !newEntry->isValid()) diff --git a/kio/kio/kservicetypefactory.h b/kio/kio/kservicetypefactory.h index 7c5fdf96e..db64aa115 100644 --- a/kio/kio/kservicetypefactory.h +++ b/kio/kio/kservicetypefactory.h @@ -22,8 +22,8 @@ #include <assert.h> -#include <qstringlist.h> -#include <qvaluevector.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> #include "ksycocafactory.h" #include "kmimetype.h" @@ -56,26 +56,26 @@ public: /** * Not meant to be called at this level */ - virtual KSycocaEntry *createEntry(const QString &, const char *) + virtual KSycocaEntry *createEntry(const TQString &, const char *) { assert(0); return 0; } /** * Find a service type in the database file (allocates it) * Overloaded by KBuildServiceTypeFactory to return a memory one. */ - virtual KServiceType * findServiceTypeByName(const QString &_name); + virtual KServiceType * findServiceTypeByName(const TQString &_name); /** * Find a the property type of a named property. */ - QVariant::Type findPropertyTypeByName(const QString &_name); + TQVariant::Type findPropertyTypeByName(const TQString &_name); /** * Find a mimetype from a filename (using the pattern list) * @param _filename filename to check. * @param match if provided, returns the pattern that matched. */ - KMimeType * findFromPattern(const QString &_filename, QString *match = 0); + KMimeType * findFromPattern(const TQString &_filename, TQString *match = 0); /** * @return all mimetypes @@ -109,11 +109,11 @@ private: protected: int m_fastPatternOffset; int m_otherPatternOffset; - QMap<QString,int> m_propertyTypeDict; + TQMap<TQString,int> m_propertyTypeDict; private: - QStringList m_patterns; - QValueVector<Q_INT32> m_pattern_offsets; + TQStringList m_patterns; + TQValueVector<Q_INT32> m_pattern_offsets; protected: virtual void virtual_hook( int id, void* data ); private: diff --git a/kio/kio/kshellcompletion.cpp b/kio/kio/kshellcompletion.cpp index 321eebabf..2fb67a31f 100644 --- a/kio/kio/kshellcompletion.cpp +++ b/kio/kio/kshellcompletion.cpp @@ -19,9 +19,9 @@ #include <stdlib.h> #include <kdebug.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqregexp.h> #include <kcompletion.h> #include "kshellcompletion.h" @@ -43,7 +43,7 @@ KShellCompletion::KShellCompletion() : KURLCompletion() * * Entry point for file name completion */ -QString KShellCompletion::makeCompletion(const QString &text) +TQString KShellCompletion::makeCompletion(const TQString &text) { // Split text at the last unquoted space // @@ -51,7 +51,7 @@ QString KShellCompletion::makeCompletion(const QString &text) // Remove quotes from the text to be completed // - QString tmp = unquote(m_text_compl); + TQString tmp = unquote(m_text_compl); m_text_compl = tmp; // Do exe-completion if there was no unquoted space @@ -82,7 +82,7 @@ QString KShellCompletion::makeCompletion(const QString &text) * Add add the part of the text that was not completed * Add quotes when needed */ -void KShellCompletion::postProcessMatch( QString *match ) const +void KShellCompletion::postProcessMatch( TQString *match ) const { //kDebugInfo("KShellCompletion::postProcessMatch() in: '%s'", // match->latin1()); @@ -92,7 +92,7 @@ void KShellCompletion::postProcessMatch( QString *match ) const if ( match->isNull() ) return; - if ( match->right(1) == QChar('/') ) + if ( match->right(1) == TQChar('/') ) quoteText( match, false, true ); // don't quote the trailing '/' else quoteText( match, false, false ); // quote the whole text @@ -103,15 +103,15 @@ void KShellCompletion::postProcessMatch( QString *match ) const // match->latin1()); } -void KShellCompletion::postProcessMatches( QStringList *matches ) const +void KShellCompletion::postProcessMatches( TQStringList *matches ) const { KURLCompletion::postProcessMatches( matches ); - for ( QStringList::Iterator it = matches->begin(); + for ( TQStringList::Iterator it = matches->begin(); it != matches->end(); it++ ) { if ( !(*it).isNull() ) { - if ( (*it).right(1) == QChar('/') ) + if ( (*it).right(1) == TQChar('/') ) quoteText( &(*it), false, true ); // don't quote trailing '/' else quoteText( &(*it), false, false ); // quote the whole text @@ -129,7 +129,7 @@ void KShellCompletion::postProcessMatches( KCompletionMatches *matches ) const it != matches->end(); it++ ) { if ( !(*it).value().isNull() ) { - if ( (*it).value().right(1) == QChar('/') ) + if ( (*it).value().right(1) == TQChar('/') ) quoteText( &(*it).value(), false, true ); // don't quote trailing '/' else quoteText( &(*it).value(), false, false ); // quote the whole text @@ -147,12 +147,12 @@ void KShellCompletion::postProcessMatches( KCompletionMatches *matches ) const * text_start = [out] text at the left, including the space * text_compl = [out] text at the right */ -void KShellCompletion::splitText(const QString &text, QString &text_start, - QString &text_compl) const +void KShellCompletion::splitText(const TQString &text, TQString &text_start, + TQString &text_compl) const { bool in_quote = false; bool escaped = false; - QChar p_last_quote_char; + TQChar p_last_quote_char; int last_unquoted_space = -1; int end_space_len = 0; @@ -212,7 +212,7 @@ void KShellCompletion::splitText(const QString &text, QString &text_start, * * skip_last => ignore the last charachter (we add a space or '/' to all filenames) */ -bool KShellCompletion::quoteText(QString *text, bool force, bool skip_last) const +bool KShellCompletion::quoteText(TQString *text, bool force, bool skip_last) const { int pos = 0; @@ -240,11 +240,11 @@ bool KShellCompletion::quoteText(QString *text, bool force, bool skip_last) cons // Escape \ in the string text->replace( m_escape_char, - QString( m_escape_char ) + m_escape_char ); + TQString( m_escape_char ) + m_escape_char ); // Escape " in the string text->replace( m_quote_char1, - QString( m_escape_char ) + m_quote_char1 ); + TQString( m_escape_char ) + m_quote_char1 ); // " at the beginning text->insert( 0, m_quote_char1 ); @@ -267,12 +267,12 @@ bool KShellCompletion::quoteText(QString *text, bool force, bool skip_last) cons * Remove quotes and return the result in a new string * */ -QString KShellCompletion::unquote(const QString &text) const +TQString KShellCompletion::unquote(const TQString &text) const { bool in_quote = false; bool escaped = false; - QChar p_last_quote_char; - QString result; + TQChar p_last_quote_char; + TQString result; for (uint pos = 0; pos < text.length(); pos++) { diff --git a/kio/kio/kshellcompletion.h b/kio/kio/kshellcompletion.h index 797f275ac..acfa638cf 100644 --- a/kio/kio/kshellcompletion.h +++ b/kio/kio/kshellcompletion.h @@ -20,8 +20,8 @@ #ifndef KSHELLCOMPLETION_H #define KSHELLCOMPLETION_H -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include "kurlcompletion.h" @@ -51,30 +51,30 @@ public: * Finds completions to the given text. * The first match is returned and emitted in the signal match(). * @param text the text to complete - * @return the first match, or QString::null if not found + * @return the first match, or TQString::null if not found */ - QString makeCompletion(const QString &text); + TQString makeCompletion(const TQString &text); protected: // Called by KCompletion - void postProcessMatch( QString *match ) const; - void postProcessMatches( QStringList *matches ) const; + void postProcessMatch( TQString *match ) const; + void postProcessMatches( TQStringList *matches ) const; void postProcessMatches( KCompletionMatches *matches ) const; private: // Find the part of text that should be completed - void splitText(const QString &text, QString &text_start, QString &text_compl) const; + void splitText(const TQString &text, TQString &text_start, TQString &text_compl) const; // Insert quotes and neseccary escapes - bool quoteText(QString *text, bool force, bool skip_last) const; - QString unquote(const QString &text) const; + bool quoteText(TQString *text, bool force, bool skip_last) const; + TQString unquote(const TQString &text) const; - QString m_text_start; // part of the text that was not completed - QString m_text_compl; // part of the text that was completed (unchanged) + TQString m_text_start; // part of the text that was not completed + TQString m_text_compl; // part of the text that was completed (unchanged) - QChar m_word_break_char; - QChar m_quote_char1; - QChar m_quote_char2; - QChar m_escape_char; + TQChar m_word_break_char; + TQChar m_quote_char1; + TQChar m_quote_char2; + TQChar m_escape_char; protected: virtual void virtual_hook( int id, void* data ); diff --git a/kio/kio/kshred.cpp b/kio/kio/kshred.cpp index a4ac54b89..f3997bf58 100644 --- a/kio/kio/kshred.cpp +++ b/kio/kio/kshred.cpp @@ -27,8 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <stdlib.h> #include <kapplication.h> -// antlarr: KDE 4: Make it const QString & -KShred::KShred(QString fileName) +// antlarr: KDE 4: Make it const TQString & +KShred::KShred(TQString fileName) { if (fileName.isEmpty()) { @@ -37,7 +37,7 @@ KShred::KShred(QString fileName) } else { - file = new QFile(); + file = new TQFile(); file->setName(fileName); if (!file->open(IO_ReadWrite)) { @@ -144,9 +144,9 @@ KShred::fillrandom() } -// antlarr: KDE 4: Make it const QString & +// antlarr: KDE 4: Make it const TQString & bool -KShred::shred(QString fileName) +KShred::shred(TQString fileName) { if (fileName.isEmpty()) return false; @@ -209,7 +209,7 @@ KShred::shred() unsigned char p[6][3] = {{'\222', '\111', '\044'}, {'\111', '\044', '\222'}, {'\044', '\222', '\111'}, {'\155', '\266', '\333'}, {'\266', '\333', '\155'}, {'\333', '\155', '\266'}}; - QString msg = i18n("Shredding: pass %1 of 35"); + TQString msg = i18n("Shredding: pass %1 of 35"); emit processedSize(0); diff --git a/kio/kio/kshred.h b/kio/kio/kshred.h index 320216998..c38c610ed 100644 --- a/kio/kio/kshred.h +++ b/kio/kio/kshred.h @@ -27,9 +27,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <stdio.h> #include <string.h> #include <unistd.h> -#include <qstring.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqobject.h> #include <kio/global.h> @@ -42,7 +42,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * @author Andreas F. Pour <bugs@mieterra.com> * @author David Faure <faure@kde.org> (integration into KDE and progress signal) */ -class KIO_EXPORT_DEPRECATED KShred : public QObject { // KDE4: remove +class KIO_EXPORT_DEPRECATED KShred : public TQObject { // KDE4: remove Q_OBJECT @@ -52,7 +52,7 @@ class KIO_EXPORT_DEPRECATED KShred : public QObject { // KDE4: remove * Initialize the class using the name of the file to 'shred'. * @param fileName fully qualified name of the file to shred. */ - KShred(QString fileName); + KShred(TQString fileName); /* * Destructor for the class. @@ -105,7 +105,7 @@ class KIO_EXPORT_DEPRECATED KShred : public QObject { // KDE4: remove * No need to create an instance of the class. * @param fileName fully qualified name of the file to shred. */ - static bool shred(QString fileName); + static bool shred(TQString fileName); signals: /** @@ -118,7 +118,7 @@ class KIO_EXPORT_DEPRECATED KShred : public QObject { // KDE4: remove * Shows a message in the progress dialog * @param message the message to display */ - void infoMessage(const QString & message); + void infoMessage(const TQString & message); private: /** @@ -134,7 +134,7 @@ class KIO_EXPORT_DEPRECATED KShred : public QObject { // KDE4: remove /** * @internal structure for the file information */ - QFile *file; + TQFile *file; /** * @internal for the size of the file diff --git a/kio/kio/ktar.cpp b/kio/kio/ktar.cpp index 52c10c0b1..cf4bade20 100644 --- a/kio/kio/ktar.cpp +++ b/kio/kio/ktar.cpp @@ -25,9 +25,9 @@ #include <pwd.h>*/ #include <assert.h> -#include <qcstring.h> -#include <qdir.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqdir.h> +#include <tqfile.h> #include <kdebug.h> #include <kmimetype.h> #include <ktempfile.h> @@ -46,26 +46,26 @@ class KTar::KTarPrivate { public: KTarPrivate() : tarEnd( 0 ), tmpFile( 0 ) {} - QStringList dirList; + TQStringList dirList; int tarEnd; KTempFile* tmpFile; - QString mimetype; - QCString origFileName; + TQString mimetype; + TQCString origFileName; - bool fillTempFile(const QString & filename); - bool writeBackTempFile( const QString & filename ); + bool fillTempFile(const TQString & filename); + bool writeBackTempFile( const TQString & filename ); }; -KTar::KTar( const QString& filename, const QString & _mimetype ) +KTar::KTar( const TQString& filename, const TQString & _mimetype ) : KArchive( 0 ) { m_filename = filename; d = new KTarPrivate; - QString mimetype( _mimetype ); + TQString mimetype( _mimetype ); bool forced = true; if ( mimetype.isEmpty() ) // Find out mimetype manually { - if ( QFile::exists( filename ) ) + if ( TQFile::exists( filename ) ) mimetype = KMimeType::findByFileContent( filename )->name(); else mimetype = KMimeType::findByPath( filename, 0, true )->name(); @@ -85,7 +85,7 @@ KTar::KTar( const QString& filename, const QString & _mimetype ) else { // Something else. Check if it's not really gzip though (e.g. for KOffice docs) - QFile file( filename ); + TQFile file( filename ); if ( file.open( IO_ReadOnly ) ) { unsigned char firstByte = file.getch(); @@ -111,11 +111,11 @@ KTar::KTar( const QString& filename, const QString & _mimetype ) prepareDevice( filename, mimetype, forced ); } -void KTar::prepareDevice( const QString & filename, - const QString & mimetype, bool /*forced*/ ) +void KTar::prepareDevice( const TQString & filename, + const TQString & mimetype, bool /*forced*/ ) { if( "application/x-tar" == mimetype ) - setDevice( new QFile( filename ) ); + setDevice( new TQFile( filename ) ); else { // The compression filters are very slow with random access. @@ -133,13 +133,13 @@ void KTar::prepareDevice( const QString & filename, // KTempFile opens the file automatically, // the device must be closed, however, for KArchive.setDevice() - QFile* file = d->tmpFile->file(); + TQFile* file = d->tmpFile->file(); file->close(); setDevice(file); } } -KTar::KTar( QIODevice * dev ) +KTar::KTar( TQIODevice * dev ) : KArchive( dev ) { Q_ASSERT( dev ); @@ -161,7 +161,7 @@ KTar::~KTar() delete d; } -void KTar::setOrigFileName( const QCString & fileName ) +void KTar::setOrigFileName( const TQCString & fileName ) { if ( !isOpened() || !(mode() & IO_WriteOnly) ) { @@ -178,7 +178,7 @@ Q_LONG KTar::readRawHeader(char *buffer) { // Make sure this is actually a tar header if (strncmp(buffer + 257, "ustar", 5)) { // The magic isn't there (broken/old tars), but maybe a correct checksum? - QCString s; + TQCString s; int check = 0; for( uint j = 0; j < 0x200; ++j ) @@ -197,7 +197,7 @@ Q_LONG KTar::readRawHeader(char *buffer) { if( strncmp( buffer + 148 + 6 - s.length(), s.data(), s.length() ) && strncmp( buffer + 148 + 7 - s.length(), s.data(), s.length() ) && strncmp( buffer + 148 + 8 - s.length(), s.data(), s.length() ) ) { - kdWarning(7041) << "KTar: invalid TAR file. Header is: " << QCString( buffer+257, 5 ) << endl; + kdWarning(7041) << "KTar: invalid TAR file. Header is: " << TQCString( buffer+257, 5 ) << endl; return -1; } }/*end if*/ @@ -208,9 +208,9 @@ Q_LONG KTar::readRawHeader(char *buffer) { return n; } -bool KTar::readLonglink(char *buffer,QCString &longlink) { +bool KTar::readLonglink(char *buffer,TQCString &longlink) { Q_LONG n = 0; - QIODevice *dev = device(); + TQIODevice *dev = device(); // read size of longlink from size field in header // size is in bytes including the trailing null (which we ignore) buffer[ 0x88 ] = 0; // was 0x87, but 0x88 fixes BR #26437 @@ -238,7 +238,7 @@ bool KTar::readLonglink(char *buffer,QCString &longlink) { return true; } -Q_LONG KTar::readHeader(char *buffer,QString &name,QString &symlink) { +Q_LONG KTar::readHeader(char *buffer,TQString &name,TQString &symlink) { name.truncate(0); symlink.truncate(0); while (true) { @@ -248,11 +248,11 @@ Q_LONG KTar::readHeader(char *buffer,QString &name,QString &symlink) { // is it a longlink? if (strcmp(buffer,"././@LongLink") == 0) { char typeflag = buffer[0x9c]; - QCString longlink; + TQCString longlink; readLonglink(buffer,longlink); switch (typeflag) { - case 'L': name = QFile::decodeName(longlink); break; - case 'K': symlink = QFile::decodeName(longlink); break; + case 'L': name = TQFile::decodeName(longlink); break; + case 'K': symlink = TQFile::decodeName(longlink); break; }/*end switch*/ } else { break; @@ -263,9 +263,9 @@ Q_LONG KTar::readHeader(char *buffer,QString &name,QString &symlink) { if (name.isEmpty()) // there are names that are exactly 100 bytes long // and neither longlink nor \0 terminated (bug:101472) - name = QFile::decodeName(QCString(buffer, 101)); + name = TQFile::decodeName(TQCString(buffer, 101)); if (symlink.isEmpty()) - symlink = QFile::decodeName(QCString(buffer + 0x9d, 101)); + symlink = TQFile::decodeName(TQCString(buffer + 0x9d, 101)); return 0x200; } @@ -275,7 +275,7 @@ Q_LONG KTar::readHeader(char *buffer,QString &name,QString &symlink) { * to decompress the original file now and write * the contents to the temporary file. */ -bool KTar::KTarPrivate::fillTempFile( const QString & filename) { +bool KTar::KTarPrivate::fillTempFile( const TQString & filename) { if ( ! tmpFile ) return true; @@ -288,17 +288,17 @@ bool KTar::KTarPrivate::fillTempFile( const QString & filename) { || "application/x-bzip2" == mimetype) forced = true; - QIODevice *filterDev = KFilterDev::deviceForFile( filename, mimetype, forced ); + TQIODevice *filterDev = KFilterDev::deviceForFile( filename, mimetype, forced ); if( filterDev ) { - QFile* file = tmpFile->file(); + TQFile* file = tmpFile->file(); file->close(); if ( ! file->open( IO_WriteOnly ) ) { delete filterDev; return false; } - QByteArray buffer(8*1024); + TQByteArray buffer(8*1024); if ( ! filterDev->open( IO_ReadOnly ) ) { delete filterDev; @@ -342,7 +342,7 @@ bool KTar::openArchive( int mode ) //stat( m_filename, &buf ); d->dirList.clear(); - QIODevice* dev = device(); + TQIODevice* dev = device(); if ( !dev ) return false; @@ -352,8 +352,8 @@ bool KTar::openArchive( int mode ) bool ende = false; do { - QString name; - QString symlink; + TQString name; + TQString symlink; // Read header Q_LONG n = readHeader(buffer,name,symlink); @@ -361,7 +361,7 @@ bool KTar::openArchive( int mode ) if (n == 0x200) { bool isdir = false; - QString nm; + TQString nm; if ( name.right(1) == "/" ) { @@ -383,8 +383,8 @@ bool KTar::openArchive( int mode ) int access = (int)strtol( p, &dummy, 8 ); // read user and group - QString user( buffer + 0x109 ); - QString group( buffer + 0x129 ); + TQString user( buffer + 0x109 ); + TQString group( buffer + 0x129 ); // read time buffer[ 0x93 ] = 0; @@ -470,7 +470,7 @@ bool KTar::openArchive( int mode ) else { // In some tar files we can find dir/./file => call cleanDirPath - QString path = QDir::cleanDirPath( name.left( pos ) ); + TQString path = TQDir::cleanDirPath( name.left( pos ) ); // Ensure container directory exists, create otherwise KArchiveDirectory * d = findOrCreate( path ); d->addEntry( e ); @@ -491,7 +491,7 @@ bool KTar::openArchive( int mode ) * to the original file. * Must only be called if in IO_WriteOnly mode */ -bool KTar::KTarPrivate::writeBackTempFile( const QString & filename ) { +bool KTar::KTarPrivate::writeBackTempFile( const TQString & filename ) { if ( ! tmpFile ) return true; @@ -504,9 +504,9 @@ bool KTar::KTarPrivate::writeBackTempFile( const QString & filename ) { forced = true; - QIODevice *dev = KFilterDev::deviceForFile( filename, mimetype, forced ); + TQIODevice *dev = KFilterDev::deviceForFile( filename, mimetype, forced ); if( dev ) { - QFile* file = tmpFile->file(); + TQFile* file = tmpFile->file(); file->close(); if ( ! file->open(IO_ReadOnly) || ! dev->open(IO_WriteOnly) ) { @@ -516,7 +516,7 @@ bool KTar::KTarPrivate::writeBackTempFile( const QString & filename ) { } if ( forced ) static_cast<KFilterDev *>(dev)->setOrigFileName( origFileName ); - QByteArray buffer(8*1024); + TQByteArray buffer(8*1024); Q_LONG len; while ( ! file->atEnd()) { len = file->readBlock(buffer.data(),buffer.size()); @@ -544,7 +544,7 @@ bool KTar::closeArchive() return true; } -bool KTar::writeDir( const QString& name, const QString& user, const QString& group ) +bool KTar::writeDir( const TQString& name, const TQString& user, const TQString& group ) { mode_t perm = 040755; time_t the_time = time(0); @@ -563,7 +563,7 @@ bool KTar::writeDir( const QString& name, const QString& user, const QString& gr } // In some tar files we can find dir/./ => call cleanDirPath - QString dirName ( QDir::cleanDirPath( name ) ); + TQString dirName ( TQDir::cleanDirPath( name ) ); // Need trailing '/' if ( dirName.right(1) != "/" ) @@ -582,7 +582,7 @@ bool KTar::writeDir( const QString& name, const QString& user, const QString& gr strcpy( buffer, "././@LongLink" ); fillBuffer( buffer, " 0", dirName.length()+1, 'L', user.local8Bit(), group.local8Bit() ); device()->writeBlock( buffer, 0x200 ); - strncpy( buffer, QFile::encodeName(dirName), 0x200 ); + strncpy( buffer, TQFile::encodeName(dirName), 0x200 ); buffer[0x200] = 0; // write long name device()->writeBlock( buffer, 0x200 ); @@ -591,7 +591,7 @@ bool KTar::writeDir( const QString& name, const QString& user, const QString& gr else { // Write name - strncpy( buffer, QFile::encodeName(dirName), 0x200 ); + strncpy( buffer, TQFile::encodeName(dirName), 0x200 ); buffer[0x200] = 0; } @@ -606,7 +606,7 @@ bool KTar::writeDir( const QString& name, const QString& user, const QString& gr #endif } -bool KTar::prepareWriting( const QString& name, const QString& user, const QString& group, uint size ) +bool KTar::prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size ) { mode_t dflt_perm = 0100644; time_t the_time = time(0); @@ -670,7 +670,7 @@ void KTar::fillBuffer( char * buffer, strcpy( buffer + 0x74, " 144 "); // size - QCString s; + TQCString s; s.sprintf("%o", size); // OCT s = s.rightJustify( 11, ' ' ); strcpy( buffer + 0x7c, s.data() ); @@ -719,7 +719,7 @@ void KTar::fillBuffer( char * buffer, strcpy( buffer + 0x94, s.data() ); } -void KTar::writeLonglink(char *buffer, const QCString &name, char typeflag, +void KTar::writeLonglink(char *buffer, const TQCString &name, char typeflag, const char *uname, const char *gname) { strcpy( buffer, "././@LongLink" ); int namelen = name.length() + 1; @@ -737,14 +737,14 @@ void KTar::writeLonglink(char *buffer, const QCString &name, char typeflag, }/*wend*/ } -bool KTar::prepareWriting(const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, +bool KTar::prepareWriting(const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime) { return KArchive::prepareWriting(name,user,group,size,perm,atime,mtime,ctime); } -bool KTar::prepareWriting_impl(const QString &name, const QString &user, - const QString &group, uint size, mode_t perm, +bool KTar::prepareWriting_impl(const TQString &name, const TQString &user, + const TQString &group, uint size, mode_t perm, time_t /*atime*/, time_t mtime, time_t /*ctime*/) { if ( !isOpened() ) { @@ -759,7 +759,7 @@ bool KTar::prepareWriting_impl(const QString &name, const QString &user, } // In some tar files we can find dir/./file => call cleanDirPath - QString fileName ( QDir::cleanDirPath( name ) ); + TQString fileName ( TQDir::cleanDirPath( name ) ); /* // Create toplevel dirs @@ -767,11 +767,11 @@ bool KTar::prepareWriting_impl(const QString &name, const QString &user, // he needs to implement a findOrCreate equivalent in writeDir. // But as KTar and the "tar" program both handle tar files without // dir entries, there's really no need for that - QString tmp ( fileName ); + TQString tmp ( fileName ); int i = tmp.findRev( '/' ); if ( i != -1 ) { - QString d = tmp.left( i + 1 ); // contains trailing slash + TQString d = tmp.left( i + 1 ); // contains trailing slash if ( !m_dirList.contains( d ) ) { tmp = tmp.mid( i + 1 ); @@ -785,9 +785,9 @@ bool KTar::prepareWriting_impl(const QString &name, const QString &user, if ( mode() & IO_ReadWrite ) device()->at(d->tarEnd); // Go to end of archive as might have moved with a read // provide converted stuff we need lateron - QCString encodedFilename = QFile::encodeName(fileName); - QCString uname = user.local8Bit(); - QCString gname = group.local8Bit(); + TQCString encodedFilename = TQFile::encodeName(fileName); + TQCString uname = user.local8Bit(); + TQCString gname = group.local8Bit(); // If more than 100 chars, we need to use the LongLink trick if ( fileName.length() > 99 ) @@ -799,7 +799,7 @@ bool KTar::prepareWriting_impl(const QString &name, const QString &user, // zero out the rest (except for what gets filled anyways) memset(buffer+0x9d, 0, 0x200 - 0x9d); - QCString permstr; + TQCString permstr; permstr.sprintf("%o",perm); permstr = permstr.rightJustify(6, ' '); fillBuffer(buffer, permstr, size, mtime, 0x30, uname, gname); @@ -808,14 +808,14 @@ bool KTar::prepareWriting_impl(const QString &name, const QString &user, return device()->writeBlock( buffer, 0x200 ) == 0x200; } -bool KTar::writeDir(const QString& name, const QString& user, - const QString& group, mode_t perm, +bool KTar::writeDir(const TQString& name, const TQString& user, + const TQString& group, mode_t perm, time_t atime, time_t mtime, time_t ctime) { return KArchive::writeDir(name,user,group,perm,atime,mtime,ctime); } -bool KTar::writeDir_impl(const QString &name, const QString &user, - const QString &group, mode_t perm, +bool KTar::writeDir_impl(const TQString &name, const TQString &user, + const TQString &group, mode_t perm, time_t /*atime*/, time_t mtime, time_t /*ctime*/) { if ( !isOpened() ) { @@ -830,7 +830,7 @@ bool KTar::writeDir_impl(const QString &name, const QString &user, } // In some tar files we can find dir/./ => call cleanDirPath - QString dirName ( QDir::cleanDirPath( name ) ); + TQString dirName ( TQDir::cleanDirPath( name ) ); // Need trailing '/' if ( dirName.right(1) != "/" ) @@ -844,9 +844,9 @@ bool KTar::writeDir_impl(const QString &name, const QString &user, if ( mode() & IO_ReadWrite ) device()->at(d->tarEnd); // Go to end of archive as might have moved with a read // provide converted stuff we need lateron - QCString encodedDirname = QFile::encodeName(dirName); - QCString uname = user.local8Bit(); - QCString gname = group.local8Bit(); + TQCString encodedDirname = TQFile::encodeName(dirName); + TQCString uname = user.local8Bit(); + TQCString gname = group.local8Bit(); // If more than 100 chars, we need to use the LongLink trick if ( dirName.length() > 99 ) @@ -858,7 +858,7 @@ bool KTar::writeDir_impl(const QString &name, const QString &user, // zero out the rest (except for what gets filled anyways) memset(buffer+0x9d, 0, 0x200 - 0x9d); - QCString permstr; + TQCString permstr; permstr.sprintf("%o",perm); permstr = permstr.rightJustify(6, ' '); fillBuffer( buffer, permstr, 0, mtime, 0x35, uname, gname); @@ -871,14 +871,14 @@ bool KTar::writeDir_impl(const QString &name, const QString &user, return true; // TODO if wanted, better error control } -bool KTar::writeSymLink(const QString &name, const QString &target, - const QString &user, const QString &group, +bool KTar::writeSymLink(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) { return KArchive::writeSymLink(name,target,user,group,perm,atime,mtime,ctime); } -bool KTar::writeSymLink_impl(const QString &name, const QString &target, - const QString &user, const QString &group, +bool KTar::writeSymLink_impl(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t /*atime*/, time_t mtime, time_t /*ctime*/) { if ( !isOpened() ) { @@ -895,17 +895,17 @@ bool KTar::writeSymLink_impl(const QString &name, const QString &target, device()->flush(); // In some tar files we can find dir/./file => call cleanDirPath - QString fileName ( QDir::cleanDirPath( name ) ); + TQString fileName ( TQDir::cleanDirPath( name ) ); char buffer[ 0x201 ]; memset( buffer, 0, 0x200 ); if ( mode() & IO_ReadWrite ) device()->at(d->tarEnd); // Go to end of archive as might have moved with a read // provide converted stuff we need lateron - QCString encodedFilename = QFile::encodeName(fileName); - QCString encodedTarget = QFile::encodeName(target); - QCString uname = user.local8Bit(); - QCString gname = group.local8Bit(); + TQCString encodedFilename = TQFile::encodeName(fileName); + TQCString encodedTarget = TQFile::encodeName(target); + TQCString uname = user.local8Bit(); + TQCString gname = group.local8Bit(); // If more than 100 chars, we need to use the LongLink trick if (target.length() > 99) @@ -922,7 +922,7 @@ bool KTar::writeSymLink_impl(const QString &name, const QString &target, // zero out the rest memset(buffer+0x9d+100, 0, 0x200 - 100 - 0x9d); - QCString permstr; + TQCString permstr; permstr.sprintf("%o",perm); permstr = permstr.rightJustify(6, ' '); fillBuffer(buffer, permstr, 0, mtime, 0x32, uname, gname); diff --git a/kio/kio/ktar.h b/kio/kio/ktar.h index 174117215..915cfed3a 100644 --- a/kio/kio/ktar.h +++ b/kio/kio/ktar.h @@ -22,10 +22,10 @@ #include <sys/stat.h> #include <sys/types.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> #include <karchive.h> @@ -50,17 +50,17 @@ public: * specify the compression layer ! If the mimetype is omitted, it * will be determined from the filename. */ - KTar( const QString& filename, const QString & mimetype = QString::null ); + KTar( const TQString& filename, const TQString & mimetype = TQString::null ); /** * Creates an instance that operates on the given device. - * The device can be compressed (KFilterDev) or not (QFile, etc.). - * @warning Do not assume that giving a QFile here will decompress the file, + * The device can be compressed (KFilterDev) or not (TQFile, etc.). + * @warning Do not assume that giving a TQFile here will decompress the file, * in case it's compressed! * @param dev the device to read from. If the source is compressed, the - * QIODevice must take care of decompression + * TQIODevice must take care of decompression */ - KTar( QIODevice * dev ); + KTar( TQIODevice * dev ); /** * If the tar ball is still opened, then it will be @@ -70,10 +70,10 @@ public: /** * The name of the tar file, as passed to the constructor - * Null if you used the QIODevice constructor. - * @return the name of the file, or QString::null if unknown + * Null if you used the TQIODevice constructor. + * @return the name of the file, or TQString::null if unknown */ - QString fileName() { return m_filename; } // TODO KDE4 const + TQString fileName() { return m_filename; } // TODO KDE4 const /** * Special function for setting the "original file name" in the gzip header, @@ -81,20 +81,20 @@ public: * for instance. Should only be called if the underlying device is a KFilterDev! * @param fileName the original file name */ - void setOrigFileName( const QCString & fileName ); + void setOrigFileName( const TQCString & fileName ); // TODO(BIC) make virtual. For now it must be implemented by virtual_hook. - bool writeSymLink(const QString &name, const QString &target, - const QString &user, const QString &group, + bool writeSymLink(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime); - virtual bool writeDir( const QString& name, const QString& user, const QString& group ); + virtual bool writeDir( const TQString& name, const TQString& user, const TQString& group ); // TODO(BIC) make virtual. For now it must be implemented by virtual_hook. - bool writeDir( const QString& name, const QString& user, const QString& group, + bool writeDir( const TQString& name, const TQString& user, const TQString& group, mode_t perm, time_t atime, time_t mtime, time_t ctime ); - virtual bool prepareWriting( const QString& name, const QString& user, const QString& group, uint size ); + virtual bool prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size ); // TODO(BIC) make virtual. For now it must be implemented by virtual_hook. - bool prepareWriting( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool prepareWriting( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime ); virtual bool doneWriting( uint size ); @@ -112,7 +112,7 @@ private: /** * @internal */ - void prepareDevice( const QString & filename, const QString & mimetype, bool forced = false ); + void prepareDevice( const TQString & filename, const TQString & mimetype, bool forced = false ); /** * @internal @@ -135,24 +135,24 @@ private: * @p uname user name * @p gname group name */ - void writeLonglink(char *buffer, const QCString &name, char typeflag, + void writeLonglink(char *buffer, const TQCString &name, char typeflag, const char *uname, const char *gname); Q_LONG readRawHeader(char *buffer); - bool readLonglink(char *buffer,QCString &longlink); - Q_LONG readHeader(char *buffer,QString &name,QString &symlink); + bool readLonglink(char *buffer,TQCString &longlink); + Q_LONG readHeader(char *buffer,TQString &name,TQString &symlink); - QString m_filename; + TQString m_filename; protected: virtual void virtual_hook( int id, void* data ); - bool prepareWriting_impl(const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool prepareWriting_impl(const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime); - bool writeDir_impl(const QString& name, const QString& user, - const QString& group, mode_t perm, + bool writeDir_impl(const TQString& name, const TQString& user, + const TQString& group, mode_t perm, time_t atime, time_t mtime, time_t ctime ); - bool writeSymLink_impl(const QString &name, const QString &target, - const QString &user, const QString &group, + bool writeSymLink_impl(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime); private: class KTarPrivate; diff --git a/kio/kio/ktrader.cpp b/kio/kio/ktrader.cpp index 6349e0cad..dbe096075 100644 --- a/kio/kio/ktrader.cpp +++ b/kio/kio/ktrader.cpp @@ -19,8 +19,8 @@ #include "ktrader.h" #include "ktraderparsetree.h" -#include <qtl.h> -#include <qbuffer.h> +#include <tqtl.h> +#include <tqbuffer.h> #include <kuserprofile.h> #include <kstandarddirs.h> @@ -103,15 +103,15 @@ KTrader::~KTrader() { } -KTrader::OfferList KTrader::query( const QString& _servicetype, const QString& _constraint, - const QString& _preferences ) const +KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString& _constraint, + const TQString& _preferences ) const { - return query( _servicetype, QString::null, _constraint, _preferences ); + return query( _servicetype, TQString::null, _constraint, _preferences ); } -KTrader::OfferList KTrader::query( const QString& _servicetype, const QString& _genericServiceType, - const QString& _constraint, - const QString& _preferences ) const +KTrader::OfferList KTrader::query( const TQString& _servicetype, const TQString& _genericServiceType, + const TQString& _constraint, + const TQString& _preferences ) const { // TODO: catch errors here ParseTreeBase::Ptr constr; @@ -147,7 +147,7 @@ KTrader::OfferList KTrader::query( const QString& _servicetype, const QString& _ if ( !!prefs ) { - QValueList<KTraderSorter> sorter; + TQValueList<KTraderSorter> sorter; KServiceTypeProfile::OfferList::Iterator it = lst.begin(); for( ; it != lst.end(); ++it ) { @@ -157,7 +157,7 @@ KTrader::OfferList KTrader::query( const QString& _servicetype, const QString& _ } qBubbleSort( sorter ); - QValueList<KTraderSorter>::Iterator it2 = sorter.begin(); + TQValueList<KTraderSorter>::Iterator it2 = sorter.begin(); for( ; it2 != sorter.end(); ++it2 ) ret.prepend( (*it2).service() ); } @@ -169,7 +169,7 @@ KTrader::OfferList KTrader::query( const QString& _servicetype, const QString& _ } #ifndef NDEBUG - QString query = _servicetype; + TQString query = _servicetype; if ( !_genericServiceType.isEmpty() ) { query += ", "; query += _genericServiceType; diff --git a/kio/kio/ktrader.h b/kio/kio/ktrader.h index 3bf90ce84..e5bb734e6 100644 --- a/kio/kio/ktrader.h +++ b/kio/kio/ktrader.h @@ -18,8 +18,8 @@ #ifndef __ktrader_h__ #define __ktrader_h__ -#include <qstring.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqobject.h> #include <kservice.h> /** @@ -89,8 +89,8 @@ public: /** * A list of services. */ - typedef QValueList<KService::Ptr> OfferList; - typedef QValueListIterator<KService::Ptr> OfferListIterator; + typedef TQValueList<KService::Ptr> OfferList; + typedef TQValueListIterator<KService::Ptr> OfferListIterator; /** * Standard destructor @@ -117,18 +117,18 @@ public: * fields found in the .desktop files. * * @param servicetype A service type like 'text/plain', 'text/html', or 'KOfficePlugin'. - * @param constraint A constraint to limit the choices returned, QString::null to + * @param constraint A constraint to limit the choices returned, TQString::null to * get all services of the given @p servicetype - * @param preferences Indicates a particular preference to return, QString::null to ignore. + * @param preferences Indicates a particular preference to return, TQString::null to ignore. * Uses an expression in the constraint language that must return * a number * * @return A list of services that satisfy the query * @see http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/kio/kio/html/tradersyntax.html */ - virtual OfferList query( const QString& servicetype, - const QString& constraint = QString::null, - const QString& preferences = QString::null) const; + virtual OfferList query( const TQString& servicetype, + const TQString& constraint = TQString::null, + const TQString& preferences = TQString::null) const; /** * A variant of query(), that takes two service types as an input. @@ -144,18 +144,18 @@ public: * * @param servicetype A service type like 'text/plain', 'text/html', or 'KOfficePlugin'. * @param genericServiceType a basic service type, like 'KParts/ReadOnlyPart' or 'Application' - * @param constraint A constraint to limit the choices returned, QString::null to + * @param constraint A constraint to limit the choices returned, TQString::null to * get all services of the given @p servicetype - * @param preferences Indicates a particular preference to return, QString::null to ignore. + * @param preferences Indicates a particular preference to return, TQString::null to ignore. * Uses an expression in the constraint language that must return * a number * * @return A list of services that satisfy the query * @see http://developer.kde.org/documentation/library/kdeqt/tradersyntax.html */ - OfferList query( const QString& servicetype, const QString& genericServiceType, - const QString& constraint /*= QString::null*/, - const QString& preferences /*= QString::null*/) const; + OfferList query( const TQString& servicetype, const TQString& genericServiceType, + const TQString& constraint /*= TQString::null*/, + const TQString& preferences /*= TQString::null*/) const; /** * This is a static pointer to a KTrader instance. diff --git a/kio/kio/ktraderparse.cpp b/kio/kio/ktraderparse.cpp index aa4b799c4..64d9e449f 100644 --- a/kio/kio/ktraderparse.cpp +++ b/kio/kio/ktraderparse.cpp @@ -35,9 +35,9 @@ using namespace KIO; static ParseTreeBase::Ptr *pTree = 0; static const char* sCode = 0; -ParseTreeBase::Ptr KIO::parseConstraints( const QString& _constr ) +ParseTreeBase::Ptr KIO::parseConstraints( const TQString& _constr ) { - QCString str = _constr.utf8(); + TQCString str = _constr.utf8(); sCode = str.data(); KTraderParse_mainParse( sCode ); sCode = 0; @@ -45,9 +45,9 @@ ParseTreeBase::Ptr KIO::parseConstraints( const QString& _constr ) return *pTree; } -ParseTreeBase::Ptr KIO::parsePreferences( const QString& _prefs ) +ParseTreeBase::Ptr KIO::parsePreferences( const TQString& _prefs ) { - QCString str = _prefs.utf8(); + TQCString str = _prefs.utf8(); sCode = str.data(); KTraderParse_mainParse( sCode ); sCode = 0; diff --git a/kio/kio/ktraderparsetree.cpp b/kio/kio/ktraderparsetree.cpp index 74366b990..711ec5356 100644 --- a/kio/kio/ktraderparsetree.cpp +++ b/kio/kio/ktraderparsetree.cpp @@ -396,7 +396,7 @@ bool ParseTreeEXIST::eval( ParseContext *_context ) const { _context->type = ParseContext::T_BOOL; - QVariant prop = _context->service->property( m_id ); + TQVariant prop = _context->service->property( m_id ); _context->b = prop.isValid(); return true; @@ -433,13 +433,13 @@ bool ParseTreeIN::eval( ParseContext *_context ) const if ( (c1.type == ParseContext::T_NUM) && (c2.type == ParseContext::T_SEQ) && - ((*(c2.seq.begin())).type() == QVariant::Int)) { + ((*(c2.seq.begin())).type() == TQVariant::Int)) { - QValueList<QVariant>::ConstIterator it = c2.seq.begin(); - QValueList<QVariant>::ConstIterator end = c2.seq.end(); + TQValueList<TQVariant>::ConstIterator it = c2.seq.begin(); + TQValueList<TQVariant>::ConstIterator end = c2.seq.end(); _context->b = false; for (; it != end; it++) - if ((*it).type() == QVariant::Int && + if ((*it).type() == TQVariant::Int && (*it).toInt() == c1.i) { _context->b = true; break; @@ -449,13 +449,13 @@ bool ParseTreeIN::eval( ParseContext *_context ) const if ( c1.type == ParseContext::T_DOUBLE && c2.type == ParseContext::T_SEQ && - (*(c2.seq.begin())).type() == QVariant::Double) { + (*(c2.seq.begin())).type() == TQVariant::Double) { - QValueList<QVariant>::ConstIterator it = c2.seq.begin(); - QValueList<QVariant>::ConstIterator end = c2.seq.end(); + TQValueList<TQVariant>::ConstIterator it = c2.seq.begin(); + TQValueList<TQVariant>::ConstIterator end = c2.seq.end(); _context->b = false; for (; it != end; it++) - if ((*it).type() == QVariant::Double && + if ((*it).type() == TQVariant::Double && (*it).toDouble() == c1.i) { _context->b = true; break; @@ -474,46 +474,46 @@ bool ParseTreeIN::eval( ParseContext *_context ) const bool ParseTreeID::eval( ParseContext *_context ) const { - QVariant prop = _context->service->property( m_str ); + TQVariant prop = _context->service->property( m_str ); if ( !prop.isValid() ) return false; - if ( prop.type() == QVariant::String ) + if ( prop.type() == TQVariant::String ) { _context->str = prop.toString(); _context->type = ParseContext::T_STRING; return true; } - if ( prop.type() == QVariant::Int ) + if ( prop.type() == TQVariant::Int ) { _context->i = prop.toInt(); _context->type = ParseContext::T_NUM; return true; } - if ( prop.type() == QVariant::Bool ) + if ( prop.type() == TQVariant::Bool ) { _context->b = prop.toBool(); _context->type = ParseContext::T_BOOL; return true; } - if ( prop.type() == QVariant::Double ) + if ( prop.type() == TQVariant::Double ) { _context->f = prop.toDouble(); _context->type = ParseContext::T_DOUBLE; return true; } - if ( prop.type() == QVariant::List ) + if ( prop.type() == TQVariant::List ) { _context->seq = prop.toList(); _context->type = ParseContext::T_SEQ; return true; } - if ( prop.type() == QVariant::StringList ) + if ( prop.type() == TQVariant::StringList ) { _context->strSeq = prop.toStringList(); _context->type = ParseContext::T_STR_SEQ; @@ -528,24 +528,24 @@ bool ParseTreeMIN2::eval( ParseContext *_context ) const { _context->type = ParseContext::T_DOUBLE; - QVariant prop = _context->service->property( m_strId ); + TQVariant prop = _context->service->property( m_strId ); if ( !prop.isValid() ) return false; if ( !_context->initMaxima( m_strId ) ) return false; - QMap<QString,PreferencesMaxima>::Iterator it = _context->maxima.find( m_strId ); + TQMap<TQString,PreferencesMaxima>::Iterator it = _context->maxima.find( m_strId ); if ( it == _context->maxima.end() ) return false; - if ( prop.type() == QVariant::Int && it.data().type == PreferencesMaxima::PM_INT ) + if ( prop.type() == TQVariant::Int && it.data().type == PreferencesMaxima::PM_INT ) { _context->f = (double)( prop.toInt() - it.data().iMin ) / (double)(it.data().iMax - it.data().iMin ) * (-2.0) + 1.0; return true; } - else if ( prop.type() == QVariant::Double && it.data().type == PreferencesMaxima::PM_DOUBLE ) + else if ( prop.type() == TQVariant::Double && it.data().type == PreferencesMaxima::PM_DOUBLE ) { _context->f = ( prop.toDouble() - it.data().fMin ) / (it.data().fMax - it.data().fMin ) * (-2.0) + 1.0; @@ -559,7 +559,7 @@ bool ParseTreeMAX2::eval( ParseContext *_context ) const { _context->type = ParseContext::T_DOUBLE; - QVariant prop = _context->service->property( m_strId ); + TQVariant prop = _context->service->property( m_strId ); if ( !prop.isValid() ) return false; @@ -568,17 +568,17 @@ bool ParseTreeMAX2::eval( ParseContext *_context ) const return false; // Find extrema - QMap<QString,PreferencesMaxima>::Iterator it = _context->maxima.find( m_strId ); + TQMap<TQString,PreferencesMaxima>::Iterator it = _context->maxima.find( m_strId ); if ( it == _context->maxima.end() ) return false; - if ( prop.type() == QVariant::Int && it.data().type == PreferencesMaxima::PM_INT ) + if ( prop.type() == TQVariant::Int && it.data().type == PreferencesMaxima::PM_INT ) { _context->f = (double)( prop.toInt() - it.data().iMin ) / (double)(it.data().iMax - it.data().iMin ) * 2.0 - 1.0; return true; } - else if ( prop.type() == QVariant::Double && it.data().type == PreferencesMaxima::PM_DOUBLE ) + else if ( prop.type() == TQVariant::Double && it.data().type == PreferencesMaxima::PM_DOUBLE ) { _context->f = ( prop.toDouble() - it.data().fMin ) / (it.data().fMax - it.data().fMin ) * 2.0 - 1.0; @@ -595,7 +595,7 @@ int matchConstraint( const ParseTreeBase *_tree, const KService::Ptr &_service, if ( !_tree ) return 1; - QMap<QString,PreferencesMaxima> maxima; + TQMap<TQString,PreferencesMaxima> maxima; ParseContext c( _service, _list, maxima ); // Error during evaluation ? @@ -618,7 +618,7 @@ PreferencesReturn matchPreferences( const ParseTreeBase *_tree, const KService:: if ( !_tree ) return ret; - QMap<QString,PreferencesMaxima> maxima; + TQMap<TQString,PreferencesMaxima> maxima; ParseContext c( _service, _list, maxima ); if ( !_tree->eval( &c ) ) @@ -639,26 +639,26 @@ PreferencesReturn matchPreferences( const ParseTreeBase *_tree, const KService:: return ret; } -bool ParseContext::initMaxima( const QString& _prop ) +bool ParseContext::initMaxima( const TQString& _prop ) { // Is the property known ? - QVariant prop = service->property( _prop ); + TQVariant prop = service->property( _prop ); if ( !prop.isValid() ) return false; // Numeric ? - if ( prop.type() != QVariant::Int && prop.type() != QVariant::Double ) + if ( prop.type() != TQVariant::Int && prop.type() != TQVariant::Double ) return false; // Did we cache the result ? - QMap<QString,PreferencesMaxima>::Iterator it = maxima.find( _prop ); + TQMap<TQString,PreferencesMaxima>::Iterator it = maxima.find( _prop ); if ( it != maxima.end() ) return ( it.data().type == PreferencesMaxima::PM_DOUBLE || it.data().type == PreferencesMaxima::PM_INT ); // Double or Int ? PreferencesMaxima extrema; - if ( prop.type() == QVariant::Int ) + if ( prop.type() == TQVariant::Int ) extrema.type = PreferencesMaxima::PM_INVALID_INT; else extrema.type = PreferencesMaxima::PM_INVALID_DOUBLE; @@ -667,7 +667,7 @@ bool ParseContext::initMaxima( const QString& _prop ) KServiceTypeProfile::OfferList::ConstIterator oit = offers.begin(); for( ; oit != offers.end(); ++oit ) { - QVariant p = (*oit).service()->property( _prop ); + TQVariant p = (*oit).service()->property( _prop ); if ( p.isValid() ) { // Determine new maximum/minimum diff --git a/kio/kio/ktraderparsetree.h b/kio/kio/ktraderparsetree.h index 8dfeed36b..3af4273d0 100644 --- a/kio/kio/ktraderparsetree.h +++ b/kio/kio/ktraderparsetree.h @@ -20,11 +20,11 @@ #ifndef __parse_tree_h__ #define __parse_tree_h__ -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qmap.h> -#include <qshared.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqmap.h> +#include <tqshared.h> #include <kservice.h> #include <kuserprofile.h> @@ -95,25 +95,25 @@ public: ParseContext( const ParseContext* _ctx ) : service( _ctx->service ), maxima( _ctx->maxima ), offers( _ctx->offers ) {} ParseContext( const KService::Ptr & _service, const KServiceTypeProfile::OfferList& _offers, - QMap<QString,PreferencesMaxima>& _m ) + TQMap<TQString,PreferencesMaxima>& _m ) : service( _service ), maxima( _m ), offers( _offers ) {} - bool initMaxima( const QString& _prop); + bool initMaxima( const TQString& _prop); enum Type { T_STRING = 1, T_DOUBLE = 2, T_NUM = 3, T_BOOL = 4, T_STR_SEQ = 5, T_SEQ = 6 }; - QString str; + TQString str; int i; double f; bool b; - QValueList<QVariant> seq; - QStringList strSeq; + TQValueList<TQVariant> seq; + TQStringList strSeq; Type type; KService::Ptr service; - QMap<QString,PreferencesMaxima>& maxima; + TQMap<TQString,PreferencesMaxima>& maxima; const KServiceTypeProfile::OfferList& offers; }; @@ -131,8 +131,8 @@ protected: virtual ~ParseTreeBase() { }; }; -KIO_EXPORT ParseTreeBase::Ptr parseConstraints( const QString& _constr ); -KIO_EXPORT ParseTreeBase::Ptr parsePreferences( const QString& _prefs ); +KIO_EXPORT ParseTreeBase::Ptr parseConstraints( const TQString& _constr ); +KIO_EXPORT ParseTreeBase::Ptr parsePreferences( const TQString& _prefs ); /** * @internal @@ -265,7 +265,7 @@ public: bool eval( ParseContext *_context ) const; protected: - QString m_id; + TQString m_id; }; /** @@ -279,7 +279,7 @@ public: bool eval( ParseContext *_context ) const; protected: - QString m_str; + TQString m_str; }; /** @@ -293,7 +293,7 @@ public: bool eval( ParseContext *_context ) const { _context->type = ParseContext::T_STRING; _context->str = m_str; return true; } protected: - QString m_str; + TQString m_str; }; /** @@ -349,7 +349,7 @@ public: bool eval( ParseContext *_context ) const; protected: - QString m_strId; + TQString m_strId; }; /** @@ -363,7 +363,7 @@ public: bool eval( ParseContext *_context ) const; protected: - QString m_strId; + TQString m_strId; }; } diff --git a/kio/kio/kurifilter.cpp b/kio/kio/kurifilter.cpp index 7188ba62b..2c4c5b12e 100644 --- a/kio/kio/kurifilter.cpp +++ b/kio/kio/kurifilter.cpp @@ -30,12 +30,12 @@ #include "kurifilter.h" -template class QPtrList<KURIFilterPlugin>; +template class TQPtrList<KURIFilterPlugin>; -KURIFilterPlugin::KURIFilterPlugin( QObject *parent, const char *name, double pri ) - :QObject( parent, name ) +KURIFilterPlugin::KURIFilterPlugin( TQObject *parent, const char *name, double pri ) + :TQObject( parent, name ) { - m_strName = QString::fromLatin1( name ); + m_strName = TQString::fromLatin1( name ); m_dblPriority = pri; } @@ -52,9 +52,9 @@ class KURIFilterDataPrivate { public: KURIFilterDataPrivate() {}; - QString abs_path; - QString args; - QString typedString; + TQString abs_path; + TQString args; + TQString typedString; }; KURIFilterData::KURIFilterData( const KURIFilterData& data ) @@ -81,20 +81,20 @@ void KURIFilterData::init( const KURL& url ) { m_iType = KURIFilterData::UNKNOWN; m_pURI = url; - m_strErrMsg = QString::null; - m_strIconName = QString::null; + m_strErrMsg = TQString::null; + m_strIconName = TQString::null; m_bCheckForExecutables = true; m_bChanged = true; d = new KURIFilterDataPrivate; d->typedString = url.url(); } -void KURIFilterData::init( const QString& url ) +void KURIFilterData::init( const TQString& url ) { m_iType = KURIFilterData::UNKNOWN; m_pURI = url; - m_strErrMsg = QString::null; - m_strIconName = QString::null; + m_strErrMsg = TQString::null; + m_strIconName = TQString::null; m_bCheckForExecutables = true; m_bChanged = true; d = new KURIFilterDataPrivate; @@ -107,13 +107,13 @@ void KURIFilterData::reinit(const KURL &url) init(url); } -void KURIFilterData::reinit(const QString &url) +void KURIFilterData::reinit(const TQString &url) { delete d; init(url); } -QString KURIFilterData::typedString() const +TQString KURIFilterData::typedString() const { return d->typedString; } @@ -133,7 +133,7 @@ bool KURIFilterData::hasAbsolutePath() const return !d->abs_path.isEmpty(); } -bool KURIFilterData::setAbsolutePath( const QString& absPath ) +bool KURIFilterData::setAbsolutePath( const TQString& absPath ) { // Since a malformed URL could possibly be a relative // URL we tag it as a possible local resource... @@ -145,17 +145,17 @@ bool KURIFilterData::setAbsolutePath( const QString& absPath ) return false; } -QString KURIFilterData::absolutePath() const +TQString KURIFilterData::absolutePath() const { return d->abs_path; } -QString KURIFilterData::argsAndOptions() const +TQString KURIFilterData::argsAndOptions() const { return d->args; } -QString KURIFilterData::iconName() +TQString KURIFilterData::iconName() { if( m_bChanged ) { @@ -170,37 +170,37 @@ QString KURIFilterData::iconName() } case KURIFilterData::EXECUTABLE: { - QString exeName = m_pURI.url(); + TQString exeName = m_pURI.url(); exeName = exeName.mid( exeName.findRev( '/' ) + 1 ); // strip path if given KService::Ptr service = KService::serviceByDesktopName( exeName ); - if (service && service->icon() != QString::fromLatin1( "unknown" )) + if (service && service->icon() != TQString::fromLatin1( "unknown" )) m_strIconName = service->icon(); // Try to find an icon with the same name as the binary (useful for non-kde apps) else if ( !KGlobal::iconLoader()->loadIcon( exeName, KIcon::NoGroup, 16, KIcon::DefaultState, 0, true ).isNull() ) m_strIconName = exeName; else // not found, use default - m_strIconName = QString::fromLatin1("exec"); + m_strIconName = TQString::fromLatin1("exec"); break; } case KURIFilterData::HELP: { - m_strIconName = QString::fromLatin1("khelpcenter"); + m_strIconName = TQString::fromLatin1("khelpcenter"); break; } case KURIFilterData::SHELL: { - m_strIconName = QString::fromLatin1("konsole"); + m_strIconName = TQString::fromLatin1("konsole"); break; } case KURIFilterData::ERROR: case KURIFilterData::BLOCKED: { - m_strIconName = QString::fromLatin1("error"); + m_strIconName = TQString::fromLatin1("error"); break; } default: - m_strIconName = QString::null; + m_strIconName = TQString::null; break; } m_bChanged = false; @@ -209,7 +209,7 @@ QString KURIFilterData::iconName() } //******************************************** KURIFilterPlugin ********************************************** -void KURIFilterPlugin::setArguments( KURIFilterData& data, const QString& args ) const +void KURIFilterPlugin::setArguments( KURIFilterData& data, const TQString& args ) const { data.d->args = args; } @@ -235,7 +235,7 @@ KURIFilter::~KURIFilter() { } -bool KURIFilter::filterURI( KURIFilterData& data, const QStringList& filters ) +bool KURIFilter::filterURI( KURIFilterData& data, const TQStringList& filters ) { bool filtered = false; KURIFilterPluginList use_plugins; @@ -247,9 +247,9 @@ bool KURIFilter::filterURI( KURIFilterData& data, const QStringList& filters ) else { //kdDebug() << "Named plugins requested..." << endl; - for( QStringList::ConstIterator lst = filters.begin(); lst != filters.end(); ++lst ) + for( TQStringList::ConstIterator lst = filters.begin(); lst != filters.end(); ++lst ) { - QPtrListIterator<KURIFilterPlugin> it( m_lstPlugins ); + TQPtrListIterator<KURIFilterPlugin> it( m_lstPlugins ); for( ; it.current() ; ++it ) { if( (*lst) == it.current()->name() ) @@ -262,7 +262,7 @@ bool KURIFilter::filterURI( KURIFilterData& data, const QStringList& filters ) } } - QPtrListIterator<KURIFilterPlugin> it( use_plugins ); + TQPtrListIterator<KURIFilterPlugin> it( use_plugins ); //kdDebug() << "Using " << use_plugins.count() << " out of the " // << m_lstPlugins.count() << " available plugins" << endl; for (; it.current() && !filtered; ++it) @@ -273,7 +273,7 @@ bool KURIFilter::filterURI( KURIFilterData& data, const QStringList& filters ) return filtered; } -bool KURIFilter::filterURI( KURL& uri, const QStringList& filters ) +bool KURIFilter::filterURI( KURL& uri, const TQStringList& filters ) { KURIFilterData data = uri; bool filtered = filterURI( data, filters ); @@ -281,7 +281,7 @@ bool KURIFilter::filterURI( KURL& uri, const QStringList& filters ) return filtered; } -bool KURIFilter::filterURI( QString& uri, const QStringList& filters ) +bool KURIFilter::filterURI( TQString& uri, const TQStringList& filters ) { KURIFilterData data = uri; bool filtered = filterURI( data, filters ); @@ -290,29 +290,29 @@ bool KURIFilter::filterURI( QString& uri, const QStringList& filters ) } -KURL KURIFilter::filteredURI( const KURL &uri, const QStringList& filters ) +KURL KURIFilter::filteredURI( const KURL &uri, const TQStringList& filters ) { KURIFilterData data = uri; filterURI( data, filters ); return data.uri(); } -QString KURIFilter::filteredURI( const QString &uri, const QStringList& filters ) +TQString KURIFilter::filteredURI( const TQString &uri, const TQStringList& filters ) { KURIFilterData data = uri; filterURI( data, filters ); return data.uri().url(); } -QPtrListIterator<KURIFilterPlugin> KURIFilter::pluginsIterator() const +TQPtrListIterator<KURIFilterPlugin> KURIFilter::pluginsIterator() const { - return QPtrListIterator<KURIFilterPlugin>(m_lstPlugins); + return TQPtrListIterator<KURIFilterPlugin>(m_lstPlugins); } -QStringList KURIFilter::pluginNames() const +TQStringList KURIFilter::pluginNames() const { - QStringList list; - for(QPtrListIterator<KURIFilterPlugin> i = pluginsIterator(); *i; ++i) + TQStringList list; + for(TQPtrListIterator<KURIFilterPlugin> i = pluginsIterator(); *i; ++i) list.append((*i)->name()); return list; } diff --git a/kio/kio/kurifilter.h b/kio/kio/kurifilter.h index 309eae889..0960c1419 100644 --- a/kio/kio/kurifilter.h +++ b/kio/kio/kurifilter.h @@ -25,9 +25,9 @@ #ifndef __kurifilter_h__ #define __kurifilter_h__ -#include <qptrlist.h> -#include <qobject.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqstringlist.h> #include <kurl.h> @@ -54,7 +54,7 @@ class KCModule; * \b Example * * \code -* QString text = "kde.org"; +* TQString text = "kde.org"; * KURIFilterData d = text; * bool filtered = KURIFilter::self()->filter( d ); * cout << "URL: " << text.latin1() << endl @@ -117,7 +117,7 @@ public: * * @param url is the string to be filtered. */ - KURIFilterData( const QString& url ) { init( url ); } + KURIFilterData( const TQString& url ) { init( url ); } /** * Copy constructor. @@ -161,11 +161,11 @@ public: * This functions returns the error message set * by the plugin whenever the uri type is set to * KURIFilterData::ERROR. Otherwise, it returns - * a QString::null. + * a TQString::null. * * @return the error message or a NULL when there is none. */ - QString errorMsg() const { return m_strErrMsg; } + TQString errorMsg() const { return m_strErrMsg; } /** * Returns the URI type. @@ -185,7 +185,7 @@ public: * * @param url the string to be filtered. */ - void setData( const QString& url ) { reinit( url ); } + void setData( const TQString& url ) { reinit( url ); } /** * Same as above except the argument is a URL. @@ -212,14 +212,14 @@ public: * @param abs_path the abolute path to the local resource. * @return true if absolute path is successfully set. Otherwise, false. */ - bool setAbsolutePath( const QString& abs_path ); + bool setAbsolutePath( const TQString& abs_path ); /** * Returns the absolute path if one has already been set. - * @return the absolute path, or QString::null + * @return the absolute path, or TQString::null * @see hasAbsolutePath() */ - QString absolutePath() const; + TQString absolutePath() const; /** * Checks whether the supplied data had an absolute path. @@ -232,9 +232,9 @@ public: * Returns the command line options and arguments for a * local resource when present. * - * @return options and arguments when present, otherwise QString::null + * @return options and arguments when present, otherwise TQString::null */ - QString argsAndOptions() const; + TQString argsAndOptions() const; /** * Checks whether the current data is a local resource with @@ -252,9 +252,9 @@ public: * is found. * * @return the name of the icon associated with the resource, - * or QString::null if not found + * or TQString::null if not found */ - QString iconName(); + TQString iconName(); /** * Check whether the provided uri is executable or not. @@ -280,7 +280,7 @@ public: * @return the string as typed by the user, before any URL processing is done * @since 3.2 */ - QString typedString() const; + TQString typedString() const; /** * Overloaded assigenment operator. @@ -300,7 +300,7 @@ public: * * @return an instance of a KURIFilterData object. */ - KURIFilterData& operator=( const QString& url ) { reinit( url ); return *this; } + KURIFilterData& operator=( const TQString& url ) { reinit( url ); return *this; } protected: @@ -314,20 +314,20 @@ protected: * Initializes the KURIFilterData on construction. * @param url the URL to initialize the object with */ - void init( const QString& url = QString::null ); + void init( const TQString& url = TQString::null ); private: // BC hack to avoid leaking KURIFilterDataPrivate objects. // setData() and operator= used to call init() without deleting `d' void reinit(const KURL& url); - void reinit(const QString& url = QString::null); + void reinit(const TQString& url = TQString::null); bool m_bCheckForExecutables; bool m_bChanged; - QString m_strErrMsg; - QString m_strIconName; + TQString m_strErrMsg; + TQString m_strIconName; KURL m_pURI; URITypes m_iType; @@ -361,14 +361,14 @@ public: * @param name the name of the plugin, or 0 for no name * @param pri the priority of the plugin. */ - KURIFilterPlugin( QObject *parent = 0, const char *name = 0, double pri = 1.0 ); + KURIFilterPlugin( TQObject *parent = 0, const char *name = 0, double pri = 1.0 ); /** * Returns the filter's name. * * @return A string naming the filter. */ - virtual QString name() const { return m_strName; } + virtual TQString name() const { return m_strName; } /** * Returns the filter's priority. @@ -396,14 +396,14 @@ public: * * @return A configuration module, 0 if the filter isn't configurable. */ - virtual KCModule *configModule( QWidget*, const char* ) const { return 0; } + virtual KCModule *configModule( TQWidget*, const char* ) const { return 0; } /** * Returns the name of the configuration module for the filter. * - * @return the name of a configuration module or QString::null if none. + * @return the name of a configuration module or TQString::null if none. */ - virtual QString configName() const { return name(); } + virtual TQString configName() const { return name(); } protected: @@ -415,7 +415,7 @@ protected: /** * Sets the error message in @p data to @p errormsg. */ - void setErrorMsg ( KURIFilterData& data, const QString& errmsg ) const { + void setErrorMsg ( KURIFilterData& data, const TQString& errmsg ) const { data.m_strErrMsg = errmsg; } @@ -431,9 +431,9 @@ protected: * Sets the arguments and options string in @p data * to @p args if any were found during filterting. */ - void setArguments( KURIFilterData& data, const QString& args ) const; + void setArguments( KURIFilterData& data, const TQString& args ) const; - QString m_strName; + TQString m_strName; double m_dblPriority; protected: @@ -446,7 +446,7 @@ private: /** * A list of filter plugins. */ -class KIO_EXPORT KURIFilterPluginList : public QPtrList<KURIFilterPlugin> +class KIO_EXPORT KURIFilterPluginList : public TQPtrList<KURIFilterPlugin> { public: virtual int compareItems(Item a, Item b) @@ -500,25 +500,25 @@ private: * of a boolean flag: * * \code - * QString u = KURIFilter::self()->filteredURI( "kde.org" ); + * TQString u = KURIFilter::self()->filteredURI( "kde.org" ); * \endcode * * You can also restrict the filter(s) to be used by supplying * the name of the filter(s) to use. By defualt all available * filters will be used. To use specific filters, add the names - * of the filters you want to use to a QStringList and invoke + * of the filters you want to use to a TQStringList and invoke * the appropriate filtering function. The examples below show * the use of specific filters. The first one uses a single * filter called kshorturifilter while the second example uses * multiple filters: * * \code - * QString text = "kde.org"; + * TQString text = "kde.org"; * bool filtered = KURIFilter::self()->filterURI( text, "kshorturifilter" ); * \endcode * * \code - * QStringList list; + * TQStringList list; * list << "kshorturifilter" << "localdomainfilter"; * bool filtered = KURIFilter::self()->filterURI( text, list ); * \endcode @@ -555,7 +555,7 @@ public: * * @return a boolean indicating whether the URI has been changed */ - bool filterURI( KURIFilterData& data, const QStringList& filters = QStringList() ); + bool filterURI( KURIFilterData& data, const TQStringList& filters = TQStringList() ); /** * Filters the URI given by the URL. @@ -568,7 +568,7 @@ public: * * @return a boolean indicating whether the URI has been changed */ - bool filterURI( KURL &uri, const QStringList& filters = QStringList() ); + bool filterURI( KURL &uri, const TQStringList& filters = TQStringList() ); /** * Filters a string representing a URI. @@ -581,7 +581,7 @@ public: * * @return a boolean indicating whether the URI has been changed */ - bool filterURI( QString &uri, const QStringList& filters = QStringList() ); + bool filterURI( TQString &uri, const TQStringList& filters = TQStringList() ); /** * Returns the filtered URI. @@ -594,7 +594,7 @@ public: * * @return the filtered URI or null if it cannot be filtered */ - KURL filteredURI( const KURL &uri, const QStringList& filters = QStringList() ); + KURL filteredURI( const KURL &uri, const TQStringList& filters = TQStringList() ); /** * Return a filtered string representation of a URI. @@ -607,7 +607,7 @@ public: * * @return the filtered URI or null if it cannot be filtered */ - QString filteredURI( const QString &uri, const QStringList& filters = QStringList() ); + TQString filteredURI( const TQString &uri, const TQStringList& filters = TQStringList() ); /** * Return an iterator to iterate over all loaded @@ -615,15 +615,15 @@ public: * * @return a plugin iterator. */ - QPtrListIterator<KURIFilterPlugin> pluginsIterator() const; + TQPtrListIterator<KURIFilterPlugin> pluginsIterator() const; /** * Return a list of the names of all loaded plugins. * - * @return a QStringList of plugin names + * @return a TQStringList of plugin names * @since 3.1 */ - QStringList pluginNames() const; + TQStringList pluginNames() const; protected: diff --git a/kio/kio/kurlcompletion.cpp b/kio/kio/kurlcompletion.cpp index cddd9fa79..88a566b5f 100644 --- a/kio/kio/kurlcompletion.cpp +++ b/kio/kio/kurlcompletion.cpp @@ -28,16 +28,16 @@ #include <assert.h> #include <limits.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qdir.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qdeepcopy.h> -#include <qthread.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqdeepcopy.h> +#include <tqthread.h> #include <kapplication.h> #include <kdebug.h> @@ -61,10 +61,10 @@ #include "kurlcompletion.h" -static bool expandTilde(QString &); -static bool expandEnv(QString &); +static bool expandTilde(TQString &); +static bool expandEnv(TQString &); -static QString unescape(const QString &text); +static TQString unescape(const TQString &text); // Permission mask for files that are executable by // user, group or other @@ -84,7 +84,7 @@ class CompletionMatchEvent : public QCustomEvent { public: CompletionMatchEvent( CompletionThread *thread ) : - QCustomEvent( uniqueType() ), + TQCustomEvent( uniqueType() ), m_completionThread( thread ) {} @@ -99,17 +99,17 @@ class CompletionThread : public QThread { protected: CompletionThread( KURLCompletion *receiver ) : - QThread(), + TQThread(), m_receiver( receiver ), m_terminationRequested( false ) {} public: void requestTermination() { m_terminationRequested = true; } - QDeepCopy<QStringList> matches() const { return m_matches; } + TQDeepCopy<TQStringList> matches() const { return m_matches; } protected: - void addMatch( const QString &match ) { m_matches.append( match ); } + void addMatch( const TQString &match ) { m_matches.append( match ); } bool terminationRequested() const { return m_terminationRequested; } void done() { @@ -121,7 +121,7 @@ protected: private: KURLCompletion *m_receiver; - QStringList m_matches; + TQStringList m_matches; bool m_terminationRequested; }; @@ -140,11 +140,11 @@ public: protected: virtual void run() { - static const QChar tilde = '~'; + static const TQChar tilde = '~'; struct passwd *pw; while ( ( pw = ::getpwent() ) && !terminationRequested() ) - addMatch( tilde + QString::fromLocal8Bit( pw->pw_name ) ); + addMatch( tilde + TQString::fromLocal8Bit( pw->pw_name ) ); ::endpwent(); @@ -158,15 +158,15 @@ class DirectoryListThread : public CompletionThread { public: DirectoryListThread( KURLCompletion *receiver, - const QStringList &dirList, - const QString &filter, + const TQStringList &dirList, + const TQString &filter, bool onlyExe, bool onlyDir, bool noHidden, bool appendSlashToDir ) : CompletionThread( receiver ), - m_dirList( QDeepCopy<QStringList>( dirList ) ), - m_filter( QDeepCopy<QString>( filter ) ), + m_dirList( TQDeepCopy<TQStringList>( dirList ) ), + m_filter( TQDeepCopy<TQString>( filter ) ), m_onlyExe( onlyExe ), m_onlyDir( onlyDir ), m_noHidden( noHidden ), @@ -176,8 +176,8 @@ public: virtual void run(); private: - QStringList m_dirList; - QString m_filter; + TQStringList m_dirList; + TQString m_filter; bool m_onlyExe; bool m_onlyDir; bool m_noHidden; @@ -192,22 +192,22 @@ void DirectoryListThread::run() // of all of the things that would seem to be problematic. Here are a few // things that I have checked to be safe here (some used indirectly): // - // QDir::currentDirPath(), QDir::setCurrent(), QFile::decodeName(), QFile::encodeName() - // QString::fromLocal8Bit(), QString::local8Bit(), QTextCodec::codecForLocale() + // TQDir::currentDirPath(), TQDir::setCurrent(), TQFile::decodeName(), TQFile::encodeName() + // TQString::fromLocal8Bit(), TQString::local8Bit(), TQTextCodec::codecForLocale() // // Also see (for POSIX functions): // http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html DIR *dir = 0; - for ( QStringList::ConstIterator it = m_dirList.begin(); + for ( TQStringList::ConstIterator it = m_dirList.begin(); it != m_dirList.end() && !terminationRequested(); ++it ) { // Open the next directory if ( !dir ) { - dir = ::opendir( QFile::encodeName( *it ) ); + dir = ::opendir( TQFile::encodeName( *it ) ); if ( ! dir ) { kdDebug() << "Failed to open dir: " << *it << endl; done(); @@ -219,8 +219,8 @@ void DirectoryListThread::run() // chdir to the directroy so we won't have to deal with full paths // with stat() - QString path = QDir::currentDirPath(); - QDir::setCurrent( *it ); + TQString path = TQDir::currentDirPath(); + TQDir::setCurrent( *it ); // Loop through all directory entries // Solaris and IRIX dirent structures do not allocate space for d_name. On @@ -256,7 +256,7 @@ void DirectoryListThread::run() if ( dirEntry->d_name[0] == '.' && dirEntry->d_name[1] == '.' && dirEntry->d_name[2] == '\0' ) continue; - QString file = QFile::decodeName( dirEntry->d_name ); + TQString file = TQFile::decodeName( dirEntry->d_name ); if ( m_filter.isEmpty() || file.startsWith( m_filter ) ) { @@ -293,7 +293,7 @@ void DirectoryListThread::run() // chdir to the original directory - QDir::setCurrent( path ); + TQDir::setCurrent( path ); ::closedir( dir ); dir = 0; @@ -313,19 +313,19 @@ void DirectoryListThread::run() class KURLCompletion::MyURL { public: - MyURL(const QString &url, const QString &cwd); + MyURL(const TQString &url, const TQString &cwd); MyURL(const MyURL &url); ~MyURL(); KURL *kurl() const { return m_kurl; } - QString protocol() const { return m_kurl->protocol(); } + TQString protocol() const { return m_kurl->protocol(); } // The directory with a trailing '/' - QString dir() const { return m_kurl->directory(false, false); } - QString file() const { return m_kurl->fileName(false); } + TQString dir() const { return m_kurl->directory(false, false); } + TQString file() const { return m_kurl->fileName(false); } // The initial, unparsed, url, as a string. - QString url() const { return m_url; } + TQString url() const { return m_url; } // Is the initial string a URL, or just a path (whether absolute or relative) bool isURL() const { return m_isURL; } @@ -333,14 +333,14 @@ public: void filter( bool replace_user_dir, bool replace_env ); private: - void init(const QString &url, const QString &cwd); + void init(const TQString &url, const TQString &cwd); KURL *m_kurl; - QString m_url; + TQString m_url; bool m_isURL; }; -KURLCompletion::MyURL::MyURL(const QString &url, const QString &cwd) +KURLCompletion::MyURL::MyURL(const TQString &url, const TQString &cwd) { init(url, cwd); } @@ -352,24 +352,24 @@ KURLCompletion::MyURL::MyURL(const MyURL &url) m_isURL = url.m_isURL; } -void KURLCompletion::MyURL::init(const QString &url, const QString &cwd) +void KURLCompletion::MyURL::init(const TQString &url, const TQString &cwd) { // Save the original text m_url = url; // Non-const copy - QString url_copy = url; + TQString url_copy = url; // Special shortcuts for "man:" and "info:" if ( url_copy[0] == '#' ) { if ( url_copy[1] == '#' ) - url_copy.replace( 0, 2, QString("info:") ); + url_copy.replace( 0, 2, TQString("info:") ); else - url_copy.replace( 0, 1, QString("man:") ); + url_copy.replace( 0, 1, TQString("man:") ); } // Look for a protocol in 'url' - QRegExp protocol_regex = QRegExp( "^[^/\\s\\\\]*:" ); + TQRegExp protocol_regex = TQRegExp( "^[^/\\s\\\\]*:" ); // Assume "file:" or whatever is given by 'cwd' if there is // no protocol. (KURL does this only for absoute paths) @@ -384,7 +384,7 @@ void KURLCompletion::MyURL::init(const QString &url, const QString &cwd) if ( cwd.isEmpty() ) { m_kurl = new KURL(); - if ( !QDir::isRelativePath(url_copy) || url_copy[0] == '$' || url_copy[0] == '~' ) + if ( !TQDir::isRelativePath(url_copy) || url_copy[0] == '$' || url_copy[0] == '~' ) m_kurl->setPath( url_copy ); else *m_kurl = url_copy; @@ -394,7 +394,7 @@ void KURLCompletion::MyURL::init(const QString &url, const QString &cwd) KURL base = KURL::fromPathOrURL( cwd ); base.adjustPath(+1); - if ( !QDir::isRelativePath(url_copy) || url_copy[0] == '~' || url_copy[0] == '$' ) + if ( !TQDir::isRelativePath(url_copy) || url_copy[0] == '~' || url_copy[0] == '$' ) { m_kurl = new KURL(); m_kurl->setPath( url_copy ); @@ -416,7 +416,7 @@ KURLCompletion::MyURL::~MyURL() void KURLCompletion::MyURL::filter( bool replace_user_dir, bool replace_env ) { - QString d = dir() + file(); + TQString d = dir() + file(); if ( replace_user_dir ) expandTilde( d ); if ( replace_env ) expandEnv( d ); m_kurl->setPath( d ); @@ -434,7 +434,7 @@ public: dirListThread(0) {} ~KURLCompletionPrivate(); - QValueList<KURL*> list_urls; + TQValueList<KURL*> list_urls; bool onlyLocalProto; @@ -446,13 +446,13 @@ public: bool popup_append_slash; // Keep track of currently listed files to avoid reading them again - QString last_path_listed; - QString last_file_listed; - QString last_prepend; + TQString last_path_listed; + TQString last_file_listed; + TQString last_prepend; int last_compl_type; int last_no_hidden; - QString cwd; // "current directory" = base dir for completion + TQString cwd; // "current directory" = base dir for completion KURLCompletion::Mode mode; // ExeCompletion, FileCompletion, DirCompletion bool replace_env; @@ -461,13 +461,13 @@ public: KIO::ListJob *list_job; // kio job to list directories - QString prepend; // text to prepend to listed items - QString compl_text; // text to pass on to KCompletion + TQString prepend; // text to prepend to listed items + TQString compl_text; // text to pass on to KCompletion // Filters for files read with kio bool list_urls_only_exe; // true = only list executables bool list_urls_no_hidden; - QString list_urls_filter; // filter for listed files + TQString list_urls_filter; // filter for listed files CompletionThread *userListThread; CompletionThread *dirListThread; @@ -509,7 +509,7 @@ void KURLCompletion::init() { d = new KURLCompletionPrivate; - d->cwd = QDir::homeDirPath(); + d->cwd = TQDir::homeDirPath(); d->replace_home = true; d->replace_env = true; @@ -527,12 +527,12 @@ void KURLCompletion::init() d->onlyLocalProto = c->readBoolEntry("LocalProtocolsOnly", false); } -void KURLCompletion::setDir(const QString &dir) +void KURLCompletion::setDir(const TQString &dir) { d->cwd = dir; } -QString KURLCompletion::dir() const +TQString KURLCompletion::dir() const { return d->cwd; } @@ -572,7 +572,7 @@ void KURLCompletion::setReplaceHome( bool replace ) * * Entry point for file name completion */ -QString KURLCompletion::makeCompletion(const QString &text) +TQString KURLCompletion::makeCompletion(const TQString &text) { //kdDebug() << "KURLCompletion::makeCompletion: " << text << " d->cwd=" << d->cwd << endl; @@ -588,7 +588,7 @@ QString KURLCompletion::makeCompletion(const QString &text) d->prepend = text.left( text.length() - toRemove ); d->complete_url = url.isURL(); - QString match; + TQString match; // Environment variables // @@ -635,7 +635,7 @@ QString KURLCompletion::makeCompletion(const QString &text) setListedURL( CTNone ); stop(); - return QString::null; + return TQString::null; } /* @@ -644,7 +644,7 @@ QString KURLCompletion::makeCompletion(const QString &text) * Go on and call KCompletion. * Called when all matches have been added */ -QString KURLCompletion::finished() +TQString KURLCompletion::finished() { if ( d->last_compl_type == CTInfo ) return KCompletion::makeCompletion( d->compl_text.lower() ); @@ -676,7 +676,7 @@ void KURLCompletion::stop() } if ( !d->list_urls.isEmpty() ) { - QValueList<KURL*>::Iterator it = d->list_urls.begin(); + TQValueList<KURL*>::Iterator it = d->list_urls.begin(); for ( ; it != d->list_urls.end(); it++ ) delete (*it); d->list_urls.clear(); @@ -692,8 +692,8 @@ void KURLCompletion::stop() * Keep track of the last listed directory */ void KURLCompletion::setListedURL( int complType, - const QString& dir, - const QString& filter, + const TQString& dir, + const TQString& filter, bool no_hidden ) { d->last_compl_type = complType; @@ -704,8 +704,8 @@ void KURLCompletion::setListedURL( int complType, } bool KURLCompletion::isListedURL( int complType, - const QString& dir, - const QString& filter, + const TQString& dir, + const TQString& filter, bool no_hidden ) { return d->last_compl_type == complType @@ -734,7 +734,7 @@ bool KURLCompletion::isAutoCompletion() // User directories // -bool KURLCompletion::userCompletion(const MyURL &url, QString *match) +bool KURLCompletion::userCompletion(const MyURL &url, TQString *match) { if ( url.protocol() != "file" || !url.dir().isEmpty() @@ -753,7 +753,7 @@ bool KURLCompletion::userCompletion(const MyURL &url, QString *match) // are added to the first matching case. d->userListThread->wait( 200 ); - QStringList l = d->userListThread->matches(); + TQStringList l = d->userListThread->matches(); addMatches( l ); } } @@ -768,7 +768,7 @@ bool KURLCompletion::userCompletion(const MyURL &url, QString *match) extern char **environ; // Array of environment variables -bool KURLCompletion::envCompletion(const MyURL &url, QString *match) +bool KURLCompletion::envCompletion(const MyURL &url, TQString *match) { if ( url.file().at(0) != '$' ) return false; @@ -779,12 +779,12 @@ bool KURLCompletion::envCompletion(const MyURL &url, QString *match) char **env = environ; - QString dollar = QString("$"); + TQString dollar = TQString("$"); - QStringList l; + TQStringList l; while ( *env ) { - QString s = QString::fromLocal8Bit( *env ); + TQString s = TQString::fromLocal8Bit( *env ); int pos = s.find('='); @@ -811,12 +811,12 @@ bool KURLCompletion::envCompletion(const MyURL &url, QString *match) // Executables // -bool KURLCompletion::exeCompletion(const MyURL &url, QString *match) +bool KURLCompletion::exeCompletion(const MyURL &url, TQString *match) { if ( url.protocol() != "file" ) return false; - QString dir = url.dir(); + TQString dir = url.dir(); dir = unescape( dir ); // remove escapes @@ -827,9 +827,9 @@ bool KURLCompletion::exeCompletion(const MyURL &url, QString *match) // 3. $PATH // 4. no directory at all - QStringList dirList; + TQStringList dirList; - if ( !QDir::isRelativePath(dir) ) { + if ( !TQDir::isRelativePath(dir) ) { // complete path in url dirList.append( dir ); } @@ -839,10 +839,10 @@ bool KURLCompletion::exeCompletion(const MyURL &url, QString *match) } else if ( !url.file().isEmpty() ) { // $PATH - dirList = QStringList::split(KPATH_SEPARATOR, - QString::fromLocal8Bit(::getenv("PATH"))); + dirList = TQStringList::split(KPATH_SEPARATOR, + TQString::fromLocal8Bit(::getenv("PATH"))); - QStringList::Iterator it = dirList.begin(); + TQStringList::Iterator it = dirList.begin(); for ( ; it != dirList.end(); it++ ) (*it).append('/'); @@ -868,7 +868,7 @@ bool KURLCompletion::exeCompletion(const MyURL &url, QString *match) else { if ( d->dirListThread ) setListedURL( CTExe, dir, url.file(), no_hidden_files ); - *match = QString::null; + *match = TQString::null; } return true; @@ -879,12 +879,12 @@ bool KURLCompletion::exeCompletion(const MyURL &url, QString *match) // Local files // -bool KURLCompletion::fileCompletion(const MyURL &url, QString *match) +bool KURLCompletion::fileCompletion(const MyURL &url, TQString *match) { if ( url.protocol() != "file" ) return false; - QString dir = url.dir(); + TQString dir = url.dir(); if (url.url()[0] == '.') { @@ -911,9 +911,9 @@ bool KURLCompletion::fileCompletion(const MyURL &url, QString *match) // 2. current directory (d->cwd) // 3. no directory at all - QStringList dirList; + TQStringList dirList; - if ( !QDir::isRelativePath(dir) ) { + if ( !TQDir::isRelativePath(dir) ) { // complete path in url dirList.append( dir ); } @@ -948,7 +948,7 @@ bool KURLCompletion::fileCompletion(const MyURL &url, QString *match) *match = finished(); } else { - *match = QString::null; + *match = TQString::null; } return true; @@ -959,7 +959,7 @@ bool KURLCompletion::fileCompletion(const MyURL &url, QString *match) // URLs not handled elsewhere... // -bool KURLCompletion::urlCompletion(const MyURL &url, QString *match) +bool KURLCompletion::urlCompletion(const MyURL &url, TQString *match) { //kdDebug() << "urlCompletion: url = " << *url.kurl() << endl; if (d->onlyLocalProto && KProtocolInfo::protocolClass(url.protocol()) != ":local") @@ -977,8 +977,8 @@ bool KURLCompletion::urlCompletion(const MyURL &url, QString *match) // 3. there is no directory (e.g. "ftp://ftp.kd" shouldn't do anything) // 4. auto or popup completion mode depending on settings - bool man_or_info = ( url_dir.protocol() == QString("man") - || url_dir.protocol() == QString("info") ); + bool man_or_info = ( url_dir.protocol() == TQString("man") + || url_dir.protocol() == TQString("info") ); if ( !url_dir.isValid() || !KProtocolInfo::supportsListing( url_dir ) @@ -992,7 +992,7 @@ bool KURLCompletion::urlCompletion(const MyURL &url, QString *match) url_dir.setFileName(""); // not really nesseccary, but clear the filename anyway... // Remove escapes - QString dir = url_dir.directory( false, false ); + TQString dir = url_dir.directory( false, false ); dir = unescape( dir ); @@ -1007,18 +1007,18 @@ bool KURLCompletion::urlCompletion(const MyURL &url, QString *match) setListedURL( CTUrl, url_dir.prettyURL(), "" ); - QValueList<KURL*> url_list; + TQValueList<KURL*> url_list; url_list.append( new KURL( url_dir ) ); listURLs( url_list, "", false ); - *match = QString::null; + *match = TQString::null; } else if ( !isRunning() ) { *match = finished(); } else { - *match = QString::null; + *match = TQString::null; } return true; @@ -1034,10 +1034,10 @@ bool KURLCompletion::urlCompletion(const MyURL &url, QString *match) * * Called to add matches to KCompletion */ -void KURLCompletion::addMatches( const QStringList &matches ) +void KURLCompletion::addMatches( const TQStringList &matches ) { - QStringList::ConstIterator it = matches.begin(); - QStringList::ConstIterator end = matches.end(); + TQStringList::ConstIterator it = matches.begin(); + TQStringList::ConstIterator end = matches.end(); if ( d->complete_url ) for ( ; it != end; it++ ) @@ -1056,12 +1056,12 @@ void KURLCompletion::addMatches( const QStringList &matches ) * In either case, addMatches() is called with the listed * files, and eventually finished() when the listing is done * - * Returns the match if available, or QString::null if + * Returns the match if available, or TQString::null if * DirLister timed out or using kio */ -QString KURLCompletion::listDirectories( - const QStringList &dirList, - const QString &filter, +TQString KURLCompletion::listDirectories( + const TQStringList &dirList, + const TQString &filter, bool only_exe, bool only_dir, bool no_hidden, @@ -1078,9 +1078,9 @@ QString KURLCompletion::listDirectories( if ( d->dirListThread ) d->dirListThread->requestTermination(); - QStringList dirs; + TQStringList dirs; - for ( QStringList::ConstIterator it = dirList.begin(); + for ( TQStringList::ConstIterator it = dirList.begin(); it != dirList.end(); ++it ) { @@ -1103,9 +1103,9 @@ QString KURLCompletion::listDirectories( // Use KIO //kdDebug() << "Listing (listDirectories): " << dirList << " with KIO" << endl; - QValueList<KURL*> url_list; + TQValueList<KURL*> url_list; - QStringList::ConstIterator it = dirList.begin(); + TQStringList::ConstIterator it = dirList.begin(); for ( ; it != dirList.end(); it++ ) url_list.append( new KURL(*it) ); @@ -1113,7 +1113,7 @@ QString KURLCompletion::listDirectories( listURLs( url_list, filter, only_exe, no_hidden ); // Will call addMatches() and finished() - return QString::null; + return TQString::null; } } @@ -1126,8 +1126,8 @@ QString KURLCompletion::listDirectories( * finished() is called when the listing is done */ void KURLCompletion::listURLs( - const QValueList<KURL *> &urls, - const QString &filter, + const TQValueList<KURL *> &urls, + const TQString &filter, bool only_exe, bool no_hidden ) { @@ -1156,20 +1156,20 @@ void KURLCompletion::listURLs( */ void KURLCompletion::slotEntries(KIO::Job*, const KIO::UDSEntryList& entries) { - QStringList matches; + TQStringList matches; KIO::UDSEntryListConstIterator it = entries.begin(); KIO::UDSEntryListConstIterator end = entries.end(); - QString filter = d->list_urls_filter; + TQString filter = d->list_urls_filter; int filter_len = filter.length(); // Iterate over all files // for (; it != end; ++it) { - QString name; - QString url; + TQString name; + TQString url; bool is_exe = false; bool is_dir = false; @@ -1256,12 +1256,12 @@ void KURLCompletion::slotIOFinished( KIO::Job * job ) assert( d->list_job ); connect( d->list_job, - SIGNAL(result(KIO::Job*)), - SLOT(slotIOFinished(KIO::Job*)) ); + TQT_SIGNAL(result(KIO::Job*)), + TQT_SLOT(slotIOFinished(KIO::Job*)) ); connect( d->list_job, - SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList&)), - SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList&)) ); + TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList&)), + TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList&)) ); delete kurl; } @@ -1278,7 +1278,7 @@ void KURLCompletion::slotIOFinished( KIO::Job * job ) * Append '/' to directories for file completion. This is * done here to avoid stat()'ing a lot of files */ -void KURLCompletion::postProcessMatch( QString *match ) const +void KURLCompletion::postProcessMatch( TQString *match ) const { // kdDebug() << "KURLCompletion::postProcess: " << *match << endl; @@ -1291,27 +1291,27 @@ void KURLCompletion::postProcessMatch( QString *match ) const } } -void KURLCompletion::adjustMatch( QString& match ) const +void KURLCompletion::adjustMatch( TQString& match ) const { if ( match.at( match.length()-1 ) != '/' ) { - QString copy; + TQString copy; - if ( match.startsWith( QString("file:") ) ) + if ( match.startsWith( TQString("file:") ) ) copy = KURL(match).path(); else copy = match; expandTilde( copy ); expandEnv( copy ); - if ( QDir::isRelativePath(copy) ) + if ( TQDir::isRelativePath(copy) ) copy.prepend( d->cwd + '/' ); // kdDebug() << "postProcess: stating " << copy << endl; KDE_struct_stat sbuff; - QCString file = QFile::encodeName( copy ); + TQCString file = TQFile::encodeName( copy ); if ( KDE_stat( (const char*)file, &sbuff ) == 0 ) { if ( S_ISDIR ( sbuff.st_mode ) ) @@ -1323,10 +1323,10 @@ void KURLCompletion::adjustMatch( QString& match ) const } } -void KURLCompletion::postProcessMatches( QStringList * matches ) const +void KURLCompletion::postProcessMatches( TQStringList * matches ) const { if ( !matches->isEmpty() && d->last_compl_type == CTFile ) { - QStringList::Iterator it = matches->begin(); + TQStringList::Iterator it = matches->begin(); for (; it != matches->end(); ++it ) { adjustMatch( (*it) ); } @@ -1343,7 +1343,7 @@ void KURLCompletion::postProcessMatches( KCompletionMatches * matches ) const } } -void KURLCompletion::customEvent(QCustomEvent *e) +void KURLCompletion::customEvent(TQCustomEvent *e) { if ( e->type() == CompletionMatchEvent::uniqueType() ) { @@ -1370,12 +1370,12 @@ void KURLCompletion::customEvent(QCustomEvent *e) } // static -QString KURLCompletion::replacedPath( const QString& text, bool replaceHome, bool replaceEnv ) +TQString KURLCompletion::replacedPath( const TQString& text, bool replaceHome, bool replaceEnv ) { if ( text.isEmpty() ) return text; - MyURL url( text, QString::null ); // no need to replace something of our current cwd + MyURL url( text, TQString::null ); // no need to replace something of our current cwd if ( !url.kurl()->isLocalFile() ) return text; @@ -1384,7 +1384,7 @@ QString KURLCompletion::replacedPath( const QString& text, bool replaceHome, boo } -QString KURLCompletion::replacedPath( const QString& text ) +TQString KURLCompletion::replacedPath( const TQString& text ) { return replacedPath( text, d->replace_home, d->replace_env ); } @@ -1399,7 +1399,7 @@ QString KURLCompletion::replacedPath( const QString& text ) * Expand environment variables in text. Escaped '$' are ignored. * Return true if expansion was made. */ -static bool expandEnv( QString &text ) +static bool expandEnv( TQString &text ) { // Find all environment variables beginning with '$' // @@ -1433,9 +1433,9 @@ static bool expandEnv( QString &text ) // if ( pos2 >= 0 ) { int len = pos2 - pos; - QString key = text.mid( pos+1, len-1); - QString value = - QString::fromLocal8Bit( ::getenv(key.local8Bit()) ); + TQString key = text.mid( pos+1, len-1); + TQString value = + TQString::fromLocal8Bit( ::getenv(key.local8Bit()) ); if ( !value.isEmpty() ) { expanded = true; @@ -1458,7 +1458,7 @@ static bool expandEnv( QString &text ) * Replace "~user" with the users home directory * Return true if expansion was made. */ -static bool expandTilde(QString &text) +static bool expandTilde(TQString &text) { if ( text[0] != '~' ) return false; @@ -1480,13 +1480,13 @@ static bool expandTilde(QString &text) // if ( pos2 >= 0 ) { - QString user = text.mid( 1, pos2-1 ); - QString dir; + TQString user = text.mid( 1, pos2-1 ); + TQString dir; // A single ~ is replaced with $HOME // if ( user.isEmpty() ) { - dir = QDir::homeDirPath(); + dir = TQDir::homeDirPath(); } // ~user is replaced with the dir from passwd // @@ -1494,7 +1494,7 @@ static bool expandTilde(QString &text) struct passwd *pw = ::getpwnam( user.local8Bit() ); if ( pw ) - dir = QFile::decodeName( pw->pw_dir ); + dir = TQFile::decodeName( pw->pw_dir ); ::endpwent(); } @@ -1514,9 +1514,9 @@ static bool expandTilde(QString &text) * Remove escapes and return the result in a new string * */ -static QString unescape(const QString &text) +static TQString unescape(const TQString &text) { - QString result; + TQString result; for (uint pos = 0; pos < text.length(); pos++) if ( text[pos] != '\\' ) diff --git a/kio/kio/kurlcompletion.h b/kio/kio/kurlcompletion.h index 85e9b027f..a06d7dc4b 100644 --- a/kio/kio/kurlcompletion.h +++ b/kio/kio/kurlcompletion.h @@ -25,8 +25,8 @@ #include <kcompletion.h> #include <kio/jobclasses.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> class KURL; class KURLCompletionPrivate; @@ -74,25 +74,25 @@ public: * The completion is done asyncronously if KIO is used. * * Returns the first match for user, environment, and local dir completion - * and QString::null for asynchronous completion (KIO or threaded). + * and TQString::null for asynchronous completion (KIO or threaded). * * @param text the text to complete - * @return the first match, or QString::null if not found + * @return the first match, or TQString::null if not found */ - virtual QString makeCompletion(const QString &text); // KDE4: remove return value, it's often null due to threading + virtual TQString makeCompletion(const TQString &text); // KDE4: remove return value, it's often null due to threading /** * Sets the current directory (used as base for completion). * Default = $HOME. * @param dir the current directory, either as a path or URL */ - virtual void setDir(const QString &dir); + virtual void setDir(const TQString &dir); /** * Returns the current directory, as it was given in setDir * @return the current directory (path or URL) */ - virtual QString dir() const; + virtual TQString dir() const; /** * Check whether asynchronous completion is in progress. @@ -157,23 +157,23 @@ public: * @return the path or URL resulting from this operation. If you * want to convert it to a KURL, use KURL::fromPathOrURL. */ - QString replacedPath( const QString& text ); + TQString replacedPath( const TQString& text ); /** * @internal I'll let ossi add a real one to KShell :) * @since 3.2 */ - static QString replacedPath( const QString& text, + static TQString replacedPath( const TQString& text, bool replaceHome, bool replaceEnv = true ); class MyURL; protected: // Called by KCompletion, adds '/' to directories - void postProcessMatch( QString *match ) const; - void postProcessMatches( QStringList *matches ) const; + void postProcessMatch( TQString *match ) const; + void postProcessMatches( TQStringList *matches ) const; void postProcessMatches( KCompletionMatches* matches ) const; - virtual void customEvent( QCustomEvent *e ); + virtual void customEvent( TQCustomEvent *e ); protected slots: void slotEntries( KIO::Job *, const KIO::UDSEntryList& ); @@ -183,48 +183,48 @@ private: bool isAutoCompletion(); - bool userCompletion(const MyURL &url, QString *match); - bool envCompletion(const MyURL &url, QString *match); - bool exeCompletion(const MyURL &url, QString *match); - bool fileCompletion(const MyURL &url, QString *match); - bool urlCompletion(const MyURL &url, QString *match); + bool userCompletion(const MyURL &url, TQString *match); + bool envCompletion(const MyURL &url, TQString *match); + bool exeCompletion(const MyURL &url, TQString *match); + bool fileCompletion(const MyURL &url, TQString *match); + bool urlCompletion(const MyURL &url, TQString *match); // List a directory using readdir() - void listDir( const QString& dir, - QStringList *matches, - const QString& filter, + void listDir( const TQString& dir, + TQStringList *matches, + const TQString& filter, bool only_exe, bool no_hidden ); // List the next dir in m_dirs - QString listDirectories(const QStringList &, - const QString &, + TQString listDirectories(const TQStringList &, + const TQString &, bool only_exe = false, bool only_dir = false, bool no_hidden = false, bool stat_files = true); - void listURLs( const QValueList<KURL *> &urls, - const QString &filter = QString::null, + void listURLs( const TQValueList<KURL *> &urls, + const TQString &filter = TQString::null, bool only_exe = false, bool no_hidden = false ); - void addMatches( const QStringList & ); - QString finished(); + void addMatches( const TQStringList & ); + TQString finished(); void init(); void setListedURL(int compl_type /* enum ComplType */, - const QString& dir = QString::null, - const QString& filter = QString::null, + const TQString& dir = TQString::null, + const TQString& filter = TQString::null, bool no_hidden = false ); bool isListedURL( int compl_type /* enum ComplType */, - const QString& dir = QString::null, - const QString& filter = QString::null, + const TQString& dir = TQString::null, + const TQString& filter = TQString::null, bool no_hidden = false ); - void adjustMatch( QString& match ) const; + void adjustMatch( TQString& match ) const; protected: virtual void virtual_hook( int id, void* data ); diff --git a/kio/kio/kurlpixmapprovider.cpp b/kio/kio/kurlpixmapprovider.cpp index e20c3b6ec..caeedf066 100644 --- a/kio/kio/kurlpixmapprovider.cpp +++ b/kio/kio/kurlpixmapprovider.cpp @@ -20,7 +20,7 @@ #include "kurlpixmapprovider.h" -QPixmap KURLPixmapProvider::pixmapFor( const QString& url, int size ) { +TQPixmap KURLPixmapProvider::pixmapFor( const TQString& url, int size ) { KURL u; if ( url.at(0) == '/' ) u.setPath( url ); diff --git a/kio/kio/kurlpixmapprovider.h b/kio/kio/kurlpixmapprovider.h index 7edd37d5b..1fa400c1e 100644 --- a/kio/kio/kurlpixmapprovider.h +++ b/kio/kio/kurlpixmapprovider.h @@ -50,7 +50,7 @@ public: * @return the resulting pixmap * @see KIcon::StdSizes */ - virtual QPixmap pixmapFor( const QString& url, int size = 0 ); + virtual TQPixmap pixmapFor( const TQString& url, int size = 0 ); protected: virtual void virtual_hook( int id, void* data ); }; diff --git a/kio/kio/kuserprofile.cpp b/kio/kio/kuserprofile.cpp index 1895ebb98..b7ef68c76 100644 --- a/kio/kio/kuserprofile.cpp +++ b/kio/kio/kuserprofile.cpp @@ -27,10 +27,10 @@ #include <kdebug.h> #include <kstaticdeleter.h> -#include <qtl.h> +#include <tqtl.h> -template class QPtrList<KServiceTypeProfile>; -typedef QPtrList<KServiceTypeProfile> KServiceTypeProfileList; +template class TQPtrList<KServiceTypeProfile>; +typedef TQPtrList<KServiceTypeProfile> KServiceTypeProfileList; /********************************************* * @@ -55,24 +55,24 @@ void KServiceTypeProfile::initStatic() KConfig config( "profilerc", true, false); - static const QString & defaultGroup = KGlobal::staticQString("<default>"); + static const TQString & defaultGroup = KGlobal::staticQString("<default>"); - QStringList tmpList = config.groupList(); - for (QStringList::Iterator aIt = tmpList.begin(); + TQStringList tmpList = config.groupList(); + for (TQStringList::Iterator aIt = tmpList.begin(); aIt != tmpList.end(); ++aIt) { if ( *aIt == defaultGroup ) continue; config.setGroup( *aIt ); - QString appId = config.readEntry( "Application" ); + TQString appId = config.readEntry( "Application" ); KService::Ptr pService = KService::serviceByStorageId(appId); if ( pService ) { - QString application = pService->storageId(); - QString type = config.readEntry( "ServiceType" ); - QString type2 = config.readEntry( "GenericServiceType" ); + TQString application = pService->storageId(); + TQString type = config.readEntry( "ServiceType" ); + TQString type2 = config.readEntry( "GenericServiceType" ); if (type2.isEmpty()) // compat code type2 = (pService->type() == "Application") ? "Application" : "KParts/ReadOnlyPart"; int pref = config.readNumEntry( "Preference" ); @@ -107,10 +107,10 @@ void KServiceTypeProfile::clear() } //static -KServiceTypeProfile::OfferList KServiceTypeProfile::offers( const QString& _servicetype, const QString& _genericServiceType ) +KServiceTypeProfile::OfferList KServiceTypeProfile::offers( const TQString& _servicetype, const TQString& _genericServiceType ) { OfferList offers; - QStringList serviceList; + TQStringList serviceList; //kdDebug(7014) << "KServiceTypeProfile::offers( " << _servicetype << "," << _genericServiceType << " )" << endl; // Note that KServiceTypeProfile::offers() calls KServiceType::offers(), @@ -120,7 +120,7 @@ KServiceTypeProfile::OfferList KServiceTypeProfile::offers( const QString& _serv initStatic(); // We want all profiles for servicetype, if we have profiles. // ## Slow loop, if profilerc is big. We should use a map instead? - QPtrListIterator<KServiceTypeProfile> it( *s_lstProfiles ); + TQPtrListIterator<KServiceTypeProfile> it( *s_lstProfiles ); for( ; it.current(); ++it ) if ( it.current()->m_strServiceType == _servicetype ) { @@ -159,7 +159,7 @@ KServiceTypeProfile::OfferList KServiceTypeProfile::offers( const QString& _serv // but it's also the case for any service that's neither App nor ReadOnlyPart, e.g. RenameDlg/Plugin KService::List list = KServiceType::offers( _servicetype ); //kdDebug(7014) << "Using KServiceType::offers, result: " << list.count() << " offers" << endl; - QValueListIterator<KService::Ptr> it = list.begin(); + TQValueListIterator<KService::Ptr> it = list.begin(); for( ; it != list.end(); ++it ) { if (_genericServiceType.isEmpty() /*no constraint*/ || (*it)->hasServiceType( _genericServiceType )) @@ -191,7 +191,7 @@ KServiceTypeProfile::OfferList KServiceTypeProfile::offers( const QString& _serv return offers; } -KServiceTypeProfile::KServiceTypeProfile( const QString& _servicetype, const QString& _genericServiceType ) +KServiceTypeProfile::KServiceTypeProfile( const TQString& _servicetype, const TQString& _genericServiceType ) { initStatic(); @@ -203,26 +203,26 @@ KServiceTypeProfile::~KServiceTypeProfile() { } -void KServiceTypeProfile::addService( const QString& _service, +void KServiceTypeProfile::addService( const TQString& _service, int _preference, bool _allow_as_default ) { m_mapServices[ _service ].m_iPreference = _preference; m_mapServices[ _service ].m_bAllowAsDefault = _allow_as_default; } -int KServiceTypeProfile::preference( const QString& _service ) const +int KServiceTypeProfile::preference( const TQString& _service ) const { KService::Ptr service = KService::serviceByName( _service ); if (!service) return 0; - QMap<QString,Service>::ConstIterator it = m_mapServices.find( service->storageId() ); + TQMap<TQString,Service>::ConstIterator it = m_mapServices.find( service->storageId() ); if ( it == m_mapServices.end() ) return 0; return it.data().m_iPreference; } -bool KServiceTypeProfile::allowAsDefault( const QString& _service ) const +bool KServiceTypeProfile::allowAsDefault( const TQString& _service ) const { KService::Ptr service = KService::serviceByName( _service ); if (!service) @@ -233,21 +233,21 @@ bool KServiceTypeProfile::allowAsDefault( const QString& _service ) const return false; // Look what the user says ... - QMap<QString,Service>::ConstIterator it = m_mapServices.find( service->storageId() ); + TQMap<TQString,Service>::ConstIterator it = m_mapServices.find( service->storageId() ); if ( it == m_mapServices.end() ) return 0; return it.data().m_bAllowAsDefault; } -KServiceTypeProfile* KServiceTypeProfile::serviceTypeProfile( const QString& _servicetype, const QString& _genericServiceType ) +KServiceTypeProfile* KServiceTypeProfile::serviceTypeProfile( const TQString& _servicetype, const TQString& _genericServiceType ) { initStatic(); - static const QString& app_str = KGlobal::staticQString("Application"); + static const TQString& app_str = KGlobal::staticQString("Application"); - const QString &_genservicetype = ((!_genericServiceType.isEmpty()) ? _genericServiceType : app_str); + const TQString &_genservicetype = ((!_genericServiceType.isEmpty()) ? _genericServiceType : app_str); - QPtrListIterator<KServiceTypeProfile> it( *s_lstProfiles ); + TQPtrListIterator<KServiceTypeProfile> it( *s_lstProfiles ); for( ; it.current(); ++it ) if (( it.current()->m_strServiceType == _servicetype ) && ( it.current()->m_strGenericServiceType == _genservicetype)) @@ -263,14 +263,14 @@ KServiceTypeProfile::OfferList KServiceTypeProfile::offers() const kdDebug(7014) << "KServiceTypeProfile::offers serviceType=" << m_strServiceType << " genericServiceType=" << m_strGenericServiceType << endl; KService::List list = KServiceType::offers( m_strServiceType ); - QValueListIterator<KService::Ptr> it = list.begin(); + TQValueListIterator<KService::Ptr> it = list.begin(); for( ; it != list.end(); ++it ) { //kdDebug(7014) << "KServiceTypeProfile::offers considering " << (*it)->name() << endl; if ( m_strGenericServiceType.isEmpty() || (*it)->hasServiceType( m_strGenericServiceType ) ) { // Now look into the profile, to find this service's preference. - QMap<QString,Service>::ConstIterator it2 = m_mapServices.find( (*it)->storageId() ); + TQMap<TQString,Service>::ConstIterator it2 = m_mapServices.find( (*it)->storageId() ); if( it2 != m_mapServices.end() ) { @@ -300,7 +300,7 @@ KServiceTypeProfile::OfferList KServiceTypeProfile::offers() const return offers; } -KService::Ptr KServiceTypeProfile::preferredService( const QString & _serviceType, const QString & _genericServiceType ) +KService::Ptr KServiceTypeProfile::preferredService( const TQString & _serviceType, const TQString & _genericServiceType ) { OfferList lst = offers( _serviceType, _genericServiceType ); diff --git a/kio/kio/kuserprofile.h b/kio/kio/kuserprofile.h index 4591771f0..061657625 100644 --- a/kio/kio/kuserprofile.h +++ b/kio/kio/kuserprofile.h @@ -20,10 +20,10 @@ #ifndef __kuserprofile_h__ #define __kuserprofile_h__ -#include <qmap.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> #include <kservice.h> @@ -117,7 +117,7 @@ private: class KIO_EXPORT KServiceTypeProfile { public: - typedef QValueList<KServiceOffer> OfferList; + typedef TQValueList<KServiceOffer> OfferList; ~KServiceTypeProfile(); @@ -128,7 +128,7 @@ public: * @return the user's preference number of the given * @p _service, or 0 the service is unknown. */ - int preference( const QString& _service ) const; + int preference( const TQString& _service ) const; /** * @deprecated Remove in KDE 4, unused. @@ -136,7 +136,7 @@ public: * @param _service the name of the service to check * @return true if allowed as default */ - bool allowAsDefault( const QString& _service ) const; + bool allowAsDefault( const TQString& _service ) const; /** * Returns the list of all service offers for the service types @@ -154,17 +154,17 @@ public: * "KParts/ReadOnlyPart") * @return the preferred service, or 0 if no service is available */ - static KService::Ptr preferredService( const QString & serviceType, const QString & genericServiceType ); + static KService::Ptr preferredService( const TQString & serviceType, const TQString & genericServiceType ); /** * Returns the profile for the requested service type. * @param servicetype the service type (e.g. a MIME type) * @param genericServiceType the generic service type (e.g. "Application" - * or "KParts/ReadOnlyPart"). Can be QString::null, + * or "KParts/ReadOnlyPart"). Can be TQString::null, * then the "Application" generic type will be used * @return the KServiceTypeProfile with the given arguments, or 0 if not found */ - static KServiceTypeProfile* serviceTypeProfile( const QString& servicetype, const QString & genericServiceType = QString::null ); + static KServiceTypeProfile* serviceTypeProfile( const TQString& servicetype, const TQString & genericServiceType = TQString::null ); /** * Returns the offers associated with a given servicetype, sorted by preference. @@ -181,17 +181,17 @@ public: * * @param servicetype the service type (e.g. a MIME type) * @param genericServiceType the generic service type (e.g. "Application" - * or "KParts/ReadOnlyPart"). Can be QString::null, + * or "KParts/ReadOnlyPart"). Can be TQString::null, * then all generic types will be included * @return the list of offers witht he given parameters */ - static OfferList offers( const QString& servicetype, const QString& genericServiceType = QString::null ); + static OfferList offers( const TQString& servicetype, const TQString& genericServiceType = TQString::null ); /** * Returns a list of all KServiceTypeProfiles. * @return a list of all KServiceTypeProfiles */ - static const QPtrList<KServiceTypeProfile>& serviceTypeProfiles() { return *s_lstProfiles; } + static const TQPtrList<KServiceTypeProfile>& serviceTypeProfiles() { return *s_lstProfiles; } /** * Clear all cached information @@ -225,11 +225,11 @@ protected: * first time. * @param serviceType the service type (e.g. a MIME type) * @param genericServiceType the generic service type (e.g. "Application" - * or "KParts/ReadOnlyPart"). Can be QString::null, + * or "KParts/ReadOnlyPart"). Can be TQString::null, * then the "Application" generic type will be used */ - KServiceTypeProfile( const QString& serviceType, - const QString& genericServiceType = QString::null ); + KServiceTypeProfile( const TQString& serviceType, + const TQString& genericServiceType = TQString::null ); /** * Add a service to this profile. @@ -239,7 +239,7 @@ protected: * @param _allow_as_default true if the service should be used as * default */ - void addService( const QString& _service, int _preference = 1, bool _allow_as_default = true ); + void addService( const TQString& _service, int _preference = 1, bool _allow_as_default = true ); private: /** @@ -260,20 +260,20 @@ private: /** * Map of all services for which we have assessments. */ - QMap<QString,Service> m_mapServices; + TQMap<TQString,Service> m_mapServices; /** * ServiceType of this profile. */ - QString m_strServiceType; + TQString m_strServiceType; /** * Secondary ServiceType of this profile. */ - QString m_strGenericServiceType; + TQString m_strGenericServiceType; static void initStatic(); - static QPtrList<KServiceTypeProfile>* s_lstProfiles; + static TQPtrList<KServiceTypeProfile>* s_lstProfiles; static bool s_configurationMode; private: class KServiceTypeProfilePrivate* d; diff --git a/kio/kio/kzip.cpp b/kio/kio/kzip.cpp index 7943a0ae7..6f29bb264 100644 --- a/kio/kio/kzip.cpp +++ b/kio/kio/kzip.cpp @@ -44,11 +44,11 @@ #include <ksavefile.h> #include <kdebug.h> -#include <qasciidict.h> -#include <qfile.h> -#include <qdir.h> -#include <qdatetime.h> -#include <qptrlist.h> +#include <tqasciidict.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqdatetime.h> +#include <tqptrlist.h> #include <zlib.h> #include <time.h> @@ -56,7 +56,7 @@ const int max_path_len = 4095; // maximum number of character a path may contain -static void transformToMsDos(const QDateTime& dt, char* buffer) +static void transformToMsDos(const TQDateTime& dt, char* buffer) { if ( dt.isValid() ) { @@ -91,15 +91,15 @@ static time_t transformFromMsDos(const char* buffer) int h = time >> 11; int m = ( time & 0x7ff ) >> 5; int s = ( time & 0x1f ) * 2 ; - QTime qt(h, m, s); + TQTime qt(h, m, s); Q_UINT16 date = (uchar)buffer[2] | ( (uchar)buffer[3] << 8 ); int y = ( date >> 9 ) + 1980; int o = ( date & 0x1ff ) >> 5; int d = ( date & 0x1f ); - QDate qd(y, o, d); + TQDate qd(y, o, d); - QDateTime dt( qd, qt ); + TQDateTime dt( qd, qt ); return dt.toTime_t(); } @@ -108,14 +108,14 @@ static time_t transformFromMsDos(const char* buffer) /** all relevant information about parsing file information */ struct ParseFileInfo { // file related info -// QCString name; // filename +// TQCString name; // filename mode_t perm; // permissions of this file time_t atime; // last access time (UNIX format) time_t mtime; // modification time (UNIX format) time_t ctime; // creation time (UNIX format) int uid; // user id (-1 if not specified) int gid; // group id (-1 if not specified) - QCString guessed_symlink; // guessed symlink target + TQCString guessed_symlink; // guessed symlink target int extralen; // length of extra field // parsing related info @@ -321,8 +321,8 @@ public: unsigned long m_crc; // checksum KZipFileEntry* m_currentFile; // file currently being written - QIODevice* m_currentDev; // filterdev used to write to the above file - QPtrList<KZipFileEntry> m_fileList; // flat list of all files, for the index (saves a recursive method ;) + TQIODevice* m_currentDev; // filterdev used to write to the above file + TQPtrList<KZipFileEntry> m_fileList; // flat list of all files, for the index (saves a recursive method ;) int m_compression; KZip::ExtraField m_extraField; unsigned int m_offset; // holds the offset of the place in the zip, @@ -332,7 +332,7 @@ public: KSaveFile* m_saveFile; }; -KZip::KZip( const QString& filename ) +KZip::KZip( const TQString& filename ) : KArchive( 0L ) { //kdDebug(7040) << "KZip(filename) reached." << endl; @@ -344,10 +344,10 @@ KZip::KZip( const QString& filename ) // KDE4: move KSaveFile support to base class, KArchive. } -KZip::KZip( QIODevice * dev ) +KZip::KZip( TQIODevice * dev ) : KArchive( dev ) { - //kdDebug(7040) << "KZip::KZip( QIODevice * dev) reached." << endl; + //kdDebug(7040) << "KZip::KZip( TQIODevice * dev) reached." << endl; d = new KZipPrivate; } @@ -361,7 +361,7 @@ KZip::~KZip() if ( d->m_saveFile ) // writing mode delete d->m_saveFile; else // reading mode - delete device(); // (the QFile) + delete device(); // (the TQFile) } delete d; } @@ -391,9 +391,9 @@ bool KZip::openArchive( int mode ) case IO_ReadOnly: case IO_ReadWrite: { - // ReadWrite mode still uses QFile for now; we'd need to copy to the tempfile, in fact. + // ReadWrite mode still uses TQFile for now; we'd need to copy to the tempfile, in fact. if ( !m_filename.isEmpty() ) { - setDevice( new QFile( m_filename ) ); + setDevice( new TQFile( m_filename ) ); if ( !device()->open( mode ) ) return false; } @@ -408,7 +408,7 @@ bool KZip::openArchive( int mode ) // Check that it's a valid ZIP file // the above code opened the underlying device already. - QIODevice* dev = device(); + TQIODevice* dev = device(); if (!dev) { return false; @@ -418,7 +418,7 @@ bool KZip::openArchive( int mode ) int n; // contains information gathered from the local file headers - QAsciiDict<ParseFileInfo> pfi_map(1009, true /*case sensitive */, true /*copy keys*/); + TQAsciiDict<ParseFileInfo> pfi_map(1009, true /*case sensitive */, true /*copy keys*/); pfi_map.setAutoDelete(true); // We set a bool for knowing if we are allowed to skip the start of the file @@ -477,7 +477,7 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; kdDebug(7040) << "archive size: " << dev->size() << endl; // read filename - QCString filename(namelen + 1); + TQCString filename(namelen + 1); n = dev->readBlock(filename.data(), namelen); if ( n < namelen ) { kdWarning(7040) << "Invalid ZIP file. Name not completely read (#2)" << endl; @@ -668,7 +668,7 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; //kdDebug() << "general purpose flag=" << gpf << endl; // length of the filename (well, pathname indeed) int namelen = (uchar)buffer[29] << 8 | (uchar)buffer[28]; - QCString bufferName( namelen + 1 ); + TQCString bufferName( namelen + 1 ); n = dev->readBlock( bufferName.data(), namelen ); if ( n < namelen ) kdWarning(7040) << "Invalid ZIP file. Name not completely read" << endl; @@ -677,7 +677,7 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; if (!pfi) { // can that happen? pfi_map.insert(bufferName.data(), pfi = new ParseFileInfo()); } - QString name( QFile::decodeName(bufferName) ); + TQString name( TQFile::decodeName(bufferName) ); //kdDebug(7040) << "name: " << name << endl; // only in central header ! see below. @@ -726,7 +726,7 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; access = (uchar)buffer[40] | (uchar)buffer[41] << 8; } - QString entryName; + TQString entryName; if ( name.endsWith( "/" ) ) // Entries with a trailing slash are directories { @@ -746,7 +746,7 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; KArchiveEntry* entry; if ( isdir ) { - QString path = QDir::cleanDirPath( name ); + TQString path = TQDir::cleanDirPath( name ); KArchiveEntry* ent = rootDir()->entry( path ); if ( ent && ent->isDirectory() ) { @@ -755,15 +755,15 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; } else { - entry = new KArchiveDirectory( this, entryName, access, (int)pfi->mtime, rootDir()->user(), rootDir()->group(), QString::null ); + entry = new KArchiveDirectory( this, entryName, access, (int)pfi->mtime, rootDir()->user(), rootDir()->group(), TQString::null ); //kdDebug(7040) << "KArchiveDirectory created, entryName= " << entryName << ", name=" << name << endl; } } else { - QString symlink; + TQString symlink; if (S_ISLNK(access)) { - symlink = QFile::decodeName(pfi->guessed_symlink); + symlink = TQFile::decodeName(pfi->guessed_symlink); } entry = new KZipFileEntry( this, entryName, access, pfi->mtime, rootDir()->user(), rootDir()->group(), @@ -783,7 +783,7 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; else { // In some tar files we can find dir/./file => call cleanDirPath - QString path = QDir::cleanDirPath( name.left( pos ) ); + TQString path = TQDir::cleanDirPath( name.left( pos ) ); // Ensure container directory exists, create otherwise KArchiveDirectory * tdir = findOrCreate( path ); tdir->addEntry(entry); @@ -874,7 +874,7 @@ bool KZip::closeArchive() Q_LONG centraldiroffset = device()->at(); //kdDebug(7040) << "closearchive: centraldiroffset: " << centraldiroffset << endl; Q_LONG atbackup = centraldiroffset; - QPtrListIterator<KZipFileEntry> it( d->m_fileList ); + TQPtrListIterator<KZipFileEntry> it( d->m_fileList ); for ( ; it.current() ; ++it ) { //set crc and compressed size in each local file header @@ -912,7 +912,7 @@ bool KZip::closeArchive() //kdDebug(7040) << "closearchive: filename: " << it.current()->path() // << " encoding: "<< it.current()->encoding() << endl; - QCString path = QFile::encodeName(it.current()->path()); + TQCString path = TQFile::encodeName(it.current()->path()); const int extra_field_len = 9; int bufferSize = extra_field_len + path.length() + 46; @@ -1052,7 +1052,7 @@ bool KZip::closeArchive() } // Doesn't need to be reimplemented anymore. Remove for KDE-4.0 -bool KZip::writeFile( const QString& name, const QString& user, const QString& group, uint size, const char* data ) +bool KZip::writeFile( const TQString& name, const TQString& user, const TQString& group, uint size, const char* data ) { mode_t mode = 0100644; time_t the_time = time(0); @@ -1061,8 +1061,8 @@ bool KZip::writeFile( const QString& name, const QString& user, const QString& g } // Doesn't need to be reimplemented anymore. Remove for KDE-4.0 -bool KZip::writeFile( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, +bool KZip::writeFile( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char* data ) { return KArchive::writeFile(name, user, group, size, perm, atime, mtime, @@ -1070,7 +1070,7 @@ bool KZip::writeFile( const QString& name, const QString& user, } // Doesn't need to be reimplemented anymore. Remove for KDE-4.0 -bool KZip::prepareWriting( const QString& name, const QString& user, const QString& group, uint size ) +bool KZip::prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size ) { mode_t dflt_perm = 0100644; time_t the_time = time(0); @@ -1079,14 +1079,14 @@ bool KZip::prepareWriting( const QString& name, const QString& user, const QStri } // Doesn't need to be reimplemented anymore. Remove for KDE-4.0 -bool KZip::prepareWriting(const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, +bool KZip::prepareWriting(const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime) { return KArchive::prepareWriting(name,user,group,size,perm,atime,mtime,ctime); } -bool KZip::prepareWriting_impl(const QString &name, const QString &user, - const QString &group, uint /*size*/, mode_t perm, +bool KZip::prepareWriting_impl(const TQString &name, const TQString &user, + const TQString &group, uint /*size*/, mode_t perm, time_t atime, time_t mtime, time_t ctime) { //kdDebug(7040) << "prepareWriting reached." << endl; if ( !isOpened() ) @@ -1117,7 +1117,7 @@ bool KZip::prepareWriting_impl(const QString &name, const QString &user, // to save, so that we don´t have duplicate file entries when viewing the zip // with konqi... // CAUTION: the old file itself is still in the zip and won't be removed !!! - QPtrListIterator<KZipFileEntry> it( d->m_fileList ); + TQPtrListIterator<KZipFileEntry> it( d->m_fileList ); //kdDebug(7040) << "filename to write: " << name <<endl; for ( ; it.current() ; ++it ) @@ -1132,18 +1132,18 @@ bool KZip::prepareWriting_impl(const QString &name, const QString &user, } // Find or create parent dir KArchiveDirectory* parentDir = rootDir(); - QString fileName( name ); + TQString fileName( name ); int i = name.findRev( '/' ); if ( i != -1 ) { - QString dir = name.left( i ); + TQString dir = name.left( i ); fileName = name.mid( i + 1 ); //kdDebug(7040) << "KZip::prepareWriting ensuring " << dir << " exists. fileName=" << fileName << endl; parentDir = findOrCreate( dir ); } // construct a KZipFileEntry and add it to list - KZipFileEntry * e = new KZipFileEntry( this, fileName, perm, mtime, user, group, QString::null, + KZipFileEntry * e = new KZipFileEntry( this, fileName, perm, mtime, user, group, TQString::null, name, device()->at() + 30 + name.length(), // start 0 /*size unknown yet*/, d->m_compression, 0 /*csize unknown yet*/ ); e->setHeaderStart( device()->at() ); @@ -1158,7 +1158,7 @@ bool KZip::prepareWriting_impl(const QString &name, const QString &user, extra_field_len = 17; // value also used in doneWriting() // write out zip header - QCString encodedName = QFile::encodeName(name); + TQCString encodedName = TQFile::encodeName(name); int bufferSize = extra_field_len + encodedName.length() + 30; //kdDebug(7040) << "KZip::prepareWriting bufferSize=" << bufferSize << endl; char* buffer = new char[ bufferSize ]; @@ -1298,14 +1298,14 @@ bool KZip::doneWriting( uint size ) return true; } -bool KZip::writeSymLink(const QString &name, const QString &target, - const QString &user, const QString &group, +bool KZip::writeSymLink(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) { return KArchive::writeSymLink(name,target,user,group,perm,atime,mtime,ctime); } -bool KZip::writeSymLink_impl(const QString &name, const QString &target, - const QString &user, const QString &group, +bool KZip::writeSymLink_impl(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime) { // reassure that symlink flag is set, otherwise strange things happen on @@ -1320,7 +1320,7 @@ bool KZip::writeSymLink_impl(const QString &name, const QString &target, return false; } - QCString symlink_target = QFile::encodeName(target); + TQCString symlink_target = TQFile::encodeName(target); if (!writeData(symlink_target, symlink_target.length())) { kdWarning() << "KZip::writeFile writeData failed" << endl; setCompression(c); @@ -1422,10 +1422,10 @@ void KZip::abort() /////////////// -QByteArray KZipFileEntry::data() const +TQByteArray KZipFileEntry::data() const { - QIODevice* dev = device(); - QByteArray arr; + TQIODevice* dev = device(); + TQByteArray arr; if ( dev ) { arr = dev->readAll(); delete dev; @@ -1433,7 +1433,7 @@ QByteArray KZipFileEntry::data() const return arr; } -QIODevice* KZipFileEntry::device() const +TQIODevice* KZipFileEntry::device() const { //kdDebug(7040) << "KZipFileEntry::device creating iodevice limited to pos=" << position() << ", csize=" << compressedSize() << endl; // Limit the reading to the appropriate part of the underlying device (e.g. file) @@ -1444,7 +1444,7 @@ QIODevice* KZipFileEntry::device() const if ( encoding() == 8 ) { // On top of that, create a device that uncompresses the zlib data - QIODevice* filterDev = KFilterDev::device( limitedDev, "application/x-gzip" ); + TQIODevice* filterDev = KFilterDev::device( limitedDev, "application/x-gzip" ); if ( !filterDev ) return 0L; // ouch static_cast<KFilterDev *>(filterDev)->setSkipHeaders(); // Just zlib, not gzip diff --git a/kio/kio/kzip.h b/kio/kio/kzip.h index 5e0971cd8..291f827f8 100644 --- a/kio/kio/kzip.h +++ b/kio/kio/kzip.h @@ -21,11 +21,11 @@ #include <sys/stat.h> #include <sys/types.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdict.h> -#include <qvaluelist.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdict.h> +#include <tqvaluelist.h> #include <karchive.h> class KZipFileEntry; @@ -59,16 +59,16 @@ public: * * @param filename is a local path (e.g. "/home/holger/myfile.zip") */ - KZip( const QString& filename ); + KZip( const TQString& filename ); /** * Creates an instance that operates on the given device. - * The device can be compressed (KFilterDev) or not (QFile, etc.). - * @warning Do not assume that giving a QFile here will decompress the file, + * The device can be compressed (KFilterDev) or not (TQFile, etc.). + * @warning Do not assume that giving a TQFile here will decompress the file, * in case it's compressed! * @param dev the device to access */ - KZip( QIODevice * dev ); + KZip( TQIODevice * dev ); /** * If the zip file is still opened, then it will be @@ -78,10 +78,10 @@ public: /** * The name of the zip file, as passed to the constructor. - * Null if you used the QIODevice constructor. - * @return the zip's file name, or null if a QIODevice is used + * Null if you used the TQIODevice constructor. + * @return the zip's file name, or null if a TQIODevice is used */ - QString fileName() { return m_filename; } + TQString fileName() { return m_filename; } /** * Describes the contents of the "extra field" for a given file in the Zip archive. @@ -140,7 +140,7 @@ public: * @param data a pointer to the data * @return true if successful, false otherwise */ - virtual bool writeFile( const QString& name, const QString& user, const QString& group, uint size, const char* data ); // BC: remove reimplementation for KDE-4.0 + virtual bool writeFile( const TQString& name, const TQString& user, const TQString& group, uint size, const char* data ); // BC: remove reimplementation for KDE-4.0 /** * Alternative method for writing: call prepareWriting(), then feed the data @@ -151,18 +151,18 @@ public: * @param size unused argument * @return true if successful, false otherwise */ - virtual bool prepareWriting( const QString& name, const QString& user, const QString& group, uint size ); + virtual bool prepareWriting( const TQString& name, const TQString& user, const TQString& group, uint size ); // TODO(BIC) make virtual. For now it must be implemented by virtual_hook. - bool writeSymLink(const QString &name, const QString &target, - const QString &user, const QString &group, + bool writeSymLink(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime); // TODO(BIC) make virtual. For now it must be implemented by virtual_hook. - bool prepareWriting( const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool prepareWriting( const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime ); // TODO(BIC) make virtual. For now it must be implemented by virtual_hook. - bool writeFile( const QString& name, const QString& user, const QString& group, + bool writeFile( const TQString& name, const TQString& user, const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime, const char* data ); /** @@ -194,9 +194,9 @@ protected: /** * @internal Not needed for zip */ - virtual bool writeDir( const QString& name, const QString& user, const QString& group) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); return true; } + virtual bool writeDir( const TQString& name, const TQString& user, const TQString& group) { Q_UNUSED(name); Q_UNUSED(user); Q_UNUSED(group); return true; } // TODO(BIC) uncomment and make virtual for KDE 4. -// bool writeDir( const QString& name, const QString& user, const QString& group, +// bool writeDir( const TQString& name, const TQString& user, const TQString& group, // mode_t perm, time_t atime, time_t mtime, time_t ctime ); protected: @@ -204,17 +204,17 @@ protected: /** @internal for virtual_hook */ // from KArchive bool writeData_impl( const char* data, uint size ); - bool prepareWriting_impl(const QString& name, const QString& user, - const QString& group, uint size, mode_t perm, + bool prepareWriting_impl(const TQString& name, const TQString& user, + const TQString& group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime); - bool writeSymLink_impl(const QString &name, const QString &target, - const QString &user, const QString &group, + bool writeSymLink_impl(const TQString &name, const TQString &target, + const TQString &user, const TQString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime); private: void abort(); private: - QString m_filename; + TQString m_filename; class KZipPrivate; KZipPrivate * d; }; @@ -228,9 +228,9 @@ class KIO_EXPORT KZipFileEntry : public KArchiveFile public: /*KZipFileEntry() : st(-1) {}*/ - KZipFileEntry( KZip* zip, const QString& name, int access, int date, - const QString& user, const QString& group, const QString& symlink, - const QString& path, Q_LONG start, Q_LONG uncompressedSize, + KZipFileEntry( KZip* zip, const TQString& name, int access, int date, + const TQString& user, const TQString& group, const TQString& symlink, + const TQString& path, Q_LONG start, Q_LONG uncompressedSize, int encoding, Q_LONG compressedSize) : KArchiveFile( zip, name, access, date, user, group, symlink, start, uncompressedSize ), @@ -255,29 +255,29 @@ public: void setCRC32(unsigned long crc32) { m_crc=crc32; } /// Name with complete path - KArchiveFile::name() is the filename only (no path) - QString path() const { return m_path; } + TQString path() const { return m_path; } /** * @return the content of this file. * Call data() with care (only once per file), this data isn't cached. */ - virtual QByteArray data() const; + virtual TQByteArray data() const; /** - * This method returns a QIODevice to read the file contents. + * This method returns a TQIODevice to read the file contents. * This is obviously for reading only. * Note that the ownership of the device is being transferred to the caller, * who will have to delete it. * The returned device auto-opens (in readonly mode), no need to open it. */ - QIODevice* device() const; // WARNING, not virtual! + TQIODevice* device() const; // WARNING, not virtual! private: unsigned long m_crc; Q_LONG m_compressedSize; Q_LONG m_headerStart; int m_encoding; - QString m_path; + TQString m_path; // KDE4: d pointer or at least some int for future extensions }; diff --git a/kio/kio/metainfojob.cpp b/kio/kio/metainfojob.cpp index 32a20a135..3998584e3 100644 --- a/kio/kio/metainfojob.cpp +++ b/kio/kio/metainfojob.cpp @@ -27,7 +27,7 @@ #include <kio/kservice.h> #include <kparts/componentfactory.h> -#include <qtimer.h> +#include <tqtimer.h> #include "metainfojob.moc" @@ -63,7 +63,7 @@ MetaInfoJob::MetaInfoJob(const KFileItemList &items, bool deleteItems) // Return to event loop first, determineNextFile() might delete this; // (no idea what that means, it comes from previewjob) - QTimer::singleShot(0, this, SLOT(start())); + TQTimer::singleShot(0, this, TQT_SLOT(start())); } MetaInfoJob::~MetaInfoJob() @@ -132,17 +132,17 @@ void MetaInfoJob::getMetaInfo() KIO::TransferJob* job = KIO::get(URL, false, false); addSubjob(job); - connect(job, SIGNAL(data(KIO::Job *, const QByteArray &)), - this, SLOT(slotMetaInfo(KIO::Job *, const QByteArray &))); + connect(job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + this, TQT_SLOT(slotMetaInfo(KIO::Job *, const TQByteArray &))); job->addMetaData("mimeType", d->currentItem->current()->mimetype()); } -void MetaInfoJob::slotMetaInfo(KIO::Job*, const QByteArray &data) +void MetaInfoJob::slotMetaInfo(KIO::Job*, const TQByteArray &data) { KFileMetaInfo info; - QDataStream s(data, IO_ReadOnly); + TQDataStream s(data, IO_ReadOnly); s >> info; @@ -151,18 +151,18 @@ void MetaInfoJob::slotMetaInfo(KIO::Job*, const QByteArray &data) d->succeeded = true; } -QStringList MetaInfoJob::availablePlugins() +TQStringList MetaInfoJob::availablePlugins() { - QStringList result; + TQStringList result; KTrader::OfferList plugins = KTrader::self()->query("KFilePlugin"); for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) result.append((*it)->desktopEntryName()); return result; } -QStringList MetaInfoJob::supportedMimeTypes() +TQStringList MetaInfoJob::supportedMimeTypes() { - QStringList result; + TQStringList result; KTrader::OfferList plugins = KTrader::self()->query("KFilePlugin"); for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) result += (*it)->property("MimeTypes").toStringList(); diff --git a/kio/kio/metainfojob.h b/kio/kio/metainfojob.h index 0a3c84590..3b96713fb 100644 --- a/kio/kio/metainfojob.h +++ b/kio/kio/metainfojob.h @@ -57,14 +57,14 @@ namespace KIO { * no .desktop). * @return the list of available meta info plugins */ - static QStringList availablePlugins(); + static TQStringList availablePlugins(); /** * Returns a list of all supported MIME types. The list can * contain entries like text/ * (without the space). * @return the list of MIME types that are supported */ - static QStringList supportedMimeTypes(); + static TQStringList supportedMimeTypes(); signals: /** @@ -89,11 +89,11 @@ namespace KIO { private slots: void start(); - void slotMetaInfo(KIO::Job *, const QByteArray &); + void slotMetaInfo(KIO::Job *, const TQByteArray &); private: void determineNextFile(); -// void saveMetaInfo(const QByteArray info); +// void saveMetaInfo(const TQByteArray info); private: struct MetaInfoJobPrivate *d; diff --git a/kio/kio/netaccess.cpp b/kio/kio/netaccess.cpp index 9efbb5259..68ce8ae1d 100644 --- a/kio/kio/netaccess.cpp +++ b/kio/kio/netaccess.cpp @@ -28,10 +28,10 @@ #include <cstring> -#include <qstring.h> -#include <qapplication.h> -#include <qfile.h> -#include <qmetaobject.h> +#include <tqstring.h> +#include <tqapplication.h> +#include <tqfile.h> +#include <tqmetaobject.h> #include <kapplication.h> #include <klocale.h> @@ -45,16 +45,16 @@ using namespace KIO; -QString * NetAccess::lastErrorMsg; +TQString * NetAccess::lastErrorMsg; int NetAccess::lastErrorCode = 0; -QStringList* NetAccess::tmpfiles; +TQStringList* NetAccess::tmpfiles; -bool NetAccess::download(const KURL& u, QString & target) +bool NetAccess::download(const KURL& u, TQString & target) { return NetAccess::download (u, target, 0); } -bool NetAccess::download(const KURL& u, QString & target, QWidget* window) +bool NetAccess::download(const KURL& u, TQString & target, TQWidget* window) { if (u.isLocalFile()) { // file protocol. We do not need the network @@ -86,12 +86,12 @@ bool NetAccess::download(const KURL& u, QString & target, QWidget* window) false, window, false /*copy*/); } -bool NetAccess::upload(const QString& src, const KURL& target) +bool NetAccess::upload(const TQString& src, const KURL& target) { return NetAccess::upload(src, target, 0); } -bool NetAccess::upload(const QString& src, const KURL& target, QWidget* window) +bool NetAccess::upload(const TQString& src, const KURL& target, TQWidget* window) { if (target.isEmpty()) return false; @@ -114,13 +114,13 @@ bool NetAccess::copy( const KURL & src, const KURL & target ) return NetAccess::file_copy( src, target, -1, false /*not overwrite*/, false, 0L ); } -bool NetAccess::copy( const KURL & src, const KURL & target, QWidget* window ) +bool NetAccess::copy( const KURL & src, const KURL & target, TQWidget* window ) { return NetAccess::file_copy( src, target, -1, false /*not overwrite*/, false, window ); } bool NetAccess::file_copy( const KURL& src, const KURL& target, int permissions, - bool overwrite, bool resume, QWidget* window ) + bool overwrite, bool resume, TQWidget* window ) { NetAccess kioNet; return kioNet.filecopyInternal( src, target, permissions, overwrite, resume, @@ -129,7 +129,7 @@ bool NetAccess::file_copy( const KURL& src, const KURL& target, int permissions, bool NetAccess::file_move( const KURL& src, const KURL& target, int permissions, - bool overwrite, bool resume, QWidget* window ) + bool overwrite, bool resume, TQWidget* window ) { NetAccess kioNet; return kioNet.filecopyInternal( src, target, permissions, overwrite, resume, @@ -141,27 +141,27 @@ bool NetAccess::dircopy( const KURL & src, const KURL & target ) return NetAccess::dircopy( src, target, 0 ); } -bool NetAccess::dircopy( const KURL & src, const KURL & target, QWidget* window ) +bool NetAccess::dircopy( const KURL & src, const KURL & target, TQWidget* window ) { KURL::List srcList; srcList.append( src ); return NetAccess::dircopy( srcList, target, window ); } -bool NetAccess::dircopy( const KURL::List & srcList, const KURL & target, QWidget* window ) +bool NetAccess::dircopy( const KURL::List & srcList, const KURL & target, TQWidget* window ) { NetAccess kioNet; return kioNet.dircopyInternal( srcList, target, window, false /*copy*/ ); } -bool NetAccess::move( const KURL& src, const KURL& target, QWidget* window ) +bool NetAccess::move( const KURL& src, const KURL& target, TQWidget* window ) { KURL::List srcList; srcList.append( src ); return NetAccess::move( srcList, target, window ); } -bool NetAccess::move( const KURL::List& srcList, const KURL& target, QWidget* window ) +bool NetAccess::move( const KURL::List& srcList, const KURL& target, TQWidget* window ) { NetAccess kioNet; return kioNet.dircopyInternal( srcList, target, window, true /*move*/ ); @@ -172,7 +172,7 @@ bool NetAccess::exists( const KURL & url ) return NetAccess::exists( url, false, 0 ); } -bool NetAccess::exists( const KURL & url, QWidget* window ) +bool NetAccess::exists( const KURL & url, TQWidget* window ) { return NetAccess::exists( url, false, window ); } @@ -182,10 +182,10 @@ bool NetAccess::exists( const KURL & url, bool source ) return NetAccess::exists( url, source, 0 ); } -bool NetAccess::exists( const KURL & url, bool source, QWidget* window ) +bool NetAccess::exists( const KURL & url, bool source, TQWidget* window ) { if ( url.isLocalFile() ) - return QFile::exists( url.path() ); + return TQFile::exists( url.path() ); NetAccess kioNet; return kioNet.statInternal( url, 0 /*no details*/, source, window ); } @@ -195,7 +195,7 @@ bool NetAccess::stat( const KURL & url, KIO::UDSEntry & entry ) return NetAccess::stat( url, entry, 0 ); } -bool NetAccess::stat( const KURL & url, KIO::UDSEntry & entry, QWidget* window ) +bool NetAccess::stat( const KURL & url, KIO::UDSEntry & entry, TQWidget* window ) { NetAccess kioNet; bool ret = kioNet.statInternal( url, 2 /*all details*/, true /*source*/, window ); @@ -204,7 +204,7 @@ bool NetAccess::stat( const KURL & url, KIO::UDSEntry & entry, QWidget* window ) return ret; } -KURL NetAccess::mostLocalURL(const KURL & url, QWidget* window) +KURL NetAccess::mostLocalURL(const KURL & url, TQWidget* window) { if ( url.isLocalFile() ) { @@ -217,7 +217,7 @@ KURL NetAccess::mostLocalURL(const KURL & url, QWidget* window) return url; } - QString path; + TQString path; // Extract the local path from the KIO::UDSEntry KIO::UDSEntry::ConstIterator it = entry.begin(); @@ -247,7 +247,7 @@ bool NetAccess::del( const KURL & url ) return NetAccess::del( url, 0 ); } -bool NetAccess::del( const KURL & url, QWidget* window ) +bool NetAccess::del( const KURL & url, TQWidget* window ) { NetAccess kioNet; return kioNet.delInternal( url, window ); @@ -258,50 +258,50 @@ bool NetAccess::mkdir( const KURL & url, int permissions ) return NetAccess::mkdir( url, 0, permissions ); } -bool NetAccess::mkdir( const KURL & url, QWidget* window, int permissions ) +bool NetAccess::mkdir( const KURL & url, TQWidget* window, int permissions ) { NetAccess kioNet; return kioNet.mkdirInternal( url, permissions, window ); } -QString NetAccess::fish_execute( const KURL & url, const QString command, QWidget* window ) +TQString NetAccess::fish_execute( const KURL & url, const TQString command, TQWidget* window ) { NetAccess kioNet; return kioNet.fish_executeInternal( url, command, window ); } -bool NetAccess::synchronousRun( Job* job, QWidget* window, QByteArray* data, - KURL* finalURL, QMap<QString, QString>* metaData ) +bool NetAccess::synchronousRun( Job* job, TQWidget* window, TQByteArray* data, + KURL* finalURL, TQMap<TQString, TQString>* metaData ) { NetAccess kioNet; return kioNet.synchronousRunInternal( job, window, data, finalURL, metaData ); } -QString NetAccess::mimetype( const KURL& url ) +TQString NetAccess::mimetype( const KURL& url ) { NetAccess kioNet; return kioNet.mimetypeInternal( url, 0 ); } -QString NetAccess::mimetype( const KURL& url, QWidget* window ) +TQString NetAccess::mimetype( const KURL& url, TQWidget* window ) { NetAccess kioNet; return kioNet.mimetypeInternal( url, window ); } -void NetAccess::removeTempFile(const QString& name) +void NetAccess::removeTempFile(const TQString& name) { if (!tmpfiles) return; if (tmpfiles->contains(name)) { - unlink(QFile::encodeName(name)); + unlink(TQFile::encodeName(name)); tmpfiles->remove(name); } } bool NetAccess::filecopyInternal(const KURL& src, const KURL& target, int permissions, - bool overwrite, bool resume, QWidget* window, bool move) + bool overwrite, bool resume, TQWidget* window, bool move) { bJobOK = true; // success unless further error occurs @@ -310,15 +310,15 @@ bool NetAccess::filecopyInternal(const KURL& src, const KURL& target, int permis ? KIO::file_move( src, target, permissions, overwrite, resume ) : KIO::file_copy( src, target, permissions, overwrite, resume ); job->setWindow (window); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); return bJobOK; } bool NetAccess::dircopyInternal(const KURL::List& src, const KURL& target, - QWidget* window, bool move) + TQWidget* window, bool move) { bJobOK = true; // success unless further error occurs @@ -326,72 +326,72 @@ bool NetAccess::dircopyInternal(const KURL::List& src, const KURL& target, ? KIO::move( src, target ) : KIO::copy( src, target ); job->setWindow (window); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); return bJobOK; } bool NetAccess::statInternal( const KURL & url, int details, bool source, - QWidget* window ) + TQWidget* window ) { bJobOK = true; // success unless further error occurs KIO::StatJob * job = KIO::stat( url, !url.isLocalFile() ); job->setWindow (window); job->setDetails( details ); job->setSide( source ); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); return bJobOK; } -bool NetAccess::delInternal( const KURL & url, QWidget* window ) +bool NetAccess::delInternal( const KURL & url, TQWidget* window ) { bJobOK = true; // success unless further error occurs KIO::Job * job = KIO::del( url ); job->setWindow (window); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); return bJobOK; } bool NetAccess::mkdirInternal( const KURL & url, int permissions, - QWidget* window ) + TQWidget* window ) { bJobOK = true; // success unless further error occurs KIO::Job * job = KIO::mkdir( url, permissions ); job->setWindow (window); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); return bJobOK; } -QString NetAccess::mimetypeInternal( const KURL & url, QWidget* window ) +TQString NetAccess::mimetypeInternal( const KURL & url, TQWidget* window ) { bJobOK = true; // success unless further error occurs - m_mimetype = QString::fromLatin1("unknown"); + m_mimetype = TQString::fromLatin1("unknown"); KIO::Job * job = KIO::mimetype( url ); job->setWindow (window); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); - connect( job, SIGNAL( mimetype (KIO::Job *, const QString &) ), - this, SLOT( slotMimetype (KIO::Job *, const QString &) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( mimetype (KIO::Job *, const TQString &) ), + this, TQT_SLOT( slotMimetype (KIO::Job *, const TQString &) ) ); enter_loop(); return m_mimetype; } -void NetAccess::slotMimetype( KIO::Job *, const QString & type ) +void NetAccess::slotMimetype( KIO::Job *, const TQString & type ) { m_mimetype = type; } -QString NetAccess::fish_executeInternal(const KURL & url, const QString command, QWidget* window) +TQString NetAccess::fish_executeInternal(const KURL & url, const TQString command, TQWidget* window) { - QString target, remoteTempFileName, resultData; + TQString target, remoteTempFileName, resultData; KURL tempPathUrl; KTempFile tmpFile; tmpFile.setAutoDelete( true ); @@ -407,26 +407,26 @@ QString NetAccess::fish_executeInternal(const KURL & url, const QString command, remoteTempFileName = "/tmp/fishexec_" + remoteTempFileName.mid(pos + 1); tempPathUrl.setPath( remoteTempFileName ); bJobOK = true; // success unless further error occurs - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly ); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly ); stream << int('X') << tempPathUrl << command; KIO::Job * job = KIO::special( tempPathUrl, packedArgs, true ); job->setWindow( window ); - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); // since the KIO::special does not provide feedback we need to download the result if( NetAccess::download( tempPathUrl, target, window ) ) { - QFile resultFile( target ); + TQFile resultFile( target ); if (resultFile.open( IO_ReadOnly )) { - QTextStream ts( &resultFile ); - ts.setEncoding( QTextStream::Locale ); // Locale?? + TQTextStream ts( &resultFile ); + ts.setEncoding( TQTextStream::Locale ); // Locale?? resultData = ts.read(); resultFile.close(); NetAccess::del( tempPathUrl, window ); @@ -440,14 +440,14 @@ QString NetAccess::fish_executeInternal(const KURL & url, const QString command, return resultData; } -bool NetAccess::synchronousRunInternal( Job* job, QWidget* window, QByteArray* data, - KURL* finalURL, QMap<QString,QString>* metaData ) +bool NetAccess::synchronousRunInternal( Job* job, TQWidget* window, TQByteArray* data, + KURL* finalURL, TQMap<TQString,TQString>* metaData ) { job->setWindow( window ); m_metaData = metaData; if ( m_metaData ) { - for ( QMap<QString, QString>::iterator it = m_metaData->begin(); it != m_metaData->end(); ++it ) { + for ( TQMap<TQString, TQString>::iterator it = m_metaData->begin(); it != m_metaData->end(); ++it ) { job->addMetaData( it.key(), it.data() ); } } @@ -459,21 +459,21 @@ bool NetAccess::synchronousRunInternal( Job* job, QWidget* window, QByteArray* d } } - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); - QMetaObject *meta = job->metaObject(); + TQMetaObject *meta = job->metaObject(); - static const char dataSignal[] = "data(KIO::Job*,const QByteArray&)"; + static const char dataSignal[] = "data(KIO::Job*,const TQByteArray&)"; if ( meta->findSignal( dataSignal ) != -1 ) { - connect( job, SIGNAL(data(KIO::Job*,const QByteArray&)), - this, SLOT(slotData(KIO::Job*,const QByteArray&)) ); + connect( job, TQT_SIGNAL(data(KIO::Job*,const TQByteArray&)), + this, TQT_SLOT(slotData(KIO::Job*,const TQByteArray&)) ); } static const char redirSignal[] = "redirection(KIO::Job*,const KURL&)"; if ( meta->findSignal( redirSignal ) != -1 ) { - connect( job, SIGNAL(redirection(KIO::Job*,const KURL&)), - this, SLOT(slotRedirection(KIO::Job*, const KURL&)) ); + connect( job, TQT_SIGNAL(redirection(KIO::Job*,const KURL&)), + this, TQT_SLOT(slotRedirection(KIO::Job*, const KURL&)) ); } enter_loop(); @@ -487,13 +487,13 @@ bool NetAccess::synchronousRunInternal( Job* job, QWidget* window, QByteArray* d } // If a troll sees this, he kills me -void qt_enter_modal( QWidget *widget ); -void qt_leave_modal( QWidget *widget ); +void qt_enter_modal( TQWidget *widget ); +void qt_leave_modal( TQWidget *widget ); void NetAccess::enter_loop() { - QWidget dummy(0,0,WType_Dialog | WShowModal); - dummy.setFocusPolicy( QWidget::NoFocus ); + TQWidget dummy(0,0,WType_Dialog | WShowModal); + dummy.setFocusPolicy( TQWidget::NoFocus ); qt_enter_modal(&dummy); qApp->enter_loop(); qt_leave_modal(&dummy); @@ -518,7 +518,7 @@ void NetAccess::slotResult( KIO::Job * job ) qApp->exit_loop(); } -void NetAccess::slotData( KIO::Job*, const QByteArray& data ) +void NetAccess::slotData( KIO::Job*, const TQByteArray& data ) { if ( data.isEmpty() ) return; diff --git a/kio/kio/netaccess.h b/kio/kio/netaccess.h index 089a93cfd..0bbb383de 100644 --- a/kio/kio/netaccess.h +++ b/kio/kio/netaccess.h @@ -23,8 +23,8 @@ #ifndef __kio_netaccess_h #define __kio_netaccess_h -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <kio/global.h> class QStringList; @@ -68,7 +68,7 @@ public: * If the argument * for @p target is an empty string, download will generate a * unique temporary filename in /tmp. Since @p target is a reference - * to QString you can access this filename easily. Download will + * to TQString you can access this filename easily. Download will * return true if the download was successful, otherwise false. * * Special case: @@ -82,7 +82,7 @@ public: * application has a loadFile() function): * * \code - * QString tmpFile; + * TQString tmpFile; * if( KIO::NetAccess::download( u, tmpFile, window ) ) * { * loadFile( tmpFile ); @@ -114,12 +114,12 @@ public: * @see lastErrorString() * @since 3.2 */ - static bool download(const KURL& src, QString & target, QWidget* window); + static bool download(const KURL& src, TQString & target, TQWidget* window); /** * @deprecated. Use the function above instead. */ - static bool download(const KURL& src, QString & target) KDE_DEPRECATED; + static bool download(const KURL& src, TQString & target) KDE_DEPRECATED; /** * Removes the specified file if and only if it was created @@ -132,7 +132,7 @@ public: * @param name Path to temporary file to remove. May not be * empty. */ - static void removeTempFile(const QString& name); + static void removeTempFile(const TQString& name); /** * Uploads file @p src to URL @p target. @@ -153,12 +153,12 @@ public: * @return true if successful, false for failure * @since 3.2 */ - static bool upload(const QString& src, const KURL& target, QWidget* window); + static bool upload(const TQString& src, const KURL& target, TQWidget* window); /** * @deprecated. Use the function above instead. */ - static bool upload(const QString& src, const KURL& target) KDE_DEPRECATED; + static bool upload(const TQString& src, const KURL& target) KDE_DEPRECATED; /** * Alternative to upload for copying over the network. @@ -178,7 +178,7 @@ public: * * @return true if successful, false for failure */ - static bool copy( const KURL& src, const KURL& target, QWidget* window ); + static bool copy( const KURL& src, const KURL& target, TQWidget* window ); // KDE4: rename to file_copy /** @@ -191,7 +191,7 @@ public: * Full-fledged equivalent of KIO::file_copy */ static bool file_copy( const KURL& src, const KURL& dest, int permissions=-1, - bool overwrite=false, bool resume=false, QWidget* window = 0L ); + bool overwrite=false, bool resume=false, TQWidget* window = 0L ); /** * Full-fledged equivalent of KIO::file_move. @@ -199,7 +199,7 @@ public: * @since 3.2 */ static bool file_move( const KURL& src, const KURL& target, int permissions=-1, - bool overwrite=false, bool resume=false, QWidget* window = 0L ); + bool overwrite=false, bool resume=false, TQWidget* window = 0L ); /** @@ -221,7 +221,7 @@ public: * prompted for passwords as needed. * @return true if successful, false for failure */ - static bool dircopy( const KURL& src, const KURL& target, QWidget* window ); + static bool dircopy( const KURL& src, const KURL& target, TQWidget* window ); /** * @deprecated. Use the function above instead. @@ -231,21 +231,21 @@ public: /** * Overloaded method, which takes a list of source URLs */ - static bool dircopy( const KURL::List& src, const KURL& target, QWidget* window = 0L ); + static bool dircopy( const KURL::List& src, const KURL& target, TQWidget* window = 0L ); /** * Full-fledged equivalent of KIO::move. * Moves or renames one file or directory. * @since 3.2 */ - static bool move( const KURL& src, const KURL& target, QWidget* window = 0L ); + static bool move( const KURL& src, const KURL& target, TQWidget* window = 0L ); /** * Full-fledged equivalent of KIO::move. * Moves or renames a list of files or directories. * @since 3.2 */ - static bool move( const KURL::List& src, const KURL& target, QWidget* window = 0L ); + static bool move( const KURL::List& src, const KURL& target, TQWidget* window = 0L ); /** * Tests whether a URL exists. @@ -263,13 +263,13 @@ public: * @p source, false otherwise * @since 3.2 */ - static bool exists(const KURL& url, bool source, QWidget* window); + static bool exists(const KURL& url, bool source, TQWidget* window); /** * @deprecated. Use the function above instead. * @since 3.2 */ - static bool exists(const KURL& url, QWidget* window) KDE_DEPRECATED; + static bool exists(const KURL& url, TQWidget* window) KDE_DEPRECATED; /** * @deprecated. Use the function above instead. @@ -297,7 +297,7 @@ public: * again be prompted for passwords as needed. * @return true if successful, false for failure */ - static bool stat(const KURL& url, KIO::UDSEntry & entry, QWidget* window); + static bool stat(const KURL& url, KIO::UDSEntry & entry, TQWidget* window); /** * @deprecated. Use the function above instead. @@ -320,7 +320,7 @@ public: * original URL, or the original URL if no local URL can be mapped * @since 3.5 */ - static KURL mostLocalURL(const KURL& url, QWidget* window); + static KURL mostLocalURL(const KURL& url, TQWidget* window); /** * Deletes a file or a directory in a synchronous way. @@ -336,7 +336,7 @@ public: * again be prompted for passwords as needed. * @return true on success, false on failure. */ - static bool del( const KURL & url, QWidget* window ); + static bool del( const KURL & url, TQWidget* window ); /** * @deprecated. Use the function above instead. Passing NULL as the @@ -361,7 +361,7 @@ public: * @param permissions directory permissions. * @return true on success, false on failure. */ - static bool mkdir( const KURL & url, QWidget* window, int permissions = -1 ); + static bool mkdir( const KURL & url, TQWidget* window, int permissions = -1 ); /** * @deprecated. Use the function above instead. Passing NULL as the @@ -389,19 +389,19 @@ public: * again be prompted for passwords as needed. * @return The resulting output of the @p command that is executed. */ - static QString fish_execute( const KURL & url, const QString command, QWidget* window ); + static TQString fish_execute( const KURL & url, const TQString command, TQWidget* window ); /** * This function executes a job in a synchronous way. - * If a job fetches some data, pass a QByteArray pointer as data parameter to this function + * If a job fetches some data, pass a TQByteArray pointer as data parameter to this function * and after the function returns it will contain all the data fetched by this job. * * <code> * KIO::Job *job = KIO::get( url, false, false ); - * QMap<QString, QString> metaData; + * TQMap<TQString, TQString> metaData; * metaData.insert( "PropagateHttpHeader", "true" ); * if ( NetAccess::synchronousRun( job, 0, &data, &url, &metaData ) ) { - * QString responseHeaders = metaData[ "HTTP-Headers" ]; + * TQString responseHeaders = metaData[ "HTTP-Headers" ]; * kdDebug()<<"Response header = "<< responseHeaders << endl; * } * </code> @@ -425,8 +425,8 @@ public: * * @since 3.4 */ - static bool synchronousRun( Job* job, QWidget* window, QByteArray* data=0, - KURL* finalURL=0, QMap<QString,QString>* metaData=0 ); + static bool synchronousRun( Job* job, TQWidget* window, TQByteArray* data=0, + KURL* finalURL=0, TQMap<TQString,TQString>* metaData=0 ); /** * @internal @@ -450,7 +450,7 @@ public: * again be prompted for passwords as needed. * @return The mimetype name. */ - static QString mimetype( const KURL & url, QWidget* window ); + static TQString mimetype( const KURL & url, TQWidget* window ); /** * @deprecated. Use the function above instead. Passing NULL as the @@ -458,14 +458,14 @@ public: * you should try to identify a suitable parent widget * if at all possible. */ - static QString mimetype( const KURL & url ) KDE_DEPRECATED; + static TQString mimetype( const KURL & url ) KDE_DEPRECATED; /** * Returns the error string for the last job, in case it failed. * Note that this is already translated. - * @return the last error string, or QString::null + * @return the last error string, or TQString::null */ - static QString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : QString::null; } + static TQString lastErrorString() { return lastErrorMsg ? *lastErrorMsg : TQString::null; } /** * Returns the error code for the last job, in case it failed. @@ -489,42 +489,42 @@ private: * Internal methods */ bool filecopyInternal(const KURL& src, const KURL& target, int permissions, - bool overwrite, bool resume, QWidget* window, bool move); + bool overwrite, bool resume, TQWidget* window, bool move); bool dircopyInternal(const KURL::List& src, const KURL& target, - QWidget* window, bool move); - bool statInternal(const KURL & url, int details, bool source, QWidget* window = 0); + TQWidget* window, bool move); + bool statInternal(const KURL & url, int details, bool source, TQWidget* window = 0); - bool delInternal(const KURL & url, QWidget* window = 0); - bool mkdirInternal(const KURL & url, int permissions, QWidget* window = 0); - QString fish_executeInternal(const KURL & url, const QString command, QWidget* window = 0); - bool synchronousRunInternal( Job* job, QWidget* window, QByteArray* data, - KURL* finalURL, QMap<QString,QString>* metaData ); + bool delInternal(const KURL & url, TQWidget* window = 0); + bool mkdirInternal(const KURL & url, int permissions, TQWidget* window = 0); + TQString fish_executeInternal(const KURL & url, const TQString command, TQWidget* window = 0); + bool synchronousRunInternal( Job* job, TQWidget* window, TQByteArray* data, + KURL* finalURL, TQMap<TQString,TQString>* metaData ); - QString mimetypeInternal(const KURL & url, QWidget* window = 0); + TQString mimetypeInternal(const KURL & url, TQWidget* window = 0); void enter_loop(); /** * List of temporary files */ - static QStringList* tmpfiles; + static TQStringList* tmpfiles; - static QString* lastErrorMsg; + static TQString* lastErrorMsg; static int lastErrorCode; friend class I_like_this_class; private slots: void slotResult( KIO::Job * job ); - void slotMimetype( KIO::Job * job, const QString & type ); - void slotData( KIO::Job*, const QByteArray& ); + void slotMimetype( KIO::Job * job, const TQString & type ); + void slotData( KIO::Job*, const TQByteArray& ); void slotRedirection( KIO::Job*, const KURL& ); private: UDSEntry m_entry; - QString m_mimetype; - QByteArray m_data; + TQString m_mimetype; + TQByteArray m_data; KURL m_url; - QMap<QString, QString> *m_metaData; + TQMap<TQString, TQString> *m_metaData; /** * Whether the download succeeded or not diff --git a/kio/kio/observer.cpp b/kio/kio/observer.cpp index df69ddf93..2a468b1e6 100644 --- a/kio/kio/observer.cpp +++ b/kio/kio/observer.cpp @@ -43,7 +43,7 @@ using namespace KIO; -template class QIntDict<KIO::Job>; +template class TQIntDict<KIO::Job>; Observer * Observer::s_pObserver = 0L; @@ -60,9 +60,9 @@ Observer::Observer() : DCOPObject("KIO::Observer") if ( !kapp->dcopClient()->isApplicationRegistered( "kio_uiserver" ) ) { kdDebug(KDEBUG_OBSERVER) << "Starting kio_uiserver" << endl; - QString error; + TQString error; int ret = KApplication::startServiceByDesktopPath( "kio_uiserver.desktop", - QStringList(), &error ); + TQStringList(), &error ); if ( ret > 0 ) { kdError() << "Couldn't start kio_uiserver from kio_uiserver.desktop: " << error << endl; @@ -162,7 +162,7 @@ void Observer::slotPercent( KIO::Job* job, unsigned long percent ) m_uiserver->percent( job->progressId(), percent ); } -void Observer::slotInfoMessage( KIO::Job* job, const QString & msg ) +void Observer::slotInfoMessage( KIO::Job* job, const TQString & msg ) { m_uiserver->infoMessage( job->progressId(), msg ); } @@ -208,18 +208,18 @@ void Observer::stating( KIO::Job* job, const KURL& url ) m_uiserver->stating( job->progressId(), url ); } -void Observer::mounting( KIO::Job* job, const QString & dev, const QString & point ) +void Observer::mounting( KIO::Job* job, const TQString & dev, const TQString & point ) { m_uiserver->mounting( job->progressId(), dev, point ); } -void Observer::unmounting( KIO::Job* job, const QString & point ) +void Observer::unmounting( KIO::Job* job, const TQString & point ) { m_uiserver->unmounting( job->progressId(), point ); } -bool Observer::openPassDlg( const QString& prompt, QString& user, - QString& pass, bool readOnly ) +bool Observer::openPassDlg( const TQString& prompt, TQString& user, + TQString& pass, bool readOnly ) { AuthInfo info; info.prompt = prompt; @@ -243,7 +243,7 @@ bool Observer::openPassDlg( KIO::AuthInfo& info ) &info.keepPassword, info.prompt, info.readOnly, info.caption, info.comment, info.commentLabel ); - if ( result == QDialog::Accepted ) + if ( result == TQDialog::Accepted ) { info.setModified( true ); return true; @@ -251,16 +251,16 @@ bool Observer::openPassDlg( KIO::AuthInfo& info ) return false; } -int Observer::messageBox( int progressId, int type, const QString &text, - const QString &caption, const QString &buttonYes, - const QString &buttonNo ) +int Observer::messageBox( int progressId, int type, const TQString &text, + const TQString &caption, const TQString &buttonYes, + const TQString &buttonNo ) { - return messageBox( progressId, type, text, caption, buttonYes, buttonNo, QString::null ); + return messageBox( progressId, type, text, caption, buttonYes, buttonNo, TQString::null ); } -int Observer::messageBox( int progressId, int type, const QString &text, - const QString &caption, const QString &buttonYes, - const QString &buttonNo, const QString &dontAskAgainName ) +int Observer::messageBox( int progressId, int type, const TQString &text, + const TQString &caption, const TQString &buttonYes, + const TQString &buttonNo, const TQString &dontAskAgainName ) { kdDebug() << "Observer::messageBox " << type << " " << text << " - " << caption << endl; int result = -1; @@ -291,7 +291,7 @@ int Observer::messageBox( int progressId, int type, const QString &text, break; case KIO::SlaveBase::SSLMessageBox: { - QCString observerAppId = caption.utf8(); // hack, see slaveinterface.cpp + TQCString observerAppId = caption.utf8(); // hack, see slaveinterface.cpp // Contact the object "KIO::Observer" in the application <appId> // Yes, this could be the same application we are, but not necessarily. Observer_stub observer( observerAppId, "KIO::Observer" ); @@ -301,12 +301,12 @@ int Observer::messageBox( int progressId, int type, const QString &text, KSSLCertificate *x = KSSLCertificate::fromString(meta["ssl_peer_certificate"].local8Bit()); if (x) { // Set the chain back onto the certificate - QStringList cl = - QStringList::split(QString("\n"), meta["ssl_peer_chain"]); - QPtrList<KSSLCertificate> ncl; + TQStringList cl = + TQStringList::split(TQString("\n"), meta["ssl_peer_chain"]); + TQPtrList<KSSLCertificate> ncl; ncl.setAutoDelete(true); - for (QStringList::Iterator it = cl.begin(); it != cl.end(); ++it) { + for (TQStringList::Iterator it = cl.begin(); it != cl.end(); ++it) { KSSLCertificate *y = KSSLCertificate::fromString((*it).local8Bit()); if (y) ncl.append(y); } @@ -344,20 +344,20 @@ int Observer::messageBox( int progressId, int type, const QString &text, delete config; return result; #if 0 - QByteArray data, replyData; - QCString replyType; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg( data, IO_WriteOnly ); arg << progressId; arg << type; arg << text; arg << caption; arg << buttonYes; arg << buttonNo; - if ( kapp->dcopClient()->call( "kio_uiserver", "UIServer", "messageBox(int,int,QString,QString,QString,QString)", data, replyType, replyData, true ) + if ( kapp->dcopClient()->call( "kio_uiserver", "UIServer", "messageBox(int,int,TQString,TQString,TQString,TQString)", data, replyType, replyData, true ) && replyType == "int" ) { int result; - QDataStream _reply_stream( replyData, IO_ReadOnly ); + TQDataStream _reply_stream( replyData, IO_ReadOnly ); _reply_stream >> result; kdDebug(KDEBUG_OBSERVER) << "Observer::messageBox got result " << result << endl; return result; @@ -368,9 +368,9 @@ int Observer::messageBox( int progressId, int type, const QString &text, } RenameDlg_Result Observer::open_RenameDlg( KIO::Job* job, - const QString & caption, - const QString& src, const QString & dest, - RenameDlg_Mode mode, QString& newDest, + const TQString & caption, + const TQString& src, const TQString & dest, + RenameDlg_Mode mode, TQString& newDest, KIO::filesize_t sizeSrc, KIO::filesize_t sizeDest, time_t ctimeSrc, @@ -398,7 +398,7 @@ RenameDlg_Result Observer::open_RenameDlg( KIO::Job* job, SkipDlg_Result Observer::open_SkipDlg( KIO::Job* job, bool _multi, - const QString& _error_text ) + const TQString& _error_text ) { kdDebug(KDEBUG_OBSERVER) << "Observer::open_SkipDlg job=" << job << " progressId=" << job->progressId() << endl; // Hide existing dialog box if any diff --git a/kio/kio/observer.h b/kio/kio/observer.h index beadd1dcd..94b8cede9 100644 --- a/kio/kio/observer.h +++ b/kio/kio/observer.h @@ -19,9 +19,9 @@ #ifndef __kio_observer_h__ #define __kio_observer_h__ -#include <qobject.h> +#include <tqobject.h> #include <dcopobject.h> -#include <qintdict.h> +#include <tqintdict.h> #include <kio/global.h> #include <kio/authinfo.h> @@ -52,7 +52,7 @@ namespace KIO { * @short Observer for KIO::Job progress information * @author David Faure <faure@kde.org> */ -class KIO_EXPORT Observer : public QObject, public DCOPObject { +class KIO_EXPORT Observer : public TQObject, public DCOPObject { K_DCOP Q_OBJECT @@ -87,7 +87,7 @@ public: /** * @deprecated use KIO::AutoInfo */ - bool openPassDlg( const QString& prompt, QString& user, QString& pass, + bool openPassDlg( const TQString& prompt, TQString& user, TQString& pass, bool readOnly ); /** @@ -108,8 +108,8 @@ public: * @param buttonYes the text of the "Yes" button * @param buttonNo the text of the "No button */ - static int messageBox( int progressId, int type, const QString &text, const QString &caption, - const QString &buttonYes, const QString &buttonNo ); + static int messageBox( int progressId, int type, const TQString &text, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo ); /** * Popup a message box. See KIO::SlaveBase. @@ -125,18 +125,18 @@ public: * The string is used to lookup and store the setting in kioslaverc. * @since 3.3 */ - static int messageBox( int progressId, int type, const QString &text, const QString &caption, - const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName ); + static int messageBox( int progressId, int type, const TQString &text, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo, const TQString &dontAskAgainName ); /** * @internal * See renamedlg.h */ KIO::RenameDlg_Result open_RenameDlg( KIO::Job * job, - const QString & caption, - const QString& src, const QString & dest, + const TQString & caption, + const TQString& src, const TQString & dest, KIO::RenameDlg_Mode mode, - QString& newDest, + TQString& newDest, KIO::filesize_t sizeSrc = (KIO::filesize_t) -1, KIO::filesize_t sizeDest = (KIO::filesize_t) -1, time_t ctimeSrc = (time_t) -1, @@ -151,7 +151,7 @@ public: */ KIO::SkipDlg_Result open_SkipDlg( KIO::Job * job, bool multi, - const QString & error_text ); + const TQString & error_text ); k_dcop: /** @@ -174,7 +174,7 @@ protected: UIServer_stub * m_uiserver; - QIntDict< KIO::Job > m_dctJobs; + TQIntDict< KIO::Job > m_dctJobs; public slots: @@ -188,7 +188,7 @@ public slots: void slotSpeed( KIO::Job*, unsigned long speed ); void slotPercent( KIO::Job*, unsigned long percent ); - void slotInfoMessage( KIO::Job*, const QString & msg ); + void slotInfoMessage( KIO::Job*, const TQString & msg ); void slotCopying( KIO::Job*, const KURL& from, const KURL& to ); void slotMoving( KIO::Job*, const KURL& from, const KURL& to ); @@ -201,8 +201,8 @@ public slots: public: void stating( KIO::Job*, const KURL& url ); - void mounting( KIO::Job*, const QString & dev, const QString & point ); - void unmounting( KIO::Job*, const QString & point ); + void mounting( KIO::Job*, const TQString & dev, const TQString & point ); + void unmounting( KIO::Job*, const TQString & point ); protected: virtual void virtual_hook( int id, void* data ); private: diff --git a/kio/kio/passdlg.cpp b/kio/kio/passdlg.cpp index e8d606104..83434906b 100644 --- a/kio/kio/passdlg.cpp +++ b/kio/kio/passdlg.cpp @@ -18,13 +18,13 @@ #include "passdlg.h" -#include <qapplication.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qsimplerichtext.h> -#include <qstylesheet.h> +#include <tqapplication.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqsimplerichtext.h> +#include <tqstylesheet.h> #include <kcombobox.h> #include <kconfig.h> @@ -37,22 +37,22 @@ using namespace KIO; struct PasswordDialog::PasswordDialogPrivate { - QGridLayout *layout; - QLineEdit* userEdit; + TQGridLayout *layout; + TQLineEdit* userEdit; KLineEdit* passEdit; - QLabel* userNameLabel; - QLabel* prompt; - QCheckBox* keepCheckBox; - QMap<QString,QString> knownLogins; + TQLabel* userNameLabel; + TQLabel* prompt; + TQCheckBox* keepCheckBox; + TQMap<TQString,TQString> knownLogins; KComboBox* userEditCombo; - QHBox* userNameHBox; + TQHBox* userNameHBox; bool keep; short unsigned int nRow; }; -PasswordDialog::PasswordDialog( const QString& prompt, const QString& user, - bool enableKeep, bool modal, QWidget* parent, +PasswordDialog::PasswordDialog( const TQString& prompt, const TQString& user, + bool enableKeep, bool modal, TQWidget* parent, const char* name ) :KDialogBase( parent, name, modal, i18n("Password"), Ok|Cancel, Ok, true) { @@ -64,10 +64,10 @@ PasswordDialog::~PasswordDialog() delete d; } -void PasswordDialog::init( const QString& prompt, const QString& user, +void PasswordDialog::init( const TQString& prompt, const TQString& user, bool enableKeep ) { - QWidget *main = makeMainWidget(); + TQWidget *main = makeMainWidget(); d = new PasswordDialogPrivate; d->keep = false; @@ -77,21 +77,21 @@ void PasswordDialog::init( const QString& prompt, const QString& user, KConfig* cfg = KGlobal::config(); KConfigGroupSaver saver( cfg, "Passwords" ); - d->layout = new QGridLayout( main, 9, 3, spacingHint(), marginHint()); + d->layout = new TQGridLayout( main, 9, 3, spacingHint(), marginHint()); d->layout->addColSpacing(1, 5); // Row 0: pixmap prompt - QLabel* lbl; - QPixmap pix( KGlobal::iconLoader()->loadIcon( "password", KIcon::NoGroup, KIcon::SizeHuge, 0, 0, true)); + TQLabel* lbl; + TQPixmap pix( KGlobal::iconLoader()->loadIcon( "password", KIcon::NoGroup, KIcon::SizeHuge, 0, 0, true)); if ( !pix.isNull() ) { - lbl = new QLabel( main ); + lbl = new TQLabel( main ); lbl->setPixmap( pix ); lbl->setAlignment( Qt::AlignLeft|Qt::AlignVCenter ); lbl->setFixedSize( lbl->sizeHint() ); d->layout->addWidget( lbl, 0, 0, Qt::AlignLeft ); } - d->prompt = new QLabel( main ); + d->prompt = new TQLabel( main ); d->prompt->setAlignment( Qt::AlignLeft|Qt::AlignVCenter|Qt::WordBreak ); d->layout->addWidget( d->prompt, 0, 2, Qt::AlignLeft ); if ( prompt.isEmpty() ) @@ -105,13 +105,13 @@ void PasswordDialog::init( const QString& prompt, const QString& user, // Row 2-3: Reserved for an additional comment // Row 4: Username field - d->userNameLabel = new QLabel( i18n("&Username:"), main ); + d->userNameLabel = new TQLabel( i18n("&Username:"), main ); d->userNameLabel->setAlignment( Qt::AlignVCenter | Qt::AlignLeft ); d->userNameLabel->setFixedSize( d->userNameLabel->sizeHint() ); - d->userNameHBox = new QHBox( main ); + d->userNameHBox = new TQHBox( main ); d->userEdit = new KLineEdit( d->userNameHBox ); - QSize s = d->userEdit->sizeHint(); + TQSize s = d->userEdit->sizeHint(); d->userEdit->setFixedHeight( s.height() ); d->userEdit->setMinimumWidth( s.width() ); d->userNameLabel->setBuddy( d->userEdit ); @@ -122,15 +122,15 @@ void PasswordDialog::init( const QString& prompt, const QString& user, d->layout->addRowSpacing( 5, 4 ); // Row 6: Password field - lbl = new QLabel( i18n("&Password:"), main ); + lbl = new TQLabel( i18n("&Password:"), main ); lbl->setAlignment( Qt::AlignVCenter | Qt::AlignLeft ); lbl->setFixedSize( lbl->sizeHint() ); - QHBox* hbox = new QHBox( main ); + TQHBox* hbox = new TQHBox( main ); d->passEdit = new KLineEdit( hbox ); if ( cfg->readEntry("EchoMode", "OneStar") == "NoEcho" ) - d->passEdit->setEchoMode( QLineEdit::NoEcho ); + d->passEdit->setEchoMode( TQLineEdit::NoEcho ); else - d->passEdit->setEchoMode( QLineEdit::Password ); + d->passEdit->setEchoMode( TQLineEdit::Password ); s = d->passEdit->sizeHint(); d->passEdit->setFixedHeight( s.height() ); d->passEdit->setMinimumWidth( s.width() ); @@ -143,18 +143,18 @@ void PasswordDialog::init( const QString& prompt, const QString& user, // Row 7: Add spacer d->layout->addRowSpacing( 7, 4 ); // Row 8: Keep Password - hbox = new QHBox( main ); - d->keepCheckBox = new QCheckBox( i18n("&Keep password"), hbox ); + hbox = new TQHBox( main ); + d->keepCheckBox = new TQCheckBox( i18n("&Keep password"), hbox ); d->keepCheckBox->setFixedSize( d->keepCheckBox->sizeHint() ); d->keep = cfg->readBoolEntry("Keep", false ); d->keepCheckBox->setChecked( d->keep ); - connect(d->keepCheckBox, SIGNAL(toggled( bool )), SLOT(slotKeep( bool ))); + connect(d->keepCheckBox, TQT_SIGNAL(toggled( bool )), TQT_SLOT(slotKeep( bool ))); d->layout->addWidget( hbox, 8, 2 ); } // Configure necessary key-bindings and connect necessar slots and signals - connect( d->userEdit, SIGNAL(returnPressed()), d->passEdit, SLOT(setFocus()) ); - connect( d->passEdit, SIGNAL(returnPressed()), SLOT(slotOk()) ); + connect( d->userEdit, TQT_SIGNAL(returnPressed()), d->passEdit, TQT_SLOT(setFocus()) ); + connect( d->passEdit, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotOk()) ); if ( !user.isEmpty() ) { @@ -168,12 +168,12 @@ void PasswordDialog::init( const QString& prompt, const QString& user, // setFixedSize( sizeHint() ); } -QString PasswordDialog::username() const +TQString PasswordDialog::username() const { return d->userEdit->text(); } -QString PasswordDialog::password() const +TQString PasswordDialog::password() const { return d->passEdit->text(); } @@ -189,16 +189,16 @@ bool PasswordDialog::keepPassword() const return d->keep; } -static void calculateLabelSize(QLabel *label) +static void calculateLabelSize(TQLabel *label) { - QString qt_text = label->text(); + TQString qt_text = label->text(); int pref_width = 0; int pref_height = 0; // Calculate a proper size for the text. { - QSimpleRichText rt(qt_text, label->font()); - QRect d = KGlobalSettings::desktopGeometry(label->topLevelWidget()); + TQSimpleRichText rt(qt_text, label->font()); + TQRect d = KGlobalSettings::desktopGeometry(label->topLevelWidget()); pref_width = d.width() / 4; rt.setWidth(pref_width-10); @@ -227,22 +227,22 @@ static void calculateLabelSize(QLabel *label) pref_width = used_width; } } - label->setFixedSize(QSize(pref_width+10, pref_height)); + label->setFixedSize(TQSize(pref_width+10, pref_height)); } -void PasswordDialog::addCommentLine( const QString& label, - const QString comment ) +void PasswordDialog::addCommentLine( const TQString& label, + const TQString comment ) { if (d->nRow > 0) return; - QWidget *main = mainWidget(); + TQWidget *main = mainWidget(); - QLabel* lbl = new QLabel( label, main); + TQLabel* lbl = new TQLabel( label, main); lbl->setAlignment( Qt::AlignVCenter|Qt::AlignRight ); lbl->setFixedSize( lbl->sizeHint() ); d->layout->addWidget( lbl, d->nRow+2, 0, Qt::AlignLeft ); - lbl = new QLabel( comment, main); + lbl = new TQLabel( comment, main); lbl->setAlignment( Qt::AlignVCenter|Qt::AlignLeft|Qt::WordBreak ); calculateLabelSize(lbl); d->layout->addWidget( lbl, d->nRow+2, 2, Qt::AlignLeft ); @@ -255,28 +255,28 @@ void PasswordDialog::slotKeep( bool keep ) d->keep = keep; } -static QString qrichtextify( const QString& text ) +static TQString qrichtextify( const TQString& text ) { if ( text.isEmpty() || text[0] == '<' ) return text; - QStringList lines = QStringList::split('\n', text); - for(QStringList::Iterator it = lines.begin(); it != lines.end(); ++it) + TQStringList lines = TQStringList::split('\n', text); + for(TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it) { - *it = QStyleSheet::convertFromPlainText( *it, QStyleSheetItem::WhiteSpaceNormal ); + *it = TQStyleSheet::convertFromPlainText( *it, TQStyleSheetItem::WhiteSpaceNormal ); } - return lines.join(QString::null); + return lines.join(TQString::null); } -void PasswordDialog::setPrompt(const QString& prompt) +void PasswordDialog::setPrompt(const TQString& prompt) { - QString text = qrichtextify(prompt); + TQString text = qrichtextify(prompt); d->prompt->setText(text); calculateLabelSize(d->prompt); } -void PasswordDialog::setPassword(const QString &p) +void PasswordDialog::setPassword(const TQString &p) { d->passEdit->setText(p); } @@ -288,7 +288,7 @@ void PasswordDialog::setUserReadOnly( bool readOnly ) d->passEdit->setFocus(); } -void PasswordDialog::setKnownLogins( const QMap<QString, QString>& knownLogins ) +void PasswordDialog::setKnownLogins( const TQMap<TQString, TQString>& knownLogins ) { const int nr = knownLogins.count(); if ( nr == 0 ) @@ -304,7 +304,7 @@ void PasswordDialog::setKnownLogins( const QMap<QString, QString>& knownLogins ) delete d->userEdit; d->userEditCombo = new KComboBox( true, d->userNameHBox ); d->userEdit = d->userEditCombo->lineEdit(); - QSize s = d->userEditCombo->sizeHint(); + TQSize s = d->userEditCombo->sizeHint(); d->userEditCombo->setFixedHeight( s.height() ); d->userEditCombo->setMinimumWidth( s.width() ); d->userNameLabel->setBuddy( d->userEditCombo ); @@ -315,23 +315,23 @@ void PasswordDialog::setKnownLogins( const QMap<QString, QString>& knownLogins ) d->userEditCombo->insertStringList( knownLogins.keys() ); d->userEditCombo->setFocus(); - connect( d->userEditCombo, SIGNAL( activated( const QString& ) ), - this, SLOT( slotActivated( const QString& ) ) ); + connect( d->userEditCombo, TQT_SIGNAL( activated( const TQString& ) ), + this, TQT_SLOT( slotActivated( const TQString& ) ) ); } -void PasswordDialog::slotActivated( const QString& userName ) +void PasswordDialog::slotActivated( const TQString& userName ) { - QMap<QString, QString>::ConstIterator it = d->knownLogins.find( userName ); + TQMap<TQString, TQString>::ConstIterator it = d->knownLogins.find( userName ); if ( it != d->knownLogins.end() ) setPassword( it.data() ); } -int PasswordDialog::getNameAndPassword( QString& user, QString& pass, bool* keep, - const QString& prompt, bool readOnly, - const QString& caption, - const QString& comment, - const QString& label ) +int PasswordDialog::getNameAndPassword( TQString& user, TQString& pass, bool* keep, + const TQString& prompt, bool readOnly, + const TQString& caption, + const TQString& comment, + const TQString& label ) { PasswordDialog* dlg; if( keep ) diff --git a/kio/kio/passdlg.h b/kio/kio/passdlg.h index 948ffc7f7..dbc4b294e 100644 --- a/kio/kio/passdlg.h +++ b/kio/kio/passdlg.h @@ -48,9 +48,9 @@ public: * @param parent the parent widget (default:NULL). * @param name the dialog name (default:NULL). */ - PasswordDialog( const QString& prompt, const QString& user, + PasswordDialog( const TQString& prompt, const TQString& user, bool enableKeep = false, bool modal=true, - QWidget* parent=0, const char* name=0 ); + TQWidget* parent=0, const char* name=0 ); /** * Destructor @@ -61,7 +61,7 @@ public: * Sets the prompt to show to the user. * @param prompt instructional text to be shown. */ - void setPrompt( const QString& prompt ); + void setPrompt( const TQString& prompt ); /** * Adds a comment line to the dialog. @@ -73,19 +73,19 @@ public: * @param label label for comment (ex:"Command:") * @param comment the actual comment text. */ - void addCommentLine( const QString& label, const QString comment ); + void addCommentLine( const TQString& label, const TQString comment ); /** * Returns the password entered by the user. * @return the password */ - QString password() const; + TQString password() const; /** * Returns the username entered by the user. * @return the user name */ - QString username() const; + TQString username() const; /** * Determines whether supplied authorization should @@ -122,7 +122,7 @@ public: * @param password the password to set * @since 3.1 */ - void setPassword( const QString& password ); + void setPassword( const TQString& password ); /** * Presets a number of login+password pairs that the user can choose from. @@ -131,7 +131,7 @@ public: * @param knownLogins map of known logins: the keys are usernames, the values are passwords. * @since 3.4 */ - void setKnownLogins( const QMap<QString, QString>& knownLogins ); + void setKnownLogins( const TQMap<TQString, TQString>& knownLogins ); /** * A convienence static method for obtaining authorization @@ -149,19 +149,19 @@ public: * * @return Accepted/Rejected based on the user choice. */ - static int getNameAndPassword( QString& user, QString& pass, bool* keep, - const QString& prompt = QString::null, + static int getNameAndPassword( TQString& user, TQString& pass, bool* keep, + const TQString& prompt = TQString::null, bool readOnly = false, - const QString& caption = QString::null, - const QString& comment = QString::null, - const QString& label = QString::null ); + const TQString& caption = TQString::null, + const TQString& comment = TQString::null, + const TQString& label = TQString::null ); private slots: void slotKeep( bool ); - void slotActivated( const QString& userName ); + void slotActivated( const TQString& userName ); private: - void init( const QString&, const QString&, bool ); + void init( const TQString&, const TQString&, bool ); protected: virtual void virtual_hook( int id, void* data ); diff --git a/kio/kio/paste.cpp b/kio/kio/paste.cpp index 7f66e4c05..399350236 100644 --- a/kio/kio/paste.cpp +++ b/kio/kio/paste.cpp @@ -35,19 +35,19 @@ #include <kmimetype.h> #include <ktempfile.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qdragobject.h> -#include <qtextstream.h> -#include <qvaluevector.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqdragobject.h> +#include <tqtextstream.h> +#include <tqvaluevector.h> -static KURL getNewFileName( const KURL &u, const QString& text ) +static KURL getNewFileName( const KURL &u, const TQString& text ) { bool ok; - QString dialogText( text ); + TQString dialogText( text ); if ( dialogText.isEmpty() ) dialogText = i18n( "Filename for clipboard content:" ); - QString file = KInputDialog::getText( QString::null, dialogText, QString::null, &ok ); + TQString file = KInputDialog::getText( TQString::null, dialogText, TQString::null, &ok ); if ( !ok ) return KURL(); @@ -59,7 +59,7 @@ static KURL getNewFileName( const KURL &u, const QString& text ) kdDebug(7007) << "Paste will overwrite file. Prompting..." << endl; KIO::RenameDlg_Result res = KIO::R_OVERWRITE; - QString newPath; + TQString newPath; // Ask confirmation about resuming previous transfer res = Observer::self()->open_RenameDlg( 0L, i18n("File Already Exists"), @@ -81,7 +81,7 @@ static KURL getNewFileName( const KURL &u, const QString& text ) } // The finaly step: write _data to tempfile and move it to neW_url -static KIO::CopyJob* pasteDataAsyncTo( const KURL& new_url, const QByteArray& _data ) +static KIO::CopyJob* pasteDataAsyncTo( const KURL& new_url, const TQByteArray& _data ) { KTempFile tempFile; tempFile.dataStream()->writeRawBytes( _data.data(), _data.size() ); @@ -94,15 +94,15 @@ static KIO::CopyJob* pasteDataAsyncTo( const KURL& new_url, const QByteArray& _d } #ifndef QT_NO_MIMECLIPBOARD -static KIO::CopyJob* chooseAndPaste( const KURL& u, QMimeSource* data, - const QValueVector<QCString>& formats, - const QString& text, - QWidget* widget, +static KIO::CopyJob* chooseAndPaste( const KURL& u, TQMimeSource* data, + const TQValueVector<TQCString>& formats, + const TQString& text, + TQWidget* widget, bool clipboard ) { - QStringList formatLabels; + TQStringList formatLabels; for ( uint i = 0; i < formats.size(); ++i ) { - const QCString& fmt = formats[i]; + const TQCString& fmt = formats[i]; KMimeType::Ptr mime = KMimeType::mimeType( fmt ); if ( mime != KMimeType::defaultMimeTypePtr() ) formatLabels.append( i18n( "%1 (%2)" ).arg( mime->comment() ).arg( fmt ) ); @@ -110,10 +110,10 @@ static KIO::CopyJob* chooseAndPaste( const KURL& u, QMimeSource* data, formatLabels.append( fmt ); } - QString dialogText( text ); + TQString dialogText( text ); if ( dialogText.isEmpty() ) dialogText = i18n( "Filename for clipboard content:" ); - KIO::PasteDialog dlg( QString::null, dialogText, QString::null, formatLabels, widget, clipboard ); + KIO::PasteDialog dlg( TQString::null, dialogText, TQString::null, formatLabels, widget, clipboard ); if ( dlg.exec() != KDialogBase::Accepted ) return 0; @@ -126,8 +126,8 @@ static KIO::CopyJob* chooseAndPaste( const KURL& u, QMimeSource* data, return 0; } - const QString result = dlg.lineEditText(); - const QCString chosenFormat = formats[ dlg.comboItem() ]; + const TQString result = dlg.lineEditText(); + const TQCString chosenFormat = formats[ dlg.comboItem() ]; kdDebug() << " result=" << result << " chosenFormat=" << chosenFormat << endl; KURL new_url( u ); @@ -135,9 +135,9 @@ static KIO::CopyJob* chooseAndPaste( const KURL& u, QMimeSource* data, // if "data" came from QClipboard, then it was deleted already - by a nice 0-seconds timer // In that case, get it again. Let's hope the user didn't copy something else meanwhile :/ if ( clipboard ) { - data = QApplication::clipboard()->data(); + data = TQApplication::clipboard()->data(); } - const QByteArray ba = data->encodedData( chosenFormat ); + const TQByteArray ba = data->encodedData( chosenFormat ); return pasteDataAsyncTo( new_url, ba ); } #endif @@ -146,13 +146,13 @@ static KIO::CopyJob* chooseAndPaste( const KURL& u, QMimeSource* data, KIO_EXPORT bool KIO::isClipboardEmpty() { #ifndef QT_NO_MIMECLIPBOARD - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); if ( data->provides( "text/uri-list" ) && data->encodedData( "text/uri-list" ).size() > 0 ) return false; #else // Happens with some versions of Qt Embedded... :/ // Guess. - QString data = QApplication::clipboard()->text(); + TQString data = TQApplication::clipboard()->text(); if(data.contains("://")) return false; #endif @@ -161,22 +161,22 @@ KIO_EXPORT bool KIO::isClipboardEmpty() #ifndef QT_NO_MIMECLIPBOARD // The main method for dropping -KIO::CopyJob* KIO::pasteMimeSource( QMimeSource* data, const KURL& dest_url, - const QString& dialogText, QWidget* widget, bool clipboard ) +KIO::CopyJob* KIO::pasteMimeSource( TQMimeSource* data, const KURL& dest_url, + const TQString& dialogText, TQWidget* widget, bool clipboard ) { - QByteArray ba; + TQByteArray ba; // Now check for plain text - // We don't want to display a mimetype choice for a QTextDrag, those mimetypes look ugly. - QString text; - if ( QTextDrag::canDecode( data ) && QTextDrag::decode( data, text ) ) + // We don't want to display a mimetype choice for a TQTextDrag, those mimetypes look ugly. + TQString text; + if ( TQTextDrag::canDecode( data ) && TQTextDrag::decode( data, text ) ) { - QTextStream txtStream( ba, IO_WriteOnly ); + TQTextStream txtStream( ba, IO_WriteOnly ); txtStream << text; } else { - QValueVector<QCString> formats; + TQValueVector<TQCString> formats; const char* fmt; for ( int i = 0; ( fmt = data->format( i ) ); ++i ) { if ( qstrcmp( fmt, "application/x-qiconlist" ) == 0 ) // see QIconDrag @@ -215,7 +215,7 @@ KIO_EXPORT KIO::Job *KIO::pasteClipboard( const KURL& dest_url, bool move ) } #ifndef QT_NO_MIMECLIPBOARD - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); // First check for URLs. KURL::List urls; @@ -233,18 +233,18 @@ KIO_EXPORT KIO::Job *KIO::pasteClipboard( const KURL& dest_url, bool move ) // If moving, erase the clipboard contents, the original files don't exist anymore if ( move ) - QApplication::clipboard()->clear(); + TQApplication::clipboard()->clear(); return res; } - return pasteMimeSource( data, dest_url, QString::null, 0 /*TODO parent widget*/, true /*clipboard*/ ); + return pasteMimeSource( data, dest_url, TQString::null, 0 /*TODO parent widget*/, true /*clipboard*/ ); #else - QByteArray ba; - QTextStream txtStream( ba, IO_WriteOnly ); - QStringList data = QStringList::split("\n", QApplication::clipboard()->text()); + TQByteArray ba; + TQTextStream txtStream( ba, IO_WriteOnly ); + TQStringList data = TQStringList::split("\n", TQApplication::clipboard()->text()); KURL::List urls; KURLDrag::decode(data, urls); - QStringList::Iterator end(data.end()); - for(QStringList::Iterator it=data.begin(); it!=end; ++it) + TQStringList::Iterator end(data.end()); + for(TQStringList::Iterator it=data.begin(); it!=end; ++it) txtStream << *it; if ( ba.size() == 0 ) { @@ -256,9 +256,9 @@ KIO_EXPORT KIO::Job *KIO::pasteClipboard( const KURL& dest_url, bool move ) } -KIO_EXPORT void KIO::pasteData( const KURL& u, const QByteArray& _data ) +KIO_EXPORT void KIO::pasteData( const KURL& u, const TQByteArray& _data ) { - KURL new_url = getNewFileName( u, QString::null ); + KURL new_url = getNewFileName( u, TQString::null ); // We could use KIO::put here, but that would require a class // for the slotData call. With NetAccess, we can do a synchronous call. @@ -273,12 +273,12 @@ KIO_EXPORT void KIO::pasteData( const KURL& u, const QByteArray& _data ) (void) KIO::NetAccess::upload( tempFile.name(), new_url, 0 ); } -KIO_EXPORT KIO::CopyJob* KIO::pasteDataAsync( const KURL& u, const QByteArray& _data ) +KIO_EXPORT KIO::CopyJob* KIO::pasteDataAsync( const KURL& u, const TQByteArray& _data ) { - return pasteDataAsync( u, _data, QString::null ); + return pasteDataAsync( u, _data, TQString::null ); } -KIO_EXPORT KIO::CopyJob* KIO::pasteDataAsync( const KURL& u, const QByteArray& _data, const QString& text ) +KIO_EXPORT KIO::CopyJob* KIO::pasteDataAsync( const KURL& u, const TQByteArray& _data, const TQString& text ) { KURL new_url = getNewFileName( u, text ); @@ -288,13 +288,13 @@ KIO_EXPORT KIO::CopyJob* KIO::pasteDataAsync( const KURL& u, const QByteArray& _ return pasteDataAsyncTo( new_url, _data ); } -KIO_EXPORT QString KIO::pasteActionText() +KIO_EXPORT TQString KIO::pasteActionText() { - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); KURL::List urls; if ( KURLDrag::canDecode( data ) && KURLDrag::decode( data, urls ) ) { if ( urls.isEmpty() ) - return QString::null; // nothing to paste + return TQString::null; // nothing to paste else if ( urls.first().isLocalFile() ) return i18n( "&Paste File", "&Paste %n Files", urls.count() ); else @@ -302,7 +302,7 @@ KIO_EXPORT QString KIO::pasteActionText() } else if ( data->format(0) != 0 ) { return i18n( "&Paste Clipboard Contents" ); } else { - return QString::null; + return TQString::null; } } diff --git a/kio/kio/paste.h b/kio/kio/paste.h index eb5822ee3..66975d772 100644 --- a/kio/kio/paste.h +++ b/kio/kio/paste.h @@ -19,8 +19,8 @@ #ifndef __kio_paste_h__ #define __kio_paste_h__ -#include <qstring.h> -#include <qmemarray.h> +#include <tqstring.h> +#include <tqmemarray.h> #include <kurl.h> class QWidget; class QMimeSource; @@ -54,7 +54,7 @@ namespace KIO { * @param data the data to copy * @see pasteClipboard() */ - KIO_EXPORT void pasteData( const KURL& destURL, const QByteArray& data ); + KIO_EXPORT void pasteData( const KURL& destURL, const TQByteArray& data ); /** * Pastes the given @p data to the given destination URL. @@ -66,7 +66,7 @@ namespace KIO { * @param data the data to copy * @see pasteClipboard() */ - KIO_EXPORT CopyJob *pasteDataAsync( const KURL& destURL, const QByteArray& data ); + KIO_EXPORT CopyJob *pasteDataAsync( const KURL& destURL, const TQByteArray& data ); /** * Pastes the given @p data to the given destination URL. @@ -79,7 +79,7 @@ namespace KIO { * @param dialogText the text to show in the dialog * @see pasteClipboard() */ - KIO_EXPORT CopyJob *pasteDataAsync( const KURL& destURL, const QByteArray& data, const QString& dialogText ); // KDE4: merge with above + KIO_EXPORT CopyJob *pasteDataAsync( const KURL& destURL, const TQByteArray& data, const TQString& dialogText ); // KDE4: merge with above /** @@ -88,20 +88,20 @@ namespace KIO { * This is the method used when handling drops (of anything else than URLs) * onto kdesktop and konqueror. * - * @param data the QMimeSource (e.g. a QDropEvent) + * @param data the TQMimeSource (e.g. a TQDropEvent) * @param destURL the URL of the directory where the data will be pasted. * The filename to use in that directory is prompted by this method. * @param dialogText the text to show in the dialog * @param widget parent widget to use for dialogs - * @param clipboard whether the QMimeSource comes from QClipboard. If you + * @param clipboard whether the TQMimeSource comes from QClipboard. If you * use pasteClipboard for that case, you never have to worry about this parameter. * * @see pasteClipboard() * * @since 3.5 */ - KIO_EXPORT CopyJob* pasteMimeSource( QMimeSource* data, const KURL& destURL, - const QString& dialogText, QWidget* widget, + KIO_EXPORT CopyJob* pasteMimeSource( TQMimeSource* data, const KURL& destURL, + const TQString& dialogText, TQWidget* widget, bool clipboard = false ); /** @@ -119,7 +119,7 @@ namespace KIO { * * @since 3.5 */ - KIO_EXPORT QString pasteActionText(); + KIO_EXPORT TQString pasteActionText(); } #endif diff --git a/kio/kio/pastedialog.cpp b/kio/kio/pastedialog.cpp index cf9995cb1..480eaaba8 100644 --- a/kio/kio/pastedialog.cpp +++ b/kio/kio/pastedialog.cpp @@ -22,22 +22,22 @@ #include <kmimetype.h> #include <klocale.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qapplication.h> -#include <qclipboard.h> - -KIO::PasteDialog::PasteDialog( const QString &caption, const QString &label, - const QString &value, const QStringList& items, - QWidget *parent, +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqapplication.h> +#include <tqclipboard.h> + +KIO::PasteDialog::PasteDialog( const TQString &caption, const TQString &label, + const TQString &value, const TQStringList& items, + TQWidget *parent, bool clipboard ) : KDialogBase( parent, 0 /*name*/, true, caption, Ok|Cancel, Ok, true ) { - QFrame *frame = makeMainWidget(); - QVBoxLayout *layout = new QVBoxLayout( frame, 0, spacingHint() ); + TQFrame *frame = makeMainWidget(); + TQVBoxLayout *layout = new TQVBoxLayout( frame, 0, spacingHint() ); - m_label = new QLabel( label, frame ); + m_label = new TQLabel( label, frame ); layout->addWidget( m_label ); m_lineEdit = new KLineEdit( value, frame ); @@ -46,24 +46,24 @@ KIO::PasteDialog::PasteDialog( const QString &caption, const QString &label, m_lineEdit->setFocus(); m_label->setBuddy( m_lineEdit ); - layout->addWidget( new QLabel( i18n( "Data format:" ), frame ) ); - m_comboBox = new QComboBox( frame ); + layout->addWidget( new TQLabel( i18n( "Data format:" ), frame ) ); + m_comboBox = new TQComboBox( frame ); m_comboBox->insertStringList( items ); layout->addWidget( m_comboBox ); layout->addStretch(); - //connect( m_lineEdit, SIGNAL( textChanged( const QString & ) ), - // SLOT( slotEditTextChanged( const QString & ) ) ); - //connect( this, SIGNAL( user1Clicked() ), m_lineEdit, SLOT( clear() ) ); + //connect( m_lineEdit, TQT_SIGNAL( textChanged( const TQString & ) ), + // TQT_SLOT( slotEditTextChanged( const TQString & ) ) ); + //connect( this, TQT_SIGNAL( user1Clicked() ), m_lineEdit, TQT_SLOT( clear() ) ); //slotEditTextChanged( value ); setMinimumWidth( 350 ); m_clipboardChanged = false; if ( clipboard ) - connect( QApplication::clipboard(), SIGNAL( dataChanged() ), - this, SLOT( slotClipboardDataChanged() ) ); + connect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), + this, TQT_SLOT( slotClipboardDataChanged() ) ); } void KIO::PasteDialog::slotClipboardDataChanged() @@ -71,7 +71,7 @@ void KIO::PasteDialog::slotClipboardDataChanged() m_clipboardChanged = true; } -QString KIO::PasteDialog::lineEditText() const +TQString KIO::PasteDialog::lineEditText() const { return m_lineEdit->text(); } diff --git a/kio/kio/pastedialog.h b/kio/kio/pastedialog.h index 0cf141d50..a025d532d 100644 --- a/kio/kio/pastedialog.h +++ b/kio/kio/pastedialog.h @@ -36,11 +36,11 @@ class PasteDialog : public KDialogBase { Q_OBJECT public: - PasteDialog( const QString &caption, const QString &label, - const QString &value, const QStringList& items, - QWidget *parent, bool clipboard ); + PasteDialog( const TQString &caption, const TQString &label, + const TQString &value, const TQStringList& items, + TQWidget *parent, bool clipboard ); - QString lineEditText() const; + TQString lineEditText() const; int comboItem() const; bool clipboardChanged() const { return m_clipboardChanged; } @@ -48,9 +48,9 @@ private slots: void slotClipboardDataChanged(); private: - QLabel* m_label; + TQLabel* m_label; KLineEdit* m_lineEdit; - QComboBox* m_comboBox; + TQComboBox* m_comboBox; bool m_clipboardChanged; class Private; diff --git a/kio/kio/posixacladdons.cpp b/kio/kio/posixacladdons.cpp index 7a7ebe2f7..bae51592b 100644 --- a/kio/kio/posixacladdons.cpp +++ b/kio/kio/posixacladdons.cpp @@ -24,13 +24,13 @@ #include <errno.h> #include <sys/stat.h> -#include <qptrlist.h> +#include <tqptrlist.h> -class SortedEntryList : public QPtrList<acl_entry_t> +class SortedEntryList : public TQPtrList<acl_entry_t> { protected: - int compareItems( QPtrCollection::Item i1, - QPtrCollection::Item i2 ) + int compareItems( TQPtrCollection::Item i1, + TQPtrCollection::Item i2 ) { acl_entry_t *e1 = static_cast<acl_entry_t*>( i1 ); acl_entry_t *e2 = static_cast<acl_entry_t*>( i2 ); diff --git a/kio/kio/posixacladdons.h b/kio/kio/posixacladdons.h index f77831f21..45c4af245 100644 --- a/kio/kio/posixacladdons.h +++ b/kio/kio/posixacladdons.h @@ -24,7 +24,7 @@ #include <config.h> #endif -#include <qglobal.h> +#include <tqglobal.h> #if defined(USE_POSIX_ACL) && !defined(HAVE_NON_POSIX_ACL_EXTENSIIONS) diff --git a/kio/kio/previewjob.cpp b/kio/kio/previewjob.cpp index ede141003..2a2ad91cc 100644 --- a/kio/kio/previewjob.cpp +++ b/kio/kio/previewjob.cpp @@ -34,11 +34,11 @@ #include <sys/shm.h> #endif -#include <qdir.h> -#include <qfile.h> -#include <qimage.h> -#include <qtimer.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqtimer.h> +#include <tqregexp.h> #include <kdatastream.h> // Do not remove, needed for correct bool serialization #include <kfileitem.h> @@ -69,20 +69,20 @@ struct KIO::PreviewJobPrivate STATE_CREATETHUMB // thumbnail:/ slave } state; KFileItemList initialItems; - const QStringList *enabledPlugins; + const TQStringList *enabledPlugins; // Our todo list :) - QValueList<PreviewItem> items; + TQValueList<PreviewItem> items; // The current item PreviewItem currentItem; // The modification time of that URL time_t tOrig; // Path to thumbnail cache for the current size - QString thumbPath; + TQString thumbPath; // Original URL of current item in TMS format // (file:///path/to/file instead of file:/path/to/file) - QString origName; + TQString origName; // Thumbnail file name for current item - QString thumbName; + TQString thumbName; // Size of thumbnail int width; int height; @@ -94,7 +94,7 @@ struct KIO::PreviewJobPrivate // Whether we should save the thumbnail bool bSave; // If the file to create a thumb for was a temp file, this is its name - QString tempName; + TQString tempName; // Over that, it's too much unsigned long maximumSize; // the size for the icon overlay @@ -110,14 +110,14 @@ struct KIO::PreviewJobPrivate bool deleteItems; bool succeeded; // Root of thumbnail cache - QString thumbRoot; + TQString thumbRoot; bool ignoreMaximumSize; - QTimer startPreviewTimer; + TQTimer startPreviewTimer; }; PreviewJob::PreviewJob( const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, - const QStringList *enabledPlugins, bool deleteItems ) + const TQStringList *enabledPlugins, bool deleteItems ) : KIO::Job( false /* no GUI */ ) { d = new PreviewJobPrivate; @@ -137,11 +137,11 @@ PreviewJob::PreviewJob( const KFileItemList &items, int width, int height, d->bSave = save && scale; d->succeeded = false; d->currentItem.item = 0; - d->thumbRoot = QDir::homeDirPath() + "/.thumbnails/"; + d->thumbRoot = TQDir::homeDirPath() + "/.thumbnails/"; d->ignoreMaximumSize = false; // Return to event loop first, determineNextFile() might delete this; - connect(&d->startPreviewTimer, SIGNAL(timeout()), SLOT(startPreview()) ); + connect(&d->startPreviewTimer, TQT_SIGNAL(timeout()), TQT_SLOT(startPreview()) ); d->startPreviewTimer.start(0, true); } @@ -160,13 +160,13 @@ void PreviewJob::startPreview() { // Load the list of plugins to determine which mimetypes are supported KTrader::OfferList plugins = KTrader::self()->query("ThumbCreator"); - QMap<QString, KService::Ptr> mimeMap; + TQMap<TQString, KService::Ptr> mimeMap; for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) if (!d->enabledPlugins || d->enabledPlugins->contains((*it)->desktopEntryName())) { - QStringList mimeTypes = (*it)->property("MimeTypes").toStringList(); - for (QStringList::ConstIterator mt = mimeTypes.begin(); mt != mimeTypes.end(); ++mt) + TQStringList mimeTypes = (*it)->property("MimeTypes").toStringList(); + for (TQStringList::ConstIterator mt = mimeTypes.begin(); mt != mimeTypes.end(); ++mt) mimeMap.insert(*mt, *it); } @@ -176,17 +176,17 @@ void PreviewJob::startPreview() { PreviewItem item; item.item = it.current(); - QMap<QString, KService::Ptr>::ConstIterator plugin = mimeMap.find(it.current()->mimetype()); + TQMap<TQString, KService::Ptr>::ConstIterator plugin = mimeMap.find(it.current()->mimetype()); if (plugin == mimeMap.end() && it.current()->mimetype() != "application/x-desktop") { - QString mimeType = it.current()->mimetype(); - plugin = mimeMap.find(mimeType.replace(QRegExp("/.*"), "/*")); + TQString mimeType = it.current()->mimetype(); + plugin = mimeMap.find(mimeType.replace(TQRegExp("/.*"), "/*")); if (plugin == mimeMap.end()) { // check mime type inheritance KMimeType::Ptr mimeInfo = KMimeType::mimeType(it.current()->mimetype()); - QString parentMimeType = mimeInfo->parentMimeType(); + TQString parentMimeType = mimeInfo->parentMimeType(); while (!parentMimeType.isEmpty()) { plugin = mimeMap.find(parentMimeType); @@ -203,8 +203,8 @@ void PreviewJob::startPreview() { // check X-KDE-Text property KMimeType::Ptr mimeInfo = KMimeType::mimeType(it.current()->mimetype()); - QVariant textProperty = mimeInfo->property("X-KDE-text"); - if (textProperty.isValid() && textProperty.type() == QVariant::Bool) + TQVariant textProperty = mimeInfo->property("X-KDE-text"); + if (textProperty.isValid() && textProperty.type() == TQVariant::Bool) { if (textProperty.toBool()) { @@ -255,7 +255,7 @@ void PreviewJob::startPreview() void PreviewJob::removeItem( const KFileItem *item ) { - for (QValueList<PreviewItem>::Iterator it = d->items.begin(); it != d->items.end(); ++it) + for (TQValueList<PreviewItem>::Iterator it = d->items.begin(); it != d->items.end(); ++it) if ((*it).item == item) { d->items.remove(it); @@ -372,8 +372,8 @@ void PreviewJob::slotResult( KIO::Job *job ) { if (!d->tempName.isEmpty()) { - QFile::remove(d->tempName); - d->tempName = QString::null; + TQFile::remove(d->tempName); + d->tempName = TQString::null; } determineNextFile(); return; @@ -388,7 +388,7 @@ bool PreviewJob::statResultThumbnail() KURL url = d->currentItem.item->url(); // Don't include the password if any - url.setPass(QString::null); + url.setPass(TQString::null); // The TMS defines local files as file:///path/to/file instead of KDE's // way (file:/path/to/file) #ifdef KURL_TRIPLE_SLASH_FILE_PROT @@ -398,10 +398,10 @@ bool PreviewJob::statResultThumbnail() else d->origName = url.url(); #endif - KMD5 md5( QFile::encodeName( d->origName ) ); - d->thumbName = QFile::encodeName( md5.hexDigest() ) + ".png"; + KMD5 md5( TQFile::encodeName( d->origName ) ); + d->thumbName = TQFile::encodeName( md5.hexDigest() ) + ".png"; - QImage thumb; + TQImage thumb; if ( !thumb.load( d->thumbPath + d->thumbName ) ) return false; if ( thumb.text( "Thumb::URI", 0 ) != d->origName || @@ -419,7 +419,7 @@ void PreviewJob::getOrCreateThumbnail() { // We still need to load the orig file ! (This is getting tedious) :) const KFileItem* item = d->currentItem.item; - const QString localPath = item->localPath(); + const TQString localPath = item->localPath(); if ( !localPath.isEmpty() ) createThumbnail( localPath ); else @@ -436,8 +436,8 @@ void PreviewJob::getOrCreateThumbnail() } } -// KDE 4: Make it const QString & -void PreviewJob::createThumbnail( QString pixPath ) +// KDE 4: Make it const TQString & +void PreviewJob::createThumbnail( TQString pixPath ) { d->state = PreviewJobPrivate::STATE_CREATETHUMB; KURL thumbURL; @@ -445,13 +445,13 @@ void PreviewJob::createThumbnail( QString pixPath ) thumbURL.setPath(pixPath); KIO::TransferJob *job = KIO::get(thumbURL, false, false); addSubjob(job); - connect(job, SIGNAL(data(KIO::Job *, const QByteArray &)), SLOT(slotThumbData(KIO::Job *, const QByteArray &))); + connect(job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), TQT_SLOT(slotThumbData(KIO::Job *, const TQByteArray &))); bool save = d->bSave && d->currentItem.plugin->property("CacheThumbnail").toBool(); job->addMetaData("mimeType", d->currentItem.item->mimetype()); - job->addMetaData("width", QString().setNum(save ? d->cacheWidth : d->width)); - job->addMetaData("height", QString().setNum(save ? d->cacheHeight : d->height)); - job->addMetaData("iconSize", QString().setNum(save ? 64 : d->iconSize)); - job->addMetaData("iconAlpha", QString().setNum(d->iconAlpha)); + job->addMetaData("width", TQString().setNum(save ? d->cacheWidth : d->width)); + job->addMetaData("height", TQString().setNum(save ? d->cacheHeight : d->height)); + job->addMetaData("iconSize", TQString().setNum(save ? 64 : d->iconSize)); + job->addMetaData("iconAlpha", TQString().setNum(d->iconAlpha)); job->addMetaData("plugin", d->currentItem.plugin->library()); #ifdef Q_OS_UNIX if (d->shmid == -1) @@ -475,25 +475,25 @@ void PreviewJob::createThumbnail( QString pixPath ) d->shmaddr = 0; } if (d->shmid != -1) - job->addMetaData("shmid", QString().setNum(d->shmid)); + job->addMetaData("shmid", TQString().setNum(d->shmid)); #endif } -void PreviewJob::slotThumbData(KIO::Job *, const QByteArray &data) +void PreviewJob::slotThumbData(KIO::Job *, const TQByteArray &data) { bool save = d->bSave && d->currentItem.plugin->property("CacheThumbnail").toBool() && (d->currentItem.item->url().protocol() != "file" || !d->currentItem.item->url().directory( false ).startsWith(d->thumbRoot)); - QImage thumb; + TQImage thumb; #ifdef Q_OS_UNIX if (d->shmaddr) { - QDataStream str(data, IO_ReadOnly); + TQDataStream str(data, IO_ReadOnly); int width, height, depth; bool alpha; str >> width >> height >> depth >> alpha; - thumb = QImage(d->shmaddr, width, height, depth, 0, 0, QImage::IgnoreEndian); + thumb = TQImage(d->shmaddr, width, height, depth, 0, 0, TQImage::IgnoreEndian); thumb.setAlphaBuffer(alpha); } else @@ -503,7 +503,7 @@ void PreviewJob::slotThumbData(KIO::Job *, const QByteArray &data) if (save) { thumb.setText("Thumb::URI", 0, d->origName); - thumb.setText("Thumb::MTime", 0, QString::number(d->tOrig)); + thumb.setText("Thumb::MTime", 0, TQString::number(d->tOrig)); thumb.setText("Thumb::Size", 0, number(d->currentItem.item->size())); thumb.setText("Thumb::Mimetype", 0, d->currentItem.item->mimetype()); thumb.setText("Software", 0, "KDE Thumbnail Generator"); @@ -511,16 +511,16 @@ void PreviewJob::slotThumbData(KIO::Job *, const QByteArray &data) if (temp.status() == 0) //Only try to write out the thumbnail if we { //actually created the temp file. thumb.save(temp.name(), "PNG"); - rename(QFile::encodeName(temp.name()), QFile::encodeName(d->thumbPath + d->thumbName)); + rename(TQFile::encodeName(temp.name()), TQFile::encodeName(d->thumbPath + d->thumbName)); } } emitPreview( thumb ); d->succeeded = true; } -void PreviewJob::emitPreview(const QImage &thumb) +void PreviewJob::emitPreview(const TQImage &thumb) { - QPixmap pix; + TQPixmap pix; if (thumb.width() > d->width || thumb.height() > d->height) { double imgRatio = (double)thumb.height() / (double)thumb.width(); @@ -541,9 +541,9 @@ void PreviewJob::emitFailed(const KFileItem *item) emit failed(item); } -QStringList PreviewJob::availablePlugins() +TQStringList PreviewJob::availablePlugins() { - QStringList result; + TQStringList result; KTrader::OfferList plugins = KTrader::self()->query("ThumbCreator"); for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) if (!result.contains((*it)->desktopEntryName())) @@ -551,9 +551,9 @@ QStringList PreviewJob::availablePlugins() return result; } -QStringList PreviewJob::supportedMimeTypes() +TQStringList PreviewJob::supportedMimeTypes() { - QStringList result; + TQStringList result; KTrader::OfferList plugins = KTrader::self()->query("ThumbCreator"); for (KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it) result += (*it)->property("MimeTypes").toStringList(); @@ -568,7 +568,7 @@ void PreviewJob::kill( bool quietly ) PreviewJob *KIO::filePreview( const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, - const QStringList *enabledPlugins ) + const TQStringList *enabledPlugins ) { return new PreviewJob(items, width, height, iconSize, iconAlpha, scale, save, enabledPlugins); @@ -576,7 +576,7 @@ PreviewJob *KIO::filePreview( const KFileItemList &items, int width, int height, PreviewJob *KIO::filePreview( const KURL::List &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, - const QStringList *enabledPlugins ) + const TQStringList *enabledPlugins ) { KFileItemList fileItems; for (KURL::List::ConstIterator it = items.begin(); it != items.end(); ++it) diff --git a/kio/kio/previewjob.h b/kio/kio/previewjob.h index d2e976b0f..2a59083c4 100644 --- a/kio/kio/previewjob.h +++ b/kio/kio/previewjob.h @@ -56,7 +56,7 @@ namespace KIO { */ PreviewJob( const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, - const QStringList *enabledPlugins, bool deleteItems = false ); + const TQStringList *enabledPlugins, bool deleteItems = false ); virtual ~PreviewJob(); /** @@ -81,14 +81,14 @@ namespace KIO { * no .desktop). * @return the list of plugins */ - static QStringList availablePlugins(); + static TQStringList availablePlugins(); /** * Returns a list of all supported MIME types. The list can * contain entries like text/ * (without the space). * @return the list of mime types */ - static QStringList supportedMimeTypes(); + static TQStringList supportedMimeTypes(); /** * Reimplemented for internal reasons @@ -102,7 +102,7 @@ namespace KIO { * @param item the file of the preview * @param preview the preview image */ - void gotPreview( const KFileItem *item, const QPixmap &preview ); + void gotPreview( const KFileItem *item, const TQPixmap &preview ); /** * Emitted when a thumbnail for @p item could not be created, * either because a ThumbCreator for its MIME type does not @@ -114,18 +114,18 @@ namespace KIO { protected: void getOrCreateThumbnail(); bool statResultThumbnail(); - void createThumbnail( QString ); + void createThumbnail( TQString ); protected slots: virtual void slotResult( KIO::Job *job ); private slots: void startPreview(); - void slotThumbData(KIO::Job *, const QByteArray &); + void slotThumbData(KIO::Job *, const TQByteArray &); private: void determineNextFile(); - void emitPreview(const QImage &thumb); + void emitPreview(const TQImage &thumb); void emitFailed(const KFileItem *item = 0); protected: @@ -154,7 +154,7 @@ namespace KIO { * @return the new PreviewJob * @see PreviewJob::availablePlugins() */ - KIO_EXPORT PreviewJob *filePreview( const KFileItemList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = 0 ); + KIO_EXPORT PreviewJob *filePreview( const KFileItemList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const TQStringList *enabledPlugins = 0 ); /** * Creates a PreviewJob to generate or retrieve a preview image @@ -176,7 +176,7 @@ namespace KIO { * @return the new PreviewJob * @see PreviewJob::availablePlugins() */ - KIO_EXPORT PreviewJob *filePreview( const KURL::List &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = 0 ); + KIO_EXPORT PreviewJob *filePreview( const KURL::List &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const TQStringList *enabledPlugins = 0 ); } #endif diff --git a/kio/kio/progressbase.cpp b/kio/kio/progressbase.cpp index 6d49ac69a..f01c00a7a 100644 --- a/kio/kio/progressbase.cpp +++ b/kio/kio/progressbase.cpp @@ -21,8 +21,8 @@ namespace KIO { -ProgressBase::ProgressBase( QWidget *parent ) - : QWidget( parent ) +ProgressBase::ProgressBase( TQWidget *parent ) + : TQWidget( parent ) { m_pJob = 0; @@ -37,14 +37,14 @@ ProgressBase::ProgressBase( QWidget *parent ) void ProgressBase::setJob( KIO::Job *job ) { // first connect all slots - connect( job, SIGNAL( percent( KIO::Job*, unsigned long ) ), - SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( percent( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); - connect( job, SIGNAL( canceled( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( canceled( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); // then assign job m_pJob = job; @@ -54,37 +54,37 @@ void ProgressBase::setJob( KIO::Job *job ) void ProgressBase::setJob( KIO::CopyJob *job ) { // first connect all slots - connect( job, SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), - SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( job, SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), - SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), - SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); - - connect( job, SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), - SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( job, SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), - SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), - SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); - - connect( job, SIGNAL( speed( KIO::Job*, unsigned long ) ), - SLOT( slotSpeed( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( percent( KIO::Job*, unsigned long ) ), - SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); - - connect( job, SIGNAL( copying( KIO::Job*, const KURL& , const KURL& ) ), - SLOT( slotCopying( KIO::Job*, const KURL&, const KURL& ) ) ); - connect( job, SIGNAL( moving( KIO::Job*, const KURL& , const KURL& ) ), - SLOT( slotMoving( KIO::Job*, const KURL&, const KURL& ) ) ); - connect( job, SIGNAL( creatingDir( KIO::Job*, const KURL& ) ), - SLOT( slotCreatingDir( KIO::Job*, const KURL& ) ) ); - - connect( job, SIGNAL( result( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); - - connect( job, SIGNAL( canceled( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), + TQT_SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( job, TQT_SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); + + connect( job, TQT_SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), + TQT_SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( job, TQT_SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); + + connect( job, TQT_SIGNAL( speed( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotSpeed( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( percent( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); + + connect( job, TQT_SIGNAL( copying( KIO::Job*, const KURL& , const KURL& ) ), + TQT_SLOT( slotCopying( KIO::Job*, const KURL&, const KURL& ) ) ); + connect( job, TQT_SIGNAL( moving( KIO::Job*, const KURL& , const KURL& ) ), + TQT_SLOT( slotMoving( KIO::Job*, const KURL&, const KURL& ) ) ); + connect( job, TQT_SIGNAL( creatingDir( KIO::Job*, const KURL& ) ), + TQT_SLOT( slotCreatingDir( KIO::Job*, const KURL& ) ) ); + + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); + + connect( job, TQT_SIGNAL( canceled( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); // then assign job m_pJob = job; @@ -94,40 +94,40 @@ void ProgressBase::setJob( KIO::CopyJob *job ) void ProgressBase::setJob( KIO::DeleteJob *job ) { // first connect all slots - connect( job, SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), - SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( job, SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), - SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), - SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); - - connect( job, SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), - SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); - connect( job, SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), - SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), - SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); - - connect( job, SIGNAL( speed( KIO::Job*, unsigned long ) ), - SLOT( slotSpeed( KIO::Job*, unsigned long ) ) ); - connect( job, SIGNAL( percent( KIO::Job*, unsigned long ) ), - SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); - - connect( job, SIGNAL( deleting( KIO::Job*, const KURL& ) ), - SLOT( slotDeleting( KIO::Job*, const KURL& ) ) ); - - connect( job, SIGNAL( result( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); - - connect( job, SIGNAL( canceled( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( totalSize( KIO::Job*, KIO::filesize_t ) ), + TQT_SLOT( slotTotalSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( job, TQT_SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); + + connect( job, TQT_SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), + TQT_SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); + connect( job, TQT_SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); + + connect( job, TQT_SIGNAL( speed( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotSpeed( KIO::Job*, unsigned long ) ) ); + connect( job, TQT_SIGNAL( percent( KIO::Job*, unsigned long ) ), + TQT_SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); + + connect( job, TQT_SIGNAL( deleting( KIO::Job*, const KURL& ) ), + TQT_SLOT( slotDeleting( KIO::Job*, const KURL& ) ) ); + + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); + + connect( job, TQT_SIGNAL( canceled( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); // then assign job m_pJob = job; } -void ProgressBase::closeEvent( QCloseEvent* ) { +void ProgressBase::closeEvent( TQCloseEvent* ) { // kill job when desired if ( m_bStopOnClose ) { slotStop(); diff --git a/kio/kio/progressbase.h b/kio/kio/progressbase.h index d46b1d1ba..d9e3d8f96 100644 --- a/kio/kio/progressbase.h +++ b/kio/kio/progressbase.h @@ -19,7 +19,7 @@ #define __progressbase_h__ -#include <qwidget.h> +#include <tqwidget.h> #include <kio/global.h> @@ -67,7 +67,7 @@ namespace KIO * @short Base class for IO progress dialogs. * @author Matej Koss <koss@miesto.sk> */ -class KIO_EXPORT ProgressBase : public QWidget { +class KIO_EXPORT ProgressBase : public TQWidget { Q_OBJECT @@ -77,7 +77,7 @@ public: * Creates a new progress dialog. * @param parent the parent of this dialog window, or 0 */ - ProgressBase( QWidget *parent ); + ProgressBase( TQWidget *parent ); ~ProgressBase() {} /** @@ -251,7 +251,7 @@ protected slots: protected: - virtual void closeEvent( QCloseEvent * ); + virtual void closeEvent( TQCloseEvent * ); KIO::Job* m_pJob; diff --git a/kio/kio/renamedlg.cpp b/kio/kio/renamedlg.cpp index 0c9cf8a18..fe830b2e3 100644 --- a/kio/kio/renamedlg.cpp +++ b/kio/kio/renamedlg.cpp @@ -24,11 +24,11 @@ #include <stdio.h> #include <assert.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qdir.h> +#include <tqfileinfo.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqdir.h> #include <kmessagebox.h> #include <kpushbutton.h> @@ -64,25 +64,25 @@ class RenameDlg::RenameDlgPrivate m_pLineEdit = 0; } KPushButton *bCancel; - QPushButton *bRename; - QPushButton *bSkip; - QPushButton *bAutoSkip; - QPushButton *bOverwrite; - QPushButton *bOverwriteAll; - QPushButton *bResume; - QPushButton *bResumeAll; - QPushButton *bSuggestNewName; - QLineEdit* m_pLineEdit; + TQPushButton *bRename; + TQPushButton *bSkip; + TQPushButton *bAutoSkip; + TQPushButton *bOverwrite; + TQPushButton *bOverwriteAll; + TQPushButton *bResume; + TQPushButton *bResumeAll; + TQPushButton *bSuggestNewName; + TQLineEdit* m_pLineEdit; KURL src; KURL dest; - QString mimeSrc; - QString mimeDest; + TQString mimeSrc; + TQString mimeDest; bool modal; bool plugin; }; -RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, - const QString &_src, const QString &_dest, +RenameDlg::RenameDlg(TQWidget *parent, const TQString & _caption, + const TQString &_src, const TQString &_dest, RenameDlg_Mode _mode, KIO::filesize_t sizeSrc, KIO::filesize_t sizeDest, @@ -91,7 +91,7 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, time_t mtimeSrc, time_t mtimeDest, bool _modal) - : QDialog ( parent, "KIO::RenameDialog" , _modal ) + : TQDialog ( parent, "KIO::RenameDialog" , _modal ) { d = new RenameDlgPrivate( ); d->modal = _modal; @@ -113,52 +113,52 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, setCaption( _caption ); d->bCancel = new KPushButton( KStdGuiItem::cancel(), this ); - connect(d->bCancel, SIGNAL(clicked()), this, SLOT(b0Pressed())); + connect(d->bCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(b0Pressed())); if ( ! (_mode & M_NORENAME ) ) { - d->bRename = new QPushButton( i18n( "&Rename" ), this ); + d->bRename = new TQPushButton( i18n( "&Rename" ), this ); d->bRename->setEnabled(false); - d->bSuggestNewName = new QPushButton( i18n( "Suggest New &Name" ), this ); - connect(d->bSuggestNewName, SIGNAL(clicked()), this, SLOT(b8Pressed())); - connect(d->bRename, SIGNAL(clicked()), this, SLOT(b1Pressed())); + d->bSuggestNewName = new TQPushButton( i18n( "Suggest New &Name" ), this ); + connect(d->bSuggestNewName, TQT_SIGNAL(clicked()), this, TQT_SLOT(b8Pressed())); + connect(d->bRename, TQT_SIGNAL(clicked()), this, TQT_SLOT(b1Pressed())); } if ( ( _mode & M_MULTI ) && ( _mode & M_SKIP ) ) { - d->bSkip = new QPushButton( i18n( "&Skip" ), this ); - connect(d->bSkip, SIGNAL(clicked()), this, SLOT(b2Pressed())); + d->bSkip = new TQPushButton( i18n( "&Skip" ), this ); + connect(d->bSkip, TQT_SIGNAL(clicked()), this, TQT_SLOT(b2Pressed())); - d->bAutoSkip = new QPushButton( i18n( "&Auto Skip" ), this ); - connect(d->bAutoSkip, SIGNAL(clicked()), this, SLOT(b3Pressed())); + d->bAutoSkip = new TQPushButton( i18n( "&Auto Skip" ), this ); + connect(d->bAutoSkip, TQT_SIGNAL(clicked()), this, TQT_SLOT(b3Pressed())); } if ( _mode & M_OVERWRITE ) { - d->bOverwrite = new QPushButton( i18n( "&Overwrite" ), this ); - connect(d->bOverwrite, SIGNAL(clicked()), this, SLOT(b4Pressed())); + d->bOverwrite = new TQPushButton( i18n( "&Overwrite" ), this ); + connect(d->bOverwrite, TQT_SIGNAL(clicked()), this, TQT_SLOT(b4Pressed())); if ( _mode & M_MULTI ) { - d->bOverwriteAll = new QPushButton( i18n( "O&verwrite All" ), this ); - connect(d->bOverwriteAll, SIGNAL(clicked()), this, SLOT(b5Pressed())); + d->bOverwriteAll = new TQPushButton( i18n( "O&verwrite All" ), this ); + connect(d->bOverwriteAll, TQT_SIGNAL(clicked()), this, TQT_SLOT(b5Pressed())); } } if ( _mode & M_RESUME ) { - d->bResume = new QPushButton( i18n( "&Resume" ), this ); - connect(d->bResume, SIGNAL(clicked()), this, SLOT(b6Pressed())); + d->bResume = new TQPushButton( i18n( "&Resume" ), this ); + connect(d->bResume, TQT_SIGNAL(clicked()), this, TQT_SLOT(b6Pressed())); if ( _mode & M_MULTI ) { - d->bResumeAll = new QPushButton( i18n( "R&esume All" ), this ); - connect(d->bResumeAll, SIGNAL(clicked()), this, SLOT(b7Pressed())); + d->bResumeAll = new TQPushButton( i18n( "R&esume All" ), this ); + connect(d->bResumeAll, TQT_SIGNAL(clicked()), this, TQT_SLOT(b7Pressed())); } } - QVBoxLayout* pLayout = new QVBoxLayout( this, KDialog::marginHint(), + TQVBoxLayout* pLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); pLayout->addStrut( 360 ); // makes dlg at least that wide // User tries to overwrite a file with itself ? if ( _mode & M_OVERWRITE_ITSELF ) { - QLabel *lb = new QLabel( i18n( "This action would overwrite '%1' with itself.\n" + TQLabel *lb = new TQLabel( i18n( "This action would overwrite '%1' with itself.\n" "Please enter a new file name:" ).arg( KStringHandler::csqueeze( d->src.pathOrURL(),100 ) ), this ); d->bRename->setText(i18n("C&ontinue")); pLayout->addWidget( lb ); @@ -180,7 +180,7 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, KTrader::OfferList::ConstIterator it = plugin_offers.begin(); KTrader::OfferList::ConstIterator end = plugin_offers.end(); for( ; it != end; ++it ){ - QString libName = (*it)->library(); + TQString libName = (*it)->library(); if( libName.isEmpty() ){ kdDebug(7024) << "lib is empty" << endl; continue; @@ -194,7 +194,7 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, lib->unload(); continue; } - QObject *obj = factory->create( this, (*it)->name().latin1() ); + TQObject *obj = factory->create( this, (*it)->name().latin1() ); if(!obj) { lib->unload(); continue; @@ -221,13 +221,13 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, if( !d->plugin ){ // No plugin found, build default dialog - QGridLayout * gridLayout = new QGridLayout( 0L, 9, 2, KDialog::marginHint(), + TQGridLayout * gridLayout = new TQGridLayout( 0L, 9, 2, KDialog::marginHint(), KDialog::spacingHint() ); pLayout->addLayout(gridLayout); gridLayout->setColStretch(0,0); gridLayout->setColStretch(1,10); - QString sentence1; + TQString sentence1; if (mtimeDest < mtimeSrc) sentence1 = i18n("An older item named '%1' already exists."); else if (mtimeDest == mtimeSrc) @@ -235,32 +235,32 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, else sentence1 = i18n("A newer item named '%1' already exists."); - QLabel * lb1 = new KSqueezedTextLabel( sentence1.arg(d->dest.pathOrURL() ), this ); + TQLabel * lb1 = new KSqueezedTextLabel( sentence1.arg(d->dest.pathOrURL() ), this ); gridLayout->addMultiCellWidget( lb1, 0, 0, 0, 1 ); // takes the complete first line - lb1 = new QLabel( this ); + lb1 = new TQLabel( this ); lb1->setPixmap( KMimeType::pixmapForURL( d->dest ) ); gridLayout->addMultiCellWidget( lb1, 1, 3, 0, 0 ); // takes the first column on rows 1-3 int row = 1; if ( sizeDest != (KIO::filesize_t)-1 ) { - QLabel * lb = new QLabel( i18n("size %1").arg( KIO::convertSize(sizeDest) ), this ); + TQLabel * lb = new TQLabel( i18n("size %1").arg( KIO::convertSize(sizeDest) ), this ); gridLayout->addWidget( lb, row, 1 ); row++; } if ( ctimeDest != (time_t)-1 ) { - QDateTime dctime; dctime.setTime_t( ctimeDest ); - QLabel * lb = new QLabel( i18n("created on %1").arg( KGlobal::locale()->formatDateTime(dctime) ), this ); + TQDateTime dctime; dctime.setTime_t( ctimeDest ); + TQLabel * lb = new TQLabel( i18n("created on %1").arg( KGlobal::locale()->formatDateTime(dctime) ), this ); gridLayout->addWidget( lb, row, 1 ); row++; } if ( mtimeDest != (time_t)-1 ) { - QDateTime dmtime; dmtime.setTime_t( mtimeDest ); - QLabel * lb = new QLabel( i18n("modified on %1").arg( KGlobal::locale()->formatDateTime(dmtime) ), this ); + TQDateTime dmtime; dmtime.setTime_t( mtimeDest ); + TQLabel * lb = new TQLabel( i18n("modified on %1").arg( KGlobal::locale()->formatDateTime(dmtime) ), this ); gridLayout->addWidget( lb, row, 1 ); row++; } @@ -270,10 +270,10 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, // rows 1 to 3 are the details (size/ctime/mtime), row 4 is empty gridLayout->addRowSpacing( 4, 20 ); - QLabel * lb2 = new KSqueezedTextLabel( i18n("The source file is '%1'").arg(d->src.pathOrURL()), this ); + TQLabel * lb2 = new KSqueezedTextLabel( i18n("The source file is '%1'").arg(d->src.pathOrURL()), this ); gridLayout->addMultiCellWidget( lb2, 5, 5, 0, 1 ); // takes the complete first line - lb2 = new QLabel( this ); + lb2 = new TQLabel( this ); lb2->setPixmap( KMimeType::pixmapForURL( d->src ) ); gridLayout->addMultiCellWidget( lb2, 6, 8, 0, 0 ); // takes the first column on rows 6-8 @@ -281,21 +281,21 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, if ( sizeSrc != (KIO::filesize_t)-1 ) { - QLabel * lb = new QLabel( i18n("size %1").arg( KIO::convertSize(sizeSrc) ), this ); + TQLabel * lb = new TQLabel( i18n("size %1").arg( KIO::convertSize(sizeSrc) ), this ); gridLayout->addWidget( lb, row, 1 ); row++; } if ( ctimeSrc != (time_t)-1 ) { - QDateTime dctime; dctime.setTime_t( ctimeSrc ); - QLabel * lb = new QLabel( i18n("created on %1").arg( KGlobal::locale()->formatDateTime(dctime) ), this ); + TQDateTime dctime; dctime.setTime_t( ctimeSrc ); + TQLabel * lb = new TQLabel( i18n("created on %1").arg( KGlobal::locale()->formatDateTime(dctime) ), this ); gridLayout->addWidget( lb, row, 1 ); row++; } if ( mtimeSrc != (time_t)-1 ) { - QDateTime dmtime; dmtime.setTime_t( mtimeSrc ); - QLabel * lb = new QLabel( i18n("modified on %1").arg( KGlobal::locale()->formatDateTime(dmtime) ), this ); + TQDateTime dmtime; dmtime.setTime_t( mtimeSrc ); + TQLabel * lb = new TQLabel( i18n("modified on %1").arg( KGlobal::locale()->formatDateTime(dmtime) ), this ); gridLayout->addWidget( lb, row, 1 ); row++; } @@ -306,7 +306,7 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, { // This is the case where we don't want to allow overwriting, the existing // file must be preserved (e.g. when renaming). - QString sentence1; + TQString sentence1; if (mtimeDest < mtimeSrc) sentence1 = i18n("An older item named '%1' already exists."); else if (mtimeDest == mtimeSrc) @@ -314,19 +314,19 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, else sentence1 = i18n("A newer item named '%1' already exists."); - QLabel *lb = new KSqueezedTextLabel( sentence1.arg(d->dest.pathOrURL()), this ); + TQLabel *lb = new KSqueezedTextLabel( sentence1.arg(d->dest.pathOrURL()), this ); pLayout->addWidget(lb); } - QHBoxLayout* layout2 = new QHBoxLayout(); + TQHBoxLayout* layout2 = new TQHBoxLayout(); pLayout->addLayout( layout2 ); - d->m_pLineEdit = new QLineEdit( this ); + d->m_pLineEdit = new TQLineEdit( this ); layout2->addWidget( d->m_pLineEdit ); - QString fileName = d->dest.fileName(); + TQString fileName = d->dest.fileName(); d->m_pLineEdit->setText( KIO::decodeFileName( fileName ) ); if ( d->bRename || d->bOverwrite ) - connect(d->m_pLineEdit, SIGNAL(textChanged(const QString &)), - SLOT(enableRenameButton(const QString &))); + connect(d->m_pLineEdit, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(enableRenameButton(const TQString &))); if ( d->bSuggestNewName ) { layout2->addWidget( d->bSuggestNewName ); @@ -336,7 +336,7 @@ RenameDlg::RenameDlg(QWidget *parent, const QString & _caption, KSeparator* separator = new KSeparator( this ); pLayout->addWidget( separator ); - QHBoxLayout* layout = new QHBoxLayout(); + TQHBoxLayout* layout = new TQHBoxLayout(); pLayout->addLayout( layout ); layout->addStretch(1); @@ -389,7 +389,7 @@ RenameDlg::~RenameDlg() // no need to delete Pushbuttons,... qt will do this } -void RenameDlg::enableRenameButton(const QString &newDest) +void RenameDlg::enableRenameButton(const TQString &newDest) { if ( newDest != KIO::decodeFileName( d->dest.fileName() ) && !newDest.isEmpty() ) { @@ -409,7 +409,7 @@ void RenameDlg::enableRenameButton(const QString &newDest) KURL RenameDlg::newDestURL() { KURL newDest( d->dest ); - QString fileName = d->m_pLineEdit->text(); + TQString fileName = d->m_pLineEdit->text(); newDest.setFileName( KIO::encodeFileName( fileName ) ); return newDest; } @@ -435,10 +435,10 @@ void RenameDlg::b1Pressed() done( 1 ); } -QString RenameDlg::suggestName(const KURL& baseURL, const QString& oldName) +TQString RenameDlg::suggestName(const KURL& baseURL, const TQString& oldName) { - QString dotSuffix, suggestedName; - QString basename = oldName; + TQString dotSuffix, suggestedName; + TQString basename = oldName; int index = basename.find( '.' ); if ( index != -1 ) { @@ -448,7 +448,7 @@ QString RenameDlg::suggestName(const KURL& baseURL, const QString& oldName) int pos = basename.findRev( '_' ); if(pos != -1 ){ - QString tmp = basename.mid( pos+1 ); + TQString tmp = basename.mid( pos+1 ); bool ok; int number = tmp.toInt( &ok ); if ( !ok ) {// ok there is no number @@ -456,7 +456,7 @@ QString RenameDlg::suggestName(const KURL& baseURL, const QString& oldName) } else { // yes there's already a number behind the _ so increment it by one - basename.replace( pos+1, tmp.length(), QString::number(number+1) ); + basename.replace( pos+1, tmp.length(), TQString::number(number+1) ); suggestedName = basename + dotSuffix; } } @@ -468,7 +468,7 @@ QString RenameDlg::suggestName(const KURL& baseURL, const QString& oldName) // TODO: network transparency. However, using NetAccess from a modal dialog // could be a problem, no? (given that it uses a modal widget itself....) if ( baseURL.isLocalFile() ) - exists = QFileInfo( baseURL.path(+1) + suggestedName ).exists(); + exists = TQFileInfo( baseURL.path(+1) + suggestedName ).exists(); if ( !exists ) return suggestedName; @@ -519,11 +519,11 @@ void RenameDlg::b7Pressed() done( 7 ); } -static QString mime( const KURL& src ) +static TQString mime( const KURL& src ) { KMimeType::Ptr type = KMimeType::findByURL( src ); //if( type->name() == KMimeType::defaultMimeType() ){ // ok no mimetype - // QString ty = KIO::NetAccess::mimetype(d->src ); + // TQString ty = KIO::NetAccess::mimetype(d->src ); // return ty; return type->name(); } @@ -544,10 +544,10 @@ void RenameDlg::pluginHandling() } -RenameDlg_Result KIO::open_RenameDlg( const QString & _caption, - const QString & _src, const QString & _dest, +RenameDlg_Result KIO::open_RenameDlg( const TQString & _caption, + const TQString & _src, const TQString & _dest, RenameDlg_Mode _mode, - QString& _new, + TQString& _new, KIO::filesize_t sizeSrc, KIO::filesize_t sizeDest, time_t ctimeSrc, diff --git a/kio/kio/renamedlg.h b/kio/kio/renamedlg.h index 513090cc4..a1b5d6bb2 100644 --- a/kio/kio/renamedlg.h +++ b/kio/kio/renamedlg.h @@ -23,8 +23,8 @@ #define __kio_rename_dlg__ #include <kurl.h> -#include <qdialog.h> -#include <qstring.h> +#include <tqdialog.h> +#include <tqstring.h> #include <sys/types.h> #include <kio/global.h> @@ -65,9 +65,9 @@ public: * @param modal set to true for a modal dialog * @see RenameDlg_Mode */ - RenameDlg( QWidget *parent, const QString & caption, + RenameDlg( TQWidget *parent, const TQString & caption, // KDE4: make those KURLs, and use pathOrURL() internally. - const QString & src, const QString & dest, + const TQString & src, const TQString & dest, RenameDlg_Mode mode, KIO::filesize_t sizeSrc = (KIO::filesize_t) -1, KIO::filesize_t sizeDest = (KIO::filesize_t) -1, @@ -91,7 +91,7 @@ public: * The suggested file name is of the form foo_1 foo_2 etc. * @since 3.4 */ - static QString suggestName(const KURL& baseURL, const QString& oldName); + static TQString suggestName(const KURL& baseURL, const TQString& oldName); public slots: /// KDE4: rename to cancelPressed(), renamePressed() etc. @@ -106,7 +106,7 @@ public slots: void b8Pressed(); protected slots: - void enableRenameButton(const QString &); + void enableRenameButton(const TQString &); private: class RenameDlgPrivate; RenameDlgPrivate *d; @@ -135,10 +135,10 @@ private: * @param mtimeDest modification time of destination file * @return the result */ -KIO_EXPORT RenameDlg_Result open_RenameDlg( const QString & caption, +KIO_EXPORT RenameDlg_Result open_RenameDlg( const TQString & caption, // KDE4: make those KURLs - const QString& src, const QString & dest, - RenameDlg_Mode mode, QString& newDestPath, + const TQString& src, const TQString & dest, + RenameDlg_Mode mode, TQString& newDestPath, KIO::filesize_t sizeSrc = (KIO::filesize_t) -1, KIO::filesize_t sizeDest = (KIO::filesize_t) -1, time_t ctimeSrc = (time_t) -1, diff --git a/kio/kio/renamedlgplugin.h b/kio/kio/renamedlgplugin.h index e7bda98f2..39319fdb8 100644 --- a/kio/kio/renamedlgplugin.h +++ b/kio/kio/renamedlgplugin.h @@ -21,10 +21,10 @@ #define renamedlgplugin_h #include <kio/renamedlg.h> -#include <qdialog.h> +#include <tqdialog.h> #include <sys/types.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> /** * This is the base class for all RenameDlg plugins. @@ -37,15 +37,15 @@ public: /** * This is the c'tor. */ - RenameDlgPlugin(QDialog *dialog, const char *name, const QStringList &/*list*/ = QStringList() ): QWidget(dialog, name ) {}; + RenameDlgPlugin(TQDialog *dialog, const char *name, const TQStringList &/*list*/ = TQStringList() ): TQWidget(dialog, name ) {}; /** * This function will be called by RenameDlg. The params are infos about the files. * @return If the plugin want's to display it return true, if not return false */ - virtual bool initialize(KIO::RenameDlg_Mode /*mod*/ , const QString &/*_src*/, const QString &/*_dest*/, - const QString &/*mimeSrc*/, - const QString &/*mimeDest*/, + virtual bool initialize(KIO::RenameDlg_Mode /*mod*/ , const TQString &/*_src*/, const TQString &/*_dest*/, + const TQString &/*mimeSrc*/, + const TQString &/*mimeDest*/, KIO::filesize_t /*sizeSrc*/, KIO::filesize_t /*sizeDest*/, time_t /*ctimeSrc*/, diff --git a/kio/kio/scheduler.cpp b/kio/kio/scheduler.cpp index 49b710df6..8ab080486 100644 --- a/kio/kio/scheduler.cpp +++ b/kio/kio/scheduler.cpp @@ -22,8 +22,8 @@ #include "kio/scheduler.h" #include "kio/authinfo.h" #include "kio/slave.h" -#include <qptrlist.h> -#include <qdict.h> +#include <tqptrlist.h> +#include <tqdict.h> #include <dcopclient.h> @@ -42,11 +42,11 @@ using namespace KIO; -template class QDict<KIO::Scheduler::ProtocolInfo>; +template class TQDict<KIO::Scheduler::ProtocolInfo>; Scheduler *Scheduler::instance = 0; -class KIO::SlaveList: public QPtrList<Slave> +class KIO::SlaveList: public TQPtrList<Slave> { public: SlaveList() { } @@ -73,12 +73,12 @@ public: JobData() : checkOnHold(false) { } public: - QString protocol; - QString proxy; + TQString protocol; + TQString proxy; bool checkOnHold; }; -class KIO::Scheduler::ExtraJobData: public QPtrDict<KIO::Scheduler::JobData> +class KIO::Scheduler::ExtraJobData: public TQPtrDict<KIO::Scheduler::JobData> { public: ExtraJobData() { setAutoDelete(true); } @@ -92,23 +92,23 @@ public: joblist.setAutoDelete(false); } - QPtrList<SimpleJob> joblist; + TQPtrList<SimpleJob> joblist; SlaveList activeSlaves; int maxSlaves; int skipCount; - QString protocol; + TQString protocol; }; -class KIO::Scheduler::ProtocolInfoDict : public QDict<KIO::Scheduler::ProtocolInfo> +class KIO::Scheduler::ProtocolInfoDict : public TQDict<KIO::Scheduler::ProtocolInfo> { public: ProtocolInfoDict() { } - KIO::Scheduler::ProtocolInfo *get( const QString &protocol); + KIO::Scheduler::ProtocolInfo *get( const TQString &protocol); }; KIO::Scheduler::ProtocolInfo * -KIO::Scheduler::ProtocolInfoDict::get(const QString &protocol) +KIO::Scheduler::ProtocolInfoDict::get(const TQString &protocol) { ProtocolInfo *info = find(protocol); if (!info) @@ -125,7 +125,7 @@ KIO::Scheduler::ProtocolInfoDict::get(const QString &protocol) Scheduler::Scheduler() : DCOPObject( "KIO::Scheduler" ), - QObject(kapp, "scheduler"), + TQObject(kapp, "scheduler"), slaveTimer(0, "Scheduler::slaveTimer"), coSlaveTimer(0, "Scheduler::coSlaveTimer"), cleanupTimer(0, "Scheduler::cleanupTimer") @@ -139,9 +139,9 @@ Scheduler::Scheduler() extraJobData = new ExtraJobData; sessionData = new SessionData; slaveConfig = SlaveConfig::self(); - connect(&slaveTimer, SIGNAL(timeout()), SLOT(startStep())); - connect(&coSlaveTimer, SIGNAL(timeout()), SLOT(slotScheduleCoSlave())); - connect(&cleanupTimer, SIGNAL(timeout()), SLOT(slotCleanIdleSlaves())); + connect(&slaveTimer, TQT_SIGNAL(timeout()), TQT_SLOT(startStep())); + connect(&coSlaveTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotScheduleCoSlave())); + connect(&cleanupTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotCleanIdleSlaves())); busy = false; } @@ -163,15 +163,15 @@ Scheduler::debug_info() { } -bool Scheduler::process(const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData ) +bool Scheduler::process(const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData ) { - if ( fun != "reparseSlaveConfiguration(QString)" ) + if ( fun != "reparseSlaveConfiguration(TQString)" ) return DCOPObject::process( fun, data, replyType, replyData ); slaveConfig = SlaveConfig::self(); replyType = "void"; - QDataStream stream( data, IO_ReadOnly ); - QString proto; + TQDataStream stream( data, IO_ReadOnly ); + TQString proto; stream >> proto; kdDebug( 7006 ) << "reparseConfiguration( " << proto << " )" << endl; @@ -193,7 +193,7 @@ bool Scheduler::process(const QCString &fun, const QByteArray &data, QCString &r QCStringList Scheduler::functions() { QCStringList funcs = DCOPObject::functions(); - funcs << "void reparseSlaveConfiguration(QString)"; + funcs << "void reparseSlaveConfiguration(TQString)"; return funcs; } @@ -211,7 +211,7 @@ void Scheduler::_doJob(SimpleJob *job) { slaveTimer.start(0, true); #ifndef NDEBUG if (newJobs.count() > 150) - kdDebug() << "WARNING - KIO::Scheduler got more than 150 jobs! This shows a misuse in your app (yes, a job is a QObject)." << endl; + kdDebug() << "WARNING - KIO::Scheduler got more than 150 jobs! This shows a misuse in your app (yes, a job is a TQObject)." << endl; #endif } @@ -223,7 +223,7 @@ void Scheduler::_scheduleJob(SimpleJob *job) { kdFatal(7006) << "BUG! _ScheduleJob(): No extraJobData for job!" << endl; return; } - QString protocol = jobData->protocol; + TQString protocol = jobData->protocol; // kdDebug(7006) << "Scheduler::_scheduleJob protocol=" << protocol << endl; ProtocolInfo *protInfo = protInfoDict->get(protocol); protInfo->joblist.append(job); @@ -272,7 +272,7 @@ void Scheduler::startStep() { (void) startJobDirect(); } - QDictIterator<KIO::Scheduler::ProtocolInfo> it(*protInfoDict); + TQDictIterator<KIO::Scheduler::ProtocolInfo> it(*protInfoDict); while(it.current()) { if (startJobScheduled(it.current())) return; @@ -280,12 +280,12 @@ void Scheduler::startStep() } } -void Scheduler::setupSlave(KIO::Slave *slave, const KURL &url, const QString &protocol, const QString &proxy , bool newSlave, const KIO::MetaData *config) +void Scheduler::setupSlave(KIO::Slave *slave, const KURL &url, const TQString &protocol, const TQString &proxy , bool newSlave, const KIO::MetaData *config) { - QString host = url.host(); + TQString host = url.host(); int port = url.port(); - QString user = url.user(); - QString passwd = url.pass(); + TQString user = url.user(); + TQString passwd = url.pass(); if ((newSlave) || (slave->host() != host) || @@ -300,7 +300,7 @@ void Scheduler::setupSlave(KIO::Slave *slave, const KURL &url, const QString &pr configData["UseProxy"] = proxy; - QString autoLogin = configData["EnableAutoLogin"].lower(); + TQString autoLogin = configData["EnableAutoLogin"].lower(); if ( autoLogin == "true" ) { NetRC::AutoLogin l; @@ -312,8 +312,8 @@ void Scheduler::setupSlave(KIO::Slave *slave, const KURL &url, const QString &pr configData["autoLoginPass"] = l.password; if ( usern ) { - QString macdef; - QMap<QString, QStringList>::ConstIterator it = l.macdef.begin(); + TQString macdef; + TQMap<TQString, TQStringList>::ConstIterator it = l.macdef.begin(); for ( ; it != l.macdef.end(); ++it ) macdef += it.key() + '\\' + it.data().join( "\\" ) + '\n'; configData["autoLoginMacro"] = macdef; @@ -421,7 +421,7 @@ bool Scheduler::startJobDirect() << endl; return false; } - QString protocol = jobData->protocol; + TQString protocol = jobData->protocol; ProtocolInfo *protInfo = protInfoDict->get(protocol); bool newSlave = false; @@ -447,11 +447,11 @@ bool Scheduler::startJobDirect() return true; } -static Slave *searchIdleList(SlaveList *idleSlaves, const KURL &url, const QString &protocol, bool &exact) +static Slave *searchIdleList(SlaveList *idleSlaves, const KURL &url, const TQString &protocol, bool &exact) { - QString host = url.host(); + TQString host = url.host(); int port = url.port(); - QString user = url.user(); + TQString user = url.user(); exact = true; for( Slave *slave = idleSlaves->first(); @@ -504,7 +504,7 @@ Slave *Scheduler::findIdleSlave(ProtocolInfo *, SimpleJob *job, bool &exact) if ( bCanReuse ) { KIO::MetaData outgoing = tJob->outgoingMetaData(); - QString resume = (!outgoing.contains("resume")) ? QString::null : outgoing["resume"]; + TQString resume = (!outgoing.contains("resume")) ? TQString::null : outgoing["resume"]; kdDebug(7006) << "Resume metadata is '" << resume << "'" << endl; bCanReuse = (resume.isEmpty() || resume == "0"); } @@ -535,21 +535,21 @@ Slave *Scheduler::findIdleSlave(ProtocolInfo *, SimpleJob *job, bool &exact) Slave *Scheduler::createSlave(ProtocolInfo *protInfo, SimpleJob *job, const KURL &url) { int error; - QString errortext; + TQString errortext; Slave *slave = Slave::createSlave(protInfo->protocol, url, error, errortext); if (slave) { slaveList->append(slave); idleSlaves->append(slave); - connect(slave, SIGNAL(slaveDied(KIO::Slave *)), - SLOT(slotSlaveDied(KIO::Slave *))); - connect(slave, SIGNAL(slaveStatus(pid_t,const QCString &,const QString &, bool)), - SLOT(slotSlaveStatus(pid_t,const QCString &, const QString &, bool))); - - connect(slave,SIGNAL(authorizationKey(const QCString&, const QCString&, bool)), - sessionData,SLOT(slotAuthData(const QCString&, const QCString&, bool))); - connect(slave,SIGNAL(delAuthorization(const QCString&)), sessionData, - SLOT(slotDelAuthData(const QCString&))); + connect(slave, TQT_SIGNAL(slaveDied(KIO::Slave *)), + TQT_SLOT(slotSlaveDied(KIO::Slave *))); + connect(slave, TQT_SIGNAL(slaveStatus(pid_t,const TQCString &,const TQString &, bool)), + TQT_SLOT(slotSlaveStatus(pid_t,const TQCString &, const TQString &, bool))); + + connect(slave,TQT_SIGNAL(authorizationKey(const TQCString&, const TQCString&, bool)), + sessionData,TQT_SLOT(slotAuthData(const TQCString&, const TQCString&, bool))); + connect(slave,TQT_SIGNAL(delAuthorization(const TQCString&)), sessionData, + TQT_SLOT(slotDelAuthData(const TQCString&))); } else { @@ -564,7 +564,7 @@ Slave *Scheduler::createSlave(ProtocolInfo *protInfo, SimpleJob *job, const KURL return slave; } -void Scheduler::slotSlaveStatus(pid_t, const QCString &, const QString &, bool) +void Scheduler::slotSlaveStatus(pid_t, const TQCString &, const TQString &, bool) { } @@ -697,8 +697,8 @@ void Scheduler::_removeSlaveOnHold() Slave * Scheduler::_getConnectedSlave(const KURL &url, const KIO::MetaData &config ) { - QString proxy; - QString protocol = KProtocolManager::slaveProtocol(url, proxy); + TQString proxy; + TQString protocol = KProtocolManager::slaveProtocol(url, proxy); bool dummy; Slave *slave = searchIdleList(idleSlaves, url, protocol, dummy); if (!slave) @@ -713,12 +713,12 @@ Scheduler::_getConnectedSlave(const KURL &url, const KIO::MetaData &config ) setupSlave(slave, url, protocol, proxy, true, &config); slave->send( CMD_CONNECT ); - connect(slave, SIGNAL(connected()), - SLOT(slotSlaveConnected())); - connect(slave, SIGNAL(error(int, const QString &)), - SLOT(slotSlaveError(int, const QString &))); + connect(slave, TQT_SIGNAL(connected()), + TQT_SLOT(slotSlaveConnected())); + connect(slave, TQT_SIGNAL(error(int, const TQString &)), + TQT_SLOT(slotSlaveError(int, const TQString &))); - coSlaves.insert(slave, new QPtrList<SimpleJob>()); + coSlaves.insert(slave, new TQPtrList<SimpleJob>()); // kdDebug(7006) << "_getConnectedSlave( " << slave << ")" << endl; return slave; } @@ -744,13 +744,13 @@ Scheduler::slotScheduleCoSlave() assert(!coIdleSlaves->contains(slave)); KURL url =job->url(); - QString host = url.host(); + TQString host = url.host(); int port = url.port(); if (slave->host() == "<reset>") { - QString user = url.user(); - QString passwd = url.pass(); + TQString user = url.user(); + TQString passwd = url.pass(); MetaData configData = slaveConfig->configData(url.protocol(), url.host()); slave->setConfig(configData); @@ -772,8 +772,8 @@ Scheduler::slotSlaveConnected() Slave *slave = (Slave *)sender(); // kdDebug(7006) << "slotSlaveConnected( " << slave << ")" << endl; slave->setConnected(true); - disconnect(slave, SIGNAL(connected()), - this, SLOT(slotSlaveConnected())); + disconnect(slave, TQT_SIGNAL(connected()), + this, TQT_SLOT(slotSlaveConnected())); emit slaveConnected(slave); assert(!coIdleSlaves->contains(slave)); coIdleSlaves->append(slave); @@ -781,7 +781,7 @@ Scheduler::slotSlaveConnected() } void -Scheduler::slotSlaveError(int errorNr, const QString &errorMsg) +Scheduler::slotSlaveError(int errorNr, const TQString &errorMsg) { Slave *slave = (Slave *)sender(); if (!slave->isConnected() || (coIdleSlaves->find(slave) != -1)) @@ -795,7 +795,7 @@ bool Scheduler::_assignJobToSlave(KIO::Slave *slave, SimpleJob *job) { // kdDebug(7006) << "_assignJobToSlave( " << job << ", " << slave << ")" << endl; - QString dummy; + TQString dummy; if ((slave->slaveProtocol() != KProtocolManager::slaveProtocol( job->url(), dummy )) || (!newJobs.removeRef(job))) @@ -838,10 +838,10 @@ Scheduler::_disconnectSlave(KIO::Slave *slave) delete list; coIdleSlaves->removeRef(slave); assert(!coIdleSlaves->contains(slave)); - disconnect(slave, SIGNAL(connected()), - this, SLOT(slotSlaveConnected())); - disconnect(slave, SIGNAL(error(int, const QString &)), - this, SLOT(slotSlaveError(int, const QString &))); + disconnect(slave, TQT_SIGNAL(connected()), + this, TQT_SLOT(slotSlaveConnected())); + disconnect(slave, TQT_SIGNAL(error(int, const TQString &)), + this, TQT_SLOT(slotSlaveError(int, const TQString &))); if (slave->isAlive()) { idleSlaves->append(slave); @@ -860,23 +860,23 @@ Scheduler::_checkSlaveOnHold(bool b) } void -Scheduler::_registerWindow(QWidget *wid) +Scheduler::_registerWindow(TQWidget *wid) { if (!wid) return; - QObject *obj = static_cast<QObject *>(wid); + TQObject *obj = static_cast<TQObject *>(wid); if (!m_windowList.contains(obj)) { // We must store the window Id because by the time // the destroyed signal is emitted we can no longer - // access QWidget::winId() (already destructed) + // access TQWidget::winId() (already destructed) WId windowId = wid->winId(); m_windowList.insert(obj, windowId); - connect(wid, SIGNAL(destroyed(QObject *)), - this, SLOT(slotUnregisterWindow(QObject*))); - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + connect(wid, TQT_SIGNAL(destroyed(TQObject *)), + this, TQT_SLOT(slotUnregisterWindow(TQObject*))); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << windowId; if( !kapp->dcopClient()->send( "kded", "kded", "registerWindowId(long int)", params ) ) @@ -885,22 +885,22 @@ Scheduler::_registerWindow(QWidget *wid) } void -Scheduler::slotUnregisterWindow(QObject *obj) +Scheduler::slotUnregisterWindow(TQObject *obj) { if (!obj) return; - QMap<QObject *, WId>::Iterator it = m_windowList.find(obj); + TQMap<TQObject *, WId>::Iterator it = m_windowList.find(obj); if (it == m_windowList.end()) return; WId windowId = it.data(); - disconnect( it.key(), SIGNAL(destroyed(QObject *)), - this, SLOT(slotUnregisterWindow(QObject*))); + disconnect( it.key(), TQT_SIGNAL(destroyed(TQObject *)), + this, TQT_SLOT(slotUnregisterWindow(TQObject*))); m_windowList.remove( it ); if (kapp) { - QByteArray params; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); stream << windowId; kapp->dcopClient()->send( "kded", "kded", "unregisterWindowId(long int)", params ); diff --git a/kio/kio/scheduler.h b/kio/kio/scheduler.h index 071dcb7d4..4a4f104ba 100644 --- a/kio/kio/scheduler.h +++ b/kio/kio/scheduler.h @@ -24,9 +24,9 @@ #include "kio/job.h" #include "kio/jobclasses.h" -#include <qtimer.h> -#include <qptrdict.h> -#include <qmap.h> +#include <tqtimer.h> +#include <tqptrdict.h> +#include <tqmap.h> #include <dcopobject.h> @@ -108,11 +108,11 @@ namespace KIO { * @see KIO::Job **/ - class KIO_EXPORT Scheduler : public QObject, virtual public DCOPObject { + class KIO_EXPORT Scheduler : public TQObject, virtual public DCOPObject { Q_OBJECT public: - typedef QPtrList<SimpleJob> JobList; + typedef TQPtrList<SimpleJob> JobList; // InfoDict needs Info, so we can't declare it private class ProtocolInfo; @@ -236,18 +236,18 @@ namespace KIO { * the that was started. * Register the mainwindow @p wid with the KIO subsystem * Do not call this, it is called automatically from - * void KIO::Job::setWindow(QWidget*). + * void KIO::Job::setWindow(TQWidget*). * @param wid the window to register * @since 3.1 */ - static void registerWindow(QWidget *wid) + static void registerWindow(TQWidget *wid) { self()->_registerWindow(wid); } /** * @internal * Unregisters the window registered by registerWindow(). */ - static void unregisterWindow(QObject *wid) + static void unregisterWindow(TQObject *wid) { self()->slotUnregisterWindow(wid); } /** @@ -256,21 +256,21 @@ namespace KIO { * @see slaveConnected() * @see slaveError() */ - static bool connect( const char *signal, const QObject *receiver, + static bool connect( const char *signal, const TQObject *receiver, const char *member) - { return QObject::connect(self(), signal, receiver, member); } + { return TQObject::connect(self(), signal, receiver, member); } - static bool connect( const QObject* sender, const char* signal, - const QObject* receiver, const char* member ) - { return QObject::connect(sender, signal, receiver, member); } + static bool connect( const TQObject* sender, const char* signal, + const TQObject* receiver, const char* member ) + { return TQObject::connect(sender, signal, receiver, member); } - static bool disconnect( const QObject* sender, const char* signal, - const QObject* receiver, const char* member ) - { return QObject::disconnect(sender, signal, receiver, member); } + static bool disconnect( const TQObject* sender, const char* signal, + const TQObject* receiver, const char* member ) + { return TQObject::disconnect(sender, signal, receiver, member); } - bool connect( const QObject *sender, const char *signal, + bool connect( const TQObject *sender, const char *signal, const char *member ) - { return QObject::connect(sender, signal, member); } + { return TQObject::connect(sender, signal, member); } /** * When true, the next job will check whether KLauncher has a slave @@ -281,21 +281,21 @@ namespace KIO { void debug_info(); - virtual bool process(const QCString &fun, const QByteArray &data, - QCString& replyType, QByteArray &replyData); + virtual bool process(const TQCString &fun, const TQByteArray &data, + TQCString& replyType, TQByteArray &replyData); virtual QCStringList functions(); public slots: void slotSlaveDied(KIO::Slave *slave); - void slotSlaveStatus(pid_t pid, const QCString &protocol, - const QString &host, bool connected); + void slotSlaveStatus(pid_t pid, const TQCString &protocol, + const TQString &host, bool connected); signals: void slaveConnected(KIO::Slave *slave); - void slaveError(KIO::Slave *slave, int error, const QString &errorMsg); + void slaveError(KIO::Slave *slave, int error, const TQString &errorMsg); protected: - void setupSlave(KIO::Slave *slave, const KURL &url, const QString &protocol, const QString &proxy , bool newSlave, const KIO::MetaData *config=0); + void setupSlave(KIO::Slave *slave, const KURL &url, const TQString &protocol, const TQString &proxy , bool newSlave, const KIO::MetaData *config=0); bool startJobScheduled(ProtocolInfo *protInfo); bool startJobDirect(); Scheduler(); @@ -304,10 +304,10 @@ namespace KIO { void startStep(); void slotCleanIdleSlaves(); void slotSlaveConnected(); - void slotSlaveError(int error, const QString &errorMsg); + void slotSlaveError(int error, const TQString &errorMsg); void slotScheduleCoSlave(); /// @since 3.1 - void slotUnregisterWindow(QObject *); + void slotUnregisterWindow(TQObject *); private: class ProtocolInfoDict; @@ -328,15 +328,15 @@ namespace KIO { bool _disconnectSlave(KIO::Slave *slave); void _checkSlaveOnHold(bool b); void _publishSlaveOnHold(); - void _registerWindow(QWidget *wid); + void _registerWindow(TQWidget *wid); Slave *findIdleSlave(ProtocolInfo *protInfo, SimpleJob *job, bool &exact); Slave *createSlave(ProtocolInfo *protInfo, SimpleJob *job, const KURL &url); - QTimer slaveTimer; - QTimer coSlaveTimer; - QTimer cleanupTimer; + TQTimer slaveTimer; + TQTimer coSlaveTimer; + TQTimer cleanupTimer; bool busy; SlaveList *slaveList; @@ -348,12 +348,12 @@ namespace KIO { KURL urlOnHold; JobList newJobs; - QPtrDict<JobList> coSlaves; + TQPtrDict<JobList> coSlaves; ExtraJobData *extraJobData; SlaveConfig *slaveConfig; SessionData *sessionData; bool checkOnHold; - QMap<QObject *,WId> m_windowList; + TQMap<TQObject *,WId> m_windowList; protected: virtual void virtual_hook( int id, void* data ); private: diff --git a/kio/kio/sessiondata.cpp b/kio/kio/sessiondata.cpp index 8148584c5..258f03e2a 100644 --- a/kio/kio/sessiondata.cpp +++ b/kio/kio/sessiondata.cpp @@ -18,8 +18,8 @@ Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qptrlist.h> -#include <qtextcodec.h> +#include <tqptrlist.h> +#include <tqtextcodec.h> #include <kdebug.h> #include <kconfig.h> @@ -46,34 +46,34 @@ struct SessionData::AuthData public: AuthData() {} - AuthData(const QCString& k, const QCString& g, bool p) { + AuthData(const TQCString& k, const TQCString& g, bool p) { key = k; group = g; persist = p; } - bool isKeyMatch( const QCString& val ) const { + bool isKeyMatch( const TQCString& val ) const { return (val==key); } - bool isGroupMatch( const QCString& val ) const { + bool isGroupMatch( const TQCString& val ) const { return (val==group); } - QCString key; - QCString group; + TQCString key; + TQCString group; bool persist; }; /************************* SessionData::AuthDataList ****************************/ -class SessionData::AuthDataList : public QPtrList<SessionData::AuthData> +class SessionData::AuthDataList : public TQPtrList<SessionData::AuthData> { public: AuthDataList(); ~AuthDataList(); void addData( SessionData::AuthData* ); - void removeData( const QCString& ); + void removeData( const TQCString& ); bool pingCacheDaemon(); void registerAuthData( SessionData::AuthData* ); @@ -105,7 +105,7 @@ SessionData::AuthDataList::~AuthDataList() void SessionData::AuthDataList::addData( SessionData::AuthData* d ) { - QPtrListIterator<SessionData::AuthData> it ( *this ); + TQPtrListIterator<SessionData::AuthData> it ( *this ); for ( ; it.current(); ++it ) { if ( it.current()->isKeyMatch( d->key ) ) @@ -115,9 +115,9 @@ void SessionData::AuthDataList::addData( SessionData::AuthData* d ) append( d ); } -void SessionData::AuthDataList::removeData( const QCString& gkey ) +void SessionData::AuthDataList::removeData( const TQCString& gkey ) { - QPtrListIterator<SessionData::AuthData> it( *this ); + TQPtrListIterator<SessionData::AuthData> it( *this ); for( ; it.current(); ++it ) { if ( it.current()->isGroupMatch(gkey) && pingCacheDaemon() ) @@ -153,11 +153,11 @@ void SessionData::AuthDataList::registerAuthData( SessionData::AuthData* d ) #ifdef Q_OS_UNIX bool ok; - QCString ref_key = d->key + "-refcount"; + TQCString ref_key = d->key + "-refcount"; int count = m_kdesuClient->getVar(ref_key).toInt( &ok ); if( ok ) { - QCString val; + TQCString val; val.setNum( count+1 ); m_kdesuClient->setVar( ref_key, val, 0, d->group ); } @@ -173,7 +173,7 @@ void SessionData::AuthDataList::unregisterAuthData( SessionData::AuthData* d ) bool ok; int count; - QCString ref_key = d->key + "-refcount"; + TQCString ref_key = d->key + "-refcount"; #ifdef Q_OS_UNIX count = m_kdesuClient->getVar( ref_key ).toInt( &ok ); @@ -181,7 +181,7 @@ void SessionData::AuthDataList::unregisterAuthData( SessionData::AuthData* d ) { if ( count > 1 ) { - QCString val; + TQCString val; val.setNum(count-1); m_kdesuClient->setVar( ref_key, val, 0, d->group ); } @@ -197,7 +197,7 @@ void SessionData::AuthDataList::purgeCachedData() { if ( !isEmpty() && pingCacheDaemon() ) { - QPtrListIterator<SessionData::AuthData> it( *this ); + TQPtrListIterator<SessionData::AuthData> it( *this ); for ( ; it.current(); ++it ) unregisterAuthData( it.current() ); } @@ -215,8 +215,8 @@ public: bool initDone; bool useCookie; - QString charsets; - QString language; + TQString charsets; + TQString language; }; SessionData::SessionData() @@ -233,8 +233,8 @@ SessionData::~SessionData() authData = 0L; } -void SessionData::configDataFor( MetaData &configData, const QString &proto, - const QString & ) +void SessionData::configDataFor( MetaData &configData, const TQString &proto, + const TQString & ) { if ( (proto.find("http", 0, false) == 0 ) || (proto.find("webdav", 0, false) == 0) ) @@ -269,11 +269,11 @@ void SessionData::reset() d->useCookie = cfg->readBoolEntry( "Cookies", true ); delete cfg; - static const QString & english = KGlobal::staticQString( "en" ); + static const TQString & english = KGlobal::staticQString( "en" ); // Get language settings... - QStringList languageList = KGlobal::locale()->languagesTwoAlpha(); - QStringList::Iterator it = languageList.find( QString::fromLatin1("C") ); + TQStringList languageList = KGlobal::locale()->languagesTwoAlpha(); + TQStringList::Iterator it = languageList.find( TQString::fromLatin1("C") ); if ( it != languageList.end() ) { if ( languageList.contains( english ) > 0 ) @@ -286,11 +286,11 @@ void SessionData::reset() d->language = languageList.join( ", " ); - d->charsets = QString::fromLatin1(QTextCodec::codecForLocale()->mimeName()).lower(); + d->charsets = TQString::fromLatin1(TQTextCodec::codecForLocale()->mimeName()).lower(); KProtocolManager::reparseConfiguration(); } -void SessionData::slotAuthData( const QCString& key, const QCString& gkey, +void SessionData::slotAuthData( const TQCString& key, const TQCString& gkey, bool keep ) { if (!authData) @@ -298,7 +298,7 @@ void SessionData::slotAuthData( const QCString& key, const QCString& gkey, authData->addData( new SessionData::AuthData(key, gkey, keep) ); } -void SessionData::slotDelAuthData( const QCString& gkey ) +void SessionData::slotDelAuthData( const TQCString& gkey ) { if (!authData) return; diff --git a/kio/kio/sessiondata.h b/kio/kio/sessiondata.h index 3b7838e13..408045260 100644 --- a/kio/kio/sessiondata.h +++ b/kio/kio/sessiondata.h @@ -21,7 +21,7 @@ #ifndef __KIO_SESSIONDATA_H #define __KIO_SESSIONDATA_H -#include <qobject.h> +#include <tqobject.h> #include <kio/global.h> namespace KIO { @@ -40,15 +40,15 @@ public: SessionData(); ~SessionData(); - virtual void configDataFor( KIO::MetaData &configData, const QString &proto, - const QString &host ); + virtual void configDataFor( KIO::MetaData &configData, const TQString &proto, + const TQString &host ); virtual void reset(); /// @since 3.1 struct AuthData; public slots: - void slotAuthData( const QCString&, const QCString&, bool ); - void slotDelAuthData( const QCString& ); + void slotAuthData( const TQCString&, const TQCString&, bool ); + void slotDelAuthData( const TQCString& ); private: class AuthDataList; diff --git a/kio/kio/skipdlg.cpp b/kio/kio/skipdlg.cpp index 28cbde6eb..f014b10d9 100644 --- a/kio/kio/skipdlg.cpp +++ b/kio/kio/skipdlg.cpp @@ -21,10 +21,10 @@ #include <stdio.h> #include <assert.h> -#include <qmessagebox.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqmessagebox.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <kapplication.h> #include <klocale.h> @@ -38,7 +38,7 @@ using namespace KIO; -SkipDlg::SkipDlg(QWidget *parent, bool _multi, const QString& _error_text, bool _modal ) : +SkipDlg::SkipDlg(TQWidget *parent, bool _multi, const TQString& _error_text, bool _modal ) : KDialog ( parent, "" , _modal ) { // TODO : port to KDialogBase @@ -56,28 +56,28 @@ SkipDlg::SkipDlg(QWidget *parent, bool _multi, const QString& _error_text, bool setCaption( i18n( "Information" ) ); b0 = new KPushButton( KStdGuiItem::cancel(), this ); - connect(b0, SIGNAL(clicked()), this, SLOT(b0Pressed())); + connect(b0, TQT_SIGNAL(clicked()), this, TQT_SLOT(b0Pressed())); if ( _multi ) { - b1 = new QPushButton( i18n( "Skip" ), this ); - connect(b1, SIGNAL(clicked()), this, SLOT(b1Pressed())); + b1 = new TQPushButton( i18n( "Skip" ), this ); + connect(b1, TQT_SIGNAL(clicked()), this, TQT_SLOT(b1Pressed())); - b2 = new QPushButton( i18n( "Auto Skip" ), this ); - connect(b2, SIGNAL(clicked()), this, SLOT(b2Pressed())); + b2 = new TQPushButton( i18n( "Auto Skip" ), this ); + connect(b2, TQT_SIGNAL(clicked()), this, TQT_SLOT(b2Pressed())); } - QVBoxLayout *vlayout = new QVBoxLayout( this, 10, 0 ); + TQVBoxLayout *vlayout = new TQVBoxLayout( this, 10, 0 ); // vlayout->addStrut( 360 ); makes dlg at least that wide - QLabel * lb = new QLabel( _error_text, this ); + TQLabel * lb = new TQLabel( _error_text, this ); lb->setFixedHeight( lb->sizeHint().height() ); lb->setMinimumWidth( lb->sizeHint().width() ); vlayout->addWidget( lb ); vlayout->addSpacing( 10 ); - QHBoxLayout* layout = new QHBoxLayout(); + TQHBoxLayout* layout = new TQHBoxLayout(); vlayout->addLayout( layout ); if ( b0 ) { @@ -132,7 +132,7 @@ void SkipDlg::b2Pressed() emit result( this, 2 ); } -SkipDlg_Result KIO::open_SkipDlg( bool _multi, const QString& _error_text ) +SkipDlg_Result KIO::open_SkipDlg( bool _multi, const TQString& _error_text ) { Q_ASSERT(kapp); diff --git a/kio/kio/skipdlg.h b/kio/kio/skipdlg.h index 1f6a7b8ab..fcb03fdae 100644 --- a/kio/kio/skipdlg.h +++ b/kio/kio/skipdlg.h @@ -29,7 +29,7 @@ namespace KIO { enum SkipDlg_Result { S_SKIP = 1, S_AUTO_SKIP = 2, S_CANCEL = 0 }; - KIO_EXPORT SkipDlg_Result open_SkipDlg( bool _multi, const QString& _error_text = QString::null ); + KIO_EXPORT SkipDlg_Result open_SkipDlg( bool _multi, const TQString& _error_text = TQString::null ); /** * @internal @@ -38,13 +38,13 @@ class KIO_EXPORT SkipDlg : public KDialog { Q_OBJECT public: - SkipDlg( QWidget *parent, bool _multi, const QString& _error_text, bool _modal = false ); + SkipDlg( TQWidget *parent, bool _multi, const TQString& _error_text, bool _modal = false ); ~SkipDlg(); protected: - QPushButton *b0; - QPushButton *b1; - QPushButton *b2; + TQPushButton *b0; + TQPushButton *b1; + TQPushButton *b2; bool modal; diff --git a/kio/kio/slave.cpp b/kio/kio/slave.cpp index a512e2ba7..c1a701711 100644 --- a/kio/kio/slave.cpp +++ b/kio/kio/slave.cpp @@ -30,8 +30,8 @@ #include <signal.h> #include <sys/types.h> -#include <qfile.h> -#include <qtimer.h> +#include <tqfile.h> +#include <tqtimer.h> #include <dcopclient.h> #include <kdebug.h> @@ -94,16 +94,16 @@ void Slave::accept(KSocket *socket) #endif delete serv; serv = 0; - slaveconn.connect(this, SLOT(gotInput())); + slaveconn.connect(this, TQT_SLOT(gotInput())); unlinkSocket(); } void Slave::unlinkSocket() { if (m_socket.isEmpty()) return; - QCString filename = QFile::encodeName(m_socket); + TQCString filename = TQFile::encodeName(m_socket); unlink(filename.data()); - m_socket = QString::null; + m_socket = TQString::null; } void Slave::timeout() @@ -116,7 +116,7 @@ void Slave::timeout() kdDebug(7002) << "slave is slow... pid=" << m_pid << " t=" << delta_t << endl; if (delta_t < SLAVE_CONNECTION_TIMEOUT_MAX) { - QTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, this, SLOT(timeout())); + TQTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, this, TQT_SLOT(timeout())); return; } } @@ -125,7 +125,7 @@ void Slave::timeout() serv = 0; unlinkSocket(); dead = true; - QString arg = m_protocol; + TQString arg = m_protocol; if (!m_host.isEmpty()) arg += "://"+m_host; kdDebug(7002) << "slave died pid = " << m_pid << endl; @@ -138,7 +138,7 @@ void Slave::timeout() deref(); } -Slave::Slave(KServerSocket *socket, const QString &protocol, const QString &socketname) +Slave::Slave(KServerSocket *socket, const TQString &protocol, const TQString &socketname) : SlaveInterface(&slaveconn), serv(socket), contacted(false), d(new SlavePrivate(false)) { @@ -152,13 +152,13 @@ Slave::Slave(KServerSocket *socket, const QString &protocol, const QString &sock m_pid = 0; m_port = 0; #ifndef Q_WS_WIN - connect(serv, SIGNAL(accepted( KSocket* )), - SLOT(accept(KSocket*) ) ); + connect(serv, TQT_SIGNAL(accepted( KSocket* )), + TQT_SLOT(accept(KSocket*) ) ); #endif } -Slave::Slave(bool /*derived*/, KServerSocket *socket, const QString &protocol, - const QString &socketname) +Slave::Slave(bool /*derived*/, KServerSocket *socket, const TQString &protocol, + const TQString &socketname) : SlaveInterface(&slaveconn), serv(socket), contacted(false), d(new SlavePrivate(true)) { @@ -174,8 +174,8 @@ Slave::Slave(bool /*derived*/, KServerSocket *socket, const QString &protocol, m_port = 0; if (serv != 0) { #ifndef Q_WS_WIN - connect(serv, SIGNAL(accepted( KSocket* )), - SLOT(accept(KSocket*) ) ); + connect(serv, TQT_SIGNAL(accepted( KSocket* )), + TQT_SLOT(accept(KSocket*) ) ); #endif } } @@ -193,7 +193,7 @@ Slave::~Slave() d = 0; } -void Slave::setProtocol(const QString & protocol) +void Slave::setProtocol(const TQString & protocol) { m_protocol = protocol; } @@ -224,8 +224,8 @@ void Slave::hold(const KURL &url) ref(); { - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); stream << url; slaveconn.send( CMD_SLAVE_HOLD, data ); slaveconn.close(); @@ -239,13 +239,13 @@ void Slave::hold(const KURL &url) if (!client->isAttached()) client->attach(); - QByteArray params, reply; - QCString replyType; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params, reply; + TQCString replyType; + TQDataStream stream(params, IO_WriteOnly); pid_t pid = m_pid; stream << pid; - QCString launcher = KApplication::launcher(); + TQCString launcher = KApplication::launcher(); client->call(launcher, launcher, "waitForSlave(pid_t)", params, replyType, reply); } @@ -282,7 +282,7 @@ bool Slave::suspended() return slaveconn.suspended(); } -void Slave::send(int cmd, const QByteArray &arr) { +void Slave::send(int cmd, const TQByteArray &arr) { if (d->derived) { // TODO: clean up before KDE 4 SendParams params; params.cmd = cmd; @@ -301,7 +301,7 @@ void Slave::gotInput() { slaveconn.close(); dead = true; - QString arg = m_protocol; + TQString arg = m_protocol; if (!m_host.isEmpty()) arg += "://"+m_host; kdDebug(7002) << "slave died pid = " << m_pid << endl; @@ -325,16 +325,16 @@ void Slave::kill() } } -void Slave::setHost( const QString &host, int port, - const QString &user, const QString &passwd) +void Slave::setHost( const TQString &host, int port, + const TQString &user, const TQString &passwd) { m_host = host; m_port = port; m_user = user; m_passwd = passwd; - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); stream << m_host << m_port << m_user << m_passwd; slaveconn.send( CMD_HOST, data ); } @@ -346,13 +346,13 @@ void Slave::resetHost() void Slave::setConfig(const MetaData &config) { - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); stream << config; slaveconn.send( CMD_CONFIG, data ); } -Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, QString& error_text ) +Slave* Slave::createSlave( const TQString &protocol, const KURL& url, int& error, TQString& error_text ) { //kdDebug(7002) << "createSlave '" << protocol << "' for " << url.prettyURL() << endl; // Firstly take into account all special slaves @@ -363,8 +363,8 @@ Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, if (!client->isAttached()) client->attach(); - QString prefix = locateLocal("socket", KGlobal::instance()->instanceName()); - KTempFile socketfile(prefix, QString::fromLatin1(".slave-socket")); + TQString prefix = locateLocal("socket", KGlobal::instance()->instanceName()); + KTempFile socketfile(prefix, TQString::fromLatin1(".slave-socket")); if ( socketfile.status() != 0 ) { error_text = i18n("Unable to create io-slave: %1").arg(strerror(errno)); @@ -377,7 +377,7 @@ Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, #endif #ifndef Q_WS_WIN - KServerSocket *kss = new KServerSocket(QFile::encodeName(socketfile.name())); + KServerSocket *kss = new KServerSocket(TQFile::encodeName(socketfile.name())); Slave *slave = new Slave(kss, protocol, socketfile.name()); #else @@ -391,11 +391,11 @@ Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, // In such case we start the slave via KProcess. // It's possible to force this by setting the env. variable // KDE_FORK_SLAVES, Clearcase seems to require this. - static bool bForkSlaves = !QCString(getenv("KDE_FORK_SLAVES")).isEmpty(); + static bool bForkSlaves = !TQCString(getenv("KDE_FORK_SLAVES")).isEmpty(); if (bForkSlaves || !client->isAttached() || client->isAttachedToForeignServer()) { - QString _name = KProtocolInfo::exec(protocol); + TQString _name = KProtocolInfo::exec(protocol); if (_name.isEmpty()) { error_text = i18n("Unknown protocol '%1'.").arg(protocol); @@ -403,7 +403,7 @@ Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, delete slave; return 0; } - QString lib_path = KLibLoader::findLibrary(_name.latin1()); + TQString lib_path = KLibLoader::findLibrary(_name.latin1()); if (lib_path.isEmpty()) { error_text = i18n("Can not find io-slave for protocol '%1'.").arg(protocol); @@ -414,33 +414,33 @@ Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, KProcess proc; proc << locate("exe", "kioslave") << lib_path << protocol << "" << socketfile.name(); - kdDebug(7002) << "kioslave" << ", " << lib_path << ", " << protocol << ", " << QString::null << ", " << socketfile.name() << endl; + kdDebug(7002) << "kioslave" << ", " << lib_path << ", " << protocol << ", " << TQString::null << ", " << socketfile.name() << endl; proc.start(KProcess::DontCare); #ifndef Q_WS_WIN slave->setPID(proc.pid()); - QTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, slave, SLOT(timeout())); + TQTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, slave, TQT_SLOT(timeout())); #endif return slave; } - QByteArray params, reply; - QCString replyType; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params, reply; + TQCString replyType; + TQDataStream stream(params, IO_WriteOnly); stream << protocol << url.host() << socketfile.name(); - QCString launcher = KApplication::launcher(); - if (!client->call(launcher, launcher, "requestSlave(QString,QString,QString)", + TQCString launcher = KApplication::launcher(); + if (!client->call(launcher, launcher, "requestSlave(TQString,TQString,TQString)", params, replyType, reply)) { error_text = i18n("Cannot talk to klauncher"); error = KIO::ERR_SLAVE_DEFINED; delete slave; return 0; } - QDataStream stream2(reply, IO_ReadOnly); - QString errorStr; + TQDataStream stream2(reply, IO_ReadOnly); + TQString errorStr; pid_t pid; stream2 >> pid >> errorStr; if (!pid) @@ -452,12 +452,12 @@ Slave* Slave::createSlave( const QString &protocol, const KURL& url, int& error, } #ifndef Q_WS_WIN slave->setPID(pid); - QTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, slave, SLOT(timeout())); + TQTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, slave, TQT_SLOT(timeout())); #endif return slave; } -Slave* Slave::holdSlave( const QString &protocol, const KURL& url ) +Slave* Slave::holdSlave( const TQString &protocol, const KURL& url ) { //kdDebug(7002) << "holdSlave '" << protocol << "' for " << url.prettyURL() << endl; // Firstly take into account all special slaves @@ -468,8 +468,8 @@ Slave* Slave::holdSlave( const QString &protocol, const KURL& url ) if (!client->isAttached()) client->attach(); - QString prefix = locateLocal("socket", KGlobal::instance()->instanceName()); - KTempFile socketfile(prefix, QString::fromLatin1(".slave-socket")); + TQString prefix = locateLocal("socket", KGlobal::instance()->instanceName()); + KTempFile socketfile(prefix, TQString::fromLatin1(".slave-socket")); if ( socketfile.status() != 0 ) return 0; @@ -479,25 +479,25 @@ Slave* Slave::holdSlave( const QString &protocol, const KURL& url ) #endif #ifndef Q_WS_WIN - KServerSocket *kss = new KServerSocket(QFile::encodeName(socketfile.name())); + KServerSocket *kss = new KServerSocket(TQFile::encodeName(socketfile.name())); Slave *slave = new Slave(kss, protocol, socketfile.name()); #else Slave *slave = 0; #endif - QByteArray params, reply; - QCString replyType; - QDataStream stream(params, IO_WriteOnly); + TQByteArray params, reply; + TQCString replyType; + TQDataStream stream(params, IO_WriteOnly); stream << url << socketfile.name(); - QCString launcher = KApplication::launcher(); - if (!client->call(launcher, launcher, "requestHoldSlave(KURL,QString)", + TQCString launcher = KApplication::launcher(); + if (!client->call(launcher, launcher, "requestHoldSlave(KURL,TQString)", params, replyType, reply)) { delete slave; return 0; } - QDataStream stream2(reply, IO_ReadOnly); + TQDataStream stream2(reply, IO_ReadOnly); pid_t pid; stream2 >> pid; if (!pid) @@ -507,7 +507,7 @@ Slave* Slave::holdSlave( const QString &protocol, const KURL& url ) } #ifndef Q_WS_WIN slave->setPID(pid); - QTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, slave, SLOT(timeout())); + TQTimer::singleShot(1000*SLAVE_CONNECTION_TIMEOUT_MIN, slave, TQT_SLOT(timeout())); #endif return slave; } diff --git a/kio/kio/slave.h b/kio/kio/slave.h index 8d6b24e36..790f7eab1 100644 --- a/kio/kio/slave.h +++ b/kio/kio/slave.h @@ -25,7 +25,7 @@ #include <time.h> #include <unistd.h> -#include <qobject.h> +#include <tqobject.h> #include <kurl.h> @@ -52,12 +52,12 @@ namespace KIO { * @internal * @since 3.2 */ - Slave(bool derived, KServerSocket *unixdomain, const QString &protocol, - const QString &socketname); // TODO(BIC): Remove in KDE 4 + Slave(bool derived, KServerSocket *unixdomain, const TQString &protocol, + const TQString &socketname); // TODO(BIC): Remove in KDE 4 public: Slave(KServerSocket *unixdomain, - const QString &protocol, const QString &socketname); + const TQString &protocol, const TQString &socketname); virtual ~Slave(); @@ -82,8 +82,8 @@ namespace KIO { * @param user to login as * @param passwd to login with */ - void setHost( const QString &host, int port, - const QString &user, const QString &passwd); // TODO(BIC): make virtual + void setHost( const TQString &host, int port, + const TQString &user, const TQString &passwd); // TODO(BIC): make virtual /** * Clear host info. @@ -100,9 +100,9 @@ namespace KIO { * * @return name of protocol handled by this slave, as seen by the user */ - QString protocol() { return m_protocol; } + TQString protocol() { return m_protocol; } - void setProtocol(const QString & protocol); + void setProtocol(const TQString & protocol); /** * The actual protocol used to handle the request. * @@ -115,12 +115,12 @@ namespace KIO { * * @return the actual protocol (io-slave) that handled the request */ - QString slaveProtocol() { return m_slaveProtocol; } + TQString slaveProtocol() { return m_slaveProtocol; } /** * @return Host this slave is (was?) connected to */ - QString host() { return m_host; } + TQString host() { return m_host; } /** * @return port this slave is (was?) connected to @@ -130,12 +130,12 @@ namespace KIO { /** * @return User this slave is (was?) logged in as */ - QString user() { return m_user; } + TQString user() { return m_user; } /** * @return Passwd used to log in */ - QString passwd() { return m_passwd; } + TQString passwd() { return m_passwd; } /** * Creates a new slave. @@ -148,9 +148,9 @@ namespace KIO { * @return 0 on failure, or a pointer to a slave otherwise. * @todo What are legal @p protocol values? */ - static Slave* createSlave( const QString &protocol, const KURL& url, int& error, QString& error_text ); + static Slave* createSlave( const TQString &protocol, const KURL& url, int& error, TQString& error_text ); - static Slave* holdSlave( const QString &protocol, const KURL& url ); + static Slave* holdSlave( const TQString &protocol, const KURL& url ); // == communication with connected kioslave == // whenever possible prefer these methods over the respective @@ -175,7 +175,7 @@ namespace KIO { * @param data byte array containing data * @since 3.2 */ - void send(int cmd, const QByteArray &data = QByteArray());// TODO(BIC): make virtual + void send(int cmd, const TQByteArray &data = TQByteArray());// TODO(BIC): make virtual // == end communication with connected kioslave == /** @@ -220,14 +220,14 @@ namespace KIO { void unlinkSocket(); private: - QString m_protocol; - QString m_slaveProtocol; - QString m_host; + TQString m_protocol; + TQString m_slaveProtocol; + TQString m_host; int m_port; - QString m_user; - QString m_passwd; + TQString m_user; + TQString m_passwd; KServerSocket *serv; - QString m_socket; + TQString m_socket; pid_t m_pid; bool contacted; bool dead; @@ -243,7 +243,7 @@ namespace KIO { VIRTUAL_SET_HOST, VIRTUAL_SET_CONFIG }; struct SendParams { int cmd; - const QByteArray *arr; + const TQByteArray *arr; }; struct HoldParams { const KURL *url; @@ -252,10 +252,10 @@ namespace KIO { bool retval; }; struct SetHostParams { - const QString *host; + const TQString *host; int port; - const QString *user; - const QString *passwd; + const TQString *user; + const TQString *passwd; }; struct SetConfigParams { const MetaData *config; diff --git a/kio/kio/slavebase.cpp b/kio/kio/slavebase.cpp index c52234f6d..ad683a009 100644 --- a/kio/kio/slavebase.cpp +++ b/kio/kio/slavebase.cpp @@ -40,7 +40,7 @@ #include <signal.h> #include <time.h> -#include <qfile.h> +#include <tqfile.h> #include <dcopclient.h> @@ -68,10 +68,10 @@ using namespace KIO; -template class QPtrList<QValueList<UDSAtom> >; -typedef QValueList<QCString> AuthKeysList; -typedef QMap<QString,QCString> AuthKeysMap; -#define KIO_DATA QByteArray data; QDataStream stream( data, IO_WriteOnly ); stream +template class TQPtrList<TQValueList<UDSAtom> >; +typedef TQValueList<TQCString> AuthKeysList; +typedef TQMap<TQString,TQCString> AuthKeysMap; +#define KIO_DATA TQByteArray data; TQDataStream stream( data, IO_WriteOnly ); stream #define KIO_FILESIZE_T(x) (unsigned long)(x & 0xffffffff) << (unsigned long)(x >> 32) namespace KIO { @@ -82,17 +82,17 @@ public: SlaveBaseConfig(SlaveBase *_slave) : slave(_slave) { } - bool internalHasGroup(const QCString &) const { qWarning("hasGroup(const QCString &)"); + bool internalHasGroup(const TQCString &) const { qWarning("hasGroup(const TQCString &)"); return false; } - QStringList groupList() const { return QStringList(); } + TQStringList groupList() const { return TQStringList(); } - QMap<QString,QString> entryMap(const QString &group) const - { Q_UNUSED(group); return QMap<QString,QString>(); } + TQMap<TQString,TQString> entryMap(const TQString &group) const + { Q_UNUSED(group); return TQMap<TQString,TQString>(); } void reparseConfiguration() { } - KEntryMap internalEntryMap( const QString &pGroup) const { Q_UNUSED(pGroup); return KEntryMap(); } + KEntryMap internalEntryMap( const TQString &pGroup) const { Q_UNUSED(pGroup); return KEntryMap(); } KEntryMap internalEntryMap() const { return KEntryMap(); } @@ -102,7 +102,7 @@ return false; } KEntry lookupData(const KEntryKey &_key) const { KEntry entry; - QString value = slave->metaData(_key.c_key); + TQString value = slave->metaData(_key.c_key); if (!value.isNull()) entry.mValue = value.utf8(); return entry; @@ -114,7 +114,7 @@ protected: class SlaveBasePrivate { public: - QString slaveid; + TQString slaveid; bool resume:1; bool needSendCanResume:1; bool onHold:1; @@ -129,7 +129,7 @@ public: DCOPClient *dcopClient; KRemoteEncoding *remotefile; time_t timeout; - QByteArray timeoutData; + TQByteArray timeoutData; }; } @@ -159,12 +159,12 @@ static void genericsig_handler(int sigNumber) ////////////// -SlaveBase::SlaveBase( const QCString &protocol, - const QCString &pool_socket, - const QCString &app_socket ) +SlaveBase::SlaveBase( const TQCString &protocol, + const TQCString &pool_socket, + const TQCString &app_socket ) : mProtocol(protocol), m_pConnection(0), - mPoolSocket( QFile::decodeName(pool_socket)), - mAppSocket( QFile::decodeName(app_socket)) + mPoolSocket( TQFile::decodeName(pool_socket)), + mAppSocket( TQFile::decodeName(app_socket)) { s_protocol = protocol.data(); #ifdef Q_OS_UNIX @@ -218,7 +218,7 @@ SlaveBase::SlaveBase( const QCString &protocol, d = new SlaveBasePrivate; // by kahl for netmgr (need a way to identify slaves) d->slaveid = protocol; - d->slaveid += QString::number(getpid()); + d->slaveid += TQString::number(getpid()); d->resume = false; d->needSendCanResume = false; d->config = new SlaveBaseConfig(this); @@ -264,9 +264,9 @@ void SlaveBase::dispatchLoop() { if (d->timeout && (d->timeout < time(0))) { - QByteArray data = d->timeoutData; + TQByteArray data = d->timeoutData; d->timeout = 0; - d->timeoutData = QByteArray(); + d->timeoutData = TQByteArray(); special(data); } FD_ZERO(&rfds); @@ -295,7 +295,7 @@ void SlaveBase::dispatchLoop() if ((retval>0) && FD_ISSET(appconn->fd_from(), &rfds)) { // dispatch application messages int cmd; - QByteArray data; + TQByteArray data; if ( appconn->read(&cmd, data) != -1 ) { dispatch(cmd, data); @@ -337,10 +337,10 @@ void SlaveBase::dispatchLoop() #endif } -void SlaveBase::connectSlave(const QString& path) +void SlaveBase::connectSlave(const TQString& path) { #ifdef Q_OS_UNIX //TODO: KSocket not yet available on WIN32 - appconn->init(new KSocket(QFile::encodeName(path))); + appconn->init(new KSocket(TQFile::encodeName(path))); if (!appconn->inited()) { kdDebug(7019) << "SlaveBase: failed to connect to " << path << endl; @@ -356,21 +356,21 @@ void SlaveBase::disconnectSlave() appconn->close(); } -void SlaveBase::setMetaData(const QString &key, const QString &value) +void SlaveBase::setMetaData(const TQString &key, const TQString &value) { mOutgoingMetaData.replace(key, value); } -QString SlaveBase::metaData(const QString &key) const +TQString SlaveBase::metaData(const TQString &key) const { if (mIncomingMetaData.contains(key)) return mIncomingMetaData[key]; if (d->configData.contains(key)) return d->configData[key]; - return QString::null; + return TQString::null; } -bool SlaveBase::hasMetaData(const QString &key) const +bool SlaveBase::hasMetaData(const TQString &key) const { if (mIncomingMetaData.contains(key)) return true; @@ -380,10 +380,10 @@ bool SlaveBase::hasMetaData(const QString &key) const } // ### remove the next two methods for KDE4 (they miss the const) -QString SlaveBase::metaData(const QString &key) { +TQString SlaveBase::metaData(const TQString &key) { return const_cast<const SlaveBase*>(this)->metaData( key ); } -bool SlaveBase::hasMetaData(const QString &key) { +bool SlaveBase::hasMetaData(const TQString &key) { return const_cast<const SlaveBase*>(this)->hasMetaData( key ); } @@ -410,7 +410,7 @@ KRemoteEncoding *SlaveBase::remoteEncoding() return d->remotefile = new KRemoteEncoding(metaData("Charset").latin1()); } -void SlaveBase::data( const QByteArray &data ) +void SlaveBase::data( const TQByteArray &data ) { if (!mOutgoingMetaData.isEmpty()) sendMetaData(); @@ -430,7 +430,7 @@ void SlaveBase::dataReq( ) m_pConnection->send( MSG_DATA_REQ ); } -void SlaveBase::error( int _errid, const QString &_text ) +void SlaveBase::error( int _errid, const TQString &_text ) { mIncomingMetaData.clear(); // Clear meta data mOutgoingMetaData.clear(); @@ -468,7 +468,7 @@ void SlaveBase::needSubURLData() m_pConnection->send( MSG_NEED_SUBURL_DATA ); } -void SlaveBase::slaveStatus( const QString &host, bool connected ) +void SlaveBase::slaveStatus( const TQString &host, bool connected ) { pid_t pid = getpid(); Q_INT8 b = connected ? 1 : 0; @@ -572,7 +572,7 @@ static bool isSubCommand(int cmd) (cmd == CMD_MULTI_GET)); } -void SlaveBase::mimeType( const QString &_type) +void SlaveBase::mimeType( const TQString &_type) { // kdDebug(7019) << "(" << getpid() << ") SlaveBase::mimeType '" << _type << "'" << endl; int cmd; @@ -615,19 +615,19 @@ void SlaveBase::exit() ::exit(255); } -void SlaveBase::warning( const QString &_msg) +void SlaveBase::warning( const TQString &_msg) { KIO_DATA << _msg; m_pConnection->send( INF_WARNING, data ); } -void SlaveBase::infoMessage( const QString &_msg) +void SlaveBase::infoMessage( const TQString &_msg) { KIO_DATA << _msg; m_pConnection->send( INF_INFOMESSAGE, data ); } -bool SlaveBase::requestNetwork(const QString& host) +bool SlaveBase::requestNetwork(const TQString& host) { KIO_DATA << host << d->slaveid; m_pConnection->send( MSG_NET_REQUEST, data ); @@ -635,14 +635,14 @@ bool SlaveBase::requestNetwork(const QString& host) if ( waitForAnswer( INF_NETWORK_STATUS, 0, data ) != -1 ) { bool status; - QDataStream stream( data, IO_ReadOnly ); + TQDataStream stream( data, IO_ReadOnly ); stream >> status; return status; } else return false; } -void SlaveBase::dropNetwork(const QString& host) +void SlaveBase::dropNetwork(const TQString& host) { KIO_DATA << host << d->slaveid; m_pConnection->send( MSG_NET_DROP, data ); @@ -711,15 +711,15 @@ void SlaveBase::listEntries( const UDSEntryList& list ) d->sentListEntries+=(uint)list.count(); } -void SlaveBase::sendAuthenticationKey( const QCString& key, - const QCString& group, +void SlaveBase::sendAuthenticationKey( const TQCString& key, + const TQCString& group, bool keepPass ) { KIO_DATA << key << group << keepPass; m_pConnection->send( MSG_AUTH_KEY, data ); } -void SlaveBase::delCachedAuthentication( const QString& key ) +void SlaveBase::delCachedAuthentication( const TQString& key ) { KIO_DATA << key.utf8() ; m_pConnection->send( MSG_DEL_AUTH_KEY, data ); @@ -762,7 +762,7 @@ void SlaveBase::sigpipe_handler (int) // Don't add anything else here, especially no debug output } -void SlaveBase::setHost(QString const &, int, QString const &, QString const &) +void SlaveBase::setHost(TQString const &, int, TQString const &, TQString const &) { } @@ -774,7 +774,7 @@ void SlaveBase::stat(KURL const &) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_STAT)); } void SlaveBase::put(KURL const &, int, bool, bool) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_PUT)); } -void SlaveBase::special(const QByteArray &) +void SlaveBase::special(const TQByteArray &) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_SPECIAL)); } void SlaveBase::listDir(KURL const &) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_LISTDIR)); } @@ -784,7 +784,7 @@ void SlaveBase::mimetype(KURL const &url) { get(url); } void SlaveBase::rename(KURL const &, KURL const &, bool) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_RENAME)); } -void SlaveBase::symlink(QString const &, KURL const &, bool) +void SlaveBase::symlink(TQString const &, KURL const &, bool) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_SYMLINK)); } void SlaveBase::copy(KURL const &, KURL const &, int, bool) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_COPY)); } @@ -796,12 +796,12 @@ void SlaveBase::chmod(KURL const &, int) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_CHMOD)); } void SlaveBase::setSubURL(KURL const &) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_SUBURL)); } -void SlaveBase::multiGet(const QByteArray &) +void SlaveBase::multiGet(const TQByteArray &) { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_MULTI_GET)); } void SlaveBase::slave_status() -{ slaveStatus( QString::null, false ); } +{ slaveStatus( TQString::null, false ); } void SlaveBase::reparseConfiguration() { @@ -812,7 +812,7 @@ bool SlaveBase::dispatch() assert( m_pConnection ); int cmd; - QByteArray data; + TQByteArray data; if ( m_pConnection->read( &cmd, data ) == -1 ) { kdDebug(7019) << "SlaveBase::dispatch() has read error." << endl; @@ -825,14 +825,14 @@ bool SlaveBase::dispatch() bool SlaveBase::openPassDlg( AuthInfo& info ) { - return openPassDlg(info, QString::null); + return openPassDlg(info, TQString::null); } -bool SlaveBase::openPassDlg( AuthInfo& info, const QString &errorMsg ) +bool SlaveBase::openPassDlg( AuthInfo& info, const TQString &errorMsg ) { - QCString replyType; - QByteArray params; - QByteArray reply; + TQCString replyType; + TQByteArray params; + TQByteArray reply; AuthInfo authResult; long windowId = metaData("window-id").toLong(); long progressId = metaData("progress-id").toLong(); @@ -846,14 +846,14 @@ bool SlaveBase::openPassDlg( AuthInfo& info, const QString &errorMsg ) if (progressId) uiserver.setJobVisible( progressId, false ); - QDataStream stream(params, IO_WriteOnly); + TQDataStream stream(params, IO_WriteOnly); if (metaData("no-auth-prompt").lower() == "true") - stream << info << QString("<NoAuthPrompt>") << windowId << s_seqNr << userTimestamp; + stream << info << TQString("<NoAuthPrompt>") << windowId << s_seqNr << userTimestamp; else stream << info << errorMsg << windowId << s_seqNr << userTimestamp; - bool callOK = d->dcopClient->call( "kded", "kpasswdserver", "queryAuthInfo(KIO::AuthInfo, QString, long int, long int, unsigned long int)", + bool callOK = d->dcopClient->call( "kded", "kpasswdserver", "queryAuthInfo(KIO::AuthInfo, TQString, long int, long int, unsigned long int)", params, replyType, reply ); if (progressId) @@ -867,7 +867,7 @@ bool SlaveBase::openPassDlg( AuthInfo& info, const QString &errorMsg ) if ( replyType == "KIO::AuthInfo" ) { - QDataStream stream2( reply, IO_ReadOnly ); + TQDataStream stream2( reply, IO_ReadOnly ); stream2 >> authResult >> s_seqNr; } else @@ -888,21 +888,21 @@ bool SlaveBase::openPassDlg( AuthInfo& info, const QString &errorMsg ) return true; } -int SlaveBase::messageBox( MessageBoxType type, const QString &text, const QString &caption, - const QString &buttonYes, const QString &buttonNo ) +int SlaveBase::messageBox( MessageBoxType type, const TQString &text, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo ) { - return messageBox( text, type, caption, buttonYes, buttonNo, QString::null ); + return messageBox( text, type, caption, buttonYes, buttonNo, TQString::null ); } -int SlaveBase::messageBox( const QString &text, MessageBoxType type, const QString &caption, - const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName ) +int SlaveBase::messageBox( const TQString &text, MessageBoxType type, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo, const TQString &dontAskAgainName ) { kdDebug(7019) << "messageBox " << type << " " << text << " - " << caption << buttonYes << buttonNo << endl; KIO_DATA << (Q_INT32)type << text << caption << buttonYes << buttonNo << dontAskAgainName; m_pConnection->send( INF_MESSAGEBOX, data ); if ( waitForAnswer( CMD_MESSAGEBOXANSWER, 0, data ) != -1 ) { - QDataStream stream( data, IO_ReadOnly ); + TQDataStream stream( data, IO_ReadOnly ); int answer; stream >> answer; kdDebug(7019) << "got messagebox answer" << answer << endl; @@ -933,7 +933,7 @@ bool SlaveBase::canResume( KIO::filesize_t offset ) -int SlaveBase::waitForAnswer( int expected1, int expected2, QByteArray & data, int *pCmd ) +int SlaveBase::waitForAnswer( int expected1, int expected2, TQByteArray & data, int *pCmd ) { int cmd, result; for (;;) @@ -961,14 +961,14 @@ int SlaveBase::waitForAnswer( int expected1, int expected2, QByteArray & data, i } -int SlaveBase::readData( QByteArray &buffer) +int SlaveBase::readData( TQByteArray &buffer) { int result = waitForAnswer( MSG_DATA, 0, buffer ); //kdDebug(7019) << "readData: length = " << result << " " << endl; return result; } -void SlaveBase::setTimeoutSpecialCommand(int timeout, const QByteArray &data) +void SlaveBase::setTimeoutSpecialCommand(int timeout, const TQByteArray &data) { if (timeout > 0) d->timeout = time(0)+(time_t)timeout; @@ -980,9 +980,9 @@ void SlaveBase::setTimeoutSpecialCommand(int timeout, const QByteArray &data) d->timeoutData = data; } -void SlaveBase::dispatch( int command, const QByteArray &data ) +void SlaveBase::dispatch( int command, const TQByteArray &data ) { - QDataStream stream( data, IO_ReadOnly ); + TQDataStream stream( data, IO_ReadOnly ); KURL url; int i; @@ -991,8 +991,8 @@ void SlaveBase::dispatch( int command, const QByteArray &data ) case CMD_HOST: { // Reset s_seqNr, see kpasswdserver/DESIGN s_seqNr = 0; - QString passwd; - QString host, user; + TQString passwd; + TQString host, user; stream >> host >> i >> user >> passwd; setHost( host, i, user, passwd ); } @@ -1009,8 +1009,8 @@ void SlaveBase::dispatch( int command, const QByteArray &data ) case CMD_SLAVE_CONNECT: { d->onHold = false; - QString app_socket; - QDataStream stream( data, IO_ReadOnly); + TQString app_socket; + TQDataStream stream( data, IO_ReadOnly); stream >> app_socket; appconn->send( MSG_SLAVE_ACK ); disconnectSlave(); @@ -1020,7 +1020,7 @@ void SlaveBase::dispatch( int command, const QByteArray &data ) case CMD_SLAVE_HOLD: { KURL url; - QDataStream stream( data, IO_ReadOnly); + TQDataStream stream( data, IO_ReadOnly); stream >> url; d->onHoldUrl = url; d->onHold = true; @@ -1087,7 +1087,7 @@ void SlaveBase::dispatch( int command, const QByteArray &data ) case CMD_SYMLINK: { Q_INT8 iOverwrite; - QString target; + TQString target; stream >> target >> url >> iOverwrite; bool overwrite = (iOverwrite != 0); symlink( target, url, overwrite ); @@ -1135,20 +1135,20 @@ void SlaveBase::dispatch( int command, const QByteArray &data ) } } -QString SlaveBase::createAuthCacheKey( const KURL& url ) +TQString SlaveBase::createAuthCacheKey( const KURL& url ) { if( !url.isValid() ) - return QString::null; + return TQString::null; // Generate the basic key sequence. - QString key = url.protocol(); + TQString key = url.protocol(); key += '-'; key += url.host(); int port = url.port(); if( port ) { key += ':'; - key += QString::number(port); + key += TQString::number(port); } return key; @@ -1178,9 +1178,9 @@ bool SlaveBase::pingCacheDaemon() const bool SlaveBase::checkCachedAuthentication( AuthInfo& info ) { - QCString replyType; - QByteArray params; - QByteArray reply; + TQCString replyType; + TQByteArray params; + TQByteArray reply; AuthInfo authResult; long windowId = metaData("window-id").toLong(); unsigned long userTimestamp = metaData("user-timestamp").toULong(); @@ -1189,7 +1189,7 @@ bool SlaveBase::checkCachedAuthentication( AuthInfo& info ) (void) dcopClient(); // Make sure to have a dcop client. - QDataStream stream(params, IO_WriteOnly); + TQDataStream stream(params, IO_WriteOnly); stream << info << windowId << userTimestamp; if ( !d->dcopClient->call( "kded", "kpasswdserver", "checkAuthInfo(KIO::AuthInfo, long int, unsigned long int)", @@ -1201,7 +1201,7 @@ bool SlaveBase::checkCachedAuthentication( AuthInfo& info ) if ( replyType == "KIO::AuthInfo" ) { - QDataStream stream2( reply, IO_ReadOnly ); + TQDataStream stream2( reply, IO_ReadOnly ); stream2 >> authResult; } else @@ -1221,12 +1221,12 @@ bool SlaveBase::checkCachedAuthentication( AuthInfo& info ) bool SlaveBase::cacheAuthentication( const AuthInfo& info ) { - QByteArray params; + TQByteArray params; long windowId = metaData("window-id").toLong(); (void) dcopClient(); // Make sure to have a dcop client. - QDataStream stream(params, IO_WriteOnly); + TQDataStream stream(params, IO_WriteOnly); stream << info << windowId; d->dcopClient->send( "kded", "kpasswdserver", "addAuthInfo(KIO::AuthInfo, long int)", params ); @@ -1237,7 +1237,7 @@ bool SlaveBase::cacheAuthentication( const AuthInfo& info ) int SlaveBase::connectTimeout() { bool ok; - QString tmp = metaData("ConnectTimeout"); + TQString tmp = metaData("ConnectTimeout"); int result = tmp.toInt(&ok); if (ok) return result; @@ -1247,7 +1247,7 @@ int SlaveBase::connectTimeout() int SlaveBase::proxyConnectTimeout() { bool ok; - QString tmp = metaData("ProxyConnectTimeout"); + TQString tmp = metaData("ProxyConnectTimeout"); int result = tmp.toInt(&ok); if (ok) return result; @@ -1258,7 +1258,7 @@ int SlaveBase::proxyConnectTimeout() int SlaveBase::responseTimeout() { bool ok; - QString tmp = metaData("ResponseTimeout"); + TQString tmp = metaData("ResponseTimeout"); int result = tmp.toInt(&ok); if (ok) return result; @@ -1269,7 +1269,7 @@ int SlaveBase::responseTimeout() int SlaveBase::readTimeout() { bool ok; - QString tmp = metaData("ReadTimeout"); + TQString tmp = metaData("ReadTimeout"); int result = tmp.toInt(&ok); if (ok) return result; diff --git a/kio/kio/slavebase.h b/kio/kio/slavebase.h index f10ac3553..82370ce56 100644 --- a/kio/kio/slavebase.h +++ b/kio/kio/slavebase.h @@ -45,7 +45,7 @@ class SlaveBasePrivate; class KIO_EXPORT SlaveBase { public: - SlaveBase( const QCString &protocol, const QCString &pool_socket, const QCString &app_socket); + SlaveBase( const TQCString &protocol, const TQCString &pool_socket, const TQCString &app_socket); virtual ~SlaveBase(); /** @@ -77,11 +77,11 @@ public: * Sends data in the slave to the job (i.e. in get). * * To signal end of data, simply send an empty - * QByteArray(). + * TQByteArray(). * * @param data the data read by the slave */ - void data( const QByteArray &data ); + void data( const TQByteArray &data ); /** * Asks for data from the job. @@ -106,7 +106,7 @@ public: * @param _errid the error code from KIO::Error * @param _text the rich text error message */ - void error( int _errid, const QString &_text ); + void error( int _errid, const TQString &_text ); /** * Call in openConnection, if you reimplement it, when you're done. @@ -130,7 +130,7 @@ public: * empty if not connected) * @param connected Whether an actual network connection exists. **/ - void slaveStatus(const QString &host, bool connected); + void slaveStatus(const TQString &host, bool connected); /** * Call this from stat() to express details about an object, the @@ -216,18 +216,18 @@ public: * Call this in mimetype() and in get(), when you know the mimetype. * See mimetype about other ways to implement it. */ - void mimeType( const QString &_type ); + void mimeType( const TQString &_type ); /** * Call to signal a warning, to be displayed in a dialog box. */ - void warning( const QString &msg ); + void warning( const TQString &msg ); /** * Call to signal a message, to be displayed if the application wants to, * for instance in a status bar. Usual examples are "connecting to host xyz", etc. */ - void infoMessage( const QString &msg ); + void infoMessage( const TQString &msg ); enum MessageBoxType { QuestionYesNo = 1, WarningYesNo = 2, WarningContinueCancel = 3, WarningYesNoCancel = 4, Information = 5, SSLMessageBox = 6 }; @@ -244,10 +244,10 @@ public: * and for Information, none is used. * @return a button code, as defined in KMessageBox, or 0 on communication error. */ - int messageBox( MessageBoxType type, const QString &text, - const QString &caption = QString::null, - const QString &buttonYes = QString::null, - const QString &buttonNo = QString::null ); + int messageBox( MessageBoxType type, const TQString &text, + const TQString &caption = TQString::null, + const TQString &buttonYes = TQString::null, + const TQString &buttonNo = TQString::null ); /** * Call this to show a message box from the slave @@ -265,43 +265,43 @@ public: * @return a button code, as defined in KMessageBox, or 0 on communication error. * @since 3.3 */ - int messageBox( const QString &text, MessageBoxType type, - const QString &caption = QString::null, - const QString &buttonYes = QString::null, - const QString &buttonNo = QString::null, - const QString &dontAskAgainName = QString::null ); + int messageBox( const TQString &text, MessageBoxType type, + const TQString &caption = TQString::null, + const TQString &buttonYes = TQString::null, + const TQString &buttonNo = TQString::null, + const TQString &dontAskAgainName = TQString::null ); /** * Sets meta-data to be send to the application before the first * data() or finished() signal. */ - void setMetaData(const QString &key, const QString &value); + void setMetaData(const TQString &key, const TQString &value); /** * Queries for the existence of a certain config/meta-data entry * send by the application to the slave. * @since 3.2 */ - bool hasMetaData(const QString &key) const; + bool hasMetaData(const TQString &key) const; /** * Queries for config/meta-data send by the application to the slave. * @since 3.2 */ - QString metaData(const QString &key) const; + TQString metaData(const TQString &key) const; /** * @obsolete kept for binary compatibility * Queries for the existence of a certain config/meta-data entry * send by the application to the slave. */ - bool hasMetaData(const QString &key); + bool hasMetaData(const TQString &key); /** * @obsolete kept for binary compatibility * Queries for config/meta-data sent by the application to the slave. */ - QString metaData(const QString &key); + TQString metaData(const TQString &key); /** * @internal for ForwardingSlaveBase @@ -344,7 +344,7 @@ public: * * This method is called whenever a change in host, port or user occurs. */ - virtual void setHost(const QString& host, int port, const QString& user, const QString& pass); + virtual void setHost(const TQString& host, int port, const TQString& user, const TQString& pass); /** * Prepare slave for streaming operation @@ -453,7 +453,7 @@ public: * @param dest The symlink to create. * @param overwrite whether to automatically overwrite if the dest exists */ - virtual void symlink( const QString& target, const KURL& dest, bool overwrite ); + virtual void symlink( const TQString& target, const KURL& dest, bool overwrite ); /** * Change permissions on @p path @@ -492,7 +492,7 @@ public: * slave, but usually starts with an int for the command number. * Document your slave's commands, at least in its header file. */ - virtual void special( const QByteArray & data ); + virtual void special( const TQByteArray & data ); /** * Used for multiple get. Currently only used foir HTTP pielining @@ -501,7 +501,7 @@ public: * @param data packed data; Contains number of URLs to fetch, and for * each URL the URL itself and its associated MetaData. */ - virtual void multiGet( const QByteArray & data ); + virtual void multiGet( const TQByteArray & data ); /** * Called to get the status of the slave. Slave should respond @@ -552,7 +552,7 @@ public: * cancels any pending timeout. * @since 3.1 */ - void setTimeoutSpecialCommand(int timeout, const QByteArray &data=QByteArray()); + void setTimeoutSpecialCommand(int timeout, const TQByteArray &data=TQByteArray()); /** * @internal @@ -574,7 +574,7 @@ public: /** * @internal */ - virtual void dispatch( int command, const QByteArray &data ); + virtual void dispatch( int command, const TQByteArray &data ); /** * Read data send by the job, after a dataReq @@ -584,7 +584,7 @@ public: * > 0 bytes read * < 0 error **/ - int readData( QByteArray &buffer ); + int readData( TQByteArray &buffer ); /** * internal function to be called by the slave. @@ -603,7 +603,7 @@ public: * internal function to connect a slave to/ disconnect from * either the slave pool or the application */ - void connectSlave(const QString& path); + void connectSlave(const TQString& path); void disconnectSlave(); /** @@ -618,10 +618,10 @@ public: * KIO::AuthInfo authInfo; * if ( openPassDlg( authInfo ) ) * { - * kdDebug() << QString::fromLatin1("User: ") + * kdDebug() << TQString::fromLatin1("User: ") * << authInfo.username << endl; - * kdDebug() << QString::fromLatin1("Password: ") - * << QString::fromLatin1("Not displayed here!") << endl; + * kdDebug() << TQString::fromLatin1("Password: ") + * << TQString::fromLatin1("Not displayed here!") << endl; * } * \endcode * @@ -632,13 +632,13 @@ public: * KIO::AuthInfo authInfo; * authInfo.caption= "Acme Password Dialog"; * authInfo.username= "Wile E. Coyote"; - * QString errorMsg = "You entered an incorrect password."; + * TQString errorMsg = "You entered an incorrect password."; * if ( openPassDlg( authInfo, errorMsg ) ) * { - * kdDebug() << QString::fromLatin1("User: ") + * kdDebug() << TQString::fromLatin1("User: ") * << authInfo.username << endl; - * kdDebug() << QString::fromLatin1("Password: ") - * << QString::fromLatin1("Not displayed here!") << endl; + * kdDebug() << TQString::fromLatin1("Password: ") + * << TQString::fromLatin1("Not displayed here!") << endl; * } * \endcode * @@ -655,7 +655,7 @@ public: * @return @p true if user clicks on "OK", @p false otherwsie. * @since 3.1 */ - bool openPassDlg( KIO::AuthInfo& info, const QString &errorMsg ); + bool openPassDlg( KIO::AuthInfo& info, const TQString &errorMsg ); /** * Same as above function except it does not need error message. @@ -712,7 +712,7 @@ public: * Creates a basic key to be used to cache the password. * @param url the url from which the key is supposed to be generated */ - QString createAuthCacheKey( const KURL& url ); + TQString createAuthCacheKey( const KURL& url ); /** * @obsolete as of 3.1. Use openPassDlg instead. @@ -721,7 +721,7 @@ public: * Cache authentication information is now stored automatically * by openPassDlg. */ - void sendAuthenticationKey( const QCString& gKey, const QCString& key, bool keep ); + void sendAuthenticationKey( const TQCString& gKey, const TQCString& key, bool keep ); /** * @obsolete as of 3.1. Use openPassDlg instead. @@ -731,7 +731,7 @@ public: * removed automatically when a given session ends, i.e. the * application is closed. */ - void delCachedAuthentication( const QString& key ); + void delCachedAuthentication( const TQString& key ); /** * @obsolete as of 3.1. Use openPassDlg instead. @@ -763,7 +763,7 @@ public: * @return true in theorie, the host is reachable * false the system is offline and the host is in a remote network. */ - bool requestNetwork(const QString& host = QString::null); + bool requestNetwork(const TQString& host = TQString::null); /** * Used by the slave to withdraw a connection requested by @@ -778,7 +778,7 @@ public: * * A slave should call this function every time it disconnect from a host. * */ - void dropNetwork(const QString& host = QString::null); + void dropNetwork(const TQString& host = TQString::null); /** * Return the dcop client used by this slave. @@ -790,7 +790,7 @@ public: * Wait for an answer to our request, until we get @p expected1 or @p expected2 * @return the result from readData, as well as the cmd in *pCmd if set, and the data in @p data */ - int waitForAnswer( int expected1, int expected2, QByteArray & data, int * pCmd = 0 ); + int waitForAnswer( int expected1, int expected2, TQByteArray & data, int * pCmd = 0 ); /** * Internal function to transmit meta data to the application. @@ -800,7 +800,7 @@ public: /** * Name of the protocol supported by this slave */ - QCString mProtocol; + TQCString mProtocol; Connection * m_pConnection; @@ -826,8 +826,8 @@ protected: uint listEntryCurrentSize; long listEntry_sec, listEntry_usec; Connection *appconn; - QString mPoolSocket; - QString mAppSocket; + TQString mPoolSocket; + TQString mAppSocket; bool mConnectedToApp; static long s_seqNr; virtual void virtual_hook( int id, void* data ); diff --git a/kio/kio/slaveconfig.cpp b/kio/kio/slaveconfig.cpp index e0a56b243..fe888c99c 100644 --- a/kio/kio/slaveconfig.cpp +++ b/kio/kio/slaveconfig.cpp @@ -22,7 +22,7 @@ #include <assert.h> -#include <qdict.h> +#include <tqdict.h> #include <kconfig.h> #include <kstaticdeleter.h> @@ -46,11 +46,11 @@ public: public: MetaData global; - QDict<MetaData> host; + TQDict<MetaData> host; KConfig *configFile; }; -static void readConfig(KConfig *config, const QString & group, MetaData *metaData) +static void readConfig(KConfig *config, const TQString & group, MetaData *metaData) { *metaData += config->entryMap(group); } @@ -59,12 +59,12 @@ class SlaveConfigPrivate { public: void readGlobalConfig(); - SlaveConfigProtocol *readProtocolConfig(const QString &_protocol); - SlaveConfigProtocol *findProtocolConfig(const QString &_protocol); - void readConfigProtocolHost(const QString &_protocol, SlaveConfigProtocol *scp, const QString &host); + SlaveConfigProtocol *readProtocolConfig(const TQString &_protocol); + SlaveConfigProtocol *findProtocolConfig(const TQString &_protocol); + void readConfigProtocolHost(const TQString &_protocol, SlaveConfigProtocol *scp, const TQString &host); public: MetaData global; - QDict<SlaveConfigProtocol> protocol; + TQDict<SlaveConfigProtocol> protocol; }; void SlaveConfigPrivate::readGlobalConfig() @@ -77,12 +77,12 @@ void SlaveConfigPrivate::readGlobalConfig() readConfig(config, "<default>", &global); } -SlaveConfigProtocol* SlaveConfigPrivate::readProtocolConfig(const QString &_protocol) +SlaveConfigProtocol* SlaveConfigPrivate::readProtocolConfig(const TQString &_protocol) { SlaveConfigProtocol *scp = protocol.find(_protocol); if (!scp) { - QString filename = KProtocolInfo::config(_protocol); + TQString filename = KProtocolInfo::config(_protocol); scp = new SlaveConfigProtocol; scp->configFile = new KConfig(filename, true, false); protocol.insert(_protocol, scp); @@ -92,7 +92,7 @@ SlaveConfigProtocol* SlaveConfigPrivate::readProtocolConfig(const QString &_prot return scp; } -SlaveConfigProtocol* SlaveConfigPrivate::findProtocolConfig(const QString &_protocol) +SlaveConfigProtocol* SlaveConfigPrivate::findProtocolConfig(const TQString &_protocol) { SlaveConfigProtocol *scp = protocol.find(_protocol); if (!scp) @@ -100,14 +100,14 @@ SlaveConfigProtocol* SlaveConfigPrivate::findProtocolConfig(const QString &_prot return scp; } -void SlaveConfigPrivate::readConfigProtocolHost(const QString &, SlaveConfigProtocol *scp, const QString &host) +void SlaveConfigPrivate::readConfigProtocolHost(const TQString &, SlaveConfigProtocol *scp, const TQString &host) { MetaData *metaData = new MetaData; scp->host.replace(host, metaData); // Read stuff // Break host into domains - QString domain = host; + TQString domain = host; if (!domain.contains('.')) { @@ -156,17 +156,17 @@ SlaveConfig::~SlaveConfig() _self = 0; } -void SlaveConfig::setConfigData(const QString &protocol, - const QString &host, - const QString &key, - const QString &value ) +void SlaveConfig::setConfigData(const TQString &protocol, + const TQString &host, + const TQString &key, + const TQString &value ) { MetaData config; config.insert(key, value); setConfigData(protocol, host, config); } -void SlaveConfig::setConfigData(const QString &protocol, const QString &host, const MetaData &config ) +void SlaveConfig::setConfigData(const TQString &protocol, const TQString &host, const MetaData &config ) { if (protocol.isEmpty()) d->global += config; @@ -190,7 +190,7 @@ void SlaveConfig::setConfigData(const QString &protocol, const QString &host, co } } -MetaData SlaveConfig::configData(const QString &protocol, const QString &host) +MetaData SlaveConfig::configData(const TQString &protocol, const TQString &host) { MetaData config = d->global; SlaveConfigProtocol *scp = d->findProtocolConfig(protocol); @@ -209,7 +209,7 @@ MetaData SlaveConfig::configData(const QString &protocol, const QString &host) return config; } -QString SlaveConfig::configData(const QString &protocol, const QString &host, const QString &key) +TQString SlaveConfig::configData(const TQString &protocol, const TQString &host, const TQString &key) { return configData(protocol, host)[key]; } diff --git a/kio/kio/slaveconfig.h b/kio/kio/slaveconfig.h index 5b912db2f..1eaaa55e4 100644 --- a/kio/kio/slaveconfig.h +++ b/kio/kio/slaveconfig.h @@ -21,7 +21,7 @@ #ifndef KIO_SLAVE_CONFIG_H #define KIO_SLAVE_CONFIG_H -#include <qobject.h> +#include <tqobject.h> #include <kio/global.h> namespace KIO { @@ -58,7 +58,7 @@ namespace KIO { * Changes made to the slave configuration only apply to slaves * used by the current process. */ - void setConfigData(const QString &protocol, const QString &host, const QString &key, const QString &value ); + void setConfigData(const TQString &protocol, const TQString &host, const TQString &key, const TQString &value ); /** * Configure slaves of type @p protocol with @p config. @@ -68,19 +68,19 @@ namespace KIO { * Changes made to the slave configuration only apply to slaves * used by the current process. */ - void setConfigData(const QString &protocol, const QString &host, const MetaData &config ); + void setConfigData(const TQString &protocol, const TQString &host, const MetaData &config ); /** * Query slave configuration for slaves of type @p protocol when * dealing with @p host. */ - MetaData configData(const QString &protocol, const QString &host); + MetaData configData(const TQString &protocol, const TQString &host); /** * Query a specific configuration key for slaves of type @p protocol when * dealing with @p host. */ - QString configData(const QString &protocol, const QString &host, const QString &key); + TQString configData(const TQString &protocol, const TQString &host, const TQString &key); /** * Undo any changes made by calls to setConfigData. @@ -95,7 +95,7 @@ namespace KIO { * configuration changes with setConfigData based on the * host. */ - void configNeeded(const QString &protocol, const QString &host); + void configNeeded(const TQString &protocol, const TQString &host); protected: SlaveConfig(); static SlaveConfig *_self; diff --git a/kio/kio/slaveinterface.cpp b/kio/kio/slaveinterface.cpp index c468187ec..563aad17e 100644 --- a/kio/kio/slaveinterface.cpp +++ b/kio/kio/slaveinterface.cpp @@ -30,12 +30,12 @@ #include <kapplication.h> #include <dcopclient.h> #include <time.h> -#include <qtimer.h> +#include <tqtimer.h> using namespace KIO; -QDataStream &operator <<(QDataStream &s, const KIO::UDSEntry &e ) +TQDataStream &operator <<(TQDataStream &s, const KIO::UDSEntry &e ) { // On 32-bit platforms we send UDS_SIZE with UDS_SIZE_LARGE in front // of it to carry the 32 msb. We can't send a 64 bit UDS_SIZE because @@ -67,7 +67,7 @@ QDataStream &operator <<(QDataStream &s, const KIO::UDSEntry &e ) return s; } -QDataStream &operator >>(QDataStream &s, KIO::UDSEntry &e ) +TQDataStream &operator >>(TQDataStream &s, KIO::UDSEntry &e ) { e.clear(); Q_UINT32 size; @@ -124,7 +124,7 @@ public: size_t last_time; KIO::filesize_t filesize, offset; - QTimer speed_timer; + TQTimer speed_timer; }; ////////////// @@ -135,18 +135,18 @@ SlaveInterface::SlaveInterface( Connection * connection ) m_progressId = 0; d = new SlaveInterfacePrivate; - connect(&d->speed_timer, SIGNAL(timeout()), SLOT(calcSpeed())); + connect(&d->speed_timer, TQT_SIGNAL(timeout()), TQT_SLOT(calcSpeed())); } SlaveInterface::~SlaveInterface() { // Note: no kdDebug() here (scheduler is deleted very late) - m_pConnection = 0; // a bit like the "wasDeleted" of QObject... + m_pConnection = 0; // a bit like the "wasDeleted" of TQObject... delete d; } -static KIO::filesize_t readFilesize_t(QDataStream &stream) +static KIO::filesize_t readFilesize_t(TQDataStream &stream) { KIO::filesize_t result; unsigned long ul; @@ -165,7 +165,7 @@ bool SlaveInterface::dispatch() assert( m_pConnection ); int cmd; - QByteArray data; + TQByteArray data; if (m_pConnection->read( &cmd, data ) == -1) return false; @@ -218,13 +218,13 @@ void SlaveInterface::calcSpeed() } } -bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) +bool SlaveInterface::dispatch( int _cmd, const TQByteArray &rawdata ) { //kdDebug(7007) << "dispatch " << _cmd << endl; - QDataStream stream( rawdata, IO_ReadOnly ); + TQDataStream stream( rawdata, IO_ReadOnly ); - QString str1; + TQString str1; Q_INT32 i; Q_INT8 b; Q_UINT32 ul; @@ -282,7 +282,7 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) case MSG_SLAVE_STATUS: { pid_t pid; - QCString protocol; + TQCString protocol; stream >> pid >> protocol >> str1 >> b; emit slaveStatus(pid, protocol, str1, (b != 0)); } @@ -337,7 +337,7 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) emit mimeType( str1 ); if (!m_pConnection->suspended()) - m_pConnection->sendnow( CMD_NONE, QByteArray() ); + m_pConnection->sendnow( CMD_NONE, TQByteArray() ); break; case INF_WARNING: stream >> str1; @@ -352,7 +352,7 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) } case INF_MESSAGEBOX: { kdDebug(7007) << "needs a msg box" << endl; - QString text, caption, buttonYes, buttonNo, dontAskAgainName; + TQString text, caption, buttonYes, buttonNo, dontAskAgainName; int type; stream >> type >> text >> caption >> buttonYes >> buttonNo; if (stream.atEnd()) @@ -364,7 +364,7 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) break; } case INF_INFOMESSAGE: { - QString msg; + TQString msg; stream >> msg; infoMessage(msg); break; @@ -376,15 +376,15 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) break; } case MSG_NET_REQUEST: { - QString host; - QString slaveid; + TQString host; + TQString slaveid; stream >> host >> slaveid; requestNetwork(host, slaveid); break; } case MSG_NET_DROP: { - QString host; - QString slaveid; + TQString host; + TQString slaveid; stream >> host >> slaveid; dropNetwork(host, slaveid); break; @@ -395,7 +395,7 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) } case MSG_AUTH_KEY: { bool keep; - QCString key, group; + TQCString key, group; stream >> key >> group >> keep; kdDebug(7007) << "Got auth-key: " << key << endl << " group-key: " << group << endl @@ -404,7 +404,7 @@ bool SlaveInterface::dispatch( int _cmd, const QByteArray &rawdata ) break; } case MSG_DEL_AUTH_KEY: { - QCString key; + TQCString key; stream >> key; kdDebug(7007) << "Delete auth-key: " << key << endl; emit delAuthorization( key ); @@ -423,16 +423,16 @@ void SlaveInterface::setOffset( KIO::filesize_t o) KIO::filesize_t SlaveInterface::offset() const { return d->offset; } -void SlaveInterface::requestNetwork(const QString &host, const QString &slaveid) +void SlaveInterface::requestNetwork(const TQString &host, const TQString &slaveid) { kdDebug(7007) << "requestNetwork " << host << slaveid << endl; - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly ); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly ); stream << true; m_pConnection->sendnow( INF_NETWORK_STATUS, packedArgs ); } -void SlaveInterface::dropNetwork(const QString &host, const QString &slaveid) +void SlaveInterface::dropNetwork(const TQString &host, const TQString &slaveid) { kdDebug(7007) << "dropNetwork " << host << slaveid << endl; } @@ -440,10 +440,10 @@ void SlaveInterface::dropNetwork(const QString &host, const QString &slaveid) void SlaveInterface::sendResumeAnswer( bool resume ) { kdDebug(7007) << "SlaveInterface::sendResumeAnswer ok for resuming :" << resume << endl; - m_pConnection->sendnow( resume ? CMD_RESUMEANSWER : CMD_NONE, QByteArray() ); + m_pConnection->sendnow( resume ? CMD_RESUMEANSWER : CMD_NONE, TQByteArray() ); } -void SlaveInterface::openPassDlg( const QString& prompt, const QString& user, bool readOnly ) +void SlaveInterface::openPassDlg( const TQString& prompt, const TQString& user, bool readOnly ) { AuthInfo info; info.prompt = prompt; @@ -452,9 +452,9 @@ void SlaveInterface::openPassDlg( const QString& prompt, const QString& user, bo openPassDlg( info ); } -void SlaveInterface::openPassDlg( const QString& prompt, const QString& user, - const QString& caption, const QString& comment, - const QString& label, bool readOnly ) +void SlaveInterface::openPassDlg( const TQString& prompt, const TQString& user, + const TQString& caption, const TQString& comment, + const TQString& label, bool readOnly ) { AuthInfo info; info.prompt = prompt; @@ -474,8 +474,8 @@ void SlaveInterface::openPassDlg( AuthInfo& info ) bool result = Observer::self()->openPassDlg( info ); if ( m_pConnection ) { - QByteArray data; - QDataStream stream( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream( data, IO_WriteOnly ); if ( result ) { stream << info; @@ -489,26 +489,26 @@ void SlaveInterface::openPassDlg( AuthInfo& info ) } } -void SlaveInterface::messageBox( int type, const QString &text, const QString &_caption, - const QString &buttonYes, const QString &buttonNo ) +void SlaveInterface::messageBox( int type, const TQString &text, const TQString &_caption, + const TQString &buttonYes, const TQString &buttonNo ) { - messageBox( type, text, _caption, buttonYes, buttonNo, QString::null ); + messageBox( type, text, _caption, buttonYes, buttonNo, TQString::null ); } -void SlaveInterface::messageBox( int type, const QString &text, const QString &_caption, - const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName ) +void SlaveInterface::messageBox( int type, const TQString &text, const TQString &_caption, + const TQString &buttonYes, const TQString &buttonNo, const TQString &dontAskAgainName ) { kdDebug(7007) << "messageBox " << type << " " << text << " - " << _caption << " " << dontAskAgainName << endl; - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly ); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly ); - QString caption( _caption ); + TQString caption( _caption ); if ( type == KIO::SlaveBase::SSLMessageBox ) - caption = QString::fromUtf8(kapp->dcopClient()->appId()); // hack, see observer.cpp + caption = TQString::fromUtf8(kapp->dcopClient()->appId()); // hack, see observer.cpp emit needProgressId(); kdDebug(7007) << "SlaveInterface::messageBox m_progressId=" << m_progressId << endl; - QGuardedPtr<SlaveInterface> me = this; + TQGuardedPtr<SlaveInterface> me = this; m_pConnection->suspend(); int result = Observer::/*self()->*/messageBox( m_progressId, type, text, caption, buttonYes, buttonNo, dontAskAgainName ); if ( me && m_pConnection ) // Don't do anything if deleted meanwhile diff --git a/kio/kio/slaveinterface.h b/kio/kio/slaveinterface.h index 46483d9a1..5cca5dd77 100644 --- a/kio/kio/slaveinterface.h +++ b/kio/kio/slaveinterface.h @@ -23,7 +23,7 @@ #include <unistd.h> #include <sys/types.h> -#include <qobject.h> +#include <tqobject.h> #include <kurl.h> #include <kio/global.h> @@ -116,12 +116,12 @@ signals: // Messages sent by the slave /////////// - void data( const QByteArray & ); + void data( const TQByteArray & ); void dataReq( ); - void error( int , const QString & ); + void error( int , const TQString & ); void connected(); void finished(); - void slaveStatus(pid_t, const QCString &, const QString &, bool); + void slaveStatus(pid_t, const TQCString &, const TQString &, bool); void listEntries( const KIO::UDSEntryList& ); void statEntry( const KIO::UDSEntry& ); void needSubURLData(); @@ -139,20 +139,20 @@ signals: void speed( unsigned long ) ; void errorPage() ; - void mimeType( const QString & ) ; - void warning( const QString & ) ; - void infoMessage( const QString & ) ; + void mimeType( const TQString & ) ; + void warning( const TQString & ) ; + void infoMessage( const TQString & ) ; void connectFinished(); /** * @deprecated. Obsolete as of 3.1. Replaced by kpassword, a kded module. */ - void authorizationKey( const QCString&, const QCString&, bool ); + void authorizationKey( const TQCString&, const TQCString&, bool ); /** * @deprecated. Obsolete as of 3.1. Replaced by kpassword, a kded module. */ - void delAuthorization( const QCString& grpkey ); + void delAuthorization( const TQCString& grpkey ); protected: ///////////////// @@ -160,7 +160,7 @@ protected: //////////////// virtual bool dispatch(); - virtual bool dispatch( int _cmd, const QByteArray &data ); + virtual bool dispatch( int _cmd, const TQByteArray &data ); /** * Prompt the user for authrization info (login & password). @@ -206,27 +206,27 @@ protected: /** * @deprecated. Use openPassDlg( AuthInfo& ) instead. */ - void openPassDlg( const QString& prompt, const QString& user, - const QString& caption, const QString& comment, - const QString& label, bool readOnly ) KDE_DEPRECATED; + void openPassDlg( const TQString& prompt, const TQString& user, + const TQString& caption, const TQString& comment, + const TQString& label, bool readOnly ) KDE_DEPRECATED; /** * @deprecated. Use openPassDlg( AuthInfo& ) instead. */ - void openPassDlg( const QString& prompt, const QString& user, bool readOnly ) KDE_DEPRECATED; + void openPassDlg( const TQString& prompt, const TQString& user, bool readOnly ) KDE_DEPRECATED; - void messageBox( int type, const QString &text, const QString &caption, - const QString &buttonYes, const QString &buttonNo ); + void messageBox( int type, const TQString &text, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo ); /** * @since 3.3 */ - void messageBox( int type, const QString &text, const QString &caption, - const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName ); + void messageBox( int type, const TQString &text, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo, const TQString &dontAskAgainName ); // I need to identify the slaves - void requestNetwork( const QString &, const QString &); - void dropNetwork( const QString &, const QString &); + void requestNetwork( const TQString &, const TQString &); + void dropNetwork( const TQString &, const TQString &); /** * @internal @@ -250,7 +250,7 @@ private: } -inline QDataStream &operator >>(QDataStream &s, KIO::UDSAtom &a ) +inline TQDataStream &operator >>(TQDataStream &s, KIO::UDSAtom &a ) { Q_INT32 l; s >> a.m_uds; @@ -258,7 +258,7 @@ inline QDataStream &operator >>(QDataStream &s, KIO::UDSAtom &a ) if ( a.m_uds & KIO::UDS_LONG ) { s >> l; a.m_long = l; - a.m_str = QString::null; + a.m_str = TQString::null; } else if ( a.m_uds & KIO::UDS_STRING ) { s >> a.m_str; a.m_long = 0; @@ -268,7 +268,7 @@ inline QDataStream &operator >>(QDataStream &s, KIO::UDSAtom &a ) return s; } -inline QDataStream &operator <<(QDataStream &s, const KIO::UDSAtom &a ) +inline TQDataStream &operator <<(TQDataStream &s, const KIO::UDSAtom &a ) { s << a.m_uds; @@ -282,7 +282,7 @@ inline QDataStream &operator <<(QDataStream &s, const KIO::UDSAtom &a ) return s; } -KIO_EXPORT QDataStream &operator <<(QDataStream &s, const KIO::UDSEntry &e ); -KIO_EXPORT QDataStream &operator >>(QDataStream &s, KIO::UDSEntry &e ); +KIO_EXPORT TQDataStream &operator <<(TQDataStream &s, const KIO::UDSEntry &e ); +KIO_EXPORT TQDataStream &operator >>(TQDataStream &s, KIO::UDSEntry &e ); #endif diff --git a/kio/kio/statusbarprogress.cpp b/kio/kio/statusbarprogress.cpp index f71ca9630..910155799 100644 --- a/kio/kio/statusbarprogress.cpp +++ b/kio/kio/statusbarprogress.cpp @@ -16,11 +16,11 @@ Boston, MA 02110-1301, USA. */ -#include <qtooltip.h> -#include <qlayout.h> -#include <qwidgetstack.h> -#include <qpushbutton.h> -#include <qlabel.h> +#include <tqtooltip.h> +#include <tqlayout.h> +#include <tqwidgetstack.h> +#include <tqpushbutton.h> +#include <tqlabel.h> #include <kapplication.h> #include <klocale.h> @@ -32,7 +32,7 @@ namespace KIO { -StatusbarProgress::StatusbarProgress( QWidget* parent, bool button ) +StatusbarProgress::StatusbarProgress( TQWidget* parent, bool button ) : ProgressBase( parent ) { m_bShowButton = button; @@ -43,23 +43,23 @@ StatusbarProgress::StatusbarProgress( QWidget* parent, bool button ) setStopOnClose(false); int w = fontMetrics().width( " 999.9 kB/s 00:00:01 " ) + 8; - box = new QHBoxLayout( this, 0, 0 ); + box = new TQHBoxLayout( this, 0, 0 ); - m_pButton = new QPushButton( "X", this ); + m_pButton = new TQPushButton( "X", this ); box->addWidget( m_pButton ); - stack = new QWidgetStack( this ); + stack = new TQWidgetStack( this ); box->addWidget( stack ); - connect( m_pButton, SIGNAL( clicked() ), this, SLOT( slotStop() ) ); + connect( m_pButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotStop() ) ); m_pProgressBar = new KProgress( this ); - m_pProgressBar->setFrameStyle( QFrame::Box | QFrame::Raised ); + m_pProgressBar->setFrameStyle( TQFrame::Box | TQFrame::Raised ); m_pProgressBar->setLineWidth( 1 ); - m_pProgressBar->setBackgroundMode( QWidget::PaletteBackground ); + m_pProgressBar->setBackgroundMode( TQWidget::PaletteBackground ); m_pProgressBar->installEventFilter( this ); m_pProgressBar->setMinimumWidth( w ); stack->addWidget( m_pProgressBar, 1 ); - m_pLabel = new QLabel( "", this ); + m_pLabel = new TQLabel( "", this ); m_pLabel->setAlignment( AlignHCenter | AlignVCenter ); m_pLabel->installEventFilter( this ); m_pLabel->setMinimumWidth( w ); @@ -136,13 +136,13 @@ void StatusbarProgress::slotSpeed( KIO::Job*, unsigned long speed ) { } -bool StatusbarProgress::eventFilter( QObject *, QEvent *ev ) { +bool StatusbarProgress::eventFilter( TQObject *, TQEvent *ev ) { if ( ! m_pJob ) { // don't react when there isn't any job doing IO return true; } - if ( ev->type() == QEvent::MouseButtonPress ) { - QMouseEvent *e = (QMouseEvent*)ev; + if ( ev->type() == TQEvent::MouseButtonPress ) { + TQMouseEvent *e = (TQMouseEvent*)ev; if ( e->button() == LeftButton ) { // toggle view on left mouse button if ( mode == Label ) { diff --git a/kio/kio/statusbarprogress.h b/kio/kio/statusbarprogress.h index a8a0678ce..1cb4caf04 100644 --- a/kio/kio/statusbarprogress.h +++ b/kio/kio/statusbarprogress.h @@ -69,7 +69,7 @@ public: * @param button true to add an abort button. The button will be * connected to ProgressBase::slotStop() */ - StatusbarProgress( QWidget* parent, bool button = true ); + StatusbarProgress( TQWidget* parent, bool button = true ); ~StatusbarProgress() {} /** @@ -86,8 +86,8 @@ public slots: protected: KProgress* m_pProgressBar; - QLabel* m_pLabel; - QPushButton* m_pButton; + TQLabel* m_pLabel; + TQPushButton* m_pButton; KIO::filesize_t m_iTotalSize; @@ -98,9 +98,9 @@ protected: void setMode(); - virtual bool eventFilter( QObject *, QEvent * ); - QBoxLayout *box; - QWidgetStack *stack; + virtual bool eventFilter( TQObject *, TQEvent * ); + TQBoxLayout *box; + TQWidgetStack *stack; protected: virtual void virtual_hook( int id, void* data ); private: diff --git a/kio/kio/tcpslavebase.cpp b/kio/kio/tcpslavebase.cpp index db85483f3..78093577d 100644 --- a/kio/kio/tcpslavebase.cpp +++ b/kio/kio/tcpslavebase.cpp @@ -50,8 +50,8 @@ #include <klocale.h> #include <dcopclient.h> -#include <qcstring.h> -#include <qdatastream.h> +#include <tqcstring.h> +#include <tqdatastream.h> #include <kapplication.h> @@ -72,9 +72,9 @@ public: KSSL *kssl; bool usingTLS; KSSLCertificateCache *cc; - QString host; - QString realHost; - QString ip; + TQString host; + TQString realHost; + TQString ip; DCOPClient *dcc; KSSLPKCS12 *pkcs; @@ -92,9 +92,9 @@ public: TCPSlaveBase::TCPSlaveBase(unsigned short int defaultPort, - const QCString &protocol, - const QCString &poolSocket, - const QCString &appSocket) + const TQCString &protocol, + const TQCString &poolSocket, + const TQCString &appSocket) :SlaveBase (protocol, poolSocket, appSocket), m_iSock(-1), m_iDefaultPort(defaultPort), @@ -108,9 +108,9 @@ TCPSlaveBase::TCPSlaveBase(unsigned short int defaultPort, } TCPSlaveBase::TCPSlaveBase(unsigned short int defaultPort, - const QCString &protocol, - const QCString &poolSocket, - const QCString &appSocket, + const TQCString &protocol, + const TQCString &poolSocket, + const TQCString &appSocket, bool useSSL) :SlaveBase (protocol, poolSocket, appSocket), m_iSock(-1), @@ -299,7 +299,7 @@ unsigned short int TCPSlaveBase::port(unsigned short int _p) // a port, and if so use it, otherwise we check to see if there // is a port specified in /etc/services, and if so use that // otherwise as a last resort use the supplied default port. -bool TCPSlaveBase::connectToHost( const QString &host, +bool TCPSlaveBase::connectToHost( const TQString &host, unsigned int _port, bool sendError ) { @@ -323,7 +323,7 @@ bool TCPSlaveBase::connectToHost( const QString &host, "observe your data in transit."), WarningContinueCancel, i18n("Security Information"), - i18n("C&ontinue Loading"), QString::null, + i18n("C&ontinue Loading"), TQString::null, "WarnOnLeaveSSLMode" ); // Move this setting into KSSL instead @@ -533,7 +533,7 @@ bool TCPSlaveBase::canUseTLS() void TCPSlaveBase::certificatePrompt() { -QString certname; // the cert to use this session +TQString certname; // the cert to use this session bool send = false, prompt = false, save = false, forcePrompt = false; KSSLCertificateHome::KSSLAuthAction aa; @@ -559,7 +559,7 @@ KSSLCertificateHome::KSSLAuthAction aa; break; case KSSLCertificateHome::AuthDont: send = false; prompt = false; - certname = QString::null; + certname = TQString::null; break; case KSSLCertificateHome::AuthPrompt: send = false; prompt = true; @@ -569,7 +569,7 @@ KSSLCertificateHome::KSSLAuthAction aa; } } - QString ourHost; + TQString ourHost; if (!d->realHost.isEmpty()) { ourHost = d->realHost; } else { @@ -577,7 +577,7 @@ KSSLCertificateHome::KSSLAuthAction aa; } // Look for a certificate on a per-host basis as an override - QString tmpcn = KSSLCertificateHome::getDefaultCertificateName(ourHost, &aa); + TQString tmpcn = KSSLCertificateHome::getDefaultCertificateName(ourHost, &aa); if (aa != KSSLCertificateHome::AuthNone) { // we must override switch (aa) { case KSSLCertificateHome::AuthSend: @@ -588,7 +588,7 @@ KSSLCertificateHome::KSSLAuthAction aa; case KSSLCertificateHome::AuthDont: send = false; prompt = false; - certname = QString::null; + certname = TQString::null; break; case KSSLCertificateHome::AuthPrompt: send = false; @@ -614,9 +614,9 @@ KSSLCertificateHome::KSSLAuthAction aa; // Ok, we're supposed to prompt the user.... if (prompt || forcePrompt) { - QStringList certs = KSSLCertificateHome::getCertificateList(); + TQStringList certs = KSSLCertificateHome::getCertificateList(); - for (QStringList::Iterator it = certs.begin(); it != certs.end(); ++it) { + for (TQStringList::Iterator it = certs.begin(); it != certs.end(); ++it) { KSSLPKCS12 *pkcs = KSSLCertificateHome::getCertificateByName(*it); if (pkcs && (!pkcs->getCertificate() || !pkcs->getCertificate()->x509V3Extensions().certTypeSSLClient())) { @@ -632,22 +632,22 @@ KSSLCertificateHome::KSSLAuthAction aa; d->dcc->attach(); if (!d->dcc->isApplicationRegistered("kio_uiserver")) { KApplication::startServiceByDesktopPath("kio_uiserver.desktop", - QStringList() ); + TQStringList() ); } } - QByteArray data, retval; - QCString rettype; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, retval; + TQCString rettype; + TQDataStream arg(data, IO_WriteOnly); arg << ourHost; arg << certs; arg << metaData("window-id").toInt(); bool rc = d->dcc->call("kio_uiserver", "UIServer", - "showSSLCertDialog(QString, QStringList,int)", + "showSSLCertDialog(TQString, TQStringList,int)", data, rettype, retval); if (rc && rettype == "KSSLCertDlgRet") { - QDataStream retStream(retval, IO_ReadOnly); + TQDataStream retStream(retval, IO_ReadOnly); KSSLCertDlgRet drc; retStream >> drc; if (drc.ok) { @@ -687,7 +687,7 @@ KSSLCertificateHome::KSSLAuthAction aa; else showprompt = true; if (showprompt) { - if (!openPassDlg(ai, first ? QString::null : + if (!openPassDlg(ai, first ? TQString::null : i18n("Unable to open the certificate. Try a new password?"))) break; } @@ -741,13 +741,13 @@ int TCPSlaveBase::verifyCertificate() bool _IPmatchesCN = false; int result; bool doAddHost = false; - QString ourHost; + TQString ourHost; if (!d->realHost.isEmpty()) ourHost = d->realHost; else ourHost = d->host; - QString theurl = QString(m_sServiceName)+"://"+ourHost+":"+QString::number(m_iPort); + TQString theurl = TQString(m_sServiceName)+"://"+ourHost+":"+TQString::number(m_iPort); if (!hasMetaData("ssl_militant") || metaData("ssl_militant") == "FALSE") d->militantSSL = false; @@ -765,7 +765,7 @@ int TCPSlaveBase::verifyCertificate() #ifndef Q_WS_WIN //temporary KNetwork::KResolverResults res = KNetwork::KResolver::resolve(d->kssl->peerInfo().peerHost(), "80", KNetwork::KResolver::CanonName); if (!res.isEmpty()) { - QString old = d->kssl->peerInfo().peerHost(); + TQString old = d->kssl->peerInfo().peerHost(); d->kssl->peerInfo().setPeerHost(res[0].canonicalName()); _IPmatchesCN = d->kssl->peerInfo().certMatchesAddress(); if (!_IPmatchesCN) { @@ -795,26 +795,26 @@ int TCPSlaveBase::verifyCertificate() setMetaData("ssl_cipher_version", d->kssl->connectionInfo().getCipherVersion()); setMetaData("ssl_cipher_used_bits", - QString::number(d->kssl->connectionInfo().getCipherUsedBits())); + TQString::number(d->kssl->connectionInfo().getCipherUsedBits())); setMetaData("ssl_cipher_bits", - QString::number(d->kssl->connectionInfo().getCipherBits())); + TQString::number(d->kssl->connectionInfo().getCipherBits())); setMetaData("ssl_peer_ip", d->ip); if (!d->realHost.isEmpty()) { setMetaData("ssl_proxied", "true"); } - QString errorStr; + TQString errorStr; for(KSSLCertificate::KSSLValidationList::ConstIterator it = ksvl.begin(); it != ksvl.end(); ++it) { - errorStr += QString::number(*it)+":"; + errorStr += TQString::number(*it)+":"; } setMetaData("ssl_cert_errors", errorStr); setMetaData("ssl_peer_certificate", pc.toString()); if (pc.chain().isValid() && pc.chain().depth() > 1) { - QString theChain; - QPtrList<KSSLCertificate> chain = pc.chain().getChain(); + TQString theChain; + TQPtrList<KSSLCertificate> chain = pc.chain().getChain(); chain.setAutoDelete(true); for (KSSLCertificate *c = chain.first(); c; c = chain.next()) { theChain += c->toString(); @@ -823,7 +823,7 @@ int TCPSlaveBase::verifyCertificate() setMetaData("ssl_peer_chain", theChain); } else setMetaData("ssl_peer_chain", ""); - setMetaData("ssl_cert_state", QString::number(ksv)); + setMetaData("ssl_cert_state", TQString::number(ksv)); if (ksv == KSSLCertificate::Ok) { rc = 1; @@ -872,7 +872,7 @@ int TCPSlaveBase::verifyCertificate() { do { if (ksv == KSSLCertificate::InvalidHost) { - QString msg = i18n("The IP address of the host %1 " + TQString msg = i18n("The IP address of the host %1 " "does not match the one the " "certificate was issued to."); result = messageBox( WarningYesNoCancel, @@ -881,7 +881,7 @@ int TCPSlaveBase::verifyCertificate() i18n("&Details"), i18n("Co&ntinue") ); } else { - QString msg = i18n("The server certificate failed the " + TQString msg = i18n("The server certificate failed the " "authenticity test (%1)."); result = messageBox( WarningYesNoCancel, msg.arg(ourHost), @@ -896,17 +896,17 @@ int TCPSlaveBase::verifyCertificate() d->dcc->attach(); if (!d->dcc->isApplicationRegistered("kio_uiserver")) { KApplication::startServiceByDesktopPath("kio_uiserver.desktop", - QStringList() ); + TQStringList() ); } } - QByteArray data, ignore; - QCString ignoretype; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, ignore; + TQCString ignoretype; + TQDataStream arg(data, IO_WriteOnly); arg << theurl << mOutgoingMetaData; arg << metaData("window-id").toInt(); d->dcc->call("kio_uiserver", "UIServer", - "showSSLInfoDialog(QString,KIO::MetaData,int)", + "showSSLInfoDialog(TQString,KIO::MetaData,int)", data, ignoretype, ignore); } } while (result == KMessageBox::Yes); @@ -1011,7 +1011,7 @@ int TCPSlaveBase::verifyCertificate() setMetaData("ssl_action", "reject"); } else { do { - QString msg = i18n("The server certificate failed the " + TQString msg = i18n("The server certificate failed the " "authenticity test (%1)."); result = messageBox(WarningYesNoCancel, msg.arg(ourHost), @@ -1024,16 +1024,16 @@ int TCPSlaveBase::verifyCertificate() d->dcc->attach(); if (!d->dcc->isApplicationRegistered("kio_uiserver")) { KApplication::startServiceByDesktopPath("kio_uiserver.desktop", - QStringList() ); + TQStringList() ); } } - QByteArray data, ignore; - QCString ignoretype; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, ignore; + TQCString ignoretype; + TQDataStream arg(data, IO_WriteOnly); arg << theurl << mOutgoingMetaData; arg << metaData("window-id").toInt(); d->dcc->call("kio_uiserver", "UIServer", - "showSSLInfoDialog(QString,KIO::MetaData,int)", + "showSSLInfoDialog(TQString,KIO::MetaData,int)", data, ignoretype, ignore); } } while (result == KMessageBox::Yes); @@ -1108,16 +1108,16 @@ int TCPSlaveBase::verifyCertificate() d->dcc->attach(); if (!d->dcc->isApplicationRegistered("kio_uiserver")) { KApplication::startServiceByDesktopPath("kio_uiserver.desktop", - QStringList() ); + TQStringList() ); } } - QByteArray data, ignore; - QCString ignoretype; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, ignore; + TQCString ignoretype; + TQDataStream arg(data, IO_WriteOnly); arg << theurl << mOutgoingMetaData; arg << metaData("window-id").toInt(); d->dcc->call("kio_uiserver", "UIServer", - "showSSLInfoDialog(QString,KIO::MetaData,int)", + "showSSLInfoDialog(TQString,KIO::MetaData,int)", data, ignoretype, ignore); } } while (result != KMessageBox::No); @@ -1274,7 +1274,7 @@ void TCPSlaveBase::setEnableSSLTunnel( bool enable ) d->useSSLTunneling = enable; } -void TCPSlaveBase::setRealHost( const QString& realHost ) +void TCPSlaveBase::setRealHost( const TQString& realHost ) { d->realHost = realHost; } @@ -1282,7 +1282,7 @@ void TCPSlaveBase::setRealHost( const QString& realHost ) bool TCPSlaveBase::doSSLHandShake( bool sendError ) { kdDebug(7029) << "TCPSlaveBase::doSSLHandShake: " << endl; - QString msgHost = d->host; + TQString msgHost = d->host; d->kssl->reInitialize(); diff --git a/kio/kio/tcpslavebase.h b/kio/kio/tcpslavebase.h index 21b391dac..bbf2bb95f 100644 --- a/kio/kio/tcpslavebase.h +++ b/kio/kio/tcpslavebase.h @@ -45,11 +45,11 @@ namespace KIO { class KIO_EXPORT TCPSlaveBase : public SlaveBase { public: - TCPSlaveBase(unsigned short int defaultPort, const QCString &protocol, - const QCString &poolSocket, const QCString &appSocket); + TCPSlaveBase(unsigned short int defaultPort, const TQCString &protocol, + const TQCString &poolSocket, const TQCString &appSocket); - TCPSlaveBase(unsigned short int defaultPort, const QCString &protocol, - const QCString &poolSocket, const QCString &appSocket, + TCPSlaveBase(unsigned short int defaultPort, const TQCString &protocol, + const TQCString &poolSocket, const TQCString &appSocket, bool useSSL); virtual ~TCPSlaveBase(); @@ -80,7 +80,7 @@ protected: /** * @deprecated Due to inconsistency with KDE naming convention. */ - KDE_DEPRECATED bool ConnectToHost( const QString &host, unsigned int port, + KDE_DEPRECATED bool ConnectToHost( const TQString &host, unsigned int port, bool sendError ) { return connectToHost( host, port, sendError ); } /** @@ -170,7 +170,7 @@ protected: * on failure, false is returned and an appropriate * error message is send to the application. */ - bool connectToHost( const QString &host, unsigned int port, + bool connectToHost( const TQString &host, unsigned int port, bool sendError = true ); /** @@ -352,7 +352,7 @@ protected: * * @param realHost the actual host name we are connecting to */ - void setRealHost( const QString& realHost ); + void setRealHost( const TQString& realHost ); // don't use me! void doConstructorStuff(); @@ -371,7 +371,7 @@ protected: bool m_bIsSSL; unsigned short int m_iPort; unsigned short int m_iDefaultPort; - QCString m_sServiceName; + TQCString m_sServiceName; FILE *fp; private: diff --git a/kio/kio/thumbcreator.h b/kio/kio/thumbcreator.h index 4612a0916..f16132b3a 100644 --- a/kio/kio/thumbcreator.h +++ b/kio/kio/thumbcreator.h @@ -20,7 +20,7 @@ #ifndef _THUMBCREATOR_H_ #define _THUMBCREATOR_H_ -#include <qstring.h> +#include <tqstring.h> class QString; class QImage; @@ -106,7 +106,7 @@ public: * * @return true if preview generation succeeded */ - virtual bool create(const QString &path, int width, int height, QImage &img) = 0; + virtual bool create(const TQString &path, int width, int height, TQImage &img) = 0; /** * The flags of this plugin: |