Logo Search packages:      
Sourcecode: packagesearch version File versions

void NWidgets::TagSelectionListView::filterByTagSet (  )  [protected]

Hides all tags where selecting would result in an empty result list.

This iterates over all visible items and checks if they may be selected according to the demand stated above. If _pColl is not set (i.e. equals 0) the function does nothing.

all items that shall be processed must be visible.
See also:
_filterByNamePattern, filter()

Definition at line 185 of file tagselectionlistview.cpp.

References _pColl, _selected, and TagListViewItem::filterByTagset().

Referenced by filter().

      if (_pColl==0 || _selected.empty() ) return;
      TagListViewItem* pRoot = static_cast<TagListViewItem*>(firstChild());
      if (pRoot == 0)   // if we do not have a root
      Tagcoll::OpSet<string> selectedTags;
      // insert all items names in the new set
            _selected.begin(), _selected.end(), 
            inserter(selectedTags, selectedTags.begin()),   // inserter to insert in the set
      Tagcoll::OpSet<string> companionTags = _pColl->getCompanionTags(selectedTags);
      companionTags += selectedTags;

/*    for ( iterator it = begin(QListViewItemIterator::Visible); it != end(); ++it)
            // assumes that a child implies its parent, else the parent could be hidden and the 
            // child shown
            if ( companionTags.find(it->fullTagname()) == companionTags.end() )

Generated by  Doxygen 1.6.0   Back to index