// the group item itself will be removed automatically, // when the last child is removed void KonqSidebarHistoryGroupItem::remove() { KURL::List list; KonqSidebarHistoryItem *child = static_cast<KonqSidebarHistoryItem*>( firstChild() ); while( child ) { list.append( child->externalURL() ); child = static_cast<KonqSidebarHistoryItem*>( child->nextSibling() ); } if ( !list.isEmpty() ) KonqHistoryManager::kself()->emitRemoveFromHistory( list ); }
void KonqSidebarHistoryModule::slotRemoveEntry() { QListViewItem *item = tree()->selectedItem(); KonqSidebarHistoryItem *hi = dynamic_cast<KonqSidebarHistoryItem*>( item ); if ( hi ) // remove a single entry KonqHistoryManager::kself()->emitRemoveFromHistory( hi->externalURL()); else { // remove a group of entries KonqSidebarHistoryGroupItem *gi = dynamic_cast<KonqSidebarHistoryGroupItem*>( item ); if ( gi ) gi->remove(); } }