diff options
Diffstat (limited to 'src/parsers')
-rw-r--r-- | src/parsers/filesearch.cpp | 8 | ||||
-rw-r--r-- | src/parsers/list.cpp | 10 | ||||
-rw-r--r-- | src/parsers/parsers.cpp | 18 | ||||
-rw-r--r-- | src/parsers/parsers.h | 36 | ||||
-rw-r--r-- | src/parsers/policy.cpp | 34 | ||||
-rw-r--r-- | src/parsers/qhtmlstream.h | 126 | ||||
-rw-r--r-- | src/parsers/search.cpp | 26 | ||||
-rw-r--r-- | src/parsers/show.cpp | 52 |
8 files changed, 155 insertions, 155 deletions
diff --git a/src/parsers/filesearch.cpp b/src/parsers/filesearch.cpp index c0a7a36..281aa63 100644 --- a/src/parsers/filesearch.cpp +++ b/src/parsers/filesearch.cpp @@ -10,16 +10,16 @@ #include "parsers.h" #include "../apt.h" -static QString +static TQString html_dpkgs_line_begin("<tr><td class=\"file\">%1</td><td>\n\t"), html_dpkgs_line_end("\n</td></tr>\n"); namespace Parsers { -void FileSearch::operator() (AptProtocol* slave, const QString & tag, const QString & value ) +void FileSearch::operator() (AptProtocol* slave, const TQString & tag, const TQString & value ) { - static QString buffer; + static TQString buffer; if (tag == "begin") { m_result_count = 0; @@ -33,7 +33,7 @@ void FileSearch::operator() (AptProtocol* slave, const QString & tag, const QStr if (m_result_count) *slave << buffer + html_dpkgs_line_end; - *slave << html_dpkgs_line_begin.arg(value); + *slave << html_dpkgs_line_begin.tqarg(value); ++m_result_count; buffer = ""; } diff --git a/src/parsers/list.cpp b/src/parsers/list.cpp index afaac7f..e4cea8e 100644 --- a/src/parsers/list.cpp +++ b/src/parsers/list.cpp @@ -13,7 +13,7 @@ #include <kio/slavebase.h> #include <klocale.h> -#include <qregexp.h> +#include <tqregexp.h> #include <kurl.h> namespace Parsers @@ -22,11 +22,11 @@ namespace Parsers : m_links(links) {} /** Parses the tokens sent by PackageManager::list */ - void List::operator() (AptProtocol* slave, const QString& tag, const QString& value ) + void List::operator() (AptProtocol* slave, const TQString& tag, const TQString& value ) { - static QRegExp rx_manpage("/man/.*\\.\\d[^/]*$"); + static TQRegExp rx_manpage("/man/.*\\.\\d[^/]*$"); - static QStringList files; + static TQStringList files; if (tag == "begin") { @@ -62,7 +62,7 @@ namespace Parsers files.sort(); *slave << "<div class=\"filelist\">\n" + files.join("\n<br>") + "\n</div>\n" - "<div class=\"footer\">" + i18n("%1 files in the package").arg(result_count()) + "</div>\n"; + "<div class=\"footer\">" + i18n("%1 files in the package").tqarg(result_count()) + "</div>\n"; files.clear(); } } diff --git a/src/parsers/parsers.cpp b/src/parsers/parsers.cpp index 2f959ce..2789355 100644 --- a/src/parsers/parsers.cpp +++ b/src/parsers/parsers.cpp @@ -14,7 +14,7 @@ #include <kio/slavebase.h> #include <qhtmlstream.h> -#include <qregexp.h> +#include <tqregexp.h> #include <stdlib.h> @@ -22,14 +22,14 @@ namespace Parsers { static void print_czstring(KIO::SlaveBase& slave, const char* data, int len) { - QByteArray nonull; + TQByteArray nonull; nonull.setRawData(data, len); slave.data(nonull); nonull.resetRawData(data, len); } - void operator << (KIO::SlaveBase& slave, const QCString& string) + void operator << (KIO::SlaveBase& slave, const TQCString& string) { print_czstring(slave, string.data(), string.size() - 1); } - void operator << (KIO::SlaveBase& slave, const QString& string) + void operator << (KIO::SlaveBase& slave, const TQString& string) { slave << string.utf8(); } void operator << (KIO::SlaveBase& slave, const char* string) { print_czstring(slave, string, strlen(string)); } @@ -39,7 +39,7 @@ namespace Parsers Parser::Parser( ) {} Parser::~Parser( ) {} - void Parser::attribute_begin(QHtmlStream& stream, const QString& text) + void Parser::attribute_begin(TQHtmlStream& stream, const TQString& text) { stream << block("tr") << endl @@ -48,15 +48,15 @@ namespace Parsers << close() << endl << block("td"); } - void Parser::attribute_end(QHtmlStream& stream) + void Parser::attribute_end(TQHtmlStream& stream) { stream << close() << endl << close(); } // void Parser::operator ( )( KIO::SlaveBase * /*slave*/, -// const QString & /*tag*/, const QString & /*value*/ ) +// const TQString & /*tag*/, const TQString & /*value*/ ) // {} - QString mangle_version(QString version) - { return "version_" + version.replace(QRegExp("[-:\\.\\+]"), QString("_")); } + TQString mangle_version(TQString version) + { return "version_" + version.tqreplace(TQRegExp("[-:\\.\\+]"), TQString("_")); } } diff --git a/src/parsers/parsers.h b/src/parsers/parsers.h index 26e0113..904ff00 100644 --- a/src/parsers/parsers.h +++ b/src/parsers/parsers.h @@ -11,13 +11,13 @@ #ifndef PARSERS_H #define PARSERS_H -#include <qstring.h> +#include <tqstring.h> namespace KIO { class SlaveBase; } -class QHtmlStream; +class TQHtmlStream; class AptProtocol; /** Here are defined the functional objects that takes the tokens @@ -29,20 +29,20 @@ namespace Parsers protected: int m_result_count; - static void attribute_begin(QHtmlStream& stream, const QString& text); - static void attribute_end(QHtmlStream& stream); + static void attribute_begin(TQHtmlStream& stream, const TQString& text); + static void attribute_end(TQHtmlStream& stream); public: Parser(); virtual ~Parser(); int result_count() const { return m_result_count; } - virtual void operator () (AptProtocol* slave, const QString& tag, const QString& value) = 0; + virtual void operator () (AptProtocol* slave, const TQString& tag, const TQString& value) = 0; }; class Search : public Parser { public: - void operator () (AptProtocol* slave, const QString& tag, const QString& value); + void operator () (AptProtocol* slave, const TQString& tag, const TQString& value); }; class List : public Parser @@ -50,42 +50,42 @@ namespace Parsers bool m_links; public: List(bool show_links); - void operator () (AptProtocol* slave, const QString& tag, const QString& value); + void operator () (AptProtocol* slave, const TQString& tag, const TQString& value); }; class FileSearch : public Parser { public: - void operator () (AptProtocol* slave, const QString& tag, const QString& value); + void operator () (AptProtocol* slave, const TQString& tag, const TQString& value); }; class Show : public Parser { - QString m_package, m_installed; + TQString m_package, m_installed; bool m_act; public: - Show(const QString& package, const QString& installed, bool act); - void operator () (AptProtocol* slave, const QString& tag, const QString& value); + Show(const TQString& package, const TQString& installed, bool act); + void operator () (AptProtocol* slave, const TQString& tag, const TQString& value); }; class Policy : public Parser { - QString m_package, m_installed; + TQString m_package, m_installed; bool m_has_adept_batch; bool m_act; public: - Policy(const QString& package, bool act); - QString getInstalled() const { return m_installed; } - void operator () (AptProtocol* slave, const QString& tag, const QString& value); + Policy(const TQString& package, bool act); + TQString getInstalled() const { return m_installed; } + void operator () (AptProtocol* slave, const TQString& tag, const TQString& value); }; - void operator << (KIO::SlaveBase& slave, const QCString& string); - void operator << (KIO::SlaveBase& slave, const QString& string); + void operator << (KIO::SlaveBase& slave, const TQCString& string); + void operator << (KIO::SlaveBase& slave, const TQString& string); void operator << (KIO::SlaveBase& slave, const char* string); - QString mangle_version(QString version); + TQString mangle_version(TQString version); } #endif diff --git a/src/parsers/policy.cpp b/src/parsers/policy.cpp index ad31b7f..3b8e8ed 100644 --- a/src/parsers/policy.cpp +++ b/src/parsers/policy.cpp @@ -14,9 +14,9 @@ #include <klocale.h> #include <kdebug.h> #include <qhtmlstream.h> -#include <qregexp.h> +#include <tqregexp.h> -static void policy_begin(QHtmlStream& stream) +static void policy_begin(TQHtmlStream& stream) { stream << block("div") << endl @@ -26,7 +26,7 @@ static void policy_begin(QHtmlStream& stream) << block("tbody"); } -static void add_button(QHtmlStream& stream, const QString& mode, const QString& text, const QString& package) +static void add_button(TQHtmlStream& stream, const TQString& mode, const TQString& text, const TQString& package) { stream << block("form") @@ -48,7 +48,7 @@ static void add_button(QHtmlStream& stream, const QString& mode, const QString& << close() << endl; } -static void add_version_link(QHtmlStream& stream, AptProtocol* slave, const QString& package, const QString& version) +static void add_version_link(TQHtmlStream& stream, AptProtocol* slave, const TQString& package, const TQString& version) { KURL url(slave->buildURL("show", package)); url.setHTMLRef(Parsers::mangle_version(version)); @@ -63,25 +63,25 @@ static void add_version_link(QHtmlStream& stream, AptProtocol* slave, const QStr namespace Parsers { -Policy::Policy(const QString& package, bool act) +Policy::Policy(const TQString& package, bool act) : m_package(package), m_act(false) { m_act = act; } -void Policy::operator() (AptProtocol* slave, const QString& type, const QString& value) +void Policy::operator() (AptProtocol* slave, const TQString& type, const TQString& value) { static bool first_version = false, received_sth = false; - static QString buffer; - static QHtmlStream* stream; + static TQString buffer; + static TQHtmlStream* stream; - static QRegExp rx_notinstalled("(none)"); + static TQRegExp rx_notinstalled("(none)"); kdDebug() << "policy : " << type << " " << value << endl; if (type == "begin") { - stream = new QHtmlStream(&buffer); + stream = new TQHtmlStream(&buffer); policy_begin(*stream); } else if (type == "installed") @@ -91,7 +91,7 @@ void Policy::operator() (AptProtocol* slave, const QString& type, const QString& attribute_begin(*stream, i18n("Installed")); if (rx_notinstalled.match(value) >= 0) { - m_installed = QString::null; + m_installed = TQString(); *stream << i18n("no"); } else @@ -149,8 +149,8 @@ void Policy::operator() (AptProtocol* slave, const QString& type, const QString& } else if (type == "version") { - QString version = value.section(' ', 0, 0); - QString pin = value.section(' ', 1, 1); + TQString version = value.section(' ', 0, 0); + TQString pin = value.section(' ', 1, 1); if (first_version) { @@ -163,7 +163,7 @@ void Policy::operator() (AptProtocol* slave, const QString& type, const QString& *stream << close() << close(); }*/ - QString version_link; + TQString version_link; version_link = "<a href=\"apt:/show?" + m_package + "#" + mangle_version(version) + "\">" + version + "</a>"; @@ -175,8 +175,8 @@ void Policy::operator() (AptProtocol* slave, const QString& type, const QString& } else if (type == "location") { - QStringList sections = QStringList::split(' ', value); - QString pin = sections.first(); + TQStringList sections = TQStringList::split(' ', value); + TQString pin = sections.first(); sections.pop_front(); // remove the "Packages" field if it is here if (sections.last() == "Packages") @@ -193,7 +193,7 @@ void Policy::operator() (AptProtocol* slave, const QString& type, const QString& *slave << buffer; } - buffer = QString::null; + buffer = TQString(); received_sth = false; delete stream; } diff --git a/src/parsers/qhtmlstream.h b/src/parsers/qhtmlstream.h index 330f9d5..7d27569 100644 --- a/src/parsers/qhtmlstream.h +++ b/src/parsers/qhtmlstream.h @@ -7,33 +7,33 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#ifndef QHtmlStream_H -#define QHtmlStream_H +#ifndef TQHtmlStream_H +#define TQHtmlStream_H -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqtextstream.h> +#include <tqstringlist.h> -class QHtmlStream; -class QHtmlStreamManip; +class TQHtmlStream; +class TQHtmlStreamManip; /** @author Sylvain Joyeux */ -class QHtmlStreamManip +class TQHtmlStreamManip { protected: - virtual void apply(QHtmlStream& stream) const = 0; + virtual void apply(TQHtmlStream& stream) const = 0; public: - virtual ~QHtmlStreamManip() {}; - void operator () (QHtmlStream& stream) const + virtual ~TQHtmlStreamManip() {}; + void operator () (TQHtmlStream& stream) const { apply(stream); } }; -class QHtmlStream +class TQHtmlStream { - QTextOStream m_stream; + TQTextOStream m_stream; enum States { @@ -45,8 +45,8 @@ class QHtmlStream int m_state, m_enclosing_state; bool m_newline; - QString m_indent; - QStringList m_blockstack; + TQString m_indent; + TQStringList m_blockstack; void finalize_open() { @@ -71,7 +71,7 @@ class QHtmlStream } template<class T> - QHtmlStream& output(const T& o) + TQHtmlStream& output(const T& o) { indent(); @@ -98,11 +98,11 @@ class QHtmlStream } public: - QHtmlStream(QString* buffer) + TQHtmlStream(TQString* buffer) : m_stream(buffer), m_state(NORMAL_FLOW), m_newline(true) {} - ~QHtmlStream() {} + ~TQHtmlStream() {} - void tag(const QString& name, const QString& cl, const QString& id) + void tag(const TQString& name, const TQString& cl, const TQString& id) { finalize_open(); indent(); @@ -116,7 +116,7 @@ public: m_stream << " id=\"" << id << "\""; } - void block(const QString& name, const QString& cl, const QString& id) + void block(const TQString& name, const TQString& cl, const TQString& id) { finalize_open(); indent(); @@ -132,7 +132,7 @@ public: m_stream << " id=\"" << id << "\""; } - void parameter(const QString& param_name) + void parameter(const TQString& param_name) { if (m_state == NORMAL_FLOW) return; @@ -165,34 +165,34 @@ public: finalize_open(); } - QHtmlStream & operator<< ( QChar c ) { return output(c); } - QHtmlStream & operator<< ( char c ) { return output(c); } - QHtmlStream & operator<< ( signed short i ) { return output(i); } - QHtmlStream & operator<< ( unsigned short i ) { return output(i); } - QHtmlStream & operator<< ( signed int i ) { return output(i); } - QHtmlStream & operator<< ( unsigned int i ) { return output(i); } - QHtmlStream & operator<< ( signed long i ) { return output(i); } - QHtmlStream & operator<< ( unsigned long i ) { return output(i); } - QHtmlStream & operator<< ( float f ) { return output(f); } - QHtmlStream & operator<< ( double f ) { return output(f); } - QHtmlStream & operator<< ( const char * s ) { return output(s); } - QHtmlStream & operator<< ( const QString & s ) { return output(s); } - QHtmlStream & operator<< ( const QCString & s ) { return output(s); } - - QHtmlStream & operator<< ( const QHtmlStreamManip& op ) + TQHtmlStream & operator<< ( TQChar c ) { return output(c); } + TQHtmlStream & operator<< ( char c ) { return output(c); } + TQHtmlStream & operator<< ( signed short i ) { return output(i); } + TQHtmlStream & operator<< ( unsigned short i ) { return output(i); } + TQHtmlStream & operator<< ( signed int i ) { return output(i); } + TQHtmlStream & operator<< ( unsigned int i ) { return output(i); } + TQHtmlStream & operator<< ( signed long i ) { return output(i); } + TQHtmlStream & operator<< ( unsigned long i ) { return output(i); } + TQHtmlStream & operator<< ( float f ) { return output(f); } + TQHtmlStream & operator<< ( double f ) { return output(f); } + TQHtmlStream & operator<< ( const char * s ) { return output(s); } + TQHtmlStream & operator<< ( const TQString & s ) { return output(s); } + TQHtmlStream & operator<< ( const TQCString & s ) { return output(s); } + + TQHtmlStream & operator<< ( const TQHtmlStreamManip& op ) { op(*this); return *this; } - QHtmlStream & operator<< (QTSManip m) + TQHtmlStream & operator<< (TQTSManip m) { finalize_open(); m_stream << m; return (*this); } - QHtmlStream & operator<< (QTSFUNC f) + TQHtmlStream & operator<< (TQTSFUNC f) { finalize_open(); int old_flags = m_stream.flags(); @@ -207,79 +207,79 @@ public: * Stream manipulators */ -class QHtmlStreamManip0 : public QHtmlStreamManip +class TQHtmlStreamManip0 : public TQHtmlStreamManip { public: - typedef void (QHtmlStream::*Method)(); + typedef void (TQHtmlStream::*Method)(); private: Method m_method; - void apply (QHtmlStream& stream) const + void apply (TQHtmlStream& stream) const { (stream.*m_method)(); } public: - QHtmlStreamManip0(Method m) + TQHtmlStreamManip0(Method m) : m_method(m) {} }; -class QHtmlStreamManip1 : public QHtmlStreamManip +class TQHtmlStreamManip1 : public TQHtmlStreamManip { public: - typedef void (QHtmlStream::*Method)(const QString& param); + typedef void (TQHtmlStream::*Method)(const TQString& param); private: Method m_method; - QString m_param; + TQString m_param; - void apply(QHtmlStream& stream) const + void apply(TQHtmlStream& stream) const { (stream.*m_method)(m_param); } public: - QHtmlStreamManip1(Method m, const QString& param) + TQHtmlStreamManip1(Method m, const TQString& param) : m_method(m), m_param(param) {} }; -class QHtmlStreamManip3 : public QHtmlStreamManip +class TQHtmlStreamManip3 : public TQHtmlStreamManip { public: - typedef void (QHtmlStream::*Method)(const QString& param0, const QString& param1, const QString& param2); + typedef void (TQHtmlStream::*Method)(const TQString& param0, const TQString& param1, const TQString& param2); private: Method m_method; - QString m_param0, m_param1, m_param2; + TQString m_param0, m_param1, m_param2; - void apply(QHtmlStream& stream) const + void apply(TQHtmlStream& stream) const { (stream.*m_method)(m_param0, m_param1, m_param2); } public: - QHtmlStreamManip3(Method m, const QString& param0, const QString& param1, const QString& param2) + TQHtmlStreamManip3(Method m, const TQString& param0, const TQString& param1, const TQString& param2) : m_method(m), m_param0(param0), m_param1(param1), m_param2(param2) {} }; -class CloseAll : public QHtmlStreamManip +class CloseAll : public TQHtmlStreamManip { private: bool m_indent; - void apply(QHtmlStream& stream) const + void apply(TQHtmlStream& stream) const { stream.close_all(m_indent); } public: CloseAll(bool indent) : m_indent(indent) {} }; -inline QHtmlStreamManip3 tag(const QString& name, const QString& cl = QString::null, const QString& id = QString::null) -{ return QHtmlStreamManip3(&QHtmlStream::tag, name, cl, id); } -inline QHtmlStreamManip3 block(const QString& name, const QString& cl = QString::null, const QString& id = QString::null) -{ return QHtmlStreamManip3(&QHtmlStream::block, name, cl, id); } +inline TQHtmlStreamManip3 tag(const TQString& name, const TQString& cl = TQString(), const TQString& id = TQString()) +{ return TQHtmlStreamManip3(&TQHtmlStream::tag, name, cl, id); } +inline TQHtmlStreamManip3 block(const TQString& name, const TQString& cl = TQString(), const TQString& id = TQString()) +{ return TQHtmlStreamManip3(&TQHtmlStream::block, name, cl, id); } -inline QHtmlStreamManip1 param(const QString& name) -{ return QHtmlStreamManip1(&QHtmlStream::parameter, name); } +inline TQHtmlStreamManip1 param(const TQString& name) +{ return TQHtmlStreamManip1(&TQHtmlStream::parameter, name); } -inline QHtmlStreamManip0 close() -{ return QHtmlStreamManip0(&QHtmlStream::close); } -inline QHtmlStreamManip0 data() -{ return QHtmlStreamManip0(&QHtmlStream::data); } +inline TQHtmlStreamManip0 close() +{ return TQHtmlStreamManip0(&TQHtmlStream::close); } +inline TQHtmlStreamManip0 data() +{ return TQHtmlStreamManip0(&TQHtmlStream::data); } inline CloseAll close_all(bool indent = true) { return CloseAll(indent); } diff --git a/src/parsers/search.cpp b/src/parsers/search.cpp index 0d0a952..5fd6b22 100644 --- a/src/parsers/search.cpp +++ b/src/parsers/search.cpp @@ -18,11 +18,11 @@ namespace Parsers { /** Parses the output of apt-cache search */ -void Search::operator() (AptProtocol* slave, const QString& tag, const QString& value) +void Search::operator() (AptProtocol* slave, const TQString& tag, const TQString& value) { - static QMap<QString, QString> results; - static QString cur_package; - static QString query; + static TQMap<TQString, TQString> results; + static TQString cur_package; + static TQString query; if (tag == "begin") { @@ -42,16 +42,16 @@ void Search::operator() (AptProtocol* slave, const QString& tag, const QString& { // We separate results whose package name matches the query // and those who matches only with the description - QString normal, special; - QHtmlStream sstream(&special), nstream(&normal); + TQString normal, special; + TQHtmlStream sstream(&special), nstream(&normal); - // QMap iteration sorts wrt the key < operator - // with QStrings, it means case insensitive sort - QMap<QString, QString>::ConstIterator i; + // TQMap iteration sorts wrt the key < operator + // with TQStrings, it means case insensitive sort + TQMap<TQString, TQString>::ConstIterator i; for (i = results.begin(); i != results.end(); ++i) { - const QString key = i.key(); - QHtmlStream* stream = &nstream; + const TQString key = i.key(); + TQHtmlStream* stream = &nstream; if (key == query) stream = &sstream; @@ -66,8 +66,8 @@ void Search::operator() (AptProtocol* slave, const QString& tag, const QString& } if (!special.isEmpty()) - *slave << QString("<table>") + special + QString("</table>\n<hr>\n"); - *slave << QString("<table>") + normal + QString("</table>"); + *slave << TQString("<table>") + special + TQString("</table>\n<hr>\n"); + *slave << TQString("<table>") + normal + TQString("</table>"); results.clear(); } diff --git a/src/parsers/show.cpp b/src/parsers/show.cpp index 0a1c503..2d7b0c4 100644 --- a/src/parsers/show.cpp +++ b/src/parsers/show.cpp @@ -12,60 +12,60 @@ #include "../apt.h" #include <klocale.h> -#include <qregexp.h> +#include <tqregexp.h> -static const QString +static const TQString html_attribute_begin("<tr><td class=\"attname\">%1</td>\n\t<td>\n\t\t"), html_attribute_classed("<tr class=\"%1\"><td class=\"attname\">%2</td>\n\t<td>\n\t\t"), html_attribute_end("\n\t</td>\n</tr>\n"); // Converts the special chars in orig into its HTML equivalents -static QString text2html(const QString& orig) -{ QString ret(orig); - ret = ret.replace("<(?!a href)", "<"); - //ret = ret.replace( QRegExp("\n"), "<br />\n"); +static TQString text2html(const TQString& orig) +{ TQString ret(orig); + ret = ret.tqreplace("<(?!a href)", "<"); + //ret = ret.tqreplace( TQRegExp("\n"), "<br />\n"); return ret; } -static void close_indent(int indent, QString& buffer) +static void close_indent(int indent, TQString& buffer) { if (buffer.isEmpty()) return; if (indent) buffer += "\n\t\t</div>"; } -static void close_item(int indent, QString& buffer) +static void close_item(int indent, TQString& buffer) { if (buffer.isEmpty()) return; close_indent(indent, buffer); buffer += html_attribute_end; } -static void close_table(const QString& version, int indent, QString& buffer) +static void close_table(const TQString& version, int indent, TQString& buffer) { if (buffer.isEmpty()) return; close_item(indent, buffer); buffer = version + "<table class=\"version\">\n" + buffer + "</table>\n"; } -static QString version_header_link(const KURL& url, const QString& name) -{ return QString("\t<a class=\"links\" href=\"" + url.htmlURL() + "\">" + name + "</a>\n"); } +static TQString version_header_link(const KURL& url, const TQString& name) +{ return TQString("\t<a class=\"links\" href=\"" + url.htmlURL() + "\">" + name + "</a>\n"); } namespace Parsers { -Show::Show(const QString& package, const QString& installed_version, bool act) +Show::Show(const TQString& package, const TQString& installed_version, bool act) : m_package(package), m_installed(installed_version), m_act(false) { m_act = act; } -void Show::operator() (AptProtocol* slave, const QString& tag, const QString& value) +void Show::operator() (AptProtocol* slave, const TQString& tag, const TQString& value) { // Since we want to show the version first, we should wait for it // before sending anything - static QString version; - static QString buffer; - static QString attribute; + static TQString version; + static TQString buffer; + static TQString attribute; static int indent; static bool multiline = false; static bool first_line = false, new_paragraph = true; @@ -101,16 +101,16 @@ void Show::operator() (AptProtocol* slave, const QString& tag, const QString& va { close_item(indent, buffer); buffer += - html_attribute_begin.arg(value) + html_attribute_begin.tqarg(value) + " "; close_item(indent, buffer); - buffer += html_attribute_begin.arg(" "); + buffer += html_attribute_begin.tqarg(" "); } else if (value != "Version" && value != "Package") { close_item(indent, buffer); - buffer += html_attribute_begin.arg(value); + buffer += html_attribute_begin.tqarg(value); } if (value == "Description") @@ -137,18 +137,18 @@ void Show::operator() (AptProtocol* slave, const QString& tag, const QString& va { KURL action ("apt:/get"); - QString item_id = mangle_version(value); + TQString item_id = mangle_version(value); if (value == m_installed) { action.setQuery("remove"); - version = QString("<div class=\"version-header-installed\" id=\"%1\">").arg(item_id) - + i18n("Installed version %1").arg(value); + version = TQString("<div class=\"version-header-installed\" id=\"%1\">").tqarg(item_id) + + i18n("Installed version %1").tqarg(value); } else { action.setQuery("install"); - version = QString("<div class=\"version-header\" id=\"%1\">").arg(item_id) - + i18n("Version %1").arg(value); + version = TQString("<div class=\"version-header\" id=\"%1\">").tqarg(item_id) + + i18n("Version %1").tqarg(value); } action.addQueryItem("package", m_package); @@ -168,7 +168,7 @@ void Show::operator() (AptProtocol* slave, const QString& tag, const QString& va { if (multiline) { - static const QRegExp rx_empty("^\\s*$"); + static const TQRegExp rx_empty("^\\s*$"); if (rx_empty.exactMatch(value)) { buffer += "</p>"; @@ -185,7 +185,7 @@ void Show::operator() (AptProtocol* slave, const QString& tag, const QString& va new_paragraph = false; } } - buffer += text2html(QString(value).replace(QRegExp("(http://\\S+)"),QString("<a href=\"\\1\">\\1</a>"))); + buffer += text2html(TQString(value).tqreplace(TQRegExp("(http://\\S+)"),TQString("<a href=\"\\1\">\\1</a>"))); } else if (tag == "package_link") buffer += "<a href=\"" + slave->buildURL("show", value).htmlURL() + "\">" + value + "</a>"; |