Implement workaround for flatpak QFile::moveToTrash
This commit is contained in:
+4
-2
@@ -30,6 +30,8 @@
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
bool moveToTrash(const QString &path);
|
||||
|
||||
int MainWindow::socketPair[2] = {0, 0};
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
@@ -332,7 +334,7 @@ void MainWindow::copyOrMove(bool copy, const QString &dest)
|
||||
QProgressDialog progress(copy ? tr("Copying") : tr("Moving"), tr("Cancel"), 0, files.size(), this);
|
||||
progress.setWindowModality(Qt::WindowModal);
|
||||
progress.show();
|
||||
foreach(const QString &file, files)
|
||||
for(const QString &file : files)
|
||||
{
|
||||
bool result = false;
|
||||
QFileInfo info(file);
|
||||
@@ -571,7 +573,7 @@ void MainWindow::deleteMarked()
|
||||
if(progress.wasCanceled())
|
||||
return;
|
||||
|
||||
if(!QFile::moveToTrash(file))
|
||||
if(!moveToTrash(file))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Failed to move file to trash"), tr("Failed to move file to trash %1").arg(file));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user