X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.cpp;h=c487e0fb8bdd2b05003be26a1558ade0e66b5750;hp=3dfdc6da9064f3d9591c1a41bbb8c75762ee566f;hb=789f681013cdb7749c8b3347937de813bb51d3d0;hpb=d80ba4f4bc4d3e2c8f1a86354af0c3bfce711d08 diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index 3dfdc6da..c487e0fb 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -30,6 +30,10 @@ BufferModel::BufferModel(NetworkModel *parent) _selectionModelSynchronizer(this) { setSourceModel(parent); + if(QCoreApplication::instance()->arguments().contains("--debugbufferswitches")) { + connect(_selectionModelSynchronizer.selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), + this, SLOT(debug_currentChanged(const QModelIndex &, const QModelIndex &))); + } } bool BufferModel::filterAcceptsRow(int sourceRow, const QModelIndex &parent) const { @@ -65,9 +69,6 @@ void BufferModel::setCurrentIndex(const QModelIndex &newCurrent) { } void BufferModel::debug_currentChanged(QModelIndex current, QModelIndex previous) { - qDebug() << "New current:" << current << "(previous:" << previous << ")"; -} - -void BufferModel::debug_selectionChanged(QItemSelection current , QItemSelection previous) { - qDebug() << "new selection:" << current << "(previoius:" << previous << ")"; + Q_UNUSED(previous); + qDebug() << "Switched current Buffer: " << current << current.data().toString() << "Buffer:" << current.data(NetworkModel::BufferIdRole).value(); }