diff --git a/src/common/filesystembase.cpp b/src/common/filesystembase.cpp index b63f6c1a7e156..660e2d382c648 100644 --- a/src/common/filesystembase.cpp +++ b/src/common/filesystembase.cpp @@ -591,10 +591,11 @@ bool FileSystem::remove(const QString &fileName, QString *errorString) #endif try { - if (!std::filesystem::remove(std::filesystem::path{fileName.toUtf8().data()})) { + if (!std::filesystem::remove(std::filesystem::path{fileName.toStdWString()})) { if (errorString) { *errorString = QObject::tr("File is already deleted"); } + qCWarning(lcFileSystem()) << "File is already deleted" << fileName; return false; } } @@ -603,6 +604,7 @@ bool FileSystem::remove(const QString &fileName, QString *errorString) if (errorString) { *errorString = QString::fromLatin1(e.what()); } + qCWarning(lcFileSystem()) << e.what() << fileName; return false; } catch (...) @@ -610,6 +612,7 @@ bool FileSystem::remove(const QString &fileName, QString *errorString) if (errorString) { *errorString = QObject::tr("Error deleting the file"); } + qCWarning(lcFileSystem()) << "Error deleting the file" << fileName; return false; }