summaryrefslogtreecommitdiffstats
path: root/knewsticker/common/xmlnewsaccess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knewsticker/common/xmlnewsaccess.cpp')
-rw-r--r--knewsticker/common/xmlnewsaccess.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/knewsticker/common/xmlnewsaccess.cpp b/knewsticker/common/xmlnewsaccess.cpp
index 1c892e8e..b8998e0c 100644
--- a/knewsticker/common/xmlnewsaccess.cpp
+++ b/knewsticker/common/xmlnewsaccess.cpp
@@ -14,11 +14,11 @@
#include <kdebug.h>
#include <kglobal.h>
-#include <qbuffer.h>
-#include <qdom.h>
-#include <qregexp.h>
+#include <tqbuffer.h>
+#include <tqdom.h>
+#include <tqregexp.h>
-XMLNewsArticle::XMLNewsArticle(const QString &headline, const KURL &address)
+XMLNewsArticle::XMLNewsArticle(const TQString &headline, const KURL &address)
: m_headline(headline),
m_address(address)
{
@@ -36,10 +36,10 @@ bool XMLNewsArticle::operator==(const XMLNewsArticle &a)
return m_headline == a.headline() && m_address == a.address();
}
-XMLNewsSource::XMLNewsSource() : QObject(),
- m_name(QString::null),
- m_link(QString::null),
- m_description(QString::null),
+XMLNewsSource::XMLNewsSource() : TQObject(),
+ m_name(TQString::null),
+ m_link(TQString::null),
+ m_description(TQString::null),
m_downloadData(0)
{
}
@@ -60,14 +60,14 @@ void XMLNewsSource::loadFrom(const KURL &url)
m_downloadData->open(IO_WriteOnly);
KIO::Job *job = KIO::get(url, false, false);
- job->addMetaData(QString::fromLatin1("UserAgent"),
- QString::fromLatin1("KNewsTicker v0.2"));
- connect(job, SIGNAL(data(KIO::Job *, const QByteArray &)),
- SLOT(slotData(KIO::Job *, const QByteArray &)));
- connect(job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *)));
+ job->addMetaData(TQString::fromLatin1("UserAgent"),
+ TQString::fromLatin1("KNewsTicker v0.2"));
+ connect(job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
+ TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)));
+ connect(job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *)));
}
-void XMLNewsSource::slotData(KIO::Job *, const QByteArray &data)
+void XMLNewsSource::slotData(KIO::Job *, const TQByteArray &data)
{
m_downloadData->writeBlock(data.data(), data.size());
}
@@ -80,7 +80,7 @@ void XMLNewsSource::slotResult(KIO::Job *job)
m_downloadData = 0;
}
-void XMLNewsSource::processData(const QByteArray &data, bool okSoFar)
+void XMLNewsSource::processData(const TQByteArray &data, bool okSoFar)
{
bool validContent = okSoFar;
kdDebug(5005) << "XMLNewsSource::processData(): validContent = " << validContent << endl;
@@ -90,7 +90,7 @@ void XMLNewsSource::processData(const QByteArray &data, bool okSoFar)
* Some servers prepend whitespace before the <?xml...?> declaration.
* Since QDom doesn't like that we strip this first.
*/
- QDomDocument domDoc;
+ TQDomDocument domDoc;
const char *charData = data.data();
int len = data.count();
@@ -100,25 +100,25 @@ void XMLNewsSource::processData(const QByteArray &data, bool okSoFar)
charData++;
}
- QByteArray tmpData;
+ TQByteArray tmpData;
tmpData.setRawData(charData, len);
if (validContent = domDoc.setContent(tmpData)) {
- QDomNode channelNode = domDoc.documentElement().namedItem(QString::fromLatin1("channel"));
+ TQDomNode channelNode = domDoc.documentElement().namedItem(TQString::fromLatin1("channel"));
- m_name = channelNode.namedItem(QString::fromLatin1("title")).toElement().text().simplifyWhiteSpace();
+ m_name = channelNode.namedItem(TQString::fromLatin1("title")).toElement().text().simplifyWhiteSpace();
kdDebug(5005) << "XMLNewsSource::processData(): Successfully updated " << m_name << endl;
- m_link = channelNode.namedItem(QString::fromLatin1("link")).toElement().text().simplifyWhiteSpace();
- m_description = channelNode.namedItem(QString::fromLatin1("description")).toElement().text().simplifyWhiteSpace();
+ m_link = channelNode.namedItem(TQString::fromLatin1("link")).toElement().text().simplifyWhiteSpace();
+ m_description = channelNode.namedItem(TQString::fromLatin1("description")).toElement().text().simplifyWhiteSpace();
- QDomNodeList items = domDoc.elementsByTagName(QString::fromLatin1("item"));
+ TQDomNodeList items = domDoc.elementsByTagName(TQString::fromLatin1("item"));
m_articles.clear();
- QDomNode itemNode;
- QString headline, address;
+ TQDomNode itemNode;
+ TQString headline, address;
for (unsigned int i = 0; i < items.count(); i++) {
itemNode = items.item(i);
- headline = KCharsets::resolveEntities(itemNode.namedItem(QString::fromLatin1("title")).toElement().text().simplifyWhiteSpace());
- address = KCharsets::resolveEntities(itemNode.namedItem(QString::fromLatin1("link")).toElement().text().simplifyWhiteSpace());
+ headline = KCharsets::resolveEntities(itemNode.namedItem(TQString::fromLatin1("title")).toElement().text().simplifyWhiteSpace());
+ address = KCharsets::resolveEntities(itemNode.namedItem(TQString::fromLatin1("link")).toElement().text().simplifyWhiteSpace());
m_articles.append(XMLNewsArticle(headline, KURL( address )));
}
}