always make the file we try to delete be read-write as required

on windows you must only delete read-write files

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2025-04-04 11:06:59 +02:00
parent a9293fd25b
commit ca34d86efb

View File

@ -586,9 +586,7 @@ bool FileSystem::remove(const QString &fileName, QString *errorString)
#ifdef Q_OS_WIN
// You cannot delete a read-only file on windows, but we want to
// allow that.
if (!isWritable(fileName)) {
setFileReadOnly(fileName, false);
}
setFileReadOnly(fileName, false);
#endif
QFile f(fileName);
if (!f.remove()) {