UInt32 FixedHeightTreeModelLayout::getVisibleChildCount(const TreePath& path) const { if(isVisible(path) || (path.getPathCount() == 1 && isExpanded(path))) { return _TreeModel->getChildCount(path.getLastPathComponent()); } else { return 0; } }
/*public*/ NamedIcon* CatalogPane::getSelectedIcon() { if (dTree->isSelectionEmpty() || dTree->getSelectionPath() == NULL) { return NULL; } // somebody has been selected if (log->isDebugEnabled()) log->debug(tr("getSelectedIcon with %1").arg(dTree->getSelectionPath()->toString())); TreePath* path = dTree->getSelectionPath(); int level = path->getPathCount(); if (level < 3) { return NULL; } QString buf; QString name; if (((DefaultMutableTreeNode*) path->getPathComponent(1))->getUserObject().toString() == ("resources")) { // process a .jar icon buf = QString(CatalogTreeModel::resourceRoot); for (int i = 2; i < level; i++) { buf.append("/"); buf.append(/*(String) */((DefaultMutableTreeNode*) path->getPathComponent(i))->getUserObject().toString()); } } else if (((DefaultMutableTreeNode*) path->getPathComponent(1))->getUserObject().toString() == ("files")) { // process a file buf = QString(CatalogTreeModel::fileRoot); buf.append(/*(String)*/ ((DefaultMutableTreeNode*) path->getPathComponent(2))->getUserObject().toString()); for (int i = 3; i < level; i++) { buf.append(File::separator); buf.append(/*(String)*/ ((DefaultMutableTreeNode*) path->getPathComponent(i))->getUserObject().toString()); } } else { log->error(tr("unexpected first element on getSelectedIcon: %1").arg(((TreePath*)path->getPathComponent(1))->toString())); return NULL; } name = buf/*.toString()*/; if (log->isDebugEnabled()) log->debug(tr("attempt to load file from %1").arg(name)); NamedIcon* icon = NamedIcon::getIconByName(name); return icon; }