Commit f1993b4a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

odrs: Remove seemingly unused cache files

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent c5020304
......@@ -233,13 +233,9 @@ void OdrsReviewsBackend::reviewSubmitted(QNetworkReply *reply)
const auto networkError = reply->error();
if (networkError == QNetworkReply::NoError) {
qCWarning(LIBDISCOVER_LOG) << "Review submitted";
AbstractResource *resource = qobject_cast<AbstractResource*>(reply->request().originatingObject());
const QJsonArray array = {resource->getMetadata(QStringLiteral("ODRS::review_map")).toObject()};
const QJsonDocument document(array);
// Remove local file with reviews so we can re-download it next time to get our review
QFile file(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/reviews/%1.json").arg(array.first().toObject().value(QStringLiteral("app_id")).toString()));
qCWarning(LIBDISCOVER_LOG) << "Review submitted" << resource;
const QJsonDocument document({resource->getMetadata(QStringLiteral("ODRS::review_map")).toObject()});
parseReviews(document, resource);
} else {
qCWarning(LIBDISCOVER_LOG) << "Failed to submit review: " << reply->errorString();
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment