30 #include "Helper/Logger/Logger.h" 56 for(
Tree* child : children){
57 delete child; child =
nullptr;
70 for(
Tree* child : children){
71 node->children << child->copy();
86 this->children << node;
101 deleted_node->parent =
nullptr;
103 for(
int i=0; i < children.size(); i++){
105 Tree* node = children[i];
107 if(node == deleted_node){
108 deleted_node = children.takeAt(i);
134 if(children.isEmpty()){
139 return (a->data < b->data);
142 std::sort(children.begin(), children.end(), lambda);
146 for(
Tree* child : children){
148 child->sort(recursive);
155 void print(
int lvl)
const {
157 for(
Tree* child : children){
160 for(
int i=0; i<lvl; i++){
void move(Tree *new_parent)
move current node to a new parent
Definition: Tree.h:121
Tree * remove_child(Tree *deleted_node)
remove a node from the current node
Definition: Tree.h:99
The Tree class.
Definition: LibraryGenreView.h:45
void sort(bool recursive)
sort children of all nodes in ascending way according to their data
Definition: Tree.h:131
Tree * copy()
Definition: Tree.h:67
Tree(const T &data_)
Tree constructor.
Definition: Tree.h:49
Tree * add_child(Tree *node)
adds a child to the given node
Definition: Tree.h:83
Definition: org_mpris_media_player2_adaptor.h:20