diff options
Diffstat (limited to 'akregator/src/librss/article.cpp')
-rw-r--r-- | akregator/src/librss/article.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/akregator/src/librss/article.cpp b/akregator/src/librss/article.cpp index 010cf5dcb..244130535 100644 --- a/akregator/src/librss/article.cpp +++ b/akregator/src/librss/article.cpp @@ -19,8 +19,8 @@ #include <kurllabel.h> #include <kmdcodec.h> -#include <qdatetime.h> -#include <qdom.h> +#include <tqdatetime.h> +#include <tqdom.h> using namespace RSS; namespace RSS @@ -30,18 +30,18 @@ namespace RSS struct Article::Private : public Shared { - QString title; + TQString title; KURL link; - QString description; - QDateTime pubDate; - QString guid; - QString author; + TQString description; + TQDateTime pubDate; + TQString guid; + TQString author; bool guidIsPermaLink; MetaInfoMap meta; KURL commentsLink; int numComments; Enclosure enclosure; - QValueList<Category> categories; + TQValueList<Category> categories; }; Article::Article() : d(new Private) @@ -58,15 +58,15 @@ Enclosure Article::enclosure() const return d->enclosure; } -QValueList<Category> Article::categories() const +TQValueList<Category> Article::categories() const { return d->categories; } -Article::Article(const QDomNode &node, Format format, Version version) : d(new Private) +Article::Article(const TQDomNode &node, Format format, Version version) : d(new Private) { - QString elemText; + TQString elemText; d->numComments=0; @@ -75,38 +75,38 @@ Article::Article(const QDomNode &node, Format format, Version version) : d(new P if (format==AtomFeed) { - QDomNode n; + TQDomNode n; for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - const QDomElement e = n.toElement(); - if ( (e.tagName()==QString::fromLatin1("link")) && - (e.attribute(QString::fromLatin1("rel"), QString::fromLatin1("alternate")) == QString::fromLatin1("alternate"))) + const TQDomElement e = n.toElement(); + if ( (e.tagName()==TQString::fromLatin1("link")) && + (e.attribute(TQString::fromLatin1("rel"), TQString::fromLatin1("alternate")) == TQString::fromLatin1("alternate"))) { - d->link=n.toElement().attribute(QString::fromLatin1("href")); + d->link=n.toElement().attribute(TQString::fromLatin1("href")); break; } } } else { - if (!(elemText = extractNode(node, QString::fromLatin1("link"))).isNull()) + if (!(elemText = extractNode(node, TQString::fromLatin1("link"))).isNull()) d->link = elemText; } // prefer content/content:encoded over summary/description for feeds that provide it - QString tagName=(format==AtomFeed)? QString::fromLatin1("content"): QString::fromLatin1("content:encoded"); + TQString tagName=(format==AtomFeed)? TQString::fromLatin1("content"): TQString::fromLatin1("content:encoded"); if (!(elemText = extractNode(node, tagName, false)).isNull()) d->description = elemText; if (d->description.isEmpty()) { - if (!(elemText = extractNode(node, QString::fromLatin1("body"), false)).isNull()) + if (!(elemText = extractNode(node, TQString::fromLatin1("body"), false)).isNull()) d->description = elemText; if (d->description.isEmpty()) // 3rd try: see http://www.intertwingly.net/blog/1299.html { - if (!(elemText = extractNode(node, QString::fromLatin1((format==AtomFeed)? "summary" : "description"), false)).isNull()) + if (!(elemText = extractNode(node, TQString::fromLatin1((format==AtomFeed)? "summary" : "description"), false)).isNull()) d->description = elemText; } } @@ -116,21 +116,21 @@ Article::Article(const QDomNode &node, Format format, Version version) : d(new P if (format == AtomFeed) { if (version == vAtom_1_0) - elemText = extractNode(node, QString::fromLatin1("updated")); + elemText = extractNode(node, TQString::fromLatin1("updated")); else - elemText = extractNode(node, QString::fromLatin1("issued")); + elemText = extractNode(node, TQString::fromLatin1("issued")); if (!elemText.isNull()) time = parseISO8601Date(elemText); } else { - elemText = extractNode(node, QString::fromLatin1("pubDate")); + elemText = extractNode(node, TQString::fromLatin1("pubDate")); if (!elemText.isNull()) time = KRFCDate::parseDate(elemText); } - if (!(elemText = extractNode(node, QString::fromLatin1("dc:date"))).isNull()) + if (!(elemText = extractNode(node, TQString::fromLatin1("dc:date"))).isNull()) { time = parseISO8601Date(elemText); } @@ -139,32 +139,32 @@ Article::Article(const QDomNode &node, Format format, Version version) : d(new P if (time != 0) d->pubDate.setTime_t(time); - if (!(elemText = extractNode(node, QString::fromLatin1("wfw:comment"))).isNull()) { + if (!(elemText = extractNode(node, TQString::fromLatin1("wfw:comment"))).isNull()) { d->commentsLink = elemText; } - if (!(elemText = extractNode(node, QString::fromLatin1("slash:comments"))).isNull()) { + if (!(elemText = extractNode(node, TQString::fromLatin1("slash:comments"))).isNull()) { d->numComments = elemText.toInt(); } - QDomElement element = QDomNode(node).toElement(); + TQDomElement element = TQDomNode(node).toElement(); // in RSS 1.0, we use <item about> attribute as ID // FIXME: pass format version instead of checking for attribute - if (!element.isNull() && element.hasAttribute(QString::fromLatin1("rdf:about"))) + if (!element.isNull() && element.hasAttribute(TQString::fromLatin1("rdf:about"))) { - d->guid = element.attribute(QString::fromLatin1("rdf:about")); // HACK: using ns properly did not work + d->guid = element.attribute(TQString::fromLatin1("rdf:about")); // HACK: using ns properly did not work d->guidIsPermaLink = false; } else { - tagName=(format==AtomFeed)? QString::fromLatin1("id"): QString::fromLatin1("guid"); - QDomNode n = node.namedItem(tagName); + tagName=(format==AtomFeed)? TQString::fromLatin1("id"): TQString::fromLatin1("guid"); + TQDomNode n = node.namedItem(tagName); if (!n.isNull()) { d->guidIsPermaLink = (format==AtomFeed)? false : true; - if (n.toElement().attribute(QString::fromLatin1("isPermaLink"), "true") == "false") d->guidIsPermaLink = false; + if (n.toElement().attribute(TQString::fromLatin1("isPermaLink"), "true") == "false") d->guidIsPermaLink = false; if (!(elemText = extractNode(node, tagName)).isNull()) d->guid = elemText; } @@ -174,29 +174,29 @@ Article::Article(const QDomNode &node, Format format, Version version) : d(new P d->guidIsPermaLink = false; md5Machine.reset(); - QDomNode n(node); + TQDomNode n(node); md5Machine.update(d->title.utf8()); md5Machine.update(d->description.utf8()); - d->guid = QString(md5Machine.hexDigest().data()); - d->meta[QString::fromLatin1("guidIsHash")] = QString::fromLatin1("true"); + d->guid = TQString(md5Machine.hexDigest().data()); + d->meta[TQString::fromLatin1("guidIsHash")] = TQString::fromLatin1("true"); } - QDomNode enclosure = element.namedItem(QString::fromLatin1("enclosure")); + TQDomNode enclosure = element.namedItem(TQString::fromLatin1("enclosure")); if (enclosure.isElement()) d->enclosure = Enclosure::fromXML(enclosure.toElement()); d->author = parseItemAuthor(element, format, version); - for (QDomNode i = node.firstChild(); !i.isNull(); i = i.nextSibling()) + for (TQDomNode i = node.firstChild(); !i.isNull(); i = i.nextSibling()) { if (i.isElement()) { - if (i.toElement().tagName() == QString::fromLatin1("metaInfo:meta")) + if (i.toElement().tagName() == TQString::fromLatin1("metaInfo:meta")) { - QString type = i.toElement().attribute(QString::fromLatin1("type")); + TQString type = i.toElement().attribute(TQString::fromLatin1("type")); d->meta[type] = i.toElement().text(); } - else if (i.toElement().tagName() == QString::fromLatin1("category")) + else if (i.toElement().tagName() == TQString::fromLatin1("category")) { d->categories.append(Category::fromXML(i.toElement())); } @@ -210,12 +210,12 @@ Article::~Article() delete d; } -QString Article::title() const +TQString Article::title() const { return d->title; } -QString Article::author() const +TQString Article::author() const { return d->author; } @@ -225,12 +225,12 @@ const KURL &Article::link() const return d->link; } -QString Article::description() const +TQString Article::description() const { return d->description; } -QString Article::guid() const +TQString Article::guid() const { return d->guid; } @@ -240,7 +240,7 @@ bool Article::guidIsPermaLink() const return d->guidIsPermaLink; } -const QDateTime &Article::pubDate() const +const TQDateTime &Article::pubDate() const { return d->pubDate; } @@ -256,12 +256,12 @@ int Article::comments() const } -QString Article::meta(const QString &key) const +TQString Article::meta(const TQString &key) const { return d->meta[key]; } -KURLLabel *Article::widget(QWidget *parent, const char *name) const +KURLLabel *Article::widget(TQWidget *parent, const char *name) const { KURLLabel *label = new KURLLabel(d->link.url(), d->title, parent, name); label->setUseTips(true); |