summaryrefslogtreecommitdiff
path: root/src/backend/bookshelfmodel/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/bookshelfmodel/item.h')
-rw-r--r--src/backend/bookshelfmodel/item.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/bookshelfmodel/item.h b/src/backend/bookshelfmodel/item.h
index b24b503..665343f 100644
--- a/src/backend/bookshelfmodel/item.h
+++ b/src/backend/bookshelfmodel/item.h
@@ -18,6 +18,7 @@
#include <QString>
#include <QtGlobal>
+
class CSwordModuleInfo;
namespace BookshelfModel {
@@ -71,9 +72,9 @@ class Item {
\brief Returns the index of this item under its parent.
\retval -1 if this item has no parent.
*/
- inline int childIndex() {
+ inline int childIndex() const {
if (m_parent == 0) return -1;
- return m_parent->m_children.indexOf(this);
+ return m_parent->m_children.indexOf(const_cast<Item*>(this));
}
/**
@@ -149,7 +150,7 @@ class Item {
\retval true If this item is a group and can contain the given module.
\retval false This item is not a group or a wrong group.
*/
- inline virtual bool fitFor(CSwordModuleInfo *module) {
+ inline virtual bool fitFor(CSwordModuleInfo *module) const {
Q_UNUSED(module);
return false;
}
@@ -159,6 +160,8 @@ class Item {
*/
virtual bool operator<(const Item &other) const;
+ virtual bool isHidden() const;
+
protected:
inline void setParent(Item *parent) {
Q_ASSERT(parent != 0);