diff options
Diffstat (limited to 'src/backend/bookshelfmodel/item.cpp')
-rw-r--r-- | src/backend/bookshelfmodel/item.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/bookshelfmodel/item.cpp b/src/backend/bookshelfmodel/item.cpp index 8556274..ec2dcab 100644 --- a/src/backend/bookshelfmodel/item.cpp +++ b/src/backend/bookshelfmodel/item.cpp @@ -16,6 +16,7 @@ #include "backend/bookshelfmodel/distributionitem.h" #include "backend/bookshelfmodel/languageitem.h" + namespace BookshelfModel { Item::Item(Type type) @@ -53,4 +54,12 @@ bool Item::operator<(const Item &other) const { return name().localeAwareCompare(other.name()) < 0; } +bool Item::isHidden() const { + if (m_children.empty()) return true; + Q_FOREACH(Item *child, m_children) { + if (!child->isHidden()) return false; + } + return true; +} + } // namespace BookshelfModel |