mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
allow delete button to delete folders
This commit is contained in:
parent
010baaf296
commit
88d51cca3e
1 changed files with 2 additions and 3 deletions
|
|
@ -272,8 +272,7 @@ void TabDeckStorage::actDeleteLocalDeck()
|
|||
{
|
||||
const QModelIndexList curLefts = localDirView->selectionModel()->selectedRows();
|
||||
|
||||
auto isDir = [&](const auto &curLeft) { return localDirModel->isDir(curLeft); };
|
||||
if (curLefts.isEmpty() || std::all_of(curLefts.begin(), curLefts.end(), isDir)) {
|
||||
if (curLefts.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +281,7 @@ void TabDeckStorage::actDeleteLocalDeck()
|
|||
return;
|
||||
|
||||
for (const auto &curLeft : curLefts) {
|
||||
if (!localDirModel->isDir(curLeft)) {
|
||||
if (curLeft.isValid()) {
|
||||
localDirModel->remove(curLeft);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue