summaryrefslogtreecommitdiffstats
path: root/noatun/library/downloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun/library/downloader.cpp')
-rw-r--r--noatun/library/downloader.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/noatun/library/downloader.cpp b/noatun/library/downloader.cpp
index 734f5e11..cce6e4d9 100644
--- a/noatun/library/downloader.cpp
+++ b/noatun/library/downloader.cpp
@@ -1,8 +1,8 @@
#include <noatun/downloader.h>
#include <noatun/app.h>
#include <assert.h>
-#include <qfile.h>
-#include <qtimer.h>
+#include <tqfile.h>
+#include <tqtimer.h>
#include <kio/job.h>
#include <klocale.h>
@@ -21,12 +21,12 @@ bool DownloadItem::isDownloaded() const
return true;
}
-QString DownloadItem::localFilename() const
+TQString DownloadItem::localFilename() const
{
return mLocalFilename;
}
-void DownloadItem::setLocalFilename(const QString &filename)
+void DownloadItem::setLocalFilename(const TQString &filename)
{
mLocalFilename=filename;
}
@@ -65,11 +65,11 @@ void DownloadItem::dequeue()
-Downloader::Downloader(QObject *parent)
- : QObject(parent), localfile(0), current(0), mJob(0), mTimeout(0)
+Downloader::Downloader(TQObject *parent)
+ : TQObject(parent), localfile(0), current(0), mJob(0), mTimeout(0)
{
mStarted=false;
- mUnstartedQueue=new QPtrList<Downloader::QueueItem>;
+ mUnstartedQueue=new TQPtrList<Downloader::QueueItem>;
}
Downloader::~Downloader()
@@ -84,7 +84,7 @@ void Downloader::start()
if (current)
emit enqueued(current->notifier, current->file);
- for (QPtrListIterator<Downloader::QueueItem> i(*mUnstartedQueue); i.current(); ++i)
+ for (TQPtrListIterator<Downloader::QueueItem> i(*mUnstartedQueue); i.current(); ++i)
{
(*i)->notifier->mLocalFilename = (*i)->local;
mQueue.append(*i);
@@ -93,24 +93,24 @@ void Downloader::start()
delete mUnstartedQueue;
mUnstartedQueue=0;
- QTimer::singleShot(0, this, SLOT(getNext()));
+ TQTimer::singleShot(0, this, TQT_SLOT(getNext()));
}
-static QString nonExistantFile(const QString &file)
+static TQString nonExistantFile(const TQString &file)
{
if (file.right(1)=="/") return i18n("Unknown");
int i=0;
- QString f(file);
- while (QFile(f).exists())
+ TQString f(file);
+ while (TQFile(f).exists())
{
i++;
f=file;
- f.insert(f.findRev('.'), '_'+QString::number(i));
+ f.insert(f.findRev('.'), '_'+TQString::number(i));
}
return f;
}
-QString Downloader::enqueue(DownloadItem *notifier, const KURL &file)
+TQString Downloader::enqueue(DownloadItem *notifier, const KURL &file)
{
if (file.isLocalFile()) return 0;
QueueItem *i=new QueueItem;
@@ -142,7 +142,7 @@ QString Downloader::enqueue(DownloadItem *notifier, const KURL &file)
}
mQueue.append(i);
- QTimer::singleShot(0, this, SLOT(getNext()));
+ TQTimer::singleShot(0, this, TQT_SLOT(getNext()));
emit enqueued(notifier, file);
return i->local;
}
@@ -155,7 +155,7 @@ void Downloader::dequeue(DownloadItem *notifier)
jobDone(mJob);
return;
}
- for (QPtrListIterator<Downloader::QueueItem> i(mQueue); i.current(); ++i)
+ for (TQPtrListIterator<Downloader::QueueItem> i(mQueue); i.current(); ++i)
{
if ((*i)->notifier==notifier)
{
@@ -176,22 +176,22 @@ void Downloader::getNext()
current=mQueue.take(0);
// open the QFile
- localfile=new QFile(current->local);
+ localfile=new TQFile(current->local);
localfile->open(IO_ReadWrite | IO_Append);
mJob= KIO::get(current->file, true, false);
- connect(mJob, SIGNAL(data(KIO::Job*, const QByteArray&)), SLOT(data(KIO::Job*, const QByteArray&)));
- connect(mJob, SIGNAL(result(KIO::Job*)), SLOT(jobDone(KIO::Job*)));
- connect(mJob, SIGNAL(percent(KIO::Job*, unsigned long)), SLOT(percent(KIO::Job*, unsigned long)));
+ connect(mJob, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)), TQT_SLOT(data(KIO::Job*, const TQByteArray&)));
+ connect(mJob, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(jobDone(KIO::Job*)));
+ connect(mJob, TQT_SIGNAL(percent(KIO::Job*, unsigned long)), TQT_SLOT(percent(KIO::Job*, unsigned long)));
if (mTimeout)
delete mTimeout;
- mTimeout=new QTimer(this);
+ mTimeout=new TQTimer(this);
mTimeout->start(30000, true);
- connect(mTimeout, SIGNAL(timeout()), SLOT(giveUpWithThisDownloadServerIsRunningNT()));
+ connect(mTimeout, TQT_SIGNAL(timeout()), TQT_SLOT(giveUpWithThisDownloadServerIsRunningNT()));
}
-void Downloader::data(KIO::Job *, const QByteArray &data)
+void Downloader::data(KIO::Job *, const TQByteArray &data)
{
localfile->writeBlock(data);
localfile->flush();