Commit ed11e1bb authored by Fushan Wen's avatar Fushan Wen Committed by Nate Graham
Browse files

dataengines/potd: Parse title and remoteUrl in SimonStalenhagProvider

Parse the title from the json data, and set the remote URL.

CCBUG: 422934
parent eac8ca8a
......@@ -76,8 +76,19 @@ void SimonStalenhagProvider::metaDataRequestFinished(KJob *_job)
Q_EMIT error(this);
return;
}
QUrl picUrl(urlStr);
KIO::StoredTransferJob *imageJob = KIO::storedGet(picUrl, KIO::NoReload, KIO::HideProgressInfo);
potdProviderData()->wallpaperRemoteUrl = QUrl(urlStr);
const QString titleStr = imageObj.toObject().value(QStringLiteral("name")).toString();
const QString sectionStr = imageObj.toObject().value(QStringLiteral("section")).toString();
if (!titleStr.isEmpty()) {
if (!sectionStr.isEmpty()) {
potdProviderData()->wallpaperTitle = sectionStr + " - " + titleStr;
} else {
potdProviderData()->wallpaperTitle = titleStr;
}
}
KIO::StoredTransferJob *imageJob = KIO::storedGet(potdProviderData()->wallpaperRemoteUrl, KIO::NoReload, KIO::HideProgressInfo);
connect(imageJob, &KIO::StoredTransferJob::finished, this, &SimonStalenhagProvider::imageRequestFinished);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment