mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 09:22:15 -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();
|
const QModelIndexList curLefts = localDirView->selectionModel()->selectedRows();
|
||||||
|
|
||||||
auto isDir = [&](const auto &curLeft) { return localDirModel->isDir(curLeft); };
|
if (curLefts.isEmpty()) {
|
||||||
if (curLefts.isEmpty() || std::all_of(curLefts.begin(), curLefts.end(), isDir)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,7 +281,7 @@ void TabDeckStorage::actDeleteLocalDeck()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (const auto &curLeft : curLefts) {
|
for (const auto &curLeft : curLefts) {
|
||||||
if (!localDirModel->isDir(curLeft)) {
|
if (curLeft.isValid()) {
|
||||||
localDirModel->remove(curLeft);
|
localDirModel->remove(curLeft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue