mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
refactor: Improve utils code style (#841)
* Improve utils code style * Fix indendation Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
@@ -10,21 +10,20 @@
|
||||
|
||||
namespace FileUtils {
|
||||
|
||||
QString getBaseName( QString sourceFile)
|
||||
QString getBaseName(QString sourceFile)
|
||||
{
|
||||
QFileInfo fi( sourceFile );
|
||||
QFileInfo fi(sourceFile);
|
||||
return fi.fileName();
|
||||
}
|
||||
|
||||
QString getDirName( QString sourceFile)
|
||||
QString getDirName(QString sourceFile)
|
||||
{
|
||||
QFileInfo fi( sourceFile );
|
||||
QFileInfo fi(sourceFile);
|
||||
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));
|
||||
@@ -35,8 +34,7 @@ namespace FileUtils {
|
||||
|
||||
bool fileExists(const QString& path, Logger* log, bool ignError)
|
||||
{
|
||||
QFile file(path);
|
||||
if(!file.exists())
|
||||
if(!QFile::exists(path))
|
||||
{
|
||||
ErrorIf((!ignError), log,"File does not exist: %s",QSTRING_CSTR(path));
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user