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

Have a separate featured apps list for mobile

parent 103a3353
......@@ -43,9 +43,12 @@ FeaturedModel::FeaturedModel()
const QString dir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
QDir().mkpath(dir);
*featuredCache = dir+QLatin1String("/featured-5.9.json");
const QUrl featuredUrl(QStringLiteral("https://autoconfig.kde.org/discover/featured-5.9.json"));
const bool isMobile = qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE");
auto fileName = isMobile ? QLatin1String("/featured-mobile-5.9.json") : QLatin1String("/featured-5.9.json");
*featuredCache = dir + fileName;
const QUrl featuredUrl(QStringLiteral("https://autoconfig.kde.org/discover") + fileName);
auto *m_fetchJob = KIO::storedGet(featuredUrl, KIO::NoReload, KIO::HideProgressInfo);
connect(m_fetchJob, &KIO::StoredTransferJob::result, this, [this, m_fetchJob](){
QFile f(*featuredCache);
......
Markdown is supported
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