Move beginInsertRows()
This commit is contained in:
parent
d9e378211a
commit
a79d9d4e77
|
@ -168,23 +168,23 @@ void RadioModel::AddChannels(const RadioChannelList &channels) {
|
||||||
container = container_nodes_[channel.source];
|
container = container_nodes_[channel.source];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
beginInsertRows(ItemToIndex(root_), root_->children.count(), root_->children.count());
|
||||||
RadioItem *item = new RadioItem(RadioItem::Type_Service, root_);
|
RadioItem *item = new RadioItem(RadioItem::Type_Service, root_);
|
||||||
item->source = channel.source;
|
item->source = channel.source;
|
||||||
item->display_text = Song::DescriptionForSource(channel.source);
|
item->display_text = Song::DescriptionForSource(channel.source);
|
||||||
item->sort_text = SortText(Song::TextForSource(channel.source));
|
item->sort_text = SortText(Song::TextForSource(channel.source));
|
||||||
item->lazy_loaded = true;
|
item->lazy_loaded = true;
|
||||||
beginInsertRows(ItemToIndex(root_), root_->children.count(), root_->children.count());
|
|
||||||
container_nodes_.insert(channel.source, item);
|
container_nodes_.insert(channel.source, item);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
container = item;
|
container = item;
|
||||||
}
|
}
|
||||||
|
beginInsertRows(ItemToIndex(container), container->children.count(), container->children.count());
|
||||||
RadioItem *item = new RadioItem(RadioItem::Type_Channel, container);
|
RadioItem *item = new RadioItem(RadioItem::Type_Channel, container);
|
||||||
item->source = channel.source;
|
item->source = channel.source;
|
||||||
item->display_text = channel.name;
|
item->display_text = channel.name;
|
||||||
item->sort_text = SortText(Song::TextForSource(channel.source) + " - " + channel.name);
|
item->sort_text = SortText(Song::TextForSource(channel.source) + " - " + channel.name);
|
||||||
item->channel = channel;
|
item->channel = channel;
|
||||||
item->lazy_loaded = true;
|
item->lazy_loaded = true;
|
||||||
beginInsertRows(ItemToIndex(container), container->children.count(), container->children.count());
|
|
||||||
items_ << item;
|
items_ << item;
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue