Esempio n. 1
0
void SortCommand::moveAfter(const SortItem &moveMe,
                            const SortItem &afterMe) {
    const QString destAddress =
        afterMe.isNull()
        // move as first child
        ? KBookmark::parentAddress(moveMe.bookmark().address()) + "/0"
        // move after "afterMe"
        : KBookmark::nextAddress(afterMe.bookmark().address());

    MoveCommand *cmd = new MoveCommand(m_model, moveMe.bookmark().address(),
                                       destAddress, QString(), this);
    cmd->redo();
}
Esempio n. 2
0
 static QString key(const SortItem &item) {
     return (item.bookmark().isGroup() ? "a" : "b")
         + (item.bookmark().fullText().toLower());
 }