///
-class Toc : public std::vector<TocItem> {
+class Toc : public std::vector<TocItem>
+{
public:
typedef std::vector<TocItem>::const_iterator const_iterator;
- const_iterator Toc::item(DocIterator const & dit) const;
+ const_iterator item(DocIterator const & dit) const;
};
typedef Toc::const_iterator TocIterator;
gui_view_.tocModels().updateBackend();
}
+
/* FIXME (Ugras 17/11/06):
-I have implemented a getIndexDepth function to get the model indices. In my
+I have implemented a indexDepth function to get the model indices. In my
opinion, somebody should derive a new qvariant class for tocModelItem
-which saves the string data and depth information. that will save the
-depth calculation.
-*/
-int TocWidget::getIndexDepth(QModelIndex const & index, int depth)
+which saves the string data and depth information. That will save the
+depth calculation. */
+
+static int indexDepth(QModelIndex const & index, int depth = -1)
{
++depth;
- return (index.parent() == QModelIndex())
- ? depth : getIndexDepth(index.parent(),depth);
+ return index.parent() == QModelIndex()
+ ? depth : indexDepth(index.parent(), depth);
}
int size = indices.size();
for (int i = 0; i < size; i++) {
QModelIndex index = indices[i];
- tocTV->setExpanded(index, getIndexDepth(index) < depth_);
+ tocTV->setExpanded(index, indexDepth(index) < depth_);
}
}
///
void enableControls(bool enable = true);
///
- int getIndexDepth(QModelIndex const & index, int depth = -1);
- ///
void setTreeDepth(int depth);
///
void outline(int func_code);