diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:27:17 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:27:17 -0500 |
commit | 883a1fc629f00e9a41efad8514afd1ccf259d8c2 (patch) | |
tree | 53191c33748f9cd949a2eb86a64fbedc86c5ac75 /kftpgrabber/src/engine | |
parent | 1385303ea163214e30825730ac0fbcc27f9634aa (diff) | |
download | kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.tar.gz kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.zip |
Convert to TDE R14 API
Diffstat (limited to 'kftpgrabber/src/engine')
22 files changed, 363 insertions, 363 deletions
diff --git a/kftpgrabber/src/engine/cache.cpp b/kftpgrabber/src/engine/cache.cpp index 1b28dd6..c79c70d 100644 --- a/kftpgrabber/src/engine/cache.cpp +++ b/kftpgrabber/src/engine/cache.cpp @@ -91,13 +91,13 @@ void Cache::updateDirectoryEntry(Socket *socket, KURL &path, filesize_t filesize } } -void Cache::addPath(KURL &url, const QString &target) +void Cache::addPath(KURL &url, const TQString &target) { url.adjustPath(-1); m_pathCache[url] = target; } -void Cache::addPath(Socket *socket, const QString &target) +void Cache::addPath(Socket *socket, const TQString &target) { KURL url = socket->getCurrentUrl(); url.setPath(socket->getCurrentDirectory()); @@ -111,7 +111,7 @@ void Cache::invalidateEntry(KURL &url) m_listingCache.remove(url); } -void Cache::invalidateEntry(Socket *socket, const QString &path) +void Cache::invalidateEntry(Socket *socket, const TQString &path) { KURL url = socket->getCurrentUrl(); url.setPath(path); @@ -125,7 +125,7 @@ void Cache::invalidatePath(KURL &url) m_pathCache.remove(url); } -void Cache::invalidatePath(Socket *socket, const QString &path) +void Cache::invalidatePath(Socket *socket, const TQString &path) { KURL url = socket->getCurrentUrl(); url.setPath(path); @@ -146,7 +146,7 @@ DirectoryListing Cache::findCached(KURL &url) return invalid; } -DirectoryListing Cache::findCached(Socket *socket, const QString &path) +DirectoryListing Cache::findCached(Socket *socket, const TQString &path) { KURL url = socket->getCurrentUrl(); url.setPath(path); @@ -154,17 +154,17 @@ DirectoryListing Cache::findCached(Socket *socket, const QString &path) return findCached(url); } -QString Cache::findCachedPath(KURL &url) +TQString Cache::findCachedPath(KURL &url) { url.adjustPath(-1); if (m_pathCache.contains(url)) return m_pathCache[url]; - return QString::null; + return TQString::null; } -QString Cache::findCachedPath(Socket *socket, const QString &path) +TQString Cache::findCachedPath(Socket *socket, const TQString &path) { KURL url = socket->getCurrentUrl(); url.setPath(path); diff --git a/kftpgrabber/src/engine/cache.h b/kftpgrabber/src/engine/cache.h index 7b6cf21..b995db2 100644 --- a/kftpgrabber/src/engine/cache.h +++ b/kftpgrabber/src/engine/cache.h @@ -37,7 +37,7 @@ #ifndef KFTPENGINECACHE_H #define KFTPENGINECACHE_H -#include <qmap.h> +#include <ntqmap.h> #include <kurl.h> #include "directorylisting.h" @@ -89,7 +89,7 @@ public: * @param url The url (including host information) * @param target Actual target directory */ - void addPath(KURL &url, const QString &target); + void addPath(KURL &url, const TQString &target); /** * Cache path information, extracting the host information from the @@ -98,7 +98,7 @@ public: * @param socket The socket to extract the host info from * @param target Actual target directory */ - void addPath(Socket *socket, const QString &target); + void addPath(Socket *socket, const TQString &target); /** * Invalidate a cached entry. @@ -113,7 +113,7 @@ public: * @param socket The socket to extract the host info from * @param path Path of the entry */ - void invalidateEntry(Socket *socket, const QString &path); + void invalidateEntry(Socket *socket, const TQString &path); /** * Invalidate a cached path. @@ -128,7 +128,7 @@ public: * @param socket The socket to extract the host info from * @param path Path of the entry */ - void invalidatePath(Socket *socket, const QString &path); + void invalidatePath(Socket *socket, const TQString &path); /** * Retrieve a cached directory listing. @@ -145,30 +145,30 @@ public: * @param path Path of the entry * @return A valid DirectoryListing if found, an empty DirectoryListing otherwise */ - DirectoryListing findCached(Socket *socket, const QString &path); + DirectoryListing findCached(Socket *socket, const TQString &path); /** * Retrieve a cached path. * * @param url Url of the entry - * @return A target path if found, QString::null otherwise + * @return A target path if found, TQString::null otherwise */ - QString findCachedPath(KURL &url); + TQString findCachedPath(KURL &url); /** * Retrieve a cached path. * * @param socket The socket to extract the host info from * @param path Path of the entry - * @return A target path if found, QString::null otherwise + * @return A target path if found, TQString::null otherwise */ - QString findCachedPath(Socket *socket, const QString &path); + TQString findCachedPath(Socket *socket, const TQString &path); protected: Cache(); static Cache *m_self; private: - QMap<KURL, DirectoryListing> m_listingCache; - QMap<KURL, QString> m_pathCache; + TQMap<KURL, DirectoryListing> m_listingCache; + TQMap<KURL, TQString> m_pathCache; }; } diff --git a/kftpgrabber/src/engine/connectionretry.cpp b/kftpgrabber/src/engine/connectionretry.cpp index e93a1b9..d682fbe 100644 --- a/kftpgrabber/src/engine/connectionretry.cpp +++ b/kftpgrabber/src/engine/connectionretry.cpp @@ -38,18 +38,18 @@ #include "thread.h" #include "event.h" -#include <klocale.h> +#include <tdelocale.h> namespace KFTPEngine { ConnectionRetry::ConnectionRetry(Socket *socket) - : QObject(), + : TQObject(), m_socket(socket), m_delay(socket->getConfigInt("retry_delay")), m_max(socket->getConfigInt("max_retries")), m_iteration(0) { - m_timer = new QTimer(this); + m_timer = new TQTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(slotShouldRetry())); connect(m_socket->thread()->eventHandler(), SIGNAL(engineEvent(KFTPEngine::Event*)), this, SLOT(slotEngineEvent(KFTPEngine::Event*))); @@ -96,7 +96,7 @@ void ConnectionRetry::abortRetry() m_socket->emitError(ConnectFailed); // This object should be automagicly removed - QObject::deleteLater(); + TQObject::deleteLater(); } void ConnectionRetry::slotEngineEvent(KFTPEngine::Event *event) @@ -105,7 +105,7 @@ void ConnectionRetry::slotEngineEvent(KFTPEngine::Event *event) m_socket->emitEvent(Event::EventRetrySuccess); // This object should be automagicly removed - QObject::deleteLater(); + TQObject::deleteLater(); } } diff --git a/kftpgrabber/src/engine/connectionretry.h b/kftpgrabber/src/engine/connectionretry.h index 59a351d..5b9f83e 100644 --- a/kftpgrabber/src/engine/connectionretry.h +++ b/kftpgrabber/src/engine/connectionretry.h @@ -36,8 +36,8 @@ #ifndef KFTPENGINECONNECTIONRETRY_H #define KFTPENGINECONNECTIONRETRY_H -#include <qobject.h> -#include <qtimer.h> +#include <ntqobject.h> +#include <ntqtimer.h> namespace KFTPEngine { @@ -50,7 +50,7 @@ class Event; * * @author Jernej Kos <kostko@jweb-network.net> */ -class ConnectionRetry : public QObject +class ConnectionRetry : public TQObject { Q_OBJECT public: @@ -75,7 +75,7 @@ private: int m_max; int m_iteration; - QTimer *m_timer; + TQTimer *m_timer; private slots: void slotShouldRetry(); void slotEngineEvent(KFTPEngine::Event *event); diff --git a/kftpgrabber/src/engine/directorylisting.cpp b/kftpgrabber/src/engine/directorylisting.cpp index 1647bb2..17473fe 100644 --- a/kftpgrabber/src/engine/directorylisting.cpp +++ b/kftpgrabber/src/engine/directorylisting.cpp @@ -37,16 +37,16 @@ #include "directorylisting.h" #include "misc/filter.h" -#include <qdatetime.h> +#include <ntqdatetime.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kmimetype.h> #include <sys/stat.h> using namespace KFTPCore::Filter; -using namespace KIO; +using namespace TDEIO; namespace KFTPEngine { @@ -54,7 +54,7 @@ DirectoryEntry::DirectoryEntry() { } -KIO::UDSEntry DirectoryEntry::toUdsEntry() const +TDEIO::UDSEntry DirectoryEntry::toUdsEntry() const { bool directory = m_type == 'd'; UDSAtom atom; @@ -106,12 +106,12 @@ KIO::UDSEntry DirectoryEntry::toUdsEntry() const return entry; } -QString DirectoryEntry::timeAsString() +TQString DirectoryEntry::timeAsString() { - QDateTime dt; + TQDateTime dt; dt.setTime_t(time()); - return KGlobal::locale()->formatDateTime(dt); + return TDEGlobal::locale()->formatDateTime(dt); } bool DirectoryEntry::operator<(const DirectoryEntry &entry) const @@ -167,10 +167,10 @@ void DirectoryListing::addEntry(DirectoryEntry entry) m_list.append(entry); } -void DirectoryListing::updateEntry(const QString &filename, ::filesize_t size) +void DirectoryListing::updateEntry(const TQString &filename, ::filesize_t size) { - QValueList<DirectoryEntry>::iterator listEnd = m_list.end(); - for (QValueList<DirectoryEntry>::iterator i = m_list.begin(); i != listEnd; i++) { + TQValueList<DirectoryEntry>::iterator listEnd = m_list.end(); + for (TQValueList<DirectoryEntry>::iterator i = m_list.begin(); i != listEnd; i++) { if ((*i).filename() == filename) { (*i).setSize(size); return; diff --git a/kftpgrabber/src/engine/directorylisting.h b/kftpgrabber/src/engine/directorylisting.h index b332d37..51112f5 100644 --- a/kftpgrabber/src/engine/directorylisting.h +++ b/kftpgrabber/src/engine/directorylisting.h @@ -37,11 +37,11 @@ #ifndef KFTPNETWORKDIRECTORYLISTING_H #define KFTPNETWORKDIRECTORYLISTING_H -#include <kio/global.h> +#include <tdeio/global.h> #include <kurl.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <ntqvaluelist.h> +#include <ntqptrlist.h> #include <time.h> #include <sys/time.h> @@ -54,40 +54,40 @@ class DirectoryEntry { public: DirectoryEntry(); - void setFilename(const QString &filename) { m_filename = filename; } - void setOwner(const QString &owner) { m_owner = owner; } - void setGroup(const QString &group) { m_group = group; } - void setLink(const QString &link) { m_link = link; } + void setFilename(const TQString &filename) { m_filename = filename; } + void setOwner(const TQString &owner) { m_owner = owner; } + void setGroup(const TQString &group) { m_group = group; } + void setLink(const TQString &link) { m_link = link; } void setPermissions(int permissions) { m_permissions = permissions; } void setSize(filesize_t size) { m_size = size; } void setType(char type) { m_type = type; } void setTime(time_t time) { m_time = time; } - QString filename() const { return m_filename; } - QString owner() const { return m_owner; } - QString group() const { return m_group; } - QString link() const { return m_link; } + TQString filename() const { return m_filename; } + TQString owner() const { return m_owner; } + TQString group() const { return m_group; } + TQString link() const { return m_link; } int permissions() const { return m_permissions; } filesize_t size() const { return m_size; } char type() const { return m_type; } time_t time() const { return m_time; } - QString timeAsString(); + TQString timeAsString(); bool isDirectory() const { return m_type == 'd'; } bool isFile() const { return m_type == 'f'; } bool isDevice() const { return m_type == 'c' || m_type == 'b'; } bool isSymlink() const { return !m_link.isEmpty(); } - KIO::UDSEntry toUdsEntry() const; + TDEIO::UDSEntry toUdsEntry() const; struct tm timeStruct; bool operator<(const DirectoryEntry &entry) const; private: - QString m_filename; - QString m_owner; - QString m_group; - QString m_link; + TQString m_filename; + TQString m_owner; + TQString m_group; + TQString m_link; int m_permissions; filesize_t m_size; @@ -97,8 +97,8 @@ private: class DirectoryTree { public: - typedef QValueList<DirectoryEntry>::ConstIterator FileIterator; - typedef QPtrList<DirectoryTree>::ConstIterator DirIterator; + typedef TQValueList<DirectoryEntry>::ConstIterator FileIterator; + typedef TQPtrList<DirectoryTree>::ConstIterator DirIterator; DirectoryTree() {} DirectoryTree(DirectoryEntry entry); @@ -108,12 +108,12 @@ public: DirectoryEntry info() { return m_entry; } - QValueList<DirectoryEntry> *files() { return &m_files; } - QPtrList<DirectoryTree> *directories() { return &m_directories; } + TQValueList<DirectoryEntry> *files() { return &m_files; } + TQPtrList<DirectoryTree> *directories() { return &m_directories; } private: DirectoryEntry m_entry; - QValueList<DirectoryEntry> m_files; - QPtrList<DirectoryTree> m_directories; + TQValueList<DirectoryEntry> m_files; + TQPtrList<DirectoryTree> m_directories; }; /** @@ -125,15 +125,15 @@ public: ~DirectoryListing(); void addEntry(DirectoryEntry entry); - void updateEntry(const QString &filename, filesize_t size); - QValueList<DirectoryEntry> list() { return m_list; } + void updateEntry(const TQString &filename, filesize_t size); + TQValueList<DirectoryEntry> list() { return m_list; } void setValid(bool value) { m_valid = value; } bool isValid() { return m_valid; } private: bool m_valid; KURL m_path; - QValueList<DirectoryEntry> m_list; + TQValueList<DirectoryEntry> m_list; }; } diff --git a/kftpgrabber/src/engine/event.cpp b/kftpgrabber/src/engine/event.cpp index bfbf6f6..844bffc 100644 --- a/kftpgrabber/src/engine/event.cpp +++ b/kftpgrabber/src/engine/event.cpp @@ -43,7 +43,7 @@ EventParameter::EventParameter() { } -EventParameter::EventParameter(const QString &string) +EventParameter::EventParameter(const TQString &string) { m_type = ParamString; m_string = string; @@ -85,7 +85,7 @@ EventParameter::EventParameter(void *data) m_data = data; } -QString EventParameter::asString() const +TQString EventParameter::asString() const { return m_string; } @@ -125,8 +125,8 @@ void *EventParameter::asData() const return m_data; } -Event::Event(Type type, QValueList<EventParameter> params) - : QCustomEvent(65123), +Event::Event(Type type, TQValueList<EventParameter> params) + : TQCustomEvent(65123), m_type(type), m_params(params) { @@ -137,12 +137,12 @@ Event::~Event() } EventHandler::EventHandler(Thread *thread) - : QObject(), + : TQObject(), m_thread(thread) { } -void EventHandler::customEvent(QCustomEvent *e) +void EventHandler::customEvent(TQCustomEvent *e) { if (e->type() == 65123) { Event *ev = static_cast<Event*>(e); diff --git a/kftpgrabber/src/engine/event.h b/kftpgrabber/src/engine/event.h index e21a45e..0e05f5f 100644 --- a/kftpgrabber/src/engine/event.h +++ b/kftpgrabber/src/engine/event.h @@ -37,9 +37,9 @@ #ifndef KFTPNETWORKEVENT_H #define KFTPNETWORKEVENT_H -#include <qobject.h> -#include <qevent.h> -#include <qshared.h> +#include <ntqobject.h> +#include <ntqevent.h> +#include <ntqshared.h> #include "directorylisting.h" @@ -94,9 +94,9 @@ public: /** * Constructs a new string parameter. * - * @param string The QString value + * @param string The TQString value */ - EventParameter(const QString &string); + EventParameter(const TQString &string); /** * Construct a new url parameter. @@ -145,7 +145,7 @@ public: * * @return Parameter's string value */ - QString asString() const; + TQString asString() const; /** * Returns the parameter's url value. @@ -198,7 +198,7 @@ public: private: Type m_type; - QString m_string; + TQString m_string; KURL m_url; DirectoryListing m_directoryListing; DirectoryTree m_directoryTree; @@ -259,7 +259,7 @@ public: FileExistsWakeupEvent() : WakeupEvent(WakeupFileExists), action(Skip) {} Action action; - QString newFileName; + TQString newFileName; }; /** @@ -274,7 +274,7 @@ public: */ PubkeyWakeupEvent() : WakeupEvent(WakeupPubkey) {} - QString password; + TQString password; }; /** @@ -283,7 +283,7 @@ public: * * @author Jernej Kos <kostko@jweb-network.net> */ -class Event : public QCustomEvent { +class Event : public TQCustomEvent { public: enum Type { EventMessage, @@ -315,7 +315,7 @@ public: * * @param params Parameter list */ - Event(Type type, QValueList<EventParameter> params); + Event(Type type, TQValueList<EventParameter> params); ~Event(); /** @@ -334,18 +334,18 @@ public: EventParameter getParameter(int index) { return m_params[index]; } protected: Type m_type; - QValueList<EventParameter> m_params; + TQValueList<EventParameter> m_params; }; class Thread; /** * This class handles events receieved from the thread and passes them - * on to the GUI as normal Qt signals. + * on to the GUI as normal TQt signals. * * @author Jernej Kos <kostko@jweb-network.net> */ -class EventHandler : public QObject { +class EventHandler : public TQObject { Q_OBJECT public: /** @@ -355,7 +355,7 @@ public: */ EventHandler(Thread *thread); protected: - void customEvent(QCustomEvent *e); + void customEvent(TQCustomEvent *e); protected: Thread *m_thread; signals: @@ -363,8 +363,8 @@ signals: void connected(); void disconnected(); - void gotResponse(const QString &text); - void gotRawResponse(const QString &text); + void gotResponse(const TQString &text); + void gotRawResponse(const TQString &text); }; } diff --git a/kftpgrabber/src/engine/ftpdirectoryparser.cpp b/kftpgrabber/src/engine/ftpdirectoryparser.cpp index 074328c..981d0b6 100644 --- a/kftpgrabber/src/engine/ftpdirectoryparser.cpp +++ b/kftpgrabber/src/engine/ftpdirectoryparser.cpp @@ -36,9 +36,9 @@ #include "ftpdirectoryparser.h" #include "ftpsocket.h" -#include <qvaluevector.h> -#include <qstringlist.h> -#include <qdatetime.h> +#include <ntqvaluevector.h> +#include <ntqstringlist.h> +#include <ntqdatetime.h> #include <time.h> #include <sys/stat.h> @@ -54,12 +54,12 @@ public: }; DToken() - : m_token(QString::null), + : m_token(TQString::null), m_valid(false) { } - DToken(const QString &token, int start = 0) + DToken(const TQString &token, int start = 0) : m_token(token), m_length(token.length()), m_start(start), @@ -75,7 +75,7 @@ public: return m_start; } - QString getToken() + TQString getToken() { return m_token; } @@ -85,13 +85,13 @@ public: return m_length; } - QString getString(int type = 0) + TQString getString(int type = 0) { switch (type) { case 0: return m_token; break; case 1: { if (!isRightNumeric() || isNumeric()) - return QString::null; + return TQString::null; int pos = m_length - 1; while (m_token[pos] >= '0' && m_token[pos] <= '9') @@ -102,7 +102,7 @@ public: } case 2: { if (!isLeftNumeric() || isNumeric()) - return QString::null; + return TQString::null; int len = 0; while (m_token[len] >= '0' && m_token[len] <= '9') @@ -113,7 +113,7 @@ public: } } - return QString::null; + return TQString::null; } int find(const char *chr, unsigned int start = 0) const @@ -199,12 +199,12 @@ public: return m_rightNumeric == Yes; } - QChar operator[](unsigned int n) const + TQChar operator[](unsigned int n) const { return m_token[n]; } private: - QString m_token; + TQString m_token; unsigned int m_length; int m_start; bool m_valid; @@ -216,7 +216,7 @@ private: class DLine { public: - DLine(const QString &line) + DLine(const TQString &line) : m_line(line.stripWhiteSpace()), m_parsePos(0) { @@ -277,10 +277,10 @@ public: } } private: - QStringList m_stringList; - QValueVector<DToken> m_tokens; - QValueVector<DToken> m_endLineTokens; - QString m_line; + TQStringList m_stringList; + TQValueVector<DToken> m_tokens; + TQValueVector<DToken> m_endLineTokens; + TQString m_line; unsigned int m_parsePos; }; @@ -328,9 +328,9 @@ FtpDirectoryParser::FtpDirectoryParser(FtpSocket *socket) m_monthNameMap["12"] = 12; } -void FtpDirectoryParser::addDataLine(const QString &line) +void FtpDirectoryParser::addDataLine(const TQString &line) { - QString tmp(line); + TQString tmp(line); tmp.append("\n"); addData(tmp.ascii(), tmp.length()); } @@ -338,13 +338,13 @@ void FtpDirectoryParser::addDataLine(const QString &line) void FtpDirectoryParser::addData(const char *data, int len) { // Append new data to the buffer and check for any new lines - m_buffer.append(QString::fromAscii(data, len)); + m_buffer.append(TQString::fromAscii(data, len)); int pos; while ((pos = m_buffer.find('\n')) > -1) { DirectoryEntry entry; - QString line = m_buffer.mid(0, pos).stripWhiteSpace(); - line = m_socket->remoteEncoding()->decode(QCString(line.ascii())); + TQString line = m_buffer.mid(0, pos).stripWhiteSpace(); + line = m_socket->remoteEncoding()->decode(TQCString(line.ascii())); if (parseLine(line, entry) && !entry.filename().isEmpty()) { if (entry.type() == '-') @@ -358,15 +358,15 @@ void FtpDirectoryParser::addData(const char *data, int len) } } -bool FtpDirectoryParser::parseMlsd(const QString &line, DirectoryEntry &entry) +bool FtpDirectoryParser::parseMlsd(const TQString &line, DirectoryEntry &entry) { - QStringList facts = QStringList::split(';', line); - QStringList::Iterator end = facts.end(); + TQStringList facts = TQStringList::split(';', line); + TQStringList::Iterator end = facts.end(); - for (QStringList::Iterator i = facts.begin(); i != end; ++i) { + for (TQStringList::Iterator i = facts.begin(); i != end; ++i) { if ((*i).contains('=')) { - QString key = (*i).section('=', 0, 0).lower(); - QString value = (*i).section('=', 1, 1); + TQString key = (*i).section('=', 0, 0).lower(); + TQString value = (*i).section('=', 1, 1); if (key == "type") { if (value == "file") @@ -400,7 +400,7 @@ bool FtpDirectoryParser::parseMlsd(const QString &line, DirectoryEntry &entry) return true; } -bool FtpDirectoryParser::parseUnixPermissions(const QString &permissions, DirectoryEntry &entry) +bool FtpDirectoryParser::parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry) { int p = 0; @@ -423,7 +423,7 @@ bool FtpDirectoryParser::parseUnixPermissions(const QString &permissions, Direct entry.setPermissions(p); } -bool FtpDirectoryParser::parseLine(const QString &line, DirectoryEntry &entry) +bool FtpDirectoryParser::parseLine(const TQString &line, DirectoryEntry &entry) { DLine *tLine = new DLine(line); bool done = false; @@ -478,7 +478,7 @@ bool FtpDirectoryParser::parseLine(const QString &line, DirectoryEntry &entry) // Remove unwanted names if (entry.filename() == "." || entry.filename() == "..") { - entry.setFilename(QString::null); + entry.setFilename(TQString::null); } } @@ -505,7 +505,7 @@ bool FtpDirectoryParser::parseUnix(DLine *line, DirectoryEntry &entry) chr != '-') return false; - QString permissions = token.getString(); + TQString permissions = token.getString(); entry.setType(chr); // Check for netware servers, which split the permissions into two parts @@ -536,7 +536,7 @@ bool FtpDirectoryParser::parseUnix(DLine *line, DirectoryEntry &entry) // Reset index index = startindex; - entry.setOwner(QString::null); + entry.setOwner(TQString::null); for (int i = 0; i < numOwnerGroup; i++) { if (!line->getToken(++index, token)) return false; @@ -597,7 +597,7 @@ bool FtpDirectoryParser::parseUnixDateTime(DLine *line, int &index, DirectoryEnt DToken token; // Get the month date field - QString dateMonth; + TQString dateMonth; if (!line->getToken(++index, token)) return false; @@ -664,7 +664,7 @@ bool FtpDirectoryParser::parseUnixDateTime(DLine *line, int &index, DirectoryEnt dateMonth = dateMonth.lower(); - QMap<QString, int>::iterator iter = m_monthNameMap.find(dateMonth); + TQMap<TQString, int>::iterator iter = m_monthNameMap.find(dateMonth); if (iter == m_monthNameMap.end()) return false; @@ -681,7 +681,7 @@ bool FtpDirectoryParser::parseUnixDateTime(DLine *line, int &index, DirectoryEnt if (!pos || static_cast<size_t>(pos) == (token.getLength() - 1)) return false; - QString str = token.getString(); + TQString str = token.getString(); bool tmp; int hour = str.left(pos).toInt(&tmp); if (!tmp) @@ -701,8 +701,8 @@ bool FtpDirectoryParser::parseUnixDateTime(DLine *line, int &index, DirectoryEnt entry.timeStruct.tm_min = minute; // Some servers use times only for files nweer than 6 months, - int year = QDate::currentDate().year(); - int now = QDate::currentDate().day() + 31 * QDate::currentDate().month(); + int year = TQDate::currentDate().year(); + int now = TQDate::currentDate().day() + 31 * TQDate::currentDate().month(); int file = entry.timeStruct.tm_mon * 31 + entry.timeStruct.tm_mday; if (now >= file) @@ -734,7 +734,7 @@ bool FtpDirectoryParser::parseUnixDateTime(DLine *line, int &index, DirectoryEnt if (!pos || static_cast<size_t>(pos) == (token.getLength() - 1)) return false; - QString str = token.getString(); + TQString str = token.getString(); bool tmp; long hour = str.left(pos).toInt(&tmp); if (!tmp) @@ -783,10 +783,10 @@ bool FtpDirectoryParser::parseShortDate(DToken &token, DirectoryEntry &entry) // Seems to be monthname-dd-yy // Check month name - QString dateMonth = token.getString().mid(0, pos); + TQString dateMonth = token.getString().mid(0, pos); dateMonth = dateMonth.lower(); - QMap<QString, int>::iterator iter = m_monthNameMap.find(dateMonth); + TQMap<TQString, int>::iterator iter = m_monthNameMap.find(dateMonth); if (iter == m_monthNameMap.end()) return false; @@ -859,10 +859,10 @@ bool FtpDirectoryParser::parseShortDate(DToken &token, DirectoryEntry &entry) if (gotYear || gotDay) { // Month field in yyyy-mm-dd or dd-mm-yyyy // Check month name - QString dateMonth = token.getString().mid(pos + 1, pos2 - pos - 1); + TQString dateMonth = token.getString().mid(pos + 1, pos2 - pos - 1); dateMonth = dateMonth.lower(); - QMap<QString, int>::iterator iter = m_monthNameMap.find(dateMonth); + TQMap<TQString, int>::iterator iter = m_monthNameMap.find(dateMonth); if (iter == m_monthNameMap.end()) return false; diff --git a/kftpgrabber/src/engine/ftpdirectoryparser.h b/kftpgrabber/src/engine/ftpdirectoryparser.h index 1b56831..0c02fa0 100644 --- a/kftpgrabber/src/engine/ftpdirectoryparser.h +++ b/kftpgrabber/src/engine/ftpdirectoryparser.h @@ -37,7 +37,7 @@ #ifndef KFTPENGINEFTPDIRECTORYPARSER_H #define KFTPENGINEFTPDIRECTORYPARSER_H -#include <qmap.h> +#include <ntqmap.h> #include "directorylisting.h" @@ -51,7 +51,7 @@ class DLine; /** * This class can parse multiple directory formats. Some code portions have * been taken from a windows FTP client "FileZilla by Tim Kosse" - the - * logic is mostly the same, the code has just been ported so it is more Qt + * logic is mostly the same, the code has just been ported so it is more TQt * and so it integrates nicely with the rest of the engine. * * @author Jernej Kos <kostko@jweb-network.net> @@ -62,18 +62,18 @@ public: FtpDirectoryParser(FtpSocket *socket); void addData(const char *data, int len); - void addDataLine(const QString &line); + void addDataLine(const TQString &line); - bool parseLine(const QString &line, DirectoryEntry &entry); + bool parseLine(const TQString &line, DirectoryEntry &entry); DirectoryListing getListing() { return m_listing; } private: FtpSocket *m_socket; - QString m_buffer; + TQString m_buffer; DirectoryListing m_listing; - QMap<QString, int> m_monthNameMap; + TQMap<TQString, int> m_monthNameMap; - bool parseMlsd(const QString &line, DirectoryEntry &entry); + bool parseMlsd(const TQString &line, DirectoryEntry &entry); bool parseUnix(DLine *line, DirectoryEntry &entry); bool parseDos(DLine *line, DirectoryEntry &entry); bool parseVms(DLine *line, DirectoryEntry &entry); @@ -84,7 +84,7 @@ private: bool parseComplexFileSize(DToken &token, filesize_t &size); - bool parseUnixPermissions(const QString &permissions, DirectoryEntry &entry); + bool parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry); }; } diff --git a/kftpgrabber/src/engine/ftpsocket.cpp b/kftpgrabber/src/engine/ftpsocket.cpp index b0cb9ae..dce9f99 100644 --- a/kftpgrabber/src/engine/ftpsocket.cpp +++ b/kftpgrabber/src/engine/ftpsocket.cpp @@ -44,11 +44,11 @@ #include "misc/kftpotpgenerator.h" #include "misc/config.h" -#include <qdir.h> +#include <ntqdir.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> -#include <ksocketdevice.h> +#include <tdesocketdevice.h> #include <utime.h> #include <stdlib.h> @@ -133,15 +133,15 @@ void FtpSocket::poll() } // Check for timeouts - // NOTE This should be moved to a QTimer's slot when ported to Qt 4 + // NOTE This should be moved to a TQTimer's slot when ported to TQt 4 timeoutCheck(); keepaliveCheck(); } void FtpSocket::slotControlTryRead() { - QString tmpStr; - Q_LONG size = 0; + TQString tmpStr; + TQ_LONG size = 0; // Read what we can if (getConfigInt("ssl") && m_controlSsl) { @@ -178,8 +178,8 @@ void FtpSocket::processBuffer() // Parse any lines we might have int pos; while ((pos = m_buffer.find('\n')) > -1) { - QString line = m_buffer.mid(0, pos); - line = m_remoteEncoding->decode(QCString(line.ascii())); + TQString line = m_buffer.mid(0, pos); + line = m_remoteEncoding->decode(TQCString(line.ascii())); parseLine(line); // Remove what we just parsed @@ -187,7 +187,7 @@ void FtpSocket::processBuffer() } } -void FtpSocket::parseLine(const QString &line) +void FtpSocket::parseLine(const TQString &line) { // Is this the end of multiline response ? if (!m_multiLineCode.isEmpty() && line.left(4) == m_multiLineCode) { @@ -210,9 +210,9 @@ void FtpSocket::parseLine(const QString &line) nextCommand(); } -bool FtpSocket::isResponse(const QString &code) +bool FtpSocket::isResponse(const TQString &code) { - QString ref; + TQString ref; if (isMultiline()) ref = m_multiLineCode; @@ -222,10 +222,10 @@ bool FtpSocket::isResponse(const QString &code) return ref.left(code.length()) == code; } -void FtpSocket::sendCommand(const QString &command) +void FtpSocket::sendCommand(const TQString &command) { emitEvent(Event::EventCommand, command); - QCString buffer(m_remoteEncoding->encode(command) + "\r\n"); + TQCString buffer(m_remoteEncoding->encode(command) + "\r\n"); if (getConfigInt("ssl") && m_controlSsl) m_controlSsl->write(buffer.data(), buffer.length()); @@ -340,7 +340,7 @@ public: if (socket()->isResponse("331 Response to otp-") || socket()->isResponse("331 Response to s/key")) { // OTP: 331 Response to otp-md5 41 or4828 ext required for foo. - QString tmp = socket()->getResponse(); + TQString tmp = socket()->getResponse(); tmp = tmp.section(' ', 3, 5); KFTPOTPGenerator otp(tmp, socket()->getCurrentUrl().pass()); @@ -392,7 +392,7 @@ public: } case SentPbsz: { currentState = SentProt; - QString prot = "PROT "; + TQString prot = "PROT "; if (socket()->getConfigInt("ssl.prot_mode") == 0) prot.append('P'); @@ -430,7 +430,7 @@ public: // Parse the current working directory if (socket()->isResponse("2")) { // 257 "/home/default/path" - QString tmp = socket()->getResponse(); + TQString tmp = socket()->getResponse(); int first = tmp.find('"') + 1; tmp = tmp.mid(first, tmp.findRev('"') - first); @@ -453,7 +453,7 @@ public: void parseFeat() { - QString feat = socket()->getResponse().stripWhiteSpace().upper(); + TQString feat = socket()->getResponse().stripWhiteSpace().upper(); if (feat.left(3).toInt() > 0 && feat[3] == '-') feat.remove(0, 4); @@ -492,7 +492,7 @@ void FtpSocket::protoConnect(const KURL &url) // Start the connect procedure m_controlConnecting = true; setCurrentUrl(url); - KNetwork::KStreamSocket::connect(url.host(), QString::number(url.port())); + KNetwork::KStreamSocket::connect(url.host(), TQString::number(url.port())); } void FtpSocket::slotConnected() @@ -618,7 +618,7 @@ public: currentState = SentType; socket()->resetTransferStart(); - QString type = "TYPE "; + TQString type = "TYPE "; type.append(socket()->getConfigInt("params.data_type")); socket()->sendCommand(type); break; @@ -673,7 +673,7 @@ public: // We have the connection if (socket()->getConfigInt("params.data_rest_do")) { currentState = SentRest; - socket()->sendCommand("REST " + QString::number(socket()->getConfigFs("params.data_rest"))); + socket()->sendCommand("REST " + TQString::number(socket()->getConfigFs("params.data_rest"))); } else { currentState = SentDataCmd; socket()->sendCommand(socket()->getConfig("params.data_command")); @@ -771,7 +771,7 @@ public: // We have the address, let's setup the transfer socket and then // we are done. currentState = HaveConnection; - socket()->setupPassiveTransferSocket(QString::null, port); + socket()->setupPassiveTransferSocket(TQString::null, port); } else { // Just send the EPSV command currentState = NegotiateEpsv; @@ -810,7 +810,7 @@ public: } // Convert to string - QString host; + TQString host; int port; host.sprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); @@ -856,19 +856,19 @@ public: // Setup the socket and set the apropriate port command currentState = NegotiateActive; - KNetwork::KSocketAddress address = socket()->setupActiveTransferSocket(); + KNetwork::TDESocketAddress address = socket()->setupActiveTransferSocket(); if (address.address()) { if (socket()->getConfigInt("feat.eprt")) { - QString ianaFamily = QString::number(address.ianaFamily()); + TQString ianaFamily = TQString::number(address.ianaFamily()); socket()->sendCommand("EPRT |" + ianaFamily + "|" + address.nodeName() + "|" + address.serviceName() + "|"); } else if (address.ianaFamily() == 1) { - QString format = address.nodeName().replace(".", ","); + TQString format = address.nodeName().replace(".", ","); format.append(","); - format.append(QString::number((unsigned char) address.address()->sa_data[0])); + format.append(TQString::number((unsigned char) address.address()->sa_data[0])); format.append(","); - format.append(QString::number((unsigned char) address.address()->sa_data[1])); + format.append(TQString::number((unsigned char) address.address()->sa_data[1])); socket()->sendCommand("PORT " + format); } else { @@ -902,10 +902,10 @@ void FtpSocket::initializeTransferSocket() m_transferSocket->setAddressReuseable(true); } -void FtpSocket::setupPassiveTransferSocket(const QString &host, int port) +void FtpSocket::setupPassiveTransferSocket(const TQString &host, int port) { // Use the host from control connection if empty - QString realHost = host; + TQString realHost = host; if (host.isEmpty() || getConfigInt("pasv.use_site_ip")) realHost = peerAddress().nodeName(); @@ -916,13 +916,13 @@ void FtpSocket::setupPassiveTransferSocket(const QString &host, int port) m_transferSocket = new KNetwork::KStreamSocket(); initializeTransferSocket(); - m_transferSocket->connect(realHost, QString::number(port)); + m_transferSocket->connect(realHost, TQString::number(port)); } -KNetwork::KSocketAddress FtpSocket::setupActiveTransferSocket() +KNetwork::TDESocketAddress FtpSocket::setupActiveTransferSocket() { if (!m_serverSocket) - m_serverSocket = new KNetwork::KServerSocket(); + m_serverSocket = new KNetwork::TDEServerSocket(); m_serverSocket->setAcceptBuffered(false); m_serverSocket->setFamily(KNetwork::KResolver::InetFamily); @@ -934,10 +934,10 @@ KNetwork::KSocketAddress FtpSocket::setupActiveTransferSocket() unsigned int min = KFTPCore::Config::activeMinPort(); for (unsigned int port = min + rand() % (max - min + 1); port <= max; port++) { - m_serverSocket->setAddress(QString::number(port)); + m_serverSocket->setAddress(TQString::number(port)); bool success = m_serverSocket->listen(); - if (found = (success && m_serverSocket->error() == KSocketBase::NoError)) + if (found = (success && m_serverSocket->error() == TDESocketBase::NoError)) break; m_serverSocket->close(); @@ -946,7 +946,7 @@ KNetwork::KSocketAddress FtpSocket::setupActiveTransferSocket() if (!found) { emitEvent(Event::EventMessage, i18n("Unable to establish a listening socket.")); resetCommandClass(Failed); - return KNetwork::KSocketAddress(); + return KNetwork::TDESocketAddress(); } } else { m_serverSocket->setAddress("0"); @@ -954,16 +954,16 @@ KNetwork::KSocketAddress FtpSocket::setupActiveTransferSocket() if (!m_serverSocket->listen()) { emitEvent(Event::EventMessage, i18n("Unable to establish a listening socket.")); resetCommandClass(Failed); - return KNetwork::KSocketAddress(); + return KNetwork::TDESocketAddress(); } } - KNetwork::KSocketAddress serverAddr = m_serverSocket->localAddress(); - KNetwork::KSocketAddress controlAddr = localAddress(); - KNetwork::KSocketAddress request; + KNetwork::TDESocketAddress serverAddr = m_serverSocket->localAddress(); + KNetwork::TDESocketAddress controlAddr = localAddress(); + KNetwork::TDESocketAddress request; if (KFTPCore::Config::portForceIp() && !getConfigInt("active.no_force_ip")) { - QString remoteIp = peerAddress().nodeName(); + TQString remoteIp = peerAddress().nodeName(); if (KFTPCore::Config::ignoreExternalIpForLan() && (remoteIp.startsWith("192.168.") || remoteIp.startsWith("10.") || remoteIp.startsWith("172.16."))) { @@ -1069,7 +1069,7 @@ void FtpSocket::slotDataConnected() nextCommand(); } -void FtpSocket::variableBufferUpdate(Q_LONG size) +void FtpSocket::variableBufferUpdate(TQ_LONG size) { if (size > m_transferBufferSize - 64) { if (m_transferBufferSize + 512 <= 32768) { @@ -1113,10 +1113,10 @@ void FtpSocket::slotDataTryWrite() return; } - QFile::Offset tmpOffset = getTransferFile()->at(); - Q_LONG readSize = getTransferFile()->readBlock(m_transferBuffer, m_transferBufferSize); + TQFile::Offset tmpOffset = getTransferFile()->at(); + TQ_LONG readSize = getTransferFile()->readBlock(m_transferBuffer, m_transferBufferSize); - Q_LONG size = 0; + TQ_LONG size = 0; if (m_dataSsl) size = m_dataSsl->write(m_transferBuffer, readSize); @@ -1163,7 +1163,7 @@ void FtpSocket::slotDataTryRead() m_transferBuffer = (char*) realloc(m_transferBuffer, m_transferBufferSize); } - Q_LONG size = 0; + TQ_LONG size = 0; if (m_dataSsl) { size = m_dataSsl->read(m_transferBuffer, m_transferBufferSize); @@ -1208,7 +1208,7 @@ void FtpSocket::slotDataTryRead() break; } default: { - qDebug("WARNING: slotDataReadActivity called for an invalid command!"); + tqDebug("WARNING: slotDataReadActivity called for an invalid command!"); return; } } @@ -1232,7 +1232,7 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandList, FtpSocket, CmdList) - QString path; + TQString path; void process() { @@ -1312,7 +1312,7 @@ public: return; } else if (socket()->isMultiline()) { // Some servers put the response code into the multiline reply - QString response = socket()->getResponse(); + TQString response = socket()->getResponse(); if (response.left(3) == "211") response = response.mid(4); @@ -1408,7 +1408,7 @@ public: } else { // Parse MDTM response struct tm dt = {0,0,0,0,0,0,0,0,0,0,0}; - QString tmp(socket()->getResponse()); + TQString tmp(socket()->getResponse()); tmp.remove(0, 4); dt.tm_year = tmp.left(4).toInt() - 1900; @@ -1422,12 +1422,12 @@ public: } // Check if the local file exists and stat the remote file if so - if (QDir::root().exists(destinationFile.path())) { + if (TQDir::root().exists(destinationFile.path())) { socket()->protoStat(sourceFile); currentState = StatDone; return; } else { - KStandardDirs::makeDir(destinationFile.directory()); + TDEStandardDirs::makeDir(destinationFile.directory()); // Don't break so we will get on to initiating the data connection } @@ -1556,9 +1556,9 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandCwd, FtpSocket, CmdNone) - QString targetDirectory; - QString currentPathPart; - QString cached; + TQString targetDirectory; + TQString currentPathPart; + TQString cached; int currentPart; int numParts; bool shouldCreate; @@ -1626,7 +1626,7 @@ public: case SentPwd: { // Parse the current working directory if (socket()->isResponse("2")) { - QString tmp = socket()->getResponse(); + TQString tmp = socket()->getResponse(); int first = tmp.find('"') + 1; tmp = tmp.mid(first, tmp.findRev('"') - first); @@ -1674,7 +1674,7 @@ public: } }; -void FtpSocket::changeWorkingDirectory(const QString &path, bool shouldCreate) +void FtpSocket::changeWorkingDirectory(const TQString &path, bool shouldCreate) { // Set the path to cwd to setConfig("params.cwd.path", path); @@ -1721,7 +1721,7 @@ public: fetchedSize = false; // Check if the local file exists - if (!QDir::root().exists(sourceFile.path())) { + if (!TQDir::root().exists(sourceFile.path())) { socket()->emitError(FileNotFound); socket()->resetCommandClass(Failed); return; @@ -1898,8 +1898,8 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandRemove, FtpSocket, CmdNone) - QString destinationPath; - QString parentDirectory; + TQString destinationPath; + TQString parentDirectory; void process() { @@ -1982,8 +1982,8 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandRename, FtpSocket, CmdRename) - QString sourcePath; - QString destinationPath; + TQString sourcePath; + TQString destinationPath; void process() { @@ -2053,7 +2053,7 @@ public: case None: { currentState = SentChmod; - QString chmod; + TQString chmod; chmod.sprintf("SITE CHMOD %.3d %s", socket()->getConfigInt("params.chmod.mode"), socket()->getConfig("params.chmod.path").ascii()); socket()->sendCommand(chmod); @@ -2140,7 +2140,7 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandRaw, FtpSocket, CmdRaw) - QString response; + TQString response; void process() { @@ -2163,7 +2163,7 @@ public: } }; -void FtpSocket::protoRaw(const QString &raw) +void FtpSocket::protoRaw(const TQString &raw) { setConfig("params.raw.command", raw); activateCommandClass(FtpCommandRaw); @@ -2346,7 +2346,7 @@ public: // Change type currentState = SourceSentType; - QString type = "TYPE "; + TQString type = "TYPE "; type.append(KFTPCore::Config::self()->ftpMode(sourceFile.path())); socket()->sendCommand(type); break; @@ -2452,7 +2452,7 @@ public: if (!socket()->isResponse("2")) { socket()->resetCommandClass(Failed); } else { - QString tmp = socket()->getResponse(); + TQString tmp = socket()->getResponse(); int pos = tmp.find('(') + 1; tmp = tmp.mid(pos, tmp.find(')') - pos); @@ -2464,7 +2464,7 @@ public: } case SourceDoRest: { currentState = SourceSentRest; - socket()->sendCommand("REST " + QString::number(resumeOffset)); + socket()->sendCommand("REST " + TQString::number(resumeOffset)); break; } case SourceSentRest: { @@ -2499,7 +2499,7 @@ public: if (socket()->getConfigInt("params.fxp.changed_prot")) { currentState = SourceResetProt; - QString prot = "PROT "; + TQString prot = "PROT "; if (socket()->getConfigInt("ssl.prot_mode") == 0) prot.append('P'); @@ -2554,7 +2554,7 @@ public: case DestDoType: { currentState = DestSentType; - QString type = "TYPE "; + TQString type = "TYPE "; type.append(KFTPCore::Config::self()->ftpMode(sourceFile.path())); socket()->sendCommand(type); break; @@ -2666,7 +2666,7 @@ public: if (socket()->getConfigInt("params.fxp.changed_prot")) { currentState = DestResetProt; - QString prot = "PROT "; + TQString prot = "PROT "; if (socket()->getConfigInt("ssl.prot_mode") == 0) prot.append('P'); diff --git a/kftpgrabber/src/engine/ftpsocket.h b/kftpgrabber/src/engine/ftpsocket.h index 1762bfd..8088b56 100644 --- a/kftpgrabber/src/engine/ftpsocket.h +++ b/kftpgrabber/src/engine/ftpsocket.h @@ -41,8 +41,8 @@ #include <kserversocket.h> #include <kssl.h> -#include <qguardedptr.h> -#include <qfile.h> +#include <ntqguardedptr.h> +#include <ntqfile.h> #include "speedlimiter.h" #include "socket.h" @@ -76,11 +76,11 @@ public: void protoChmodSingle(const KURL &path, int mode); void protoMkdir(const KURL &path); void protoList(const KURL &path); - void protoRaw(const QString &raw); + void protoRaw(const TQString &raw); void protoSiteToSite(Socket *socket, const KURL &source, const KURL &destination); void protoKeepAlive(); - void changeWorkingDirectory(const QString &path, bool shouldCreate = false); + void changeWorkingDirectory(const TQString &path, bool shouldCreate = false); void poll(); @@ -91,42 +91,42 @@ public: void setSslClientCertificate(KSSLPKCS12 *certificate) { m_clientCert = certificate; } - bool isResponse(const QString &code); - QString getResponse() { return m_response; } + bool isResponse(const TQString &code); + TQString getResponse() { return m_response; } bool isMultiline() { return !m_multiLineCode.isEmpty(); } - void sendCommand(const QString &command); + void sendCommand(const TQString &command); void resetCommandClass(ResetCode code = Ok); - void setupPassiveTransferSocket(const QString &host, int port); - KNetwork::KSocketAddress setupActiveTransferSocket(); + void setupPassiveTransferSocket(const TQString &host, int port); + KNetwork::TDESocketAddress setupActiveTransferSocket(); - QFile *getTransferFile() { return &m_transferFile; } + TQFile *getTransferFile() { return &m_transferFile; } void checkTransferEnd(); void checkTransferStart(); void resetTransferStart() { m_transferStart = 0; } protected: void processBuffer(); - void parseLine(const QString &line); - void variableBufferUpdate(Q_LONG size); + void parseLine(const TQString &line); + void variableBufferUpdate(TQ_LONG size); void closeDataTransferSocket(); void initializeTransferSocket(); void transferCompleted(); private: bool m_login; - QString m_buffer; - QString m_multiLineCode; - QString m_response; + TQString m_buffer; + TQString m_multiLineCode; + TQString m_response; - QGuardedPtr<KNetwork::KStreamSocket> m_transferSocket; - QGuardedPtr<KNetwork::KServerSocket> m_serverSocket; + TQGuardedPtr<KNetwork::KStreamSocket> m_transferSocket; + TQGuardedPtr<KNetwork::TDEServerSocket> m_serverSocket; FtpDirectoryParser *m_directoryParser; char m_controlBuffer[1024]; - QFile m_transferFile; + TQFile m_transferFile; char *m_transferBuffer; int m_transferBufferSize; int m_transferStart; diff --git a/kftpgrabber/src/engine/sftpsocket.cpp b/kftpgrabber/src/engine/sftpsocket.cpp index a683723..33443de 100644 --- a/kftpgrabber/src/engine/sftpsocket.cpp +++ b/kftpgrabber/src/engine/sftpsocket.cpp @@ -38,12 +38,12 @@ #include "cache.h" #include "misc/config.h" -#include <qdir.h> +#include <ntqdir.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> -#include <kio/job.h> -#include <kio/renamedlg.h> +#include <tdeio/job.h> +#include <tdeio/renamedlg.h> #include <sys/stat.h> #include <fcntl.h> @@ -73,7 +73,7 @@ int addPermInt(int &x, int n, int add) int SftpSocket::intToPosix(int permissions) { int posix = 0; - QString str = QString::number(permissions); + TQString str = TQString::number(permissions); int user = str.mid(0, 1).toInt(); int group = str.mid(1, 1).toInt(); @@ -138,7 +138,7 @@ public: } case ConnectComplete: { SSH_SESSION *sshSession = socket()->sshSession(); - QString password; + TQString password; // Check if a public key password was supplied using the wakeup event if (isWakeup()) { @@ -412,7 +412,7 @@ public: return; } - if (QDir::root().exists(destinationFile.path())) { + if (TQDir::root().exists(destinationFile.path())) { DirectoryListing list; list.addEntry(socket()->getStatResponse()); @@ -420,10 +420,10 @@ public: socket()->emitEvent(Event::EventFileExists, list); return; } else - KStandardDirs::makeDir(destinationFile.directory()); + TDEStandardDirs::makeDir(destinationFile.directory()); } case DestChecked: { - QFile file; + TQFile file; if (isWakeup()) { // We have been waken up because a decision has been made @@ -542,7 +542,7 @@ public: sourceFile.setPath(socket()->getConfig("params.get.source")); destinationFile.setPath(socket()->getConfig("params.get.destination")); - if (!QDir::root().exists(sourceFile.path())) { + if (!TQDir::root().exists(sourceFile.path())) { socket()->emitError(FileNotFound); socket()->resetCommandClass(Failed); return; @@ -566,8 +566,8 @@ public: // Create destination directories socket()->setErrorReporting(false); - QString destinationDir = destinationFile.directory(); - QString fullPath; + TQString destinationDir = destinationFile.directory(); + TQString fullPath; for (register int i = 1; i <= destinationDir.contains('/'); i++) { fullPath += "/" + destinationDir.section('/', i, i); @@ -578,7 +578,7 @@ public: } } case DestChecked: { - QFile file; + TQFile file; if (isWakeup()) { // We have been waken up because a decision has been made diff --git a/kftpgrabber/src/engine/sftpsocket.h b/kftpgrabber/src/engine/sftpsocket.h index f34a896..ab1b0e7 100644 --- a/kftpgrabber/src/engine/sftpsocket.h +++ b/kftpgrabber/src/engine/sftpsocket.h @@ -78,7 +78,7 @@ public: SSH_SESSION *sshSession() { return m_sshSession; } SFTP_SESSION *sftpSession() { return m_sftpSession; } private: - QString posixToString(int permissions); + TQString posixToString(int permissions); int intToPosix(int permissions); private: SSH_SESSION *m_sshSession; diff --git a/kftpgrabber/src/engine/socket.cpp b/kftpgrabber/src/engine/socket.cpp index 370de1b..afc5341 100644 --- a/kftpgrabber/src/engine/socket.cpp +++ b/kftpgrabber/src/engine/socket.cpp @@ -41,11 +41,11 @@ #include "misc/config.h" -#include <klocale.h> +#include <tdelocale.h> namespace KFTPEngine { -Socket::Socket(Thread *thread, const QString &protocol) +Socket::Socket(Thread *thread, const TQString &protocol) : m_remoteEncoding(new KRemoteEncoding()), m_cmdData(0), m_thread(thread), @@ -82,7 +82,7 @@ void Socket::initConfig() setConfig("keepalive.timeout", 60); } -void Socket::emitError(ErrorCode code, const QString ¶m1) +void Socket::emitError(ErrorCode code, const TQString ¶m1) { // Intercept connect and login errors and pass them on to the ConnectionRetry class (if enabled) if (getConfigInt("retry") && (code == ConnectFailed || code == LoginFailed)) { @@ -93,7 +93,7 @@ void Socket::emitError(ErrorCode code, const QString ¶m1) return; } - QValueList<EventParameter> params; + TQValueList<EventParameter> params; params.append(EventParameter(code)); params.append(EventParameter(param1)); @@ -101,9 +101,9 @@ void Socket::emitError(ErrorCode code, const QString ¶m1) m_thread->event(Event::EventError, params); } -void Socket::emitEvent(Event::Type type, const QString ¶m1, const QString ¶m2) +void Socket::emitEvent(Event::Type type, const TQString ¶m1, const TQString ¶m2) { - QValueList<EventParameter> params; + TQValueList<EventParameter> params; params.append(EventParameter(param1)); params.append(EventParameter(param2)); @@ -113,7 +113,7 @@ void Socket::emitEvent(Event::Type type, const QString ¶m1, const QString &p void Socket::emitEvent(Event::Type type, DirectoryListing param1) { - QValueList<EventParameter> params; + TQValueList<EventParameter> params; params.append(EventParameter(param1)); // Dispatch the event via socket thread @@ -122,7 +122,7 @@ void Socket::emitEvent(Event::Type type, DirectoryListing param1) void Socket::emitEvent(Event::Type type, filesize_t param1) { - QValueList<EventParameter> params; + TQValueList<EventParameter> params; params.append(EventParameter(param1)); // Dispatch the event via socket thread @@ -131,14 +131,14 @@ void Socket::emitEvent(Event::Type type, filesize_t param1) void Socket::emitEvent(Event::Type type, void *param1) { - QValueList<EventParameter> params; + TQValueList<EventParameter> params; params.append(EventParameter(param1)); // Dispatch the event via socket thread m_thread->event(type, params); } -void Socket::changeEncoding(const QString &encoding) +void Socket::changeEncoding(const TQString &encoding) { // Alter encoding and change socket config m_remoteEncoding->setEncoding(encoding.ascii()); @@ -158,7 +158,7 @@ void Socket::timeoutWait(bool start) if (start) { m_timeoutCounter.start(); } else { - m_timeoutCounter = QTime(); + m_timeoutCounter = TQTime(); } } @@ -219,8 +219,8 @@ void Socket::keepaliveCheck() Commands::Type Socket::getCurrentCommand() { if (m_commandChain.count() > 0) { - QPtrList<Commands::Base>::iterator chainEnd = m_commandChain.end(); - for (QPtrList<Commands::Base>::iterator i = m_commandChain.begin(); i != chainEnd; i++) { + TQPtrList<Commands::Base>::iterator chainEnd = m_commandChain.end(); + for (TQPtrList<Commands::Base>::iterator i = m_commandChain.begin(); i != chainEnd; i++) { if ((*i)->command() != Commands::CmdNone) return (*i)->command(); } @@ -332,7 +332,7 @@ void Socket::wakeup(WakeupEvent *event) Commands::Base *current = m_commandChain.current(); if (current->isProcessing()) { - qDebug("WARNING: Attempted to wakeup a processing socket!"); + tqDebug("WARNING: Attempted to wakeup a processing socket!"); return; } @@ -344,7 +344,7 @@ void Socket::wakeup(WakeupEvent *event) resetCommandClass(current->resetCode()); } else if (m_cmdData) { if (m_cmdData->isProcessing()) { - qDebug("WARNING: Attempted to wakeup a processing socket!"); + tqDebug("WARNING: Attempted to wakeup a processing socket!"); return; } @@ -410,9 +410,9 @@ public: } case WaitList: { // Now just extract what we need - QValueList<DirectoryEntry> list = socket()->getLastDirectoryListing().list(); - QValueList<DirectoryEntry>::iterator listEnd = list.end(); - for (QValueList<DirectoryEntry>::iterator i = list.begin(); i != listEnd; i++) { + TQValueList<DirectoryEntry> list = socket()->getLastDirectoryListing().list(); + TQValueList<DirectoryEntry>::iterator listEnd = list.end(); + for (TQValueList<DirectoryEntry>::iterator i = list.begin(); i != listEnd; i++) { if ((*i).filename() == path.fileName()) { socket()->m_lastStatResponse = *i; socket()->resetCommandClass(); @@ -434,9 +434,9 @@ void Socket::protoStat(const KURL &path) // Lookup the cache first and don't even try to list if cached DirectoryListing cached = Cache::self()->findCached(this, path.directory()); if (cached.isValid()) { - QValueList<DirectoryEntry> list = cached.list(); - QValueList<DirectoryEntry>::iterator listEnd = list.end(); - for (QValueList<DirectoryEntry>::iterator i = list.begin(); i != listEnd; i++) { + TQValueList<DirectoryEntry> list = cached.list(); + TQValueList<DirectoryEntry>::iterator listEnd = list.end(); + for (TQValueList<DirectoryEntry>::iterator i = list.begin(); i != listEnd; i++) { if ((*i).filename() == path.fileName()) { m_lastStatResponse = *i; nextCommandAsync(); @@ -472,10 +472,10 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandScan, Socket, CmdNone) - QValueList<DirectoryEntry> currentList; - QValueList<DirectoryEntry>::const_iterator currentEntry; + TQValueList<DirectoryEntry> currentList; + TQValueList<DirectoryEntry>::const_iterator currentEntry; - QString currentDirectory; + TQString currentDirectory; DirectoryTree *currentTree; void cleanup() @@ -593,8 +593,8 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandDelete, Socket, CmdDelete) - QValueList<DirectoryEntry> currentList; - QValueList<DirectoryEntry>::const_iterator currentEntry; + TQValueList<DirectoryEntry> currentList; + TQValueList<DirectoryEntry>::const_iterator currentEntry; KURL destinationPath; @@ -737,8 +737,8 @@ public: ENGINE_STANDARD_COMMAND_CONSTRUCTOR(FtpCommandRecursiveChmod, Socket, CmdChmod) - QValueList<DirectoryEntry> currentList; - QValueList<DirectoryEntry>::const_iterator currentEntry; + TQValueList<DirectoryEntry> currentList; + TQValueList<DirectoryEntry>::const_iterator currentEntry; KURL destinationPath; int mode; diff --git a/kftpgrabber/src/engine/socket.h b/kftpgrabber/src/engine/socket.h index 3c2296a..01b1807 100644 --- a/kftpgrabber/src/engine/socket.h +++ b/kftpgrabber/src/engine/socket.h @@ -39,9 +39,9 @@ #include <kurl.h> #include <kremoteencoding.h> -#include <qptrlist.h> -#include <qguardedptr.h> -#include <qdatetime.h> +#include <ntqptrlist.h> +#include <ntqguardedptr.h> +#include <ntqdatetime.h> #include "commands.h" @@ -72,7 +72,7 @@ public: * @param thread The thread that created this socket * @param protocol The protocol name */ - Socket(Thread *thread, const QString &protocol); + Socket(Thread *thread, const TQString &protocol); ~Socket(); /** @@ -81,7 +81,7 @@ public: * @param key Key * @param value Value */ - void setConfig(const QString &key, const QString &value) { m_config[key] = value; } + void setConfig(const TQString &key, const TQString &value) { m_config[key] = value; } /** * Set an internal config value. @@ -89,7 +89,7 @@ public: * @param key Key * @param value Value */ - void setConfig(const QString &key, int value) { m_config[key] = QString::number(value); } + void setConfig(const TQString &key, int value) { m_config[key] = TQString::number(value); } /** * Set an internal config value. @@ -97,7 +97,7 @@ public: * @param key Key * @param value Value */ - void setConfig(const QString &key, filesize_t value) { m_config[key] = QString::number(value); } + void setConfig(const TQString &key, filesize_t value) { m_config[key] = TQString::number(value); } /** * Get an internal config value as string. @@ -105,7 +105,7 @@ public: * @param key Key * @return The key's value or an empty string if the key doesn't exist */ - QString getConfig(const QString &key) { return m_config[key]; } + TQString getConfig(const TQString &key) { return m_config[key]; } /** * Get an internal config value as an integer. @@ -113,7 +113,7 @@ public: * @param key Key * @return The key's value or 0 if the key doesn't exist */ - int getConfigInt(const QString &key) { return m_config[key].toInt(); } + int getConfigInt(const TQString &key) { return m_config[key].toInt(); } /** * Get an internal config value as filesize. @@ -121,7 +121,7 @@ public: * @param key Key * @return The key's value or 0 if the key doesn't exist */ - filesize_t getConfigFs(const QString &key) { return m_config[key].toULongLong(); } + filesize_t getConfigFs(const TQString &key) { return m_config[key].toULongLong(); } /** * This method should initialize the configuration map. @@ -223,7 +223,7 @@ public: * * @param command The command to send */ - virtual void protoRaw(const QString&) {} + virtual void protoRaw(const TQString&) {} /** * This method should initiate a site to site transfer in case the protocol @@ -278,7 +278,7 @@ public: * * @return This socket's protocol name */ - QString protocolName() { return m_protocol; } + TQString protocolName() { return m_protocol; } /** * This method should return the socket's features by or-ing the values in @@ -315,7 +315,7 @@ public: * @param code The error code * @param param1 Optional string parameter */ - void emitError(ErrorCode code, const QString ¶m1 = 0); + void emitError(ErrorCode code, const TQString ¶m1 = 0); /** * Emit an engine event. @@ -324,7 +324,7 @@ public: * @param param1 Optional string parameter * @param param2 Optional string parameter */ - void emitEvent(Event::Type type, const QString ¶m1 = 0, const QString ¶m2 = 0); + void emitEvent(Event::Type type, const TQString ¶m1 = 0, const TQString ¶m2 = 0); /** * Emit an engine event containing a directory listing. @@ -356,7 +356,7 @@ public: * * @param encoding A valid encoding name */ - virtual void changeEncoding(const QString &encoding); + virtual void changeEncoding(const TQString &encoding); /** * Retrieve the KRemoteEncoding object for this socket set to the appropriate @@ -371,28 +371,28 @@ public: * * @param path The current directory path */ - void setCurrentDirectory(const QString &path) { m_currentDirectory = path; } + void setCurrentDirectory(const TQString &path) { m_currentDirectory = path; } /** * Get the current directory path. * * @return The current directory path. */ - virtual QString getCurrentDirectory() { return m_currentDirectory; } + virtual TQString getCurrentDirectory() { return m_currentDirectory; } /** * Sets the default directory path (like a remote home directory). * * @param path The default directory path */ - void setDefaultDirectory(const QString &path) { m_defaultDirectory = path; } + void setDefaultDirectory(const TQString &path) { m_defaultDirectory = path; } /** * Get the default directory path. * * @return The default directory path */ - virtual QString getDefaultDirectory() { return m_defaultDirectory; } + virtual TQString getDefaultDirectory() { return m_defaultDirectory; } /** * Sets the url this socket is connected to. @@ -576,7 +576,7 @@ protected: KRemoteEncoding *m_remoteEncoding; Commands::Base *m_cmdData; - QPtrList<Commands::Base> m_commandChain; + TQPtrList<Commands::Base> m_commandChain; Thread *m_thread; DirectoryListing m_lastDirectoryListing; @@ -586,18 +586,18 @@ protected: time_t m_speedLastTime; filesize_t m_speedLastBytes; - QTime m_timeoutCounter; - QTime m_keepaliveCounter; + TQTime m_timeoutCounter; + TQTime m_keepaliveCounter; private: - QMap<QString, QString> m_config; - QString m_currentDirectory; - QString m_defaultDirectory; + TQMap<TQString, TQString> m_config; + TQString m_currentDirectory; + TQString m_defaultDirectory; KURL m_currentUrl; - QString m_protocol; + TQString m_protocol; Commands::Type m_currentCommand; bool m_errorReporting; bool m_shouldAbort; - QGuardedPtr<ConnectionRetry> m_connectionRetry; + TQGuardedPtr<ConnectionRetry> m_connectionRetry; }; } diff --git a/kftpgrabber/src/engine/speedlimiter.cpp b/kftpgrabber/src/engine/speedlimiter.cpp index 85f2b72..fba03c0 100644 --- a/kftpgrabber/src/engine/speedlimiter.cpp +++ b/kftpgrabber/src/engine/speedlimiter.cpp @@ -140,9 +140,9 @@ void SpeedLimiter::remove(SpeedLimiterItem *item, Type type) item->m_availableBytes = -1; } -void SpeedLimiter::timerEvent(QTimerEvent*) +void SpeedLimiter::timerEvent(TQTimerEvent*) { - QPtrList<SpeedLimiterItem> pendingWakeup; + TQPtrList<SpeedLimiterItem> pendingWakeup; for (int i = 0; i < 2; i++) { m_tokenDebt[i] = 0; @@ -174,7 +174,7 @@ void SpeedLimiter::timerEvent(QTimerEvent*) tokens = 0; - QPtrList<SpeedLimiterItem> unsaturatedObjects; + TQPtrList<SpeedLimiterItem> unsaturatedObjects; for (SpeedLimiterItem *item = m_objects[i].first(); item; item = m_objects[i].next()) { if (item->m_availableBytes == -1) { diff --git a/kftpgrabber/src/engine/speedlimiter.h b/kftpgrabber/src/engine/speedlimiter.h index 789cb19..3cc5594 100644 --- a/kftpgrabber/src/engine/speedlimiter.h +++ b/kftpgrabber/src/engine/speedlimiter.h @@ -36,8 +36,8 @@ #ifndef KFTPENGINESPEEDLIMITER_H #define KFTPENGINESPEEDLIMITER_H -#include <qobject.h> -#include <qptrlist.h> +#include <ntqobject.h> +#include <ntqptrlist.h> namespace KFTPEngine { @@ -49,7 +49,7 @@ class SpeedLimiterItem; * * @author Jernej Kos <kostko@unimatrix-one.org> */ -class SpeedLimiter : public QObject { +class SpeedLimiter : public TQObject { Q_OBJECT public: /** @@ -114,12 +114,12 @@ protected: /** * Timer event. */ - void timerEvent(QTimerEvent*); + void timerEvent(TQTimerEvent*); private: bool m_timer; int m_limits[2]; - QPtrList<SpeedLimiterItem> m_objects[2]; + TQPtrList<SpeedLimiterItem> m_objects[2]; int m_tokenDebt[2]; private slots: diff --git a/kftpgrabber/src/engine/ssl.cpp b/kftpgrabber/src/engine/ssl.cpp index c0a0109..64bfcb2 100644 --- a/kftpgrabber/src/engine/ssl.cpp +++ b/kftpgrabber/src/engine/ssl.cpp @@ -35,7 +35,7 @@ */ #include "ssl.h" -#include <ksocketdevice.h> +#include <tdesocketdevice.h> #include <kmdcodec.h> #include <ksslx509v3.h> @@ -139,9 +139,9 @@ bool Ssl::setClientCertificate(KSSLPKCS12 *pkcs) int ret; X509 *x; EVP_PKEY *k = pkcs->getPrivateKey(); - QCString cert = QCString(pkcs->getCertificate()->toString().ascii()); + TQCString cert = TQCString(pkcs->getCertificate()->toString().ascii()); - QByteArray qba, qbb = cert.copy(); + TQByteArray qba, qbb = cert.copy(); KCodecs::base64Decode(qbb, qba); #if OPENSSL_VERSION_NUMBER > 0x009070afL const unsigned char *qbap = reinterpret_cast<unsigned char *>(qba.data()); diff --git a/kftpgrabber/src/engine/ssl.h b/kftpgrabber/src/engine/ssl.h index e0933ed..6aeb0a2 100644 --- a/kftpgrabber/src/engine/ssl.h +++ b/kftpgrabber/src/engine/ssl.h @@ -54,17 +54,17 @@ public: /** * Get the cipher in use. */ - const QString &getCipher() const { return m_cipherName; } + const TQString &getCipher() const { return m_cipherName; } /** * Describe the cipher in use. */ - const QString &getCipherDescription() const { return m_cipherDescription; } + const TQString &getCipherDescription() const { return m_cipherDescription; } /** * Get the version of the cipher in use. */ - const QString &getCipherVersion() const { return m_cipherVersion; } + const TQString &getCipherVersion() const { return m_cipherVersion; } /** * Get the number of bits of the cipher that are actually used. @@ -84,9 +84,9 @@ protected: int m_cipherUsedBits; int m_cipherBits; - QString m_cipherName; - QString m_cipherDescription; - QString m_cipherVersion; + TQString m_cipherName; + TQString m_cipherDescription; + TQString m_cipherVersion; }; /** diff --git a/kftpgrabber/src/engine/thread.cpp b/kftpgrabber/src/engine/thread.cpp index 3e151b5..500d7bf 100644 --- a/kftpgrabber/src/engine/thread.cpp +++ b/kftpgrabber/src/engine/thread.cpp @@ -37,12 +37,12 @@ #include "ftpsocket.h" #include "sftpsocket.h" -#include <qapplication.h> +#include <ntqapplication.h> namespace KFTPEngine { Thread::Thread() - : QThread(), + : TQThread(), m_eventHandler(new EventHandler(this)), m_socket(0), m_wakeupEvent(0), @@ -76,7 +76,7 @@ Thread::~Thread() void Thread::run() { while (!m_abortLoop) { - QThread::usleep(100); + TQThread::usleep(100); // "Poll" the socket m_socket->poll(); @@ -96,8 +96,8 @@ void Thread::run() if (!m_commandQueue.empty()) { m_queueMutex.lock(); - QValueList<Commands::Type>::iterator queueEnd = m_commandQueue.end(); - for (QValueList<Commands::Type>::iterator i = m_commandQueue.begin(); i != queueEnd; ++i) { + TQValueList<Commands::Type>::iterator queueEnd = m_commandQueue.end(); + for (TQValueList<Commands::Type>::iterator i = m_commandQueue.begin(); i != queueEnd; ++i) { Commands::Type cmdType = *i; // Execute the command @@ -179,7 +179,7 @@ void Thread::run() void Thread::wakeup(WakeupEvent *event) { - QMutexLocker locker(&m_wakeupMutex); + TQMutexLocker locker(&m_wakeupMutex); m_wakeupEvent = event; m_wakeUpPending = true; @@ -189,7 +189,7 @@ void Thread::abort() { // Clear any pending wakeup events if (m_wakeUpPending) { - QMutexLocker locker(&m_wakeupMutex); + TQMutexLocker locker(&m_wakeupMutex); m_wakeupEvent = 0; m_wakeUpPending = false; @@ -198,11 +198,11 @@ void Thread::abort() m_socket->protoAbort(); } -void Thread::event(Event::Type type, QValueList<EventParameter> params) +void Thread::event(Event::Type type, TQValueList<EventParameter> params) { if (m_eventHandler) { Event *e = new Event(type, params); - qApp->postEvent(m_eventHandler, e); + tqApp->postEvent(m_eventHandler, e); } } @@ -219,7 +219,7 @@ void Thread::selectSocketForProtocol(const KURL &url) EventParameter Thread::nextCommandParameter() { - QMutexLocker locker(&m_paramsMutex); + TQMutexLocker locker(&m_paramsMutex); EventParameter param = m_commandParams.front(); m_commandParams.pop_front(); @@ -228,8 +228,8 @@ EventParameter Thread::nextCommandParameter() void Thread::connect(const KURL &url) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); // Setup the correct socket to use for connection selectSocketForProtocol(url); @@ -240,16 +240,16 @@ void Thread::connect(const KURL &url) void Thread::disconnect() { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdDisconnect); } void Thread::list(const KURL &url) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdList); m_commandParams.append(EventParameter(url)); @@ -257,8 +257,8 @@ void Thread::list(const KURL &url) void Thread::scan(const KURL &url) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdScan); m_commandParams.append(EventParameter(url)); @@ -266,8 +266,8 @@ void Thread::scan(const KURL &url) void Thread::get(const KURL &source, const KURL &destination) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdGet); m_commandParams.append(EventParameter(destination)); @@ -276,8 +276,8 @@ void Thread::get(const KURL &source, const KURL &destination) void Thread::put(const KURL &source, const KURL &destination) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdPut); m_commandParams.append(EventParameter(destination)); @@ -286,8 +286,8 @@ void Thread::put(const KURL &source, const KURL &destination) void Thread::remove(const KURL &url) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdDelete); m_commandParams.append(EventParameter(url)); @@ -295,8 +295,8 @@ void Thread::remove(const KURL &url) void Thread::rename(const KURL &source, const KURL &destination) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdRename); m_commandParams.append(EventParameter(destination)); @@ -305,8 +305,8 @@ void Thread::rename(const KURL &source, const KURL &destination) void Thread::chmod(const KURL &url, int mode, bool recursive) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdChmod); m_commandParams.append(EventParameter(recursive)); @@ -316,17 +316,17 @@ void Thread::chmod(const KURL &url, int mode, bool recursive) void Thread::mkdir(const KURL &url) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdMkdir); m_commandParams.append(EventParameter(url)); } -void Thread::raw(const QString &raw) +void Thread::raw(const TQString &raw) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdRaw); m_commandParams.append(EventParameter(raw)); @@ -334,8 +334,8 @@ void Thread::raw(const QString &raw) void Thread::siteToSite(Thread *thread, const KURL &source, const KURL &destination) { - QMutexLocker locker(&m_paramsMutex); - QMutexLocker lockerq(&m_queueMutex); + TQMutexLocker locker(&m_paramsMutex); + TQMutexLocker lockerq(&m_queueMutex); m_commandQueue.append(Commands::CmdFxp); m_commandParams.append(EventParameter(destination)); diff --git a/kftpgrabber/src/engine/thread.h b/kftpgrabber/src/engine/thread.h index 62a36c4..c2977c3 100644 --- a/kftpgrabber/src/engine/thread.h +++ b/kftpgrabber/src/engine/thread.h @@ -36,10 +36,10 @@ #ifndef KFTPENGINETHREAD_H #define KFTPENGINETHREAD_H -#include <qthread.h> -#include <qmutex.h> -#include <qvaluelist.h> -#include <qdict.h> +#include <ntqthread.h> +#include <ntqmutex.h> +#include <ntqvaluelist.h> +#include <ntqdict.h> #include "event.h" #include "directorylisting.h" @@ -55,7 +55,7 @@ namespace KFTPEngine { * * @author Jernej Kos <kostko@jweb-network.net> */ -class Thread : public QThread +class Thread : public TQThread { friend class EventHandler; friend class Socket; @@ -103,25 +103,25 @@ public: void rename(const KURL &source, const KURL &destination); void chmod(const KURL &url, int mode, bool recursive = false); void mkdir(const KURL &url); - void raw(const QString &raw); + void raw(const TQString &raw); void siteToSite(Thread *thread, const KURL &source, const KURL &destination); protected: void run(); - void event(Event::Type type, QValueList<EventParameter> params); + void event(Event::Type type, TQValueList<EventParameter> params); EventParameter nextCommandParameter(); protected: EventHandler *m_eventHandler; Socket *m_socket; - QMutex m_eventMutex; - QMutex m_wakeupMutex; - QMutex m_paramsMutex; - QMutex m_queueMutex; + TQMutex m_eventMutex; + TQMutex m_wakeupMutex; + TQMutex m_paramsMutex; + TQMutex m_queueMutex; - QDict<Socket> m_protocolMap; - QValueList<Commands::Type> m_commandQueue; - QValueList<EventParameter> m_commandParams; + TQDict<Socket> m_protocolMap; + TQValueList<Commands::Type> m_commandQueue; + TQValueList<EventParameter> m_commandParams; WakeupEvent *m_wakeupEvent; bool m_abortLoop; |