Ejemplo n.º 1
0
void FreeBusyDownloadJob::start()
{
  KIO::TransferJob *job = KIO::get( mUrl, KIO::NoReload, KIO::HideProgressInfo );

  job->ui()->setWindow( mParent );

  connect( job, SIGNAL(result(KJob*)), SLOT(slotResult(KJob*)) );
  connect( job, SIGNAL(data(KIO::Job*,QByteArray)), SLOT(slotData(KIO::Job*,QByteArray)) );
}
Ejemplo n.º 2
0
void KWebPage::downloadRequest(const QNetworkRequest& request)
{
    KIO::TransferJob* job = KIO::get(request.url());
    connect(job, SIGNAL(mimetype(KIO::Job*,QString)),
            this, SLOT(_k_receivedContentType(KIO::Job*,QString)));
    connect(job, SIGNAL(result(KJob*)),
            this, SLOT(_k_receivedContentTypeResult(KJob*)));

    job->setMetaData(request.attribute(static_cast<QNetworkRequest::Attribute>(KIO::AccessManager::MetaData)).toMap());
    job->addMetaData(QL1S("MaxCacheSize"), QL1S("0")); // Don't store in http cache.
    job->addMetaData(QL1S("cache"), QL1S("cache")); // Use entry from cache if available.
    job->ui()->setWindow(d->windowWidget());
}