generic: adjust to KIO changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-20 08:46:26 +02:00
parent 45b68de2df
commit a90dae4ad9
5 changed files with 9 additions and 9 deletions

View file

@ -94,7 +94,7 @@ void Picture::setPicture(const KUrl &currentUrl)
if (!m_currentUrl.isEmpty() && !m_currentUrl.isLocalFile()) {
kDebug() << "Not a local file, downloading" << currentUrl;
KIO::StoredTransferJob * job = KIO::storedGet( currentUrl, KIO::NoReload, KIO::HideProgressInfo);
KIO::StoredTransferJob * job = KIO::storedGet( currentUrl, KIO::HideProgressInfo);
connect(job, SIGNAL(finished(KJob*)), this, SLOT(slotFinished(KJob*)));
emit pictureLoaded(defaultPicture(i18n("Loading image...")));
} else {

View file

@ -61,7 +61,7 @@ void ApodProvider::Private::pageRequestFinished(KJob *_job)
if (exp.indexIn(data) != -1) {
const QString sub = exp.cap(1);
KUrl url(QString::fromLatin1("https://antwrp.gsfc.nasa.gov/apod/%1").arg(sub));
KIO::StoredTransferJob *imageJob = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo);
KIO::StoredTransferJob *imageJob = KIO::storedGet(url, KIO::HideProgressInfo);
mParent->connect(imageJob, SIGNAL(finished(KJob*)), SLOT(imageRequestFinished(KJob*)));
} else {
emit mParent->error(mParent);
@ -85,7 +85,7 @@ ApodProvider::ApodProvider(QObject *parent, const QVariantList &args)
d(new Private(this))
{
KUrl url(QString::fromLatin1("https://antwrp.gsfc.nasa.gov/apod/"));
KIO::StoredTransferJob *job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo);
KIO::StoredTransferJob *job = KIO::storedGet(url, KIO::HideProgressInfo);
connect(job, SIGNAL(finished(KJob*)), SLOT(pageRequestFinished(KJob*)));
}

View file

@ -95,7 +95,7 @@ void FlickrProvider::Private::pageRequestFinished(KJob *kjob)
const KUrl queryurl(s_flickrapiurl + mActualDate.toString(Qt::ISODate));
kDebug() << "stat fail, retrying with" << queryurl.prettyUrl();
kstoredjob->deleteLater();
kstoredjob = KIO::storedGet(queryurl, KIO::NoReload, KIO::HideProgressInfo);
kstoredjob = KIO::storedGet(queryurl, KIO::HideProgressInfo);
kstoredjob->setAutoDelete(false);
mParent->connect(kstoredjob, SIGNAL(finished(KJob*)), SLOT(pageRequestFinished(KJob*)));
return;
@ -123,7 +123,7 @@ void FlickrProvider::Private::pageRequestFinished(KJob *kjob)
const KUrl photourl(m_photoList.at(KRandom::randomMax(m_photoList.size())));
kDebug() << "chosen photo" << photourl.prettyUrl();
kstoredjob = KIO::storedGet(photourl, KIO::NoReload, KIO::HideProgressInfo);
kstoredjob = KIO::storedGet(photourl, KIO::HideProgressInfo);
kstoredjob->setAutoDelete(false);
mParent->connect(kstoredjob, SIGNAL(finished(KJob*)), SLOT(imageRequestFinished(KJob*)));
}
@ -153,7 +153,7 @@ FlickrProvider::FlickrProvider(QObject *parent, const QVariantList &args)
d->mActualDate = date();
const KUrl queryurl(s_flickrapiurl + d->mActualDate.toString(Qt::ISODate));
kDebug() << "starting job for" << queryurl.prettyUrl();
KIO::StoredTransferJob *kstoredjob = KIO::storedGet(queryurl, KIO::NoReload, KIO::HideProgressInfo);
KIO::StoredTransferJob *kstoredjob = KIO::storedGet(queryurl, KIO::HideProgressInfo);
kstoredjob->setAutoDelete(false);
connect(kstoredjob, SIGNAL(finished(KJob*)), SLOT(pageRequestFinished(KJob*)));
}

View file

@ -94,7 +94,7 @@ void PexelsProvider::Private::pageRequestFinished(KJob *kjob)
const KUrl photourl(m_photoList.at(KRandom::randomMax(m_photoList.size())));
kDebug() << "chosen photo" << photourl.prettyUrl();
kstoredjob = KIO::storedGet(photourl, KIO::NoReload, KIO::HideProgressInfo);
kstoredjob = KIO::storedGet(photourl, KIO::HideProgressInfo);
kstoredjob->setAutoDelete(false);
kstoredjob->addMetaData("Authorization", s_pexelsapikey);
mParent->connect(kstoredjob, SIGNAL(finished(KJob*)), SLOT(imageRequestFinished(KJob*)));
@ -124,7 +124,7 @@ PexelsProvider::PexelsProvider(QObject *parent, const QVariantList &args)
{
const KUrl queryurl(s_pexelsapiurl);
kDebug() << "starting job for" << queryurl.prettyUrl();
KIO::StoredTransferJob *kstoredjob = KIO::storedGet(queryurl, KIO::NoReload, KIO::HideProgressInfo);
KIO::StoredTransferJob *kstoredjob = KIO::storedGet(queryurl, KIO::HideProgressInfo);
kstoredjob->setAutoDelete(false);
kstoredjob->addMetaData("Authorization", s_pexelsapikey);
connect(kstoredjob, SIGNAL(finished(KJob*)), SLOT(pageRequestFinished(KJob*)));

View file

@ -55,7 +55,7 @@ QVariant MDDocument::loadResource(int type, const QUrl &url)
kDebug() << "Fetching resource" << url;
m_resourcedata.clear();
KIO::TransferJob *kiojob = KIO::get(url, KIO::Reload, KIO::HideProgressInfo);
KIO::TransferJob *kiojob = KIO::get(url, KIO::HideProgressInfo);
kiojob->setAutoDelete(false);
connect(kiojob, SIGNAL(data(KIO::Job*,QByteArray)), SLOT(slotKIOData(KIO::Job*,QByteArray)));
connect(kiojob, SIGNAL(result(KJob*)), SLOT(slotKIOResult(KJob*)));