Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
Assets::Downloader Namespace Reference

Classes

class  AssetDownloader
 
class  AssetDownloaderPrivate
 
struct  DownloadableAssets
 

Functions

static bool isWritableDir (const QDir &dir)
 
static bool sameFileContent (const QFileInfo &first, const QFileInfo &second)
 
static bool createDirectory (const QDir &dir)
 
static bool canBeALocalBaseDir (const QDir &dir)
 
static QDir baseLocalDir (const QDir &preferredLocalDir)
 
static QString pathFromUrl (const QUrl &url)
 
static QList< QUrlfilterDownloadableAssets (const QList< QUrl > &assetFiles, const QDir &expectedDir)
 
static bool allAssetsPresent (const QList< QUrl > &assetFiles, const QDir &expectedDir)
 
static void precheckLocalFile (const QUrl &url)
 
static void readAssetsFileContent (QPromise< DownloadableAssets > &promise, const QByteArray &content)
 
static void unzip (QPromise< void > &promise, const QByteArray &content, const QDir &directory, const QString &fileName)
 
static void writeAsset (QPromise< void > &promise, const QByteArray &content, const QString &filePath)
 
static void copyAndCheck (QPromise< void > &promise, const QString &sourcePath, const QString &destPath)
 

Function Documentation

◆ allAssetsPresent()

static bool Assets::Downloader::allAssetsPresent ( const QList< QUrl > & assetFiles,
const QDir & expectedDir )
static

Definition at line 169 of file assetdownloader.cpp.

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the caller graph for this function:

◆ baseLocalDir()

static QDir Assets::Downloader::baseLocalDir ( const QDir & preferredLocalDir)
static

Definition at line 144 of file assetdownloader.cpp.

References QStandardPaths::AppLocalDataLocation, canBeALocalBaseDir(), qWarning, and QStandardPaths::writableLocation().

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canBeALocalBaseDir()

static bool Assets::Downloader::canBeALocalBaseDir ( const QDir & dir)
static

Definition at line 137 of file assetdownloader.cpp.

References createDirectory(), dir, QString::isEmpty(), and isWritableDir().

Referenced by baseLocalDir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyAndCheck()

static void Assets::Downloader::copyAndCheck ( QPromise< void > & promise,
const QString & sourcePath,
const QString & destPath )
static

Definition at line 324 of file assetdownloader.cpp.

References QFileInfo::absoluteFilePath(), QFile::copy(), createDirectory(), QFile::fileName(), QString::fromLatin1(), qWarning, and sameFileContent().

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createDirectory()

static bool Assets::Downloader::createDirectory ( const QDir & dir)
static

Definition at line 126 of file assetdownloader.cpp.

References createDirectory(), dir, and QString::fromUtf8().

Referenced by canBeALocalBaseDir(), copyAndCheck(), createDirectory(), and writeAsset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterDownloadableAssets()

static QList< QUrl > Assets::Downloader::filterDownloadableAssets ( const QList< QUrl > & assetFiles,
const QDir & expectedDir )
static

Definition at line 159 of file assetdownloader.cpp.

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the caller graph for this function:

◆ isWritableDir()

static bool Assets::Downloader::isWritableDir ( const QDir & dir)
static

Definition at line 87 of file assetdownloader.cpp.

References dir, file, QString::fromLatin1(), and QFile::open().

Referenced by canBeALocalBaseDir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pathFromUrl()

static QString Assets::Downloader::pathFromUrl ( const QUrl & url)
static

Definition at line 154 of file assetdownloader.cpp.

References QUrl::isLocalFile(), QUrl::toLocalFile(), QUrl::toString(), and url.

Referenced by precheckLocalFile(), Assets::Downloader::AssetDownloader::setPreferredLocalDownloadDir(), and Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ precheckLocalFile()

static void Assets::Downloader::precheckLocalFile ( const QUrl & url)
static

Definition at line 257 of file assetdownloader.cpp.

References file, QUrl::isEmpty(), QFile::open(), pathFromUrl(), qWarning, QIODeviceBase::ReadOnly, and url.

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readAssetsFileContent()

static void Assets::Downloader::readAssetsFileContent ( QPromise< DownloadableAssets > & promise,
const QByteArray & content )
static

Definition at line 266 of file assetdownloader.cpp.

References QJsonDocument::fromJson().

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sameFileContent()

static bool Assets::Downloader::sameFileContent ( const QFileInfo & first,
const QFileInfo & second )
static

Definition at line 96 of file assetdownloader.cpp.

References QFileInfo::absoluteFilePath(), QFileInfo::exists(), QIODeviceBase::ReadOnly, and QFileInfo::size().

Referenced by copyAndCheck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unzip()

static void Assets::Downloader::unzip ( QPromise< void > & promise,
const QByteArray & content,
const QDir & directory,
const QString & fileName )
static

Definition at line 284 of file assetdownloader.cpp.

References directory, fileName, QFile::remove(), and QIODeviceBase::WriteOnly.

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeAsset()

static void Assets::Downloader::writeAsset ( QPromise< void > & promise,
const QByteArray & content,
const QString & filePath )
static

Definition at line 308 of file assetdownloader.cpp.

References QFileInfo::absoluteFilePath(), QFileDevice::close(), createDirectory(), QFileInfo::dir(), file, QFile::open(), QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by Assets::Downloader::AssetDownloader::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: