modernize: Use auto where the type is clear from context
[quassel.git] / src / client / selectionmodelsynchronizer.cpp
index 6329572..d5b8f8b 100644 (file)
@@ -28,9 +28,7 @@
 SelectionModelSynchronizer::SelectionModelSynchronizer(QAbstractItemModel *parent)
     : QObject(parent),
     _model(parent),
-    _selectionModel(parent),
-    _changeCurrentEnabled(true),
-    _changeSelectionEnabled(true)
+    _selectionModel(parent)
 {
     connect(&_selectionModel, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
         this, SLOT(currentChanged(const QModelIndex &, const QModelIndex &)));
@@ -89,7 +87,7 @@ void SelectionModelSynchronizer::removeSelectionModel(QItemSelectionModel *model
 
 void SelectionModelSynchronizer::selectionModelDestroyed(QObject *object)
 {
-    QItemSelectionModel *model = static_cast<QItemSelectionModel *>(object);
+    auto *model = static_cast<QItemSelectionModel *>(object);
     QSet<QItemSelectionModel *>::iterator iter = _selectionModels.begin();
     while (iter != _selectionModels.end()) {
         if (*iter == model) {
@@ -109,7 +107,7 @@ void SelectionModelSynchronizer::syncedCurrentChanged(const QModelIndex &current
     if (!_changeCurrentEnabled)
         return;
 
-    QItemSelectionModel *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
+    auto *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
     Q_ASSERT(selectionModel);
     QModelIndex newSourceCurrent = mapToSource(current, selectionModel);
     if (newSourceCurrent.isValid() && newSourceCurrent != currentIndex())
@@ -125,7 +123,7 @@ void SelectionModelSynchronizer::syncedSelectionChanged(const QItemSelection &se
     if (!_changeSelectionEnabled)
         return;
 
-    QItemSelectionModel *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
+    auto *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
     Q_ASSERT(selectionModel);
 
     QItemSelection mappedSelection = selectionModel->selection();