Newly created buffers are now selected automatically.
[quassel.git] / src / client / buffermodel.cpp
index e0f80ed..3426632 100644 (file)
@@ -70,3 +70,8 @@ void BufferModel::mapProperty(int column, int role, QObject *target, const QByte
 QModelIndex BufferModel::currentIndex() {
   return propertyMapper()->selectionModel()->currentIndex();
 }
+
+void BufferModel::setCurrentIndex(const QModelIndex &newCurrent) {
+  standardSelectionModel()->setCurrentIndex(newCurrent, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
+  standardSelectionModel()->select(newCurrent, QItemSelectionModel::ClearAndSelect);
+}