mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
Ref T275, detect when objects have been deleted in view and using that signal in setup component
This commit is contained in:
@@ -1164,21 +1164,27 @@ namespace BlackGui
|
||||
if (this->isEmpty()) { return 0; }
|
||||
|
||||
const int currentRows = this->rowCount();
|
||||
const ContainerType selected(selectedObjects());
|
||||
const CVariant deletedObjsVariant = CVariant::from(selected);
|
||||
int delta = 0;
|
||||
|
||||
if (!this->hasFilter() && currentRows == this->selectedRowCount())
|
||||
{
|
||||
// shortcut if all are selected
|
||||
this->clear(); // clear all
|
||||
return currentRows;
|
||||
delta = currentRows;
|
||||
}
|
||||
|
||||
const ContainerType selected(selectedObjects());
|
||||
ContainerType unselectedObjects(container());
|
||||
for (const ObjectType &obj : selected)
|
||||
else
|
||||
{
|
||||
unselectedObjects.remove(obj);
|
||||
ContainerType unselectedObjects(container());
|
||||
for (const ObjectType &obj : selected)
|
||||
{
|
||||
unselectedObjects.remove(obj);
|
||||
}
|
||||
this->updateContainerMaybeAsync(unselectedObjects);
|
||||
delta = currentRows - unselectedObjects.size();
|
||||
}
|
||||
const int delta = currentRows - unselectedObjects.size();
|
||||
this->updateContainerMaybeAsync(unselectedObjects);
|
||||
emit this->objectsDeleted(deletedObjsVariant);
|
||||
return delta;
|
||||
}
|
||||
|
||||
|
||||
@@ -321,6 +321,9 @@ namespace BlackGui
|
||||
//! Object has been double clicked
|
||||
void objectSelected(const BlackMisc::CVariant &object);
|
||||
|
||||
//! Objects deleted from model
|
||||
void objectsDeleted(const BlackMisc::CVariant &objectContainer);
|
||||
|
||||
//! JSON data load from disk completed, the BlackMisc::CStatusMessage represents the success
|
||||
void jsonLoadCompleted(const BlackMisc::CStatusMessage &msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user