Rewrite collection model and search

Fixes #392
This commit is contained in:
Jonas Kvinge
2021-06-27 22:54:08 +02:00
parent ea1e4541c0
commit e477449cd4
52 changed files with 2321 additions and 2637 deletions

View File

@@ -29,16 +29,17 @@
class RadioItem : public SimpleTreeItem<RadioItem> {
public:
enum Type {
Type_LoadingIndicator,
Type_Root,
Type_Service,
Type_Channel
enum class Type {
LoadingIndicator,
Root,
Service,
Channel
};
explicit RadioItem(SimpleTreeModel<RadioItem> *_model) : SimpleTreeItem<RadioItem>(Type_Root, _model) {}
explicit RadioItem(Type _type, RadioItem *_parent = nullptr) : SimpleTreeItem<RadioItem>(_type, _parent) {}
explicit RadioItem(SimpleTreeModel<RadioItem> *_model) : SimpleTreeItem<RadioItem>(_model), type(Type::Root) {}
explicit RadioItem(const Type _type, RadioItem *_parent = nullptr) : SimpleTreeItem<RadioItem>(_parent), type(_type) {}
Type type;
Song::Source source;
RadioChannel channel;
@@ -46,4 +47,6 @@ class RadioItem : public SimpleTreeItem<RadioItem> {
Q_DISABLE_COPY(RadioItem)
};
Q_DECLARE_METATYPE(RadioItem::Type)
#endif // RADIOITEM_H