rodlie/qtfm

Bug: qtfm don't show remove dialog confirmation for symbolic link

ferion11 opened this issue · 7 comments

Bug: qtfm don't show remove dialog confirmation for symbolic link.

If, in your selection of many files, there is symbolic links between normal files, and you press Delete key, it will show the remove dialog confirmation, but it will remove all symbolic links without confirmation first. And if you move a symbolic link, qtfm make a copy.

This is on master (6.3)? I replaced the copy/move function in master and I might have overlooked something. Will check, I'm occupied for a couple of days, but will then dedicated a day to qtfm :)

Yes, is in master (6.3). It isn't a big problem for me, but is better to fix before release the 6.3 version. Take your time :)

Will of course be fixed before release :)

We have some suspicious code here:

// 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 (yesToAll == false) {
if (confirm) {
QString title = tr("Careful");
QString msg = tr("Are you sure you want to delete <p><b>\"") +
file.filePath() + "</b>?";
int ret = QMessageBox::information(this, title, msg,
QMessageBox::Yes | QMessageBox::No | QMessageBox::YesToAll);
if (ret == QMessageBox::YesToAll) yesToAll = true;
if (ret == QMessageBox::No) return;
}
}
ok = modelList->remove(selList.at(i));
}
} else if (file.isSymLink()) {
ok = QFile::remove(file.filePath());
}
}

There is also the fact that broken symbolic links don't show in qtfm (master 6.3). But I will see the move thing first.

The #148 fix the broken symbolic link thing. Now, for this bug report, the only thing that I remember is the move symbolic link action that don't remove the original.