Beispiel #1
0
void ImageThread::download(bool b) {
    if (b) {
        QString imgURI;

        _downloading = true;

        while (getNextImage(&imgURI) != 0)
                createSupervisedDownload(QUrl(imgURI));
    } else {
        _downloading = false;
    }
}
Beispiel #2
0
ThreadHandler::ThreadHandler(QObject *parent) :
    QObject(parent)
{
    aui = new ApplicationUpdateInterface(this);
    requestHandler = new RequestHandler(this);
    blackList = new BlackList(this);

    thumbnailRemoverThread = new QThread();
    thumbnailRemover = new ThumbnailRemover();
    thumbnailRemover->moveToThread(thumbnailRemoverThread);
    connect(thumbnailRemoverThread, SIGNAL(started()), thumbnailRemover, SLOT(removeOutdated()));
    thumbnailRemoverThread->start(QThread::LowPriority);

    connect(this, SIGNAL(removeFiles(QStringList)), thumbnailRemover, SLOT(removeFiles(QStringList)));

    settings = new QSettings("settings.ini", QSettings::IniFormat);
    loadSettings();

    connect(requestHandler, SIGNAL(response(QUrl,QByteArray,bool)), this, SLOT(processRequestResponse(QUrl,QByteArray,bool)));
    connect(requestHandler, SIGNAL(responseError(QUrl,int)), this, SLOT(handleRequestError(QUrl,int)));

//    connect(downloadManager, SIGNAL(error(QString)), ui->statusBar, SLOT(showMessage(QString)));
//    connect(downloadManager, SIGNAL(finishedRequestsChanged(int)), this, SLOT(updateDownloadProgress()));
//    connect(downloadManager, SIGNAL(totalRequestsChanged(int)), this, SLOT(updateDownloadProgress()));

    connect(aui, SIGNAL(connectionEstablished()), this, SLOT(updaterConnected()));
    connect(aui, SIGNAL(updateFinished()), this, SLOT(updateFinished()));
    connect(aui, SIGNAL(updaterVersionSent(QString)), this, SLOT(setUpdaterVersion(QString)));

    createComponentList();

#ifdef __DEBUG__
    createSupervisedDownload(QUrl(QString::fromUtf8("file:d:/Qt/fourchan-dl/webupdate.xml"));
#else
    createSupervisedDownload(QUrl(QString::fromUtf8("http://www.sourceforge.net/projects/fourchan-dl/files/webupdate/webupdate.xml/download")));
#endif

                             autosaveTimer = new QTimer(this);
                             autosaveTimer->setInterval(1000*60*10);     // 10 Minutes
                             autosaveTimer->setSingleShot(false);
                             connect(autosaveTimer, SIGNAL(timeout()), this, SLOT(saveSettings()));
}
Beispiel #3
0
void ImageThread::startDownload(void) {
    createSupervisedDownload(QUrl(_sUrl));
}