void MetadataItem::loadPendingData() { if (propertiesLoadedM == lsLoadPending) loadProperties(); if (childrenLoadedM == lsLoadPending) loadChildren(); }
void WTreeNode::expand() { if (!isExpanded()) { if (!childrenLoaded_) { loadChildren(); } /* * Happens if expandable() for an unpopulated node returned true, * but after populate(), there were no children: update the node to * reflect that in fact this node cannot be expanded after all */ if (parentNode() && childNodes_.empty()) { parentNode()->resetLearnedSlots(); update(); } if (loadPolicy_ == NextLevelLoading) loadGrandChildren(); doExpand(); updateChildren(); } }
void WTreeNode::setLoadPolicy(LoadPolicy loadPolicy) { loadPolicy_ = loadPolicy; switch (loadPolicy) { case PreLoading: loadChildren(); break; case NextLevelLoading: if (isExpanded()) { loadChildren(); loadGrandChildren(); } else { WTreeNode *parent = parentNode(); if (parent && parent->isExpanded()) loadChildren(); expandIcon_ ->icon1Clicked().connect(this, &WTreeNode::loadGrandChildren); } break; case LazyLoading: if (isExpanded()) loadChildren(); else { if (childCountPolicy_ == Enabled) { WTreeNode *parent = parentNode(); if (parent && parent->isExpanded()) doPopulate(); } expandIcon_->icon1Clicked().connect(this, &WTreeNode::expand); } } if (loadPolicy_ != LazyLoading) { for (unsigned i = 0; i < childNodes_.size(); ++i) childNodes_[i]->setLoadPolicy(loadPolicy_); } }
void WTreeNode::setLoadPolicy(LoadPolicy loadPolicy) { loadPolicy_ = loadPolicy; switch (loadPolicy) { case PreLoading: loadChildren(); break; case NextLevelLoading: if (expanded()) { loadChildren(); loadGrandChildren(); } else { if (parentNode_ && parentNode_->expanded()) loadChildren(); expandIcon_ ->icon1Clicked.connect(SLOT(this, WTreeNode::loadGrandChildren)); } break; case LazyLoading: if (expanded()) loadChildren(); else { if (parentNode_ && parentNode_->expanded()) { if (!populated_) { populate(); populated_= true; } } expandIcon_->icon1Clicked.connect(SLOT(this, WTreeNode::expand)); } } if (loadPolicy_ != LazyLoading) { for (unsigned i = 0; i < childNodes_.size(); ++i) childNodes_[i]->setLoadPolicy(loadPolicy_); } }
void WTreeNode::expand() { if (!expanded()) { if (!childrenLoaded_) { loadChildren(); } if (loadPolicy_ == NextLevelLoading) loadGrandChildren(); doExpand(); } }
void Property::load( const YAML::Node& yaml_node ) { if( yaml_node.Type() == YAML::NodeType::Scalar ) { loadValue( yaml_node ); } else if( yaml_node.Type() == YAML::NodeType::Map ) { loadChildren( yaml_node ); } else { printf( "Property::load() TODO: error handling - unexpected YAML type (Sequence) at line %d, column %d.\n", yaml_node.GetMark().line, yaml_node.GetMark().column ); } }
void PlaylistSelection::loadChildren( QListViewItem* browserParent, QListViewItem* selectionParent ) { QListViewItem* browserChild = browserParent->firstChild(); while( browserChild ) { SelectionListItem* selectionChild = new SelectionListItem( selectionParent, browserChild->text(0), browserChild ); if ( browserChild->pixmap(0) ) selectionChild->setPixmap( 0, *browserChild->pixmap(0) ); if( browserChild->childCount() > 0 ) loadChildren( browserChild, selectionChild ); browserChild = browserChild->nextSibling(); } }
PlaylistSelection::PlaylistSelection( QWidget* parent, char* name ) : KListView( parent, name ) { addColumn( i18n("Select Playlists") ); setRootIsDecorated( true ); PlaylistBrowserView* browserTree = PlaylistBrowser::instance()->getListView(); QListViewItem* browserItem = browserTree->firstChild(); //load into the tree the first two items, which is the smart playlist and the playlist for( int i = 0; i<2; i++ ) { QListViewItem* newItem = new QListViewItem( this, browserItem->text(0) ); newItem->setPixmap( 0, *browserItem->pixmap(0) ); loadChildren( browserItem, newItem ); newItem->setOpen( true ); browserItem = browserItem->nextSibling(); } }
void IncludeComponent::afterCreate() { try { auto relativePath = getAttribute("src"); if (relativePath.empty()) { throw IllegalStateException("Source attribute not specified on" " include component " +getId()); } loadChildren(relativePath); //erase self from parent's child list auto parentChildren = getParent()->getChildren(); auto selfIt = find(parentChildren.begin(), parentChildren.end(), getSelf()); parentChildren.erase(selfIt); } catch (Exception& e) { getChildren().clear(); throw Exception("Failed to build included view " +getAttribute("src"), e); } }
KstTopLevelView::KstTopLevelView(const QDomElement& e, QWidget *parent, const char *name, WFlags w) : KstViewObject(e), _w(new KstViewWidget(this, parent, name, w)) { commonConstructor(); loadChildren(e); }
void MetadataItem::ensureChildrenLoaded() { if (!childrenLoaded()) loadChildren(); }