diff --git a/kio_gopher.cpp b/kio_gopher.cpp index baf5457..8e5a28e 100644 --- a/kio_gopher.cpp +++ b/kio_gopher.cpp @@ -16,8 +16,8 @@ #include #include -#include -#include +#include +#include using namespace KIO; @@ -41,7 +41,7 @@ extern "C" /* gopher */ -gopher::gopher(const QByteArray &pool_socket, const QByteArray &app_socket) : TCPSlaveBase("gopher", pool_socket, app_socket) +gopher::gopher(const TQByteArray &pool_socket, const TQByteArray &app_socket) : TCPSlaveBase("gopher", pool_socket, app_socket) { } @@ -56,9 +56,9 @@ void gopher::get(const KUrl& url ) // %09 // %09%09 int port; - QChar type; - QString path(url.path()); - QString query(url.query()); + TQChar type; + TQString path(url.path()); + TQString query(url.query()); // determine the type if (path != "/" && path != "") type = path[1]; @@ -82,8 +82,8 @@ void gopher::get(const KUrl& url ) { int i, bytes; char aux[10240]; - QBuffer received; - received.open(QIODevice::WriteOnly); + TQBuffer received; + received.open(TQIODevice::WriteOnly); infoMessage(i18n("Connecting to %1...", url.host())); infoMessage(i18n("%1 contacted. Retrieving data...", url.host())); @@ -104,7 +104,7 @@ void gopher::get(const KUrl& url ) infoMessage(i18n("Retrieved %1 bytes from %2...", bytes, url.host())); } - if (type == '1' || type =='7') processDirectory(new QByteArray(received.buffer().data(), bytes + 1), url.host(), url.path()); + if (type == '1' || type =='7') processDirectory(new TQByteArray(received.buffer().data(), bytes + 1), url.host(), url.path()); else { KMimeType::Ptr result = KMimeType::findByContent(received.buffer()); @@ -116,12 +116,12 @@ void gopher::get(const KUrl& url ) finished(); } -void gopher::processDirectory(QByteArray *received, const QString &host, const QString &path) +void gopher::processDirectory(TQByteArray *received, const TQString &host, const TQString &path) { int i, remove; - QString pathToShow; - QByteArray show; - QByteArray info; + TQString pathToShow; + TQByteArray show; + TQByteArray info; if (path == "/" || path == "/1") pathToShow = ""; else pathToShow = path; mimeType("text/html"); @@ -155,13 +155,13 @@ void gopher::processDirectory(QByteArray *received, const QString &host, const Q delete received; } -void gopher::processDirectoryLine(const QByteArray &d, QByteArray &show, QByteArray &info) +void gopher::processDirectoryLine(const TQByteArray &d, TQByteArray &show, TQByteArray &info) { // gopher <\r><\n> // gopher+ <\r><\n> int i; - QByteArray type, name, url, server, port; - QByteArray data = d; + TQByteArray type, name, url, server, port; + TQByteArray data = d; type = data.left(1); data.remove(0, 1); @@ -215,8 +215,8 @@ void gopher::processDirectoryLine(const QByteArray &d, QByteArray &show, QByteAr show.append("\t\t\t
"); // support the non-standard extension for URL to external sites // in this case, url begins with 'URL:' - QByteArray finalUrl; - QByteArray iconUrl; + TQByteArray finalUrl; + TQByteArray iconUrl; if (url.startsWith("URL:")) { finalUrl = url.mid(4); @@ -243,12 +243,12 @@ void gopher::processDirectoryLine(const QByteArray &d, QByteArray &show, QByteAr } } -QByteArray gopher::parsePort(QByteArray *received) +TQByteArray gopher::parsePort(TQByteArray *received) { int i = 0; - QByteArray port; + TQByteArray port; bool found = false; - QChar c; + TQChar c; while (!found && i < received -> size()) { c = received -> at(i); @@ -260,7 +260,7 @@ QByteArray gopher::parsePort(QByteArray *received) return port; } -void gopher::findLine(QByteArray *received, int *i, int *remove) +void gopher::findLine(TQByteArray *received, int *i, int *remove) { // it's not in the rfc but most servers don't follow the spec // find lines ending only in \n and in \r\n @@ -288,11 +288,11 @@ void gopher::findLine(QByteArray *received, int *i, int *remove) } } -void gopher::handleSearch(const QString &host, const QString &path, int port) +void gopher::handleSearch(const TQString &host, const TQString &path, int port) { - QByteArray show; - QString sPort; - if (port != 70) sPort = ':' + QString::number(port); + TQByteArray show; + TQString sPort; + if (port != 70) sPort = ':' + TQString::number(port); mimeType("text/html"); show.append("\n"); show.append("\n"); @@ -330,9 +330,9 @@ void gopher::handleSearch(const QString &host, const QString &path, int port) data(show); } -void gopher::addIcon(const QString &type, const QByteArray &url, QByteArray &show) +void gopher::addIcon(const TQString &type, const TQByteArray &url, TQByteArray &show) { - QString icon; + TQString icon; if (type == "1") icon = "inode-directory.png"; else if (type == "3") icon = "dialog-error.png"; else if (type == "7") icon = "system-search.png"; @@ -343,9 +343,9 @@ void gopher::addIcon(const QString &type, const QByteArray &url, QByteArray &sho KMimeType::Ptr mime = KMimeType::findByUrl(KUrl(url), 0, false, true); icon = mime->iconName(); } - QFile file(m_iconLoader.iconPath(icon, -16)); - file.open(QIODevice::ReadOnly); - QByteArray ba = file.readAll(); + TQFile file(m_iconLoader.iconPath(icon, -16)); + file.open(TQIODevice::ReadOnly); + TQByteArray ba = file.readAll(); show.append(" "); diff --git a/kio_gopher.h b/kio_gopher.h index 755d6e9..b21e225 100644 --- a/kio_gopher.h +++ b/kio_gopher.h @@ -17,17 +17,17 @@ class gopher : public KIO::TCPSlaveBase { public: - gopher(const QByteArray &pool_socket, const QByteArray &app_socket); + gopher(const TQByteArray &pool_socket, const TQByteArray &app_socket); void get(const KUrl& url); private: - void processDirectory(QByteArray *received, const QString &host, const QString &path); - void processDirectoryLine(const QByteArray &data, QByteArray &show, QByteArray &info); - QByteArray parsePort(QByteArray *received); - void findLine(QByteArray *received, int *i, int *remove); - void handleSearch(const QString &host, const QString &path, int port); - void addIcon(const QString &type, const QByteArray &url, QByteArray &show); + void processDirectory(TQByteArray *received, const TQString &host, const TQString &path); + void processDirectoryLine(const TQByteArray &data, TQByteArray &show, TQByteArray &info); + TQByteArray parsePort(TQByteArray *received); + void findLine(TQByteArray *received, int *i, int *remove); + void handleSearch(const TQString &host, const TQString &path, int port); + void addIcon(const TQString &type, const TQByteArray &url, TQByteArray &show); KIconLoader m_iconLoader; };