modernize: Use auto where the type is clear from context
[quassel.git] / src / uisupport / bufferviewfilter.cpp
index a73b091..b8b78e2 100644 (file)
@@ -39,7 +39,7 @@
 *****************************************/
 BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config)
     : QSortFilterProxyModel(model),
-    _config(0),
+    _config(nullptr),
     _sortOrder(Qt::AscendingOrder),
     _showServerQueries(false),
     _editMode(false),
@@ -68,7 +68,7 @@ void BufferViewFilter::setConfig(BufferViewConfig *config)
         return;
 
     if (_config) {
-        disconnect(_config, 0, this, 0);
+        disconnect(_config, nullptr, this, nullptr);
     }
 
     _config = config;
@@ -192,7 +192,7 @@ Qt::ItemFlags BufferViewFilter::flags(const QModelIndex &index) const
         // This DOES mean that it looks like you can merge a buffer into the Status buffer, but that is restricted in BufferView::dropEvent().
         if (bufferType == BufferInfo::StatusBuffer) {
             // But only if the layout isn't locked!
-            ClientBufferViewConfig *clientConf = qobject_cast<ClientBufferViewConfig *>(config());
+            auto *clientConf = qobject_cast<ClientBufferViewConfig *>(config());
             if (clientConf && !clientConf->isLocked()) {
                 flags |= Qt::ItemIsDropEnabled;
             }
@@ -245,7 +245,7 @@ bool BufferViewFilter::dropMimeData(const QMimeData *data, Qt::DropAction action
             if (config()->bufferList().contains(bufferId) && !config()->sortAlphabetically()) {
                 if (config()->bufferList().indexOf(bufferId) < pos)
                     pos--;
-                ClientBufferViewConfig *clientConf = qobject_cast<ClientBufferViewConfig *>(config());
+                auto *clientConf = qobject_cast<ClientBufferViewConfig *>(config());
                 if (!clientConf || !clientConf->isLocked())
                     config()->requestMoveBuffer(bufferId, pos);
             }