diff options
Diffstat (limited to 'lib/bookmarks/bookmarkitem.cpp')
-rw-r--r-- | lib/bookmarks/bookmarkitem.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/bookmarks/bookmarkitem.cpp b/lib/bookmarks/bookmarkitem.cpp index 5dd3c22..25b1004 100644 --- a/lib/bookmarks/bookmarkitem.cpp +++ b/lib/bookmarks/bookmarkitem.cpp @@ -30,6 +30,12 @@ void BookmarkItem::appendChild(BookmarkItem *child) m_childItems.append(child); } +bool BookmarkItem::removeChild(BookmarkItem *child) +{ + Q_CHECK_PTR(child); + return m_childItems.removeOne(child); +} + BookmarkItem *BookmarkItem::child(int row) { return m_childItems.at(row); @@ -42,12 +48,12 @@ int BookmarkItem::childIndex(BookmarkItem *item) const int BookmarkItem::childCount() const { - return m_childItems.count(); + return m_childItems.size(); } int BookmarkItem::row() const { - if(m_parentItem) { + if(m_parentItem != nullptr) { return m_parentItem->m_childItems.indexOf(const_cast<BookmarkItem *>(this)); } |