int RemoteBranchModel::findBranchByName(const QString &name) const { const int count = branchCount(); for (int i = 0; i < count; i++) if (branchName(i) == name) return i; return -1; }
void InternalNode::print(std::ostream &os) const { os << "INTERNAL(" << branchCount() << ")" << std::endl; BOOST_FOREACH(const libbruce::node_branch &b, branches) os << " " << b.minKey << " -> " << b.nodeID << " (" << b.itemCount << (b.child ? "*" : "") << ")" << std::endl; BOOST_FOREACH(const libbruce::pending_edit &e, editQueue) os << " " << e << std::endl; }
bool LocalBranchModel::setData(const QModelIndex &index, const QVariant &value, int role) { // Verify if (role != Qt::EditRole || index.row() < branchCount()) return false; const QString branchName = value.toString(); // Delay the signal as we don't ourselves to be reset while // in setData(). if (checkNewBranchName(branchName)) { m_newBranch = branchName; QTimer::singleShot(0, this, SLOT(slotNewBranchDelayedRefresh())); } return true; }
int RemoteBranchModel::rowCount(const QModelIndex & /* parent */) const { return branchCount(); }
int LocalBranchModel::rowCount(const QModelIndex & /* parent */) const { return branchCount() + 1; }
bool LocalBranchModel::isNewBranchRow(int row) const { return row >= branchCount(); }