Details coming soon.

This commit is contained in:
Paulchen-Panther
2018-12-27 23:11:32 +01:00
parent e3be03ea73
commit d762aa2f3e
186 changed files with 6156 additions and 5444 deletions

View File

@@ -1,6 +1,7 @@
#include <utils/FileUtils.h>
// qt incl
#include <QDir>
#include <QFileInfo>
#include <QDebug>
@@ -21,6 +22,17 @@ namespace FileUtils {
return fi.path();
}
bool removeDir(const QString& path, Logger* log)
{
//QDir dir(path);
if(!QDir(path).removeRecursively())
{
Error(log, "Failed to remove directory: %s", QSTRING_CSTR(path));
return false;
}
return true;
}
bool fileExists(const QString& path, Logger* log, bool ignError)
{
QFile file(path);
@@ -71,17 +83,18 @@ namespace FileUtils {
return true;
}
bool removeFile(const QString& path, Logger* log)
bool removeFile(const QString& path, Logger* log, bool ignError)
{
QFile file(path);
if(!file.remove())
{
resolveFileError(file,log);
if(!ignError)
resolveFileError(file,log);
return false;
}
return true;
}
QString convertPath(const QString path)
{
QString p = path;