Move source files to /src

This commit is contained in:
Floris Bos 2022-02-14 10:06:21 +01:00
parent 4daff1ba79
commit 033ff07abf
2685 changed files with 9 additions and 7 deletions

View file

@ -0,0 +1,32 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2020 Raspberry Pi Ltd
*/
#include "networkaccessmanagerfactory.h"
#include "config.h"
#include <QNetworkAccessManager>
#include <QNetworkDiskCache>
#include <QStandardPaths>
#include <QDir>
#include <QUrl>
#include <QDebug>
/* Configure caching for files downloaded from Internet by QML (e.g. os_list.json and icons) */
NetworkAccessManagerFactory::NetworkAccessManagerFactory()
{
_c = new QNetworkDiskCache(this);
_c->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)+QDir::separator()+"oslistcache");
/* Only cache images and not the .json */
//_c->remove(QUrl(OSLIST_URL));
/* Clear all for now as we do not know any potential subitems_url in advance */
_c->clear();
}
QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
{
QNetworkAccessManager *nam = new QNetworkAccessManager(parent);
nam->setCache(_c);
return nam;
}