From ef136f8d746ed2ff61e665f7920f8952f095cb2b Mon Sep 17 00:00:00 2001 From: DanielDevBR Date: Tue, 16 Jul 2019 12:36:32 -0300 Subject: [PATCH] fix bug of remove symbolic link, at least on this part of code --- fm/src/actiontriggers.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fm/src/actiontriggers.cpp b/fm/src/actiontriggers.cpp index 05d9de9..11724be 100644 --- a/fm/src/actiontriggers.cpp +++ b/fm/src/actiontriggers.cpp @@ -315,10 +315,7 @@ void MainWindow::deleteFile() { // Delete selected file(s) for (int i = 0; i < selList.count(); ++i) { QFileInfo file(modelList->filePath(selList.at(i))); - if (file.isWritable()) { - if (file.isSymLink()) { - ok = QFile::remove(file.filePath()); - } else { + if (file.isWritable() || file.isSymLink()) { if (yesToAll == false) { if (confirm) { QString title = tr("Careful"); @@ -330,10 +327,11 @@ void MainWindow::deleteFile() { if (ret == QMessageBox::No) return; } } - ok = modelList->remove(selList.at(i)); - } - } else if (file.isSymLink()) { - ok = QFile::remove(file.filePath()); + if (file.isSymLink()) { + ok = QFile::remove(file.filePath()); + } else { + ok = modelList->remove(selList.at(i)); + } } }