Allow to delete files permanently in fileview with Qt < 5.15

This commit is contained in:
Jonas Kvinge 2020-08-19 22:25:05 +02:00
parent 47884919c8
commit f01b469f3f
1 changed files with 6 additions and 1 deletions

View File

@ -234,7 +234,12 @@ void FileView::Delete(const QStringList &filenames) {
if (DeleteConfirmationDialog::warning(filenames) != QDialogButtonBox::Yes) return; if (DeleteConfirmationDialog::warning(filenames) != QDialogButtonBox::Yes) return;
DeleteFiles *delete_files = new DeleteFiles(task_manager_, storage_, true); bool use_trash = false;
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
use_trash = true;
#endif
DeleteFiles *delete_files = new DeleteFiles(task_manager_, storage_, use_trash);
connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList))); connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList)));
delete_files->Start(filenames); delete_files->Start(filenames);