mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #641, improvements/fixes of orderable lists / models / views
* set sort order automatically to IndexOrder when changing order of items * call onChanged when model is changed and then update view (needed when model is changed directly, not via view) * support for digest signal so redundant updates can be avoided * renamed rowCountChanged (signal) to modelDataChanged - detecting row count changes only was useless * updated Doxygen / fixed typos
This commit is contained in:
@@ -72,10 +72,20 @@ namespace BlackGui
|
||||
{
|
||||
order = container[position].getOrder();
|
||||
}
|
||||
this->setSortColumnToOrder();
|
||||
container.moveTo(items, order);
|
||||
|
||||
// update container
|
||||
this->updateContainerMaybeAsync(container);
|
||||
}
|
||||
|
||||
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare>
|
||||
void COrderableListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>::setSortColumnToOrder()
|
||||
{
|
||||
// force sorted by order, otherwise display looks confusing
|
||||
this->setSorting(IOrderable::IndexOrder);
|
||||
}
|
||||
|
||||
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare>
|
||||
int COrderableListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>::update(const ContainerType &container, bool sort)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user