Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/common/filesystembase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -603,13 +604,15 @@ bool FileSystem::remove(const QString &fileName, QString *errorString)
if (errorString) {
*errorString = QString::fromLatin1(e.what());
}
qCWarning(lcFileSystem()) << e.what() << fileName;
return false;
}
catch (...)
{
if (errorString) {
*errorString = QObject::tr("Error deleting the file");
}
qCWarning(lcFileSystem()) << "Error deleting the file" << fileName;
return false;
}

Expand Down