Can load remote images and cache them locally.

This commit is contained in:
2018-12-18 18:31:51 +01:00
parent 6e7645f17b
commit 0148f7aaa5
11 changed files with 379 additions and 3 deletions

19
utils/filesutils.cpp Normal file
View File

@ -0,0 +1,19 @@
#include <QDir>
#include "filesutils.h"
FilesUtils::FilesUtils()
{
}
bool FilesUtils::CreateDirectoryIfNotExists(const QString &path)
{
QDir dir(path);
//Check if the directory already exists
if(dir.exists())
return true;
return dir.mkpath(".");
}

28
utils/filesutils.h Normal file
View File

@ -0,0 +1,28 @@
/**
* Files utilities
*
* @author Pierre HUBERT
*/
#ifndef FILESUTILS_H
#define FILESUTILS_H
#include <QString>
class FilesUtils
{
public:
FilesUtils();
/**
* Create the specified directory and all its parents if they do not
* exists
*
* @param path The path of the folder to check
* @return TRUE if the folder exists or has been successfully created /
* FALSE else
*/
static bool CreateDirectoryIfNotExists(const QString &path);
};
#endif // FILESUTILS_H