summaryrefslogtreecommitdiffstats
path: root/akregator/src/librss/loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'akregator/src/librss/loader.cpp')
-rw-r--r--akregator/src/librss/loader.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/akregator/src/librss/loader.cpp b/akregator/src/librss/loader.cpp
index d63d17676..df7f51a66 100644
--- a/akregator/src/librss/loader.cpp
+++ b/akregator/src/librss/loader.cpp
@@ -18,12 +18,12 @@
#include <kurl.h>
#include <kdebug.h>
-#include <qdom.h>
-#include <qbuffer.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtimer.h>
+#include <tqdom.h>
+#include <tqbuffer.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
using namespace RSS;
@@ -50,15 +50,15 @@ class FileRetriever::Private
delete buffer;
}
- QBuffer *buffer;
+ TQBuffer *buffer;
int lastError;
KIO::Job *job;
- static KStaticDeleter<QString> userAgentsd;
- static QString* userAgent;
+ static KStaticDeleter<TQString> userAgentsd;
+ static TQString* userAgent;
};
-KStaticDeleter<QString> FileRetriever::Private::userAgentsd;
-QString* FileRetriever::Private::userAgent = 0L;
+KStaticDeleter<TQString> FileRetriever::Private::userAgentsd;
+TQString* FileRetriever::Private::userAgent = 0L;
FileRetriever::FileRetriever()
: d(new Private)
{
@@ -71,17 +71,17 @@ FileRetriever::~FileRetriever()
bool FileRetriever::m_useCache = true;
-QString FileRetriever::userAgent()
+TQString FileRetriever::userAgent()
{
if (Private::userAgent == 0L)
- FileRetriever::Private::userAgentsd.setObject(Private::userAgent, new QString);
+ FileRetriever::Private::userAgentsd.setObject(Private::userAgent, new TQString);
return *Private::userAgent;
}
-void FileRetriever::setUserAgent(const QString &ua)
+void FileRetriever::setUserAgent(const TQString &ua)
{
if (Private::userAgent == 0L)
- FileRetriever::Private::userAgentsd.setObject(Private::userAgent, new QString);
+ FileRetriever::Private::userAgentsd.setObject(Private::userAgent, new TQString);
(*Private::userAgent) = ua;
}
@@ -106,18 +106,18 @@ void FileRetriever::retrieveData(const KURL &url)
d->job = KIO::get(u, false, false);
d->job->addMetaData("cache", m_useCache ? "refresh" : "reload");
- QString ua = userAgent();
+ TQString ua = userAgent();
if (!ua.isEmpty())
d->job->addMetaData("UserAgent", ua);
- QTimer::singleShot(1000*90, this, SLOT(slotTimeout()));
+ TQTimer::singleShot(1000*90, this, TQT_SLOT(slotTimeout()));
- connect(d->job, SIGNAL(data(KIO::Job *, const QByteArray &)),
- SLOT(slotData(KIO::Job *, const QByteArray &)));
- connect(d->job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *)));
- connect(d->job, SIGNAL(permanentRedirection(KIO::Job *, const KURL &, const KURL &)),
- SLOT(slotPermanentRedirection(KIO::Job *, const KURL &, const KURL &)));
+ connect(d->job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
+ TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)));
+ connect(d->job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *)));
+ connect(d->job, TQT_SIGNAL(permanentRedirection(KIO::Job *, const KURL &, const KURL &)),
+ TQT_SLOT(slotPermanentRedirection(KIO::Job *, const KURL &, const KURL &)));
}
void FileRetriever::slotTimeout()
@@ -129,7 +129,7 @@ void FileRetriever::slotTimeout()
d->lastError = KIO::ERR_SERVER_TIMEOUT;
- emit dataRetrieved(QByteArray(), false);
+ emit dataRetrieved(TQByteArray(), false);
}
int FileRetriever::errorCode() const
@@ -137,14 +137,14 @@ int FileRetriever::errorCode() const
return d->lastError;
}
-void FileRetriever::slotData(KIO::Job *, const QByteArray &data)
+void FileRetriever::slotData(KIO::Job *, const TQByteArray &data)
{
d->buffer->writeBlock(data.data(), data.size());
}
void FileRetriever::slotResult(KIO::Job *job)
{
- QByteArray data = d->buffer->buffer();
+ TQByteArray data = d->buffer->buffer();
data.detach();
delete d->buffer;
@@ -183,7 +183,7 @@ struct OutputRetriever::Private
}
KShellProcess *process;
- QBuffer *buffer;
+ TQBuffer *buffer;
int lastError;
};
@@ -207,10 +207,10 @@ void OutputRetriever::retrieveData(const KURL &url)
d->buffer->open(IO_WriteOnly);
d->process = new KShellProcess();
- connect(d->process, SIGNAL(processExited(KProcess *)),
- SLOT(slotExited(KProcess *)));
- connect(d->process, SIGNAL(receivedStdout(KProcess *, char *, int)),
- SLOT(slotOutput(KProcess *, char *, int)));
+ connect(d->process, TQT_SIGNAL(processExited(KProcess *)),
+ TQT_SLOT(slotExited(KProcess *)));
+ connect(d->process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ TQT_SLOT(slotOutput(KProcess *, char *, int)));
*d->process << url.path();
d->process->start(KProcess::NotifyOnExit, KProcess::Stdout);
}
@@ -230,7 +230,7 @@ void OutputRetriever::slotExited(KProcess *p)
if (!p->normalExit())
d->lastError = p->exitStatus();
- QByteArray data = d->buffer->buffer();
+ TQByteArray data = d->buffer->buffer();
data.detach();
delete d->buffer;
@@ -265,10 +265,10 @@ Loader *Loader::create()
return new Loader;
}
-Loader *Loader::create(QObject *object, const char *slot)
+Loader *Loader::create(TQObject *object, const char *slot)
{
Loader *loader = create();
- connect(loader, SIGNAL(loadingComplete(Loader *, Document, Status)),
+ connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, Status)),
object, slot);
return loader;
}
@@ -290,8 +290,8 @@ void Loader::loadFrom(const KURL &url, DataRetriever *retriever)
d->url=url;
d->retriever = retriever;
- connect(d->retriever, SIGNAL(dataRetrieved(const QByteArray &, bool)),
- this, SLOT(slotRetrieverDone(const QByteArray &, bool)));
+ connect(d->retriever, TQT_SIGNAL(dataRetrieved(const TQByteArray &, bool)),
+ this, TQT_SLOT(slotRetrieverDone(const TQByteArray &, bool)));
d->retriever->retrieveData(url);
}
@@ -309,7 +309,7 @@ void Loader::abort()
delete d->retriever;
d->retriever=NULL;
}
- emit loadingComplete(this, QDomDocument(), Aborted);
+ emit loadingComplete(this, TQDomDocument(), Aborted);
delete this;
}
@@ -318,7 +318,7 @@ const KURL &Loader::discoveredFeedURL() const
return d->discoveredFeedURL;
}
-void Loader::slotRetrieverDone(const QByteArray &data, bool success)
+void Loader::slotRetrieverDone(const TQByteArray &data, bool success)
{
d->lastError = d->retriever->errorCode();
@@ -329,7 +329,7 @@ void Loader::slotRetrieverDone(const QByteArray &data, bool success)
Status status = Success;
if (success) {
- QDomDocument doc;
+ TQDomDocument doc;
/* Some servers insert whitespace before the <?xml...?> declaration.
* QDom doesn't tolerate that (and it's right, that's invalid XML),
@@ -339,16 +339,16 @@ void Loader::slotRetrieverDone(const QByteArray &data, bool success)
const char *charData = data.data();
int len = data.count();
- while (len && QChar(*charData).isSpace()) {
+ while (len && TQChar(*charData).isSpace()) {
--len;
++charData;
}
- if ( len > 3 && QChar(*charData) == QChar(0357) ) { // 0357 0273 0277
+ if ( len > 3 && TQChar(*charData) == TQChar(0357) ) { // 0357 0273 0277
len -= 3;
charData += 3;
}
- QByteArray tmpData;
+ TQByteArray tmpData;
tmpData.setRawData(charData, len);
if (doc.setContent(tmpData))
@@ -375,11 +375,11 @@ void Loader::slotRetrieverDone(const QByteArray &data, bool success)
delete this;
}
-void Loader::discoverFeeds(const QByteArray &data)
+void Loader::discoverFeeds(const TQByteArray &data)
{
- QString str = QString(data).simplifyWhiteSpace();
+ TQString str = TQString(data).simplifyWhiteSpace();
- QStringList feeds;
+ TQStringList feeds;
FeedDetectorEntryList list = FeedDetector::extractFromLinkTags(str);
@@ -391,12 +391,12 @@ void Loader::discoverFeeds(const QByteArray &data)
if (list.isEmpty())
feeds = FeedDetector::extractBruteForce(str);
- QString feed = feeds.first();
- QString host = d->url.host();
+ TQString feed = feeds.first();
+ TQString host = d->url.host();
KURL testURL;
// loop through, prefer feeds on same host
- QStringList::Iterator end( feeds.end() );
- for ( QStringList::Iterator it = feeds.begin(); it != end; ++it)
+ TQStringList::Iterator end( feeds.end() );
+ for ( TQStringList::Iterator it = feeds.begin(); it != end; ++it)
{
testURL=*it;
if (testURL.host() == host)
@@ -406,7 +406,7 @@ void Loader::discoverFeeds(const QByteArray &data)
}
}
- d->discoveredFeedURL = feed.isNull() ? QString() : FeedDetector::fixRelativeURL(feed, d->url);
+ d->discoveredFeedURL = feed.isNull() ? TQString() : FeedDetector::fixRelativeURL(feed, d->url);
}
#include "loader.moc"