Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
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;
}
Example #4
0
int RemoteBranchModel::rowCount(const QModelIndex & /* parent */) const
{
    return branchCount();
}
Example #5
0
int LocalBranchModel::rowCount(const QModelIndex & /* parent */) const
{
    return branchCount() + 1;
}
Example #6
0
bool LocalBranchModel::isNewBranchRow(int row) const
{
    return row >= branchCount();
}