refactor: Improve utils code style (#841)

* Improve utils code style

* Fix indendation

Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
Murat Seker
2020-06-28 23:12:22 +02:00
committed by GitHub
parent bfb50b8d91
commit 458113f8f9
15 changed files with 71 additions and 98 deletions

View File

@@ -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;