static void ev_page_accessible_finalize (GObject *object) { EvPageAccessiblePrivate *priv = EV_PAGE_ACCESSIBLE (object)->priv; g_clear_pointer (&priv->links, (GDestroyNotify)g_hash_table_destroy); clear_children (EV_PAGE_ACCESSIBLE (object)); G_OBJECT_CLASS (ev_page_accessible_parent_class)->finalize (object); }
void config::merge_children(const std::string& key) { check_valid(); if (child_count(key) < 2) return; config merged_children; for (const config &cfg : child_range(key)) { merged_children.append(cfg); } clear_children(key); add_child(key,merged_children); }
void config::merge_children_by_attribute(const std::string& key, const std::string& attribute) { check_valid(); if (child_count(key) < 2) return; typedef std::map<std::string, config> config_map; config_map merged_children_map; for (const config &cfg : child_range(key)) { merged_children_map[cfg[attribute]].append(cfg); } clear_children(key); for (const config_map::value_type &i : merged_children_map) { add_child(key,i.second); } }
void clear_children(struct tree *node) { if (node->level > 0) { if (node->left != NULL) clear_children(node->left); if (node->right != NULL) clear_children(node->right); #ifndef TWO_DIMENSION if (node->up != NULL) clear_children(node->up); if (node->down != NULL) clear_children(node->down); #endif free(node); } else if (node->level == 0) { clear_children(node->left); clear_children(node->right); #ifndef TWO_DIMENSION clear_children(node->up); clear_children(node->down); #endif } }
void config::merge_children_by_attribute(const std::string& key, const std::string& attribute) { check_valid(); if (child_count(key) < 2) return; typedef std::map<std::string, config> config_map; config_map merged_children_map; for (const config &cfg : child_range(key)) { const std::string &value = cfg[attribute]; config_map::iterator m = merged_children_map.find(value); if ( m!=merged_children_map.end() ) { m->second.append(cfg); } else { merged_children_map.insert(make_pair(value, cfg)); } } clear_children(key); for (const config_map::value_type &i : merged_children_map) { add_child(key,i.second); } }
void RoomList::clear() { clear_children(); buttons.clear(); set_draw_required(); }