X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Ftreemodel.cpp;h=0d35ef64936ecd64e2c4bd52678d52f83109b503;hp=80e7630bf0d0f151035e7c2ffaa1aa4e017afd9e;hb=e2e5327ccade6baf433598b1b25dfe99cb360028;hpb=1177f164f518b8f47b64f6736d176a995d5c17ed diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index 80e7630b..0d35ef64 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -311,6 +311,17 @@ TreeModel::TreeModel(const QList &data, QObject *parent) { rootItem = new SimpleTreeItem(data, 0); connectItem(rootItem); + + /* + connect(this, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), + this, SLOT(debug_rowsAboutToBeInserted(const QModelIndex &, int, int))); + connect(this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), + this, SLOT(debug_rowsAboutToBeRemoved(const QModelIndex &, int, int))); + connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), + this, SLOT(debug_rowsInserted(const QModelIndex &, int, int))); + connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), + this, SLOT(debug_rowsRemoved(const QModelIndex &, int, int))); + */ } TreeModel::~TreeModel() { @@ -541,3 +552,29 @@ void TreeModel::endRemoveChilds() { void TreeModel::clear() { rootItem->removeAllChilds(); } + +void TreeModel::debug_rowsAboutToBeInserted(const QModelIndex &parent, int start, int end) { + qDebug() << "debug_rowsAboutToBeInserted" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; +} + +void TreeModel::debug_rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) { + qDebug() << "debug_rowsAboutToBeRemoved" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; + QModelIndex child; + for(int i = start; i <= end; i++) { + child = parent.child(i, 0); + qDebug() << " " << child << child.data().toString(); // << static_cast(parent.child(i, 0).internalPointer())->id(); + } +} + +void TreeModel::debug_rowsInserted(const QModelIndex &parent, int start, int end) { + qDebug() << "debug_rowsInserted" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; + QModelIndex child; + for(int i = start; i <= end; i++) { + child = parent.child(i, 0); + qDebug() << " " << child << child.data().toString(); // << static_cast(parent.child(i, 0).internalPointer())->id(); + } +} + +void TreeModel::debug_rowsRemoved(const QModelIndex &parent, int start, int end) { + qDebug() << "debug_rowsRemoved" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; +}