summaryrefslogtreecommitdiffstats
path: root/src/parsers/policy.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 21:38:25 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 21:38:25 +0000
commitf22f5c856d0ee7ec953825828bba094f14c9cade (patch)
tree1c89a4d4c420bce13c002b650e610bff026f6d06 /src/parsers/policy.cpp
parent0bceb5251f3c826f8fc4ee021ab76ee29f1dfdd7 (diff)
downloadtdeio-apt-f22f5c856d0ee7ec953825828bba094f14c9cade.tar.gz
tdeio-apt-f22f5c856d0ee7ec953825828bba094f14c9cade.zip
TQt4 port kio-apt
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kio-apt@1239302 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/parsers/policy.cpp')
-rw-r--r--src/parsers/policy.cpp34
1 files changed, 17 insertions, 17 deletions
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;
}