CVS commit by mornfall: - fix the "tree folds on refresh" bug better (works with deep trees as well, the former fix worked on first level only) - update TODO
M +3 -0 TODO 1.26 M +13 -0 libkapture/listtreewidget.cpp 1.16 M +2 -4 libkapture/listtreewidget.h 1.9 --- kdenonbeta/kdedebian/kapture/TODO #1.25:1.26 @@ -74,4 +74,7 @@ - try to merge node production into groupers (not neccessarily feasible) - try to fix the "tree folds itself on refresh" issue [done] + - make the groupers use some sane argument passing mechanizm instead of + argmap (yuck...); possibly string-keyed, but using an object pointer as a + value (possibly of some sensible base class type) ::: 0.3 (prealfa) ::: --- kdenonbeta/kdedebian/kapture/libkapture/listtreewidget.cpp #1.15:1.16 @@ -90,4 +90,17 @@ void ListTreeWidgetItem::setItemParent ( } /* }}} */ +// detachItem - detach m_item from us (it is being deleted) {{{ +// -------------------------------------------------------------------------- +void ListTreeWidgetItem::detachItem () +{ + // *cough* our destructor will delete all m_treeNode childrens' + // m_item, meaning that these would go and double-delete them + if (m_item) + m_open = m_item -> isOpen (); + if (m_open) + std::cerr << "open node: " << this << std::endl; + m_item = 0; +} + /* }}} */ // ListTreeWidgetPItem --- kdenonbeta/kdedebian/kapture/libkapture/listtreewidget.h #1.8:1.9 @@ -54,4 +54,5 @@ namespace kapture { ListTreeWidgetItem (ListTreeWidget *list, TreeNode *parent); void setItemParent (); + void detachItem (); virtual ~ListTreeWidgetItem (); protected: @@ -77,8 +78,5 @@ namespace kapture { virtual ~KListViewItemCustom () { - // *cough* our destructor will delete all m_treeNode childrens' - // m_item, meaning that these would go and double-delete them - if (m_treeNode) - m_treeNode -> m_item = 0; + m_treeNode -> detachItem (); } };