diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 20:34:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 20:34:15 +0000 |
commit | 1c1403293485f35fd53db45aaa77a01cdd9627e7 (patch) | |
tree | 38559cd68cd4f63023fb5f6375def9db3b8b491e /plugins/rssfeed/rss/tools_p.cpp | |
parent | 894f94545727610df22c4f73911d62d58266f695 (diff) | |
download | ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.tar.gz ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.zip |
TQt4 port ktorrent
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'plugins/rssfeed/rss/tools_p.cpp')
-rw-r--r-- | plugins/rssfeed/rss/tools_p.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/rssfeed/rss/tools_p.cpp b/plugins/rssfeed/rss/tools_p.cpp index c1ebbc9..51fcbf5 100644 --- a/plugins/rssfeed/rss/tools_p.cpp +++ b/plugins/rssfeed/rss/tools_p.cpp @@ -11,39 +11,39 @@ #include "tools_p.h" #include <krfcdate.h> -#include <qdom.h> +#include <tqdom.h> -time_t RSS::parseISO8601Date(const QString &s) +time_t RSS::parseISO8601Date(const TQString &s) { // do some sanity check: 26-12-2004T00:00+00:00 is parsed to epoch+1 in the KRFCDate, which is wrong. So let's check if the date begins with YYYY -fo if (s.stripWhiteSpace().left(4).toInt() < 1000) return 0; // error // FIXME: imho this is done in KRFCDate::parseDateISO8601() automatically, so we could omit it? -fo - if (s.find('T') != -1) + if (s.tqfind('T') != -1) return KRFCDate::parseDateISO8601(s); else return KRFCDate::parseDateISO8601(s + "T12:00:00"); } -QString RSS::extractNode(const QDomNode &parent, const QString &elemName, bool isInlined) +TQString RSS::extractNode(const TQDomNode &tqparent, const TQString &elemName, bool isInlined) { - QDomNode node = parent.namedItem(elemName); + TQDomNode node = tqparent.namedItem(elemName); if (node.isNull()) - return QString::null; + return TQString(); - QString result = node.toElement().text(); + TQString result = node.toElement().text(); - bool hasPre = result.contains("<pre>",false); - bool hasHtml = hasPre || result.contains("<"); // FIXME: test if we have html, should be more clever -> regexp + bool hasPre = result.tqcontains("<pre>",false); + bool hasHtml = hasPre || result.tqcontains("<"); // FIXME: test if we have html, should be more clever -> regexp if(!isInlined && !hasHtml) // perform nl2br if not a inline elt and it has no html elts - result = result = result.replace(QChar('\n'), "<br />"); + result = result = result.tqreplace(TQChar('\n'), "<br />"); if(!hasPre) // strip white spaces if no <pre> result = result.simplifyWhiteSpace(); if (result.isEmpty()) - return QString::null; + return TQString(); return result; } |