Changeset 1744

Show
Ignore:
Timestamp:
01/02/10 20:32:13 (2 years ago)
Author:
andreas
Message:

fixed quirk in info Remove / exported GetDefaultItem/GetDefaultGroup?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/qt_gui/src/info/lib/info_group.cc

    r1677 r1744  
    234234void InfoGroup::Remove(const InfoPath& path) 
    235235{ 
    236   InfoGroup g=GetGroup(path); 
    237   InfoGroup p=g.GetParent(); 
    238   p.impl_->RemoveSub(g.GetName()); 
     236  std::vector<string> plist=path.GetList(); 
     237  std::vector<string>::const_iterator pos=plist.begin(); 
     238  if(plist.empty()){ 
     239   return; 
     240  } 
     241  InfoGroup last_group(*this); 
     242  if(do_group_lookup(pos,plist.end(),last_group)) { 
     243    InfoGroup p=last_group.GetParent(); 
     244    p.impl_->RemoveSub(last_group.GetName()); 
     245  }  
    239246} 
    240247 
  • branches/qt_gui/src/info/pymod/wrap_info.cc

    r1677 r1744  
    127127    .def("AddDefault",&InfoHandle::AddDefault) 
    128128    .def("Copy",&InfoHandle::Copy) 
     129    .def("HasDefaultGroup",&InfoHandle::HasDefaultGroup) 
     130    .def("GetDefaultGroup",&InfoHandle::GetDefaultGroup) 
     131    .def("HasDefaultItem",&InfoHandle::HasDefaultItem) 
     132    .def("GetDefaultItem",&InfoHandle::GetDefaultItem) 
    129133    ;   
    130134