From e654398e46e37abf457b2b1122ab898d2c51c49f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:43:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/library/downloader.cpp | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'noatun/library/downloader.cpp') 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 #include #include -#include -#include +#include +#include #include #include @@ -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; + mUnstartedQueue=new TQPtrList; } Downloader::~Downloader() @@ -84,7 +84,7 @@ void Downloader::start() if (current) emit enqueued(current->notifier, current->file); - for (QPtrListIterator i(*mUnstartedQueue); i.current(); ++i) + for (TQPtrListIterator 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 i(mQueue); i.current(); ++i) + for (TQPtrListIterator 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(); -- cgit v1.2.1