-void PlacesItemModel::setItemHidden(int index, bool hide)
-{
- if (index >= 0 && index < count()) {
- PlacesItem* shownItem = placesItem(index);
- shownItem->setHidden(true);
- if (!m_hiddenItemsShown && hide) {
- const int newIndex = hiddenIndex(index);
- PlacesItem* hiddenItem = new PlacesItem(*shownItem);
- removeItem(index);
- m_hiddenItems.insert(newIndex, hiddenItem);
- }
-#ifdef PLACESITEMMODEL_DEBUG
- kDebug() << "Changed hide-state from" << index << "to" << hide;
- showModelState();
-#endif
- }
-}
-
-bool PlacesItemModel::isItemHidden(int index) const
-{
- return (index >= 0 && index < count()) ? m_hiddenItems[index] != 0 : false;
-}
-