fix(FileSystem): don't attempt to trash items on Windows Server

For some reason this makes some of our CI test runs super slow, and
sometimes fail miserably.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2023-01-10 12:50:56 -03:00
parent 976e550aa7
commit 391ef64c22
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -57,6 +57,7 @@
#include <shlobj.h>
#include <shobjidl.h>
#include <sys/utime.h>
#include <versionhelpers.h>
#include <windows.h>
#include <winnls.h>
#include <string>
@ -251,6 +252,10 @@ bool trash(QString path, QString *pathInTrash)
// FIXME: Figure out trash in Flatpak. Qt seemingly doesn't use the Trash portal
if (DesktopServices::isFlatpak())
return false;
#if defined Q_OS_WIN32
if (IsWindowsServer())
return false;
#endif
return QFile::moveToTrash(path, pathInTrash);
#endif
}