mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Details coming soon.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user