Skip to content
Snippets Groups Projects
Commit ab05075d authored by Pierre Lamot's avatar Pierre Lamot Committed by Thomas Guillem
Browse files

qt: don't update the model when the callback comes from another node in NetworkDeviceModel


  this fixes issues when we get the callback from a node after we changes view
  and end up displaying the content of a folder within the device view

Signed-off-by: default avatarThomas Guillem <thomas@gllm.fr>
parent 9cce5687
No related branches found
No related tags found
No related merge requests found
......@@ -209,20 +209,27 @@ bool NetworkDeviceModel::initializeMediaSources()
void NetworkDeviceModel::onItemCleared( MediaSourcePtr mediaSource, input_item_node_t* node )
{
if (node != &mediaSource->tree->root)
return;
refreshDeviceList( std::move( mediaSource), node->pp_children, node->i_children, true );
}
void NetworkDeviceModel::onItemAdded( MediaSourcePtr mediaSource, input_item_node_t*,
void NetworkDeviceModel::onItemAdded( MediaSourcePtr mediaSource, input_item_node_t* parent,
input_item_node_t *const children[],
size_t count )
{
if (parent != &mediaSource->tree->root)
return;
refreshDeviceList( std::move( mediaSource ), children, count, false );
}
void NetworkDeviceModel::onItemRemoved(MediaSourcePtr, input_item_node_t*,
void NetworkDeviceModel::onItemRemoved(MediaSourcePtr mediaSource, input_item_node_t* node,
input_item_node_t *const children[],
size_t count )
{
if (node != &mediaSource->tree->root)
return;
std::vector<InputItemPtr> itemList;
itemList.reserve( count );
for ( auto i = 0u; i < count; ++i )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment