diff --git a/mythtv/libs/libmythdb/mythversion.h b/mythtv/libs/libmythdb/mythversion.h index c91a25bcebe..9e22b32b35c 100644 --- a/mythtv/libs/libmythdb/mythversion.h +++ b/mythtv/libs/libmythdb/mythversion.h @@ -11,7 +11,7 @@ /// Update this whenever the plug-in API changes. /// Including changes in the libmythdb, libmyth, libmythtv, libmythav* and /// libmythui class methods used by plug-ins. -#define MYTH_BINARY_VERSION "0.25.20110125-1" +#define MYTH_BINARY_VERSION "0.25.20110125-2" /** \brief Increment this whenever the MythTV network protocol changes. * diff --git a/mythtv/libs/libmythui/mythgenerictree.cpp b/mythtv/libs/libmythui/mythgenerictree.cpp index fbf1db9d43e..1be9780391c 100644 --- a/mythtv/libs/libmythui/mythgenerictree.cpp +++ b/mythtv/libs/libmythui/mythgenerictree.cpp @@ -186,32 +186,6 @@ void MythGenericTree::deleteNode(MythGenericTree *child) child = NULL; } -int MythGenericTree::calculateDepth(int start) -{ - int current_depth; - current_depth = start + 1; - - QList *children = getAllChildren(); - if (children && children->count() > 0) - { - int found_depth; - SortableMythGenericTreeList::Iterator it; - MythGenericTree *child = NULL; - - for (it = children->begin(); it != children->end(); ++it) - { - child = *it; - if (!child) - continue; - found_depth = child->calculateDepth(start + 1); - if (found_depth > current_depth) - current_depth = found_depth; - } - } - - return current_depth; -} - MythGenericTree* MythGenericTree::findLeaf() { if (m_subnodes->count() > 0) @@ -341,6 +315,16 @@ int MythGenericTree::siblingCount(void) const return 1; } +/** + * \brief Establish how deep in the current tree this node lies + */ +int MythGenericTree::currentDepth(void) +{ + QList route = getRoute(); + + return (route.size() - 1); +} + QList *MythGenericTree::getAllChildren() const { if (m_currentOrderingIndex == -1) diff --git a/mythtv/libs/libmythui/mythgenerictree.h b/mythtv/libs/libmythui/mythgenerictree.h index 22cf03702b4..25bf3f253cf 100644 --- a/mythtv/libs/libmythui/mythgenerictree.h +++ b/mythtv/libs/libmythui/mythgenerictree.h @@ -81,12 +81,12 @@ class MPUBLIC MythGenericTree void SetData(QVariant data) { m_data = data; } const QVariant GetData(void) const { return m_data; } - int calculateDepth(int start=0); - int childCount(void) const; uint visibleChildCount() const { return m_visibleCount; } int siblingCount(void) const; + int currentDepth(void); + void setSelectable(bool flag) { m_selectable = flag; } bool isSelectable() const { return m_selectable; }