modernize: Use auto where the type is clear from context
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 9 Sep 2018 20:44:18 +0000 (22:44 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
Apply clang-tidy's modernize-use-auto fix, which uses auto where
the type would otherwise be duplicated in the line (e.g. when casting
a type, or creating an instance with 'new').

80 files changed:
src/client/buffermodel.cpp
src/client/bufferviewoverlay.cpp
src/client/client.cpp
src/client/clientauthhandler.cpp
src/client/clienttransfermanager.cpp
src/client/clientuserinputhandler.cpp
src/client/coreconnection.cpp
src/client/messagefilter.cpp
src/client/networkmodel.cpp
src/client/selectionmodelsynchronizer.cpp
src/client/treemodel.cpp
src/common/event.cpp
src/common/eventmanager.cpp
src/common/ircchannel.cpp
src/common/ircuser.cpp
src/common/quassel.cpp
src/common/remotepeer.cpp
src/common/serializers/serializers.cpp
src/common/signalproxy.cpp
src/core/core.cpp
src/core/corealiasmanager.cpp
src/core/coreauthhandler.cpp
src/core/coreignorelistmanager.cpp
src/core/coreircchannel.cpp
src/core/coreircuser.cpp
src/core/corenetwork.cpp
src/core/corenetworkconfig.cpp
src/core/coresession.cpp
src/core/coresessioneventprocessor.cpp
src/core/identserver.cpp
src/core/ircparser.cpp
src/core/postgresqlstorage.cpp
src/core/sslserver.cpp
src/qtui/bufferwidget.cpp
src/qtui/chatitem.cpp
src/qtui/chatline.cpp
src/qtui/chatlinemodelitem.cpp
src/qtui/chatmonitorview.cpp
src/qtui/chatscene.cpp
src/qtui/chatview.cpp
src/qtui/chatviewsearchbar.cpp
src/qtui/chatviewsearchcontroller.cpp
src/qtui/coreconfigwizard.cpp
src/qtui/coreconnectdlg.cpp
src/qtui/debugbufferviewoverlay.cpp
src/qtui/dockmanagernotificationbackend.cpp
src/qtui/inputwidget.cpp
src/qtui/ircconnectionwizard.cpp
src/qtui/mainpage.cpp
src/qtui/mainwin.cpp
src/qtui/nicklistwidget.cpp
src/qtui/settingsdlg.cpp
src/qtui/settingspages/bufferviewsettingspage.cpp
src/qtui/settingspages/chatmonitorsettingspage.cpp
src/qtui/settingspages/highlightsettingspage.cpp
src/qtui/settingspages/identitiessettingspage.cpp
src/qtui/settingspages/ignorelistsettingspage.cpp
src/qtui/settingspages/itemviewsettingspage.cpp
src/qtui/settingspages/keysequencewidget.cpp
src/qtui/settingspages/networkssettingspage.cpp
src/qtui/settingspages/notificationssettingspage.cpp
src/qtui/settingspages/shortcutsmodel.cpp
src/qtui/settingspages/sonnetsettingspage.cpp
src/qtui/systraynotificationbackend.cpp
src/qtui/taskbarnotificationbackend.cpp
src/qtui/topicwidget.cpp
src/uisupport/actioncollection.cpp
src/uisupport/actioncollection.h
src/uisupport/bufferview.cpp
src/uisupport/bufferviewfilter.cpp
src/uisupport/contextmenuactionprovider.cpp
src/uisupport/flatproxymodel.cpp
src/uisupport/fontselector.cpp
src/uisupport/graphicalui.cpp
src/uisupport/multilineedit.cpp
src/uisupport/networkmodelcontroller.cpp
src/uisupport/nickview.cpp
src/uisupport/tabcompleter.cpp
src/uisupport/toolbaractionprovider.cpp
src/uisupport/uistyle.cpp

index 3af4244..e5011f2 100644 (file)
@@ -70,7 +70,7 @@ void BufferModel::networkConnectionChanged(Network::ConnectionState state)
         if (currentIndex().isValid())
             return;
         {
         if (currentIndex().isValid())
             return;
         {
-            Network *net = qobject_cast<Network *>(sender());
+            auto *net = qobject_cast<Network *>(sender());
             Q_ASSERT(net);
             setCurrentIndex(mapFromSource(Client::networkModel()->networkIndex(net->networkId())));
         }
             Q_ASSERT(net);
             setCurrentIndex(mapFromSource(Client::networkModel()->networkIndex(net->networkId())));
         }
index 20d33f8..8e802fd 100644 (file)
@@ -173,7 +173,7 @@ void BufferViewOverlay::viewInitialized(BufferViewConfig *config)
 
 void BufferViewOverlay::viewInitialized()
 {
 
 void BufferViewOverlay::viewInitialized()
 {
-    BufferViewConfig *config = qobject_cast<BufferViewConfig *>(sender());
+    auto *config = qobject_cast<BufferViewConfig *>(sender());
     Q_ASSERT(config);
 
     viewInitialized(config);
     Q_ASSERT(config);
 
     viewInitialized(config);
index 3c455ae..f6e8d24 100644 (file)
@@ -222,7 +222,7 @@ void Client::coreNetworkCreated(NetworkId id)
         qWarning() << "Creation of already existing network requested!";
         return;
     }
         qWarning() << "Creation of already existing network requested!";
         return;
     }
-    Network *net = new Network(id, this);
+    auto *net = new Network(id, this);
     addNetwork(net);
 }
 
     addNetwork(net);
 }
 
@@ -283,7 +283,7 @@ void Client::removeIdentity(IdentityId id)
 void Client::coreIdentityCreated(const Identity &other)
 {
     if (!_identities.contains(other.id())) {
 void Client::coreIdentityCreated(const Identity &other)
 {
     if (!_identities.contains(other.id())) {
-        Identity *identity = new Identity(other, this);
+        auto *identity = new Identity(other, this);
         _identities[other.id()] = identity;
         identity->setInitialized();
         signalProxy()->synchronize(identity);
         _identities[other.id()] = identity;
         identity->setInitialized();
         signalProxy()->synchronize(identity);
@@ -557,7 +557,7 @@ void Client::setDisconnectedFromCore()
 
 void Client::networkDestroyed()
 {
 
 void Client::networkDestroyed()
 {
-    Network *net = static_cast<Network *>(sender());
+    auto *net = static_cast<Network *>(sender());
     QHash<NetworkId, Network *>::iterator netIter = _networks.begin();
     while (netIter != _networks.end()) {
         if (*netIter == net) {
     QHash<NetworkId, Network *>::iterator netIter = _networks.begin();
     while (netIter != _networks.end()) {
         if (*netIter == net) {
index a3fc870..acd670d 100644 (file)
@@ -58,7 +58,7 @@ void ClientAuthHandler::connectToCore()
     CoreAccountSettings s;
 
 #ifdef HAVE_SSL
     CoreAccountSettings s;
 
 #ifdef HAVE_SSL
-    QSslSocket *socket = new QSslSocket(this);
+    auto *socket = new QSslSocket(this);
     // make sure the warning is shown if we happen to connect without SSL support later
     s.setAccountValue("ShowNoClientSslWarning", true);
 #else
     // make sure the warning is shown if we happen to connect without SSL support later
     s.setAccountValue("ShowNoClientSslWarning", true);
 #else
@@ -237,8 +237,8 @@ void ClientAuthHandler::onReadyRead()
     socket()->read((char *)&reply, 4);
     reply = qFromBigEndian<quint32>(reply);
 
     socket()->read((char *)&reply, 4);
     reply = qFromBigEndian<quint32>(reply);
 
-    Protocol::Type type = static_cast<Protocol::Type>(reply & 0xff);
-    quint16 protoFeatures = static_cast<quint16>(reply>>8 & 0xffff);
+    auto type = static_cast<Protocol::Type>(reply & 0xff);
+    auto protoFeatures = static_cast<quint16>(reply>>8 & 0xffff);
     _connectionFeatures = static_cast<quint8>(reply>>24);
 
     Compressor::CompressionLevel level;
     _connectionFeatures = static_cast<quint8>(reply>>24);
 
     Compressor::CompressionLevel level;
@@ -431,7 +431,7 @@ void ClientAuthHandler::checkAndEnableSsl(bool coreSupportsSsl)
         // Make sure the warning is shown next time we don't have SSL in the core
         s.setAccountValue("ShowNoCoreSslWarning", true);
 
         // Make sure the warning is shown next time we don't have SSL in the core
         s.setAccountValue("ShowNoCoreSslWarning", true);
 
-        QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket());
+        auto *sslSocket = qobject_cast<QSslSocket *>(socket());
         Q_ASSERT(sslSocket);
         connect(sslSocket, SIGNAL(encrypted()), SLOT(onSslSocketEncrypted()));
         connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)), SLOT(onSslErrors()));
         Q_ASSERT(sslSocket);
         connect(sslSocket, SIGNAL(encrypted()), SLOT(onSslSocketEncrypted()));
         connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)), SLOT(onSslErrors()));
@@ -463,7 +463,7 @@ void ClientAuthHandler::checkAndEnableSsl(bool coreSupportsSsl)
 
 void ClientAuthHandler::onSslSocketEncrypted()
 {
 
 void ClientAuthHandler::onSslSocketEncrypted()
 {
-    QSslSocket *socket = qobject_cast<QSslSocket *>(sender());
+    auto *socket = qobject_cast<QSslSocket *>(sender());
     Q_ASSERT(socket);
 
     if (!socket->sslErrors().count()) {
     Q_ASSERT(socket);
 
     if (!socket->sslErrors().count()) {
@@ -485,7 +485,7 @@ void ClientAuthHandler::onSslSocketEncrypted()
 
 void ClientAuthHandler::onSslErrors()
 {
 
 void ClientAuthHandler::onSslErrors()
 {
-    QSslSocket *socket = qobject_cast<QSslSocket *>(sender());
+    auto *socket = qobject_cast<QSslSocket *>(sender());
     Q_ASSERT(socket);
 
     CoreAccountSettings s;
     Q_ASSERT(socket);
 
     CoreAccountSettings s;
index 9042b29..5cd4d07 100644 (file)
@@ -46,7 +46,7 @@ void ClientTransferManager::onCoreTransferAdded(const QUuid &uuid)
 
 void ClientTransferManager::onTransferInitDone()
 {
 
 void ClientTransferManager::onTransferInitDone()
 {
-    Transfer *transfer = qobject_cast<Transfer *>(sender());
+    auto *transfer = qobject_cast<Transfer *>(sender());
     Q_ASSERT(transfer);
     addTransfer(transfer);
 }
     Q_ASSERT(transfer);
     addTransfer(transfer);
 }
index 6b46682..573a28a 100644 (file)
@@ -89,7 +89,7 @@ void ClientUserInputHandler::defaultHandler(const QString &cmd, const BufferInfo
 
 void ClientUserInputHandler::handleExec(const BufferInfo &bufferInfo, const QString &execString)
 {
 
 void ClientUserInputHandler::handleExec(const BufferInfo &bufferInfo, const QString &execString)
 {
-    ExecWrapper *exec = new ExecWrapper(this); // gets suicidal when it's done
+    auto *exec = new ExecWrapper(this); // gets suicidal when it's done
     exec->start(bufferInfo, execString);
 }
 
     exec->start(bufferInfo, execString);
 }
 
index d333b53..c6f4c9f 100644 (file)
@@ -133,7 +133,7 @@ void CoreConnection::reconnectTimeout()
 void CoreConnection::networkDetectionModeChanged(const QVariant &vmode)
 {
     CoreConnectionSettings s;
 void CoreConnection::networkDetectionModeChanged(const QVariant &vmode)
 {
     CoreConnectionSettings s;
-    CoreConnectionSettings::NetworkDetectionMode mode = (CoreConnectionSettings::NetworkDetectionMode)vmode.toInt();
+    auto mode = (CoreConnectionSettings::NetworkDetectionMode)vmode.toInt();
     if (mode == CoreConnectionSettings::UsePingTimeout)
         Client::signalProxy()->setMaxHeartBeatCount(s.pingTimeoutInterval() / 30);
     else {
     if (mode == CoreConnectionSettings::UsePingTimeout)
         Client::signalProxy()->setMaxHeartBeatCount(s.pingTimeoutInterval() / 30);
     else {
@@ -375,7 +375,7 @@ void CoreConnection::connectToCurrentAccount()
             return;
         }
 
             return;
         }
 
-        InternalPeer *peer = new InternalPeer();
+        auto *peer = new InternalPeer();
         _peer = peer;
         Client::instance()->signalProxy()->addPeer(peer); // sigproxy will take ownership
         emit connectionMsg(tr("Initializing..."));
         _peer = peer;
         Client::instance()->signalProxy()->addPeer(peer); // sigproxy will take ownership
         emit connectionMsg(tr("Initializing..."));
@@ -496,7 +496,7 @@ void CoreConnection::syncToCore(const Protocol::SessionState &sessionState)
         NetworkId netid = networkid.value<NetworkId>();
         if (Client::network(netid))
             continue;
         NetworkId netid = networkid.value<NetworkId>();
         if (Client::network(netid))
             continue;
-        Network *net = new Network(netid, Client::instance());
+        auto *net = new Network(netid, Client::instance());
         _netsToSync.insert(net);
         connect(net, SIGNAL(initDone()), SLOT(networkInitDone()));
         connect(net, SIGNAL(destroyed()), SLOT(networkInitDone()));
         _netsToSync.insert(net);
         connect(net, SIGNAL(initDone()), SLOT(networkInitDone()));
         connect(net, SIGNAL(destroyed()), SLOT(networkInitDone()));
index 578f340..fd6e78b 100644 (file)
@@ -245,7 +245,7 @@ bool MessageFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourcePar
         }
 
         // Mark query as having a quit message inserted
         }
 
         // Mark query as having a quit message inserted
-        MessageFilter *that = const_cast<MessageFilter *>(this);
+        auto *that = const_cast<MessageFilter *>(this);
         that->_filteredQuitMsgTime.insert(messageTimestamp);
         return true;
     }
         that->_filteredQuitMsgTime.insert(messageTimestamp);
         return true;
     }
index 7b7f5bc..e4e2e79 100644 (file)
@@ -135,7 +135,7 @@ BufferItem *NetworkItem::bufferItem(const BufferInfo &bufferInfo)
     switch (bufferInfo.type()) {
     case BufferInfo::ChannelBuffer:
     {
     switch (bufferInfo.type()) {
     case BufferInfo::ChannelBuffer:
     {
-        ChannelBufferItem *channelBufferItem = static_cast<ChannelBufferItem *>(bufferItem);
+        auto *channelBufferItem = static_cast<ChannelBufferItem *>(bufferItem);
         if (_network) {
             IrcChannel *ircChannel = _network->ircChannel(bufferInfo.bufferName());
             if (ircChannel)
         if (_network) {
             IrcChannel *ircChannel = _network->ircChannel(bufferInfo.bufferName());
             if (ircChannel)
@@ -263,7 +263,7 @@ QString NetworkItem::toolTip(int column) const
 void NetworkItem::onBeginRemoveChilds(int start, int end)
 {
     for (int i = start; i <= end; i++) {
 void NetworkItem::onBeginRemoveChilds(int start, int end)
 {
     for (int i = start; i <= end; i++) {
-        StatusBufferItem *statusBufferItem = qobject_cast<StatusBufferItem *>(child(i));
+        auto *statusBufferItem = qobject_cast<StatusBufferItem *>(child(i));
         if (statusBufferItem) {
             _statusBufferItem = nullptr;
             break;
         if (statusBufferItem) {
             _statusBufferItem = nullptr;
             break;
@@ -486,7 +486,7 @@ StatusBufferItem::StatusBufferItem(const BufferInfo &bufferInfo, NetworkItem *pa
 
 QString StatusBufferItem::toolTip(int column) const
 {
 
 QString StatusBufferItem::toolTip(int column) const
 {
-    NetworkItem *networkItem = qobject_cast<NetworkItem *>(parent());
+    auto *networkItem = qobject_cast<NetworkItem *>(parent());
     if (networkItem)
         return networkItem->toolTip(column);
     else
     if (networkItem)
         return networkItem->toolTip(column);
     else
@@ -975,7 +975,7 @@ void ChannelBufferItem::userModeChanged(IrcUser *ircUser)
     // find the item that needs reparenting
     IrcUserItem *ircUserItem = nullptr;
     for (int i = 0; i < childCount(); i++) {
     // find the item that needs reparenting
     IrcUserItem *ircUserItem = nullptr;
     for (int i = 0; i < childCount(); i++) {
-        UserCategoryItem *oldCategoryItem = qobject_cast<UserCategoryItem *>(child(i));
+        auto *oldCategoryItem = qobject_cast<UserCategoryItem *>(child(i));
         Q_ASSERT(oldCategoryItem);
         IrcUserItem *userItem = oldCategoryItem->findIrcUser(ircUser);
         if (userItem) {
         Q_ASSERT(oldCategoryItem);
         IrcUserItem *userItem = oldCategoryItem->findIrcUser(ircUser);
         if (userItem) {
@@ -1065,7 +1065,7 @@ void UserCategoryItem::addUsers(const QList<IrcUser *> &ircUsers)
 bool UserCategoryItem::removeUser(IrcUser *ircUser)
 {
     IrcUserItem *userItem = findIrcUser(ircUser);
 bool UserCategoryItem::removeUser(IrcUser *ircUser)
 {
     IrcUserItem *userItem = findIrcUser(ircUser);
-    bool success = (bool)userItem;
+    auto success = (bool)userItem;
     if (success) {
         removeChild(userItem);
         emit dataChanged(0);
     if (success) {
         removeChild(userItem);
         emit dataChanged(0);
@@ -1271,11 +1271,11 @@ QString IrcUserItem::channelModes() const
 {
     // IrcUserItems are parented to UserCategoryItem, which are parented to ChannelBufferItem.
     // We want the channel buffer item in order to get the channel-specific user modes.
 {
     // IrcUserItems are parented to UserCategoryItem, which are parented to ChannelBufferItem.
     // We want the channel buffer item in order to get the channel-specific user modes.
-    UserCategoryItem *category = qobject_cast<UserCategoryItem *>(parent());
+    auto *category = qobject_cast<UserCategoryItem *>(parent());
     if (!category)
         return QString();
 
     if (!category)
         return QString();
 
-    ChannelBufferItem *channel = qobject_cast<ChannelBufferItem *>(category->parent());
+    auto *channel = qobject_cast<ChannelBufferItem *>(category->parent());
     if (!channel)
         return QString();
 
     if (!channel)
         return QString();
 
@@ -1439,7 +1439,7 @@ QList<QPair<NetworkId, BufferId> > NetworkModel::mimeDataToBufferList(const QMim
 
 QMimeData *NetworkModel::mimeData(const QModelIndexList &indexes) const
 {
 
 QMimeData *NetworkModel::mimeData(const QModelIndexList &indexes) const
 {
-    QMimeData *mimeData = new QMimeData();
+    auto *mimeData = new QMimeData();
 
     QStringList bufferlist;
     QString netid, uid, bufferid;
 
     QStringList bufferlist;
     QString netid, uid, bufferid;
@@ -1690,7 +1690,7 @@ NetworkId NetworkModel::networkId(BufferId bufferId) const
     if (!_bufferItemCache.contains(bufferId))
         return NetworkId();
 
     if (!_bufferItemCache.contains(bufferId))
         return NetworkId();
 
-    NetworkItem *netItem = qobject_cast<NetworkItem *>(_bufferItemCache[bufferId]->parent());
+    auto *netItem = qobject_cast<NetworkItem *>(_bufferItemCache[bufferId]->parent());
     if (netItem)
         return netItem->networkId();
     else
     if (netItem)
         return netItem->networkId();
     else
@@ -1703,7 +1703,7 @@ QString NetworkModel::networkName(BufferId bufferId) const
     if (!_bufferItemCache.contains(bufferId))
         return QString();
 
     if (!_bufferItemCache.contains(bufferId))
         return QString();
 
-    NetworkItem *netItem = qobject_cast<NetworkItem *>(_bufferItemCache[bufferId]->parent());
+    auto *netItem = qobject_cast<NetworkItem *>(_bufferItemCache[bufferId]->parent());
     if (netItem)
         return netItem->networkName();
     else
     if (netItem)
         return netItem->networkName();
     else
@@ -1718,7 +1718,7 @@ BufferId NetworkModel::bufferId(NetworkId networkId, const QString &bufferName,
         return BufferId();
 
     for (int i = 0; i < netItem->childCount(); i++) {
         return BufferId();
 
     for (int i = 0; i < netItem->childCount(); i++) {
-        BufferItem *bufferItem = qobject_cast<BufferItem *>(netItem->child(i));
+        auto *bufferItem = qobject_cast<BufferItem *>(netItem->child(i));
         if (bufferItem && !bufferItem->bufferName().compare(bufferName, cs))
             return bufferItem->bufferId();
     }
         if (bufferItem && !bufferItem->bufferName().compare(bufferName, cs))
             return bufferItem->bufferId();
     }
index 717ef4e..d5b8f8b 100644 (file)
@@ -87,7 +87,7 @@ void SelectionModelSynchronizer::removeSelectionModel(QItemSelectionModel *model
 
 void SelectionModelSynchronizer::selectionModelDestroyed(QObject *object)
 {
 
 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) {
     QSet<QItemSelectionModel *>::iterator iter = _selectionModels.begin();
     while (iter != _selectionModels.end()) {
         if (*iter == model) {
@@ -107,7 +107,7 @@ void SelectionModelSynchronizer::syncedCurrentChanged(const QModelIndex &current
     if (!_changeCurrentEnabled)
         return;
 
     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())
     Q_ASSERT(selectionModel);
     QModelIndex newSourceCurrent = mapToSource(current, selectionModel);
     if (newSourceCurrent.isValid() && newSourceCurrent != currentIndex())
@@ -123,7 +123,7 @@ void SelectionModelSynchronizer::syncedSelectionChanged(const QItemSelection &se
     if (!_changeSelectionEnabled)
         return;
 
     if (!_changeSelectionEnabled)
         return;
 
-    QItemSelectionModel *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
+    auto *selectionModel = qobject_cast<QItemSelectionModel *>(sender());
     Q_ASSERT(selectionModel);
 
     QItemSelection mappedSelection = selectionModel->selection();
     Q_ASSERT(selectionModel);
 
     QItemSelection mappedSelection = selectionModel->selection();
index 768a295..486ed6c 100644 (file)
@@ -136,7 +136,7 @@ void AbstractTreeItem::customEvent(QEvent *event)
 
     event->accept();
 
 
     event->accept();
 
-    RemoveChildLaterEvent *removeEvent = static_cast<RemoveChildLaterEvent *>(event);
+    auto *removeEvent = static_cast<RemoveChildLaterEvent *>(event);
     int childRow = _childItems.indexOf(removeEvent->child());
     if (childRow == -1)
         return;
     int childRow = _childItems.indexOf(removeEvent->child());
     if (childRow == -1)
         return;
@@ -392,7 +392,7 @@ QModelIndex TreeModel::parent(const QModelIndex &index) const
         return QModelIndex();
     }
 
         return QModelIndex();
     }
 
-    AbstractTreeItem *childItem = static_cast<AbstractTreeItem *>(index.internalPointer());
+    auto *childItem = static_cast<AbstractTreeItem *>(index.internalPointer());
     AbstractTreeItem *parentItem = childItem->parent();
 
     Q_ASSERT(parentItem);
     AbstractTreeItem *parentItem = childItem->parent();
 
     Q_ASSERT(parentItem);
@@ -438,7 +438,7 @@ QVariant TreeModel::data(const QModelIndex &index, int role) const
     if (!index.isValid())
         return QVariant();
 
     if (!index.isValid())
         return QVariant();
 
-    AbstractTreeItem *item = static_cast<AbstractTreeItem *>(index.internalPointer());
+    auto *item = static_cast<AbstractTreeItem *>(index.internalPointer());
     return item->data(index.column(), role);
 }
 
     return item->data(index.column(), role);
 }
 
@@ -448,7 +448,7 @@ bool TreeModel::setData(const QModelIndex &index, const QVariant &value, int rol
     if (!index.isValid())
         return false;
 
     if (!index.isValid())
         return false;
 
-    AbstractTreeItem *item = static_cast<AbstractTreeItem *>(index.internalPointer());
+    auto *item = static_cast<AbstractTreeItem *>(index.internalPointer());
     return item->setData(index.column(), value, role);
 }
 
     return item->setData(index.column(), value, role);
 }
 
@@ -459,7 +459,7 @@ Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const
         return rootItem->flags() & Qt::ItemIsDropEnabled;
     }
     else {
         return rootItem->flags() & Qt::ItemIsDropEnabled;
     }
     else {
-        AbstractTreeItem *item = static_cast<AbstractTreeItem *>(index.internalPointer());
+        auto *item = static_cast<AbstractTreeItem *>(index.internalPointer());
         return item->flags();
     }
 }
         return item->flags();
     }
 }
@@ -476,7 +476,7 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation, int rol
 
 void TreeModel::itemDataChanged(int column)
 {
 
 void TreeModel::itemDataChanged(int column)
 {
-    AbstractTreeItem *item = qobject_cast<AbstractTreeItem *>(sender());
+    auto *item = qobject_cast<AbstractTreeItem *>(sender());
     QModelIndex leftIndex, rightIndex;
 
     if (item == rootItem)
     QModelIndex leftIndex, rightIndex;
 
     if (item == rootItem)
@@ -514,7 +514,7 @@ void TreeModel::connectItem(AbstractTreeItem *item)
 
 void TreeModel::beginAppendChilds(int firstRow, int lastRow)
 {
 
 void TreeModel::beginAppendChilds(int firstRow, int lastRow)
 {
-    AbstractTreeItem *parentItem = qobject_cast<AbstractTreeItem *>(sender());
+    auto *parentItem = qobject_cast<AbstractTreeItem *>(sender());
     if (!parentItem) {
         qWarning() << "TreeModel::beginAppendChilds(): cannot append Children to unknown parent";
         return;
     if (!parentItem) {
         qWarning() << "TreeModel::beginAppendChilds(): cannot append Children to unknown parent";
         return;
@@ -531,7 +531,7 @@ void TreeModel::beginAppendChilds(int firstRow, int lastRow)
 
 void TreeModel::endAppendChilds()
 {
 
 void TreeModel::endAppendChilds()
 {
-    AbstractTreeItem *parentItem = qobject_cast<AbstractTreeItem *>(sender());
+    auto *parentItem = qobject_cast<AbstractTreeItem *>(sender());
     if (!parentItem) {
         qWarning() << "TreeModel::endAppendChilds(): cannot append Children to unknown parent";
         return;
     if (!parentItem) {
         qWarning() << "TreeModel::endAppendChilds(): cannot append Children to unknown parent";
         return;
@@ -553,7 +553,7 @@ void TreeModel::endAppendChilds()
 
 void TreeModel::beginRemoveChilds(int firstRow, int lastRow)
 {
 
 void TreeModel::beginRemoveChilds(int firstRow, int lastRow)
 {
-    AbstractTreeItem *parentItem = qobject_cast<AbstractTreeItem *>(sender());
+    auto *parentItem = qobject_cast<AbstractTreeItem *>(sender());
     if (!parentItem) {
         qWarning() << "TreeModel::beginRemoveChilds(): cannot append Children to unknown parent";
         return;
     if (!parentItem) {
         qWarning() << "TreeModel::beginRemoveChilds(): cannot append Children to unknown parent";
         return;
@@ -577,7 +577,7 @@ void TreeModel::beginRemoveChilds(int firstRow, int lastRow)
 
 void TreeModel::endRemoveChilds()
 {
 
 void TreeModel::endRemoveChilds()
 {
-    AbstractTreeItem *parentItem = qobject_cast<AbstractTreeItem *>(sender());
+    auto *parentItem = qobject_cast<AbstractTreeItem *>(sender());
     if (!parentItem) {
         qWarning() << "TreeModel::endRemoveChilds(): cannot remove Children from unknown parent";
         return;
     if (!parentItem) {
         qWarning() << "TreeModel::endRemoveChilds(): cannot remove Children from unknown parent";
         return;
index 4bb0221..7341b2d 100644 (file)
@@ -87,11 +87,11 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network)
         return nullptr;
     }
 
         return nullptr;
     }
 
-    EventManager::EventType type = static_cast<EventManager::EventType>(inttype);
+    auto type = static_cast<EventManager::EventType>(inttype);
     if (type == EventManager::Invalid || type == EventManager::GenericEvent)
         return nullptr;
 
     if (type == EventManager::Invalid || type == EventManager::GenericEvent)
         return nullptr;
 
-    EventManager::EventType group = static_cast<EventManager::EventType>(type & EventManager::EventGroupMask);
+    auto group = static_cast<EventManager::EventType>(type & EventManager::EventGroupMask);
 
     Event *e = nullptr;
 
 
     Event *e = nullptr;
 
index 503babf..606356d 100644 (file)
@@ -207,7 +207,7 @@ void EventManager::registerEventHandler(QList<EventType> events, QObject *object
 void EventManager::postEvent(Event *event)
 {
     if (sender() && sender()->thread() != this->thread()) {
 void EventManager::postEvent(Event *event)
 {
     if (sender() && sender()->thread() != this->thread()) {
-        QueuedQuasselEvent *queuedEvent = new QueuedQuasselEvent(event);
+        auto *queuedEvent = new QueuedQuasselEvent(event);
         QCoreApplication::postEvent(this, queuedEvent);
     }
     else {
         QCoreApplication::postEvent(this, queuedEvent);
     }
     else {
@@ -223,7 +223,7 @@ void EventManager::postEvent(Event *event)
 void EventManager::customEvent(QEvent *event)
 {
     if (event->type() == QEvent::User) {
 void EventManager::customEvent(QEvent *event)
 {
     if (event->type() == QEvent::User) {
-        QueuedQuasselEvent *queuedEvent = static_cast<QueuedQuasselEvent *>(event);
+        auto *queuedEvent = static_cast<QueuedQuasselEvent *>(event);
         processEvent(queuedEvent->event);
         event->accept();
     }
         processEvent(queuedEvent->event);
         event->accept();
     }
@@ -258,7 +258,7 @@ void EventManager::dispatchEvent(Event *event)
 
     // special handling for numeric IrcEvents
     if ((type & ~IrcEventNumericMask) == IrcEventNumeric) {
 
     // special handling for numeric IrcEvents
     if ((type & ~IrcEventNumericMask) == IrcEventNumeric) {
-        ::IrcEventNumeric *numEvent = static_cast< ::IrcEventNumeric *>(event);
+        auto *numEvent = static_cast< ::IrcEventNumeric *>(event);
         if (!numEvent)
             qWarning() << "Invalid event type for IrcEventNumeric!";
         else {
         if (!numEvent)
             qWarning() << "Invalid event type for IrcEventNumeric!";
         else {
index c4e45d5..7bb83ed 100644 (file)
@@ -424,7 +424,7 @@ void IrcChannel::initSetChanModes(const QVariantMap &channelModes)
 
 void IrcChannel::ircUserDestroyed()
 {
 
 void IrcChannel::ircUserDestroyed()
 {
-    IrcUser *ircUser = static_cast<IrcUser *>(sender());
+    auto *ircUser = static_cast<IrcUser *>(sender());
     Q_ASSERT(ircUser);
     _userModes.remove(ircUser);
     // no further propagation.
     Q_ASSERT(ircUser);
     _userModes.remove(ircUser);
     // no further propagation.
@@ -434,7 +434,7 @@ void IrcChannel::ircUserDestroyed()
 
 void IrcChannel::ircUserNickSet(QString nick)
 {
 
 void IrcChannel::ircUserNickSet(QString nick)
 {
-    IrcUser *ircUser = qobject_cast<IrcUser *>(sender());
+    auto *ircUser = qobject_cast<IrcUser *>(sender());
     Q_ASSERT(ircUser);
     emit ircUserNickSet(ircUser, nick);
 }
     Q_ASSERT(ircUser);
     emit ircUserNickSet(ircUser, nick);
 }
index 52023ef..cf1aeda 100644 (file)
@@ -362,7 +362,7 @@ void IrcUser::quit()
 void IrcUser::channelDestroyed()
 {
     // private slot!
 void IrcUser::channelDestroyed()
 {
     // private slot!
-    IrcChannel *channel = static_cast<IrcChannel *>(sender());
+    auto *channel = static_cast<IrcChannel *>(sender());
     if (_channels.contains(channel)) {
         _channels.remove(channel);
         if (_channels.isEmpty() && !network()->isMe(this))
     if (_channels.contains(channel)) {
         _channels.remove(channel);
         if (_channels.isEmpty() && !network()->isMe(this))
index f0f257c..03cf739 100644 (file)
@@ -589,8 +589,8 @@ QString Quassel::translationDirPath()
 
 void Quassel::loadTranslation(const QLocale &locale)
 {
 
 void Quassel::loadTranslation(const QLocale &locale)
 {
-    QTranslator *qtTranslator = QCoreApplication::instance()->findChild<QTranslator *>("QtTr");
-    QTranslator *quasselTranslator = QCoreApplication::instance()->findChild<QTranslator *>("QuasselTr");
+    auto *qtTranslator = QCoreApplication::instance()->findChild<QTranslator *>("QtTr");
+    auto *quasselTranslator = QCoreApplication::instance()->findChild<QTranslator *>("QuasselTr");
 
     if (qtTranslator)
         qApp->removeTranslator(qtTranslator);
 
     if (qtTranslator)
         qApp->removeTranslator(qtTranslator);
@@ -669,7 +669,7 @@ Quassel::Features::Features(const QStringList &features, LegacyFeatures legacyFe
 
 bool Quassel::Features::isEnabled(Feature feature) const
 {
 
 bool Quassel::Features::isEnabled(Feature feature) const
 {
-    size_t i = static_cast<size_t>(feature);
+    auto i = static_cast<size_t>(feature);
     return i < _features.size() ? _features[i] : false;
 }
 
     return i < _features.size() ? _features[i] : false;
 }
 
index 31783dc..d621632 100644 (file)
@@ -51,7 +51,7 @@ RemotePeer::RemotePeer(::AuthHandler *authHandler, QTcpSocket *socket, Compresso
     connect(socket, SIGNAL(disconnected()), SIGNAL(disconnected()));
 
 #ifdef HAVE_SSL
     connect(socket, SIGNAL(disconnected()), SIGNAL(disconnected()));
 
 #ifdef HAVE_SSL
-    QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
+    auto *sslSocket = qobject_cast<QSslSocket *>(socket);
     if (sslSocket)
         connect(sslSocket, SIGNAL(encrypted()), SIGNAL(secureStateChanged()));
 #endif
     if (sslSocket)
         connect(sslSocket, SIGNAL(encrypted()), SIGNAL(secureStateChanged()));
 #endif
@@ -168,7 +168,7 @@ bool RemotePeer::isSecure() const
         if (isLocal())
             return true;
 #ifdef HAVE_SSL
         if (isLocal())
             return true;
 #ifdef HAVE_SSL
-        QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket());
+        auto *sslSocket = qobject_cast<QSslSocket *>(socket());
         if (sslSocket && sslSocket->isEncrypted())
             return true;
 #endif
         if (sslSocket && sslSocket->isEncrypted())
             return true;
 #endif
@@ -260,7 +260,7 @@ bool RemotePeer::readMessage(QByteArray &msg)
 
 void RemotePeer::writeMessage(const QByteArray &msg)
 {
 
 void RemotePeer::writeMessage(const QByteArray &msg)
 {
-    quint32 size = qToBigEndian<quint32>(msg.size());
+    auto size = qToBigEndian<quint32>(msg.size());
     _compressor->write((const char*)&size, 4, Compressor::NoFlush);
     _compressor->write(msg.constData(), msg.size());
 }
     _compressor->write((const char*)&size, 4, Compressor::NoFlush);
     _compressor->write(msg.constData(), msg.size());
 }
index f0df398..5050940 100644 (file)
@@ -490,7 +490,7 @@ bool Serializers::deserialize(QDataStream &stream, const Quassel::Features &feat
         allocated += blockSize;
     }
     if ((stream.byteOrder() == QDataStream::BigEndian) != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
         allocated += blockSize;
     }
     if ((stream.byteOrder() == QDataStream::BigEndian) != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
-        uint16_t *rawData = reinterpret_cast<uint16_t *>(data.data());
+        auto *rawData = reinterpret_cast<uint16_t *>(data.data());
         while (length--) {
             *rawData = qbswap(*rawData);
             ++rawData;
         while (length--) {
             *rawData = qbswap(*rawData);
             ++rawData;
index 9a290fc..8935538 100644 (file)
@@ -388,7 +388,7 @@ void SignalProxy::objectRenamed(const QByteArray &classname, const QString &newn
 
 const QMetaObject *SignalProxy::metaObject(const QObject *obj)
 {
 
 const QMetaObject *SignalProxy::metaObject(const QObject *obj)
 {
-    if (const SyncableObject *syncObject = qobject_cast<const SyncableObject *>(obj))
+    if (const auto *syncObject = qobject_cast<const SyncableObject *>(obj))
         return syncObject->syncMetaObject();
     else
         return obj->metaObject();
         return syncObject->syncMetaObject();
     else
         return obj->metaObject();
@@ -740,7 +740,7 @@ void SignalProxy::customEvent(QEvent *event)
 {
     switch ((int)event->type()) {
     case RemovePeerEvent: {
 {
     switch ((int)event->type()) {
     case RemovePeerEvent: {
-        ::RemovePeerEvent *e = static_cast< ::RemovePeerEvent *>(event);
+        auto *e = static_cast< ::RemovePeerEvent *>(event);
         removePeer(e->peer);
         event->accept();
         break;
         removePeer(e->peer);
         event->accept();
         break;
@@ -788,7 +788,7 @@ void SignalProxy::disconnectDevice(QIODevice *dev, const QString &reason)
 {
     if (!reason.isEmpty())
         qWarning() << qPrintable(reason);
 {
     if (!reason.isEmpty())
         qWarning() << qPrintable(reason);
-    QAbstractSocket *sock  = qobject_cast<QAbstractSocket *>(dev);
+    auto *sock  = qobject_cast<QAbstractSocket *>(dev);
     if (sock)
         qWarning() << qPrintable(tr("Disconnecting")) << qPrintable(sock->peerAddress().toString());
     dev->close();
     if (sock)
         qWarning() << qPrintable(tr("Disconnecting")) << qPrintable(sock->peerAddress().toString());
     dev->close();
index 6e77294..35b46b6 100644 (file)
@@ -577,7 +577,7 @@ bool Core::initAuthenticator(const QString &backend, const QVariantMap &settings
 bool Core::sslSupported()
 {
 #ifdef HAVE_SSL
 bool Core::sslSupported()
 {
 #ifdef HAVE_SSL
-    SslServer *sslServer = qobject_cast<SslServer *>(&instance()->_server);
+    auto *sslServer = qobject_cast<SslServer *>(&instance()->_server);
     return sslServer && sslServer->isCertValid();
 #else
     return false;
     return sslServer && sslServer->isCertValid();
 #else
     return false;
@@ -588,10 +588,10 @@ bool Core::sslSupported()
 bool Core::reloadCerts()
 {
 #ifdef HAVE_SSL
 bool Core::reloadCerts()
 {
 #ifdef HAVE_SSL
-    SslServer *sslServerv4 = qobject_cast<SslServer *>(&_server);
+    auto *sslServerv4 = qobject_cast<SslServer *>(&_server);
     bool retv4 = sslServerv4->reloadCerts();
 
     bool retv4 = sslServerv4->reloadCerts();
 
-    SslServer *sslServerv6 = qobject_cast<SslServer *>(&_v6server);
+    auto *sslServerv6 = qobject_cast<SslServer *>(&_v6server);
     bool retv6 = sslServerv6->reloadCerts();
 
     return retv4 && retv6;
     bool retv6 = sslServerv6->reloadCerts();
 
     return retv4 && retv6;
@@ -736,12 +736,12 @@ void Core::stopListening(const QString &reason)
 
 void Core::incomingConnection()
 {
 
 void Core::incomingConnection()
 {
-    QTcpServer *server = qobject_cast<QTcpServer *>(sender());
+    auto *server = qobject_cast<QTcpServer *>(sender());
     Q_ASSERT(server);
     while (server->hasPendingConnections()) {
         QTcpSocket *socket = server->nextPendingConnection();
 
     Q_ASSERT(server);
     while (server->hasPendingConnections()) {
         QTcpSocket *socket = server->nextPendingConnection();
 
-        CoreAuthHandler *handler = new CoreAuthHandler(socket, this);
+        auto *handler = new CoreAuthHandler(socket, this);
         _connectingClients.insert(handler);
 
         connect(handler, SIGNAL(disconnected()), SLOT(clientDisconnected()));
         _connectingClients.insert(handler);
 
         connect(handler, SIGNAL(disconnected()), SLOT(clientDisconnected()));
@@ -760,7 +760,7 @@ void Core::incomingConnection()
 // Potentially called during the initialization phase (before handing the connection off to the session)
 void Core::clientDisconnected()
 {
 // Potentially called during the initialization phase (before handing the connection off to the session)
 void Core::clientDisconnected()
 {
-    CoreAuthHandler *handler = qobject_cast<CoreAuthHandler *>(sender());
+    auto *handler = qobject_cast<CoreAuthHandler *>(sender());
     Q_ASSERT(handler);
 
     quInfo() << qPrintable(tr("Non-authed client disconnected:")) << qPrintable(handler->socket()->peerAddress().toString());
     Q_ASSERT(handler);
 
     quInfo() << qPrintable(tr("Non-authed client disconnected:")) << qPrintable(handler->socket()->peerAddress().toString());
@@ -779,7 +779,7 @@ void Core::clientDisconnected()
 
 void Core::setupClientSession(RemotePeer *peer, UserId uid)
 {
 
 void Core::setupClientSession(RemotePeer *peer, UserId uid)
 {
-    CoreAuthHandler *handler = qobject_cast<CoreAuthHandler *>(sender());
+    auto *handler = qobject_cast<CoreAuthHandler *>(sender());
     Q_ASSERT(handler);
 
     // From now on everything is handled by the client session
     Q_ASSERT(handler);
 
     // From now on everything is handled by the client session
@@ -799,7 +799,7 @@ void Core::setupClientSession(RemotePeer *peer, UserId uid)
 void Core::customEvent(QEvent *event)
 {
     if (event->type() == AddClientEventId) {
 void Core::customEvent(QEvent *event)
 {
     if (event->type() == AddClientEventId) {
-        AddClientEvent *addClientEvent = static_cast<AddClientEvent *>(event);
+        auto *addClientEvent = static_cast<AddClientEvent *>(event);
         addClientHelper(addClientEvent->peer, addClientEvent->userId);
         return;
     }
         addClientHelper(addClientEvent->peer, addClientEvent->userId);
         return;
     }
@@ -851,7 +851,7 @@ void Core::setupInternalClientSession(QPointer<InternalPeer> clientPeer)
         return;
     }
 
         return;
     }
 
-    InternalPeer *corePeer = new InternalPeer(this);
+    auto *corePeer = new InternalPeer(this);
     corePeer->setPeer(clientPeer);
     clientPeer->setPeer(corePeer);
 
     corePeer->setPeer(clientPeer);
     clientPeer->setPeer(corePeer);
 
@@ -1181,7 +1181,7 @@ std::unique_ptr<AbstractSqlMigrationReader> Core::getMigrationReader(Storage *st
     if (!storage)
         return nullptr;
 
     if (!storage)
         return nullptr;
 
-    AbstractSqlStorage *sqlStorage = qobject_cast<AbstractSqlStorage *>(storage);
+    auto *sqlStorage = qobject_cast<AbstractSqlStorage *>(storage);
     if (!sqlStorage) {
         qDebug() << "Core::migrateDb(): only SQL based backends can be migrated!";
         return nullptr;
     if (!sqlStorage) {
         qDebug() << "Core::migrateDb(): only SQL based backends can be migrated!";
         return nullptr;
@@ -1196,7 +1196,7 @@ std::unique_ptr<AbstractSqlMigrationWriter> Core::getMigrationWriter(Storage *st
     if (!storage)
         return nullptr;
 
     if (!storage)
         return nullptr;
 
-    AbstractSqlStorage *sqlStorage = qobject_cast<AbstractSqlStorage *>(storage);
+    auto *sqlStorage = qobject_cast<AbstractSqlStorage *>(storage);
     if (!sqlStorage) {
         qDebug() << "Core::migrateDb(): only SQL based backends can be migrated!";
         return nullptr;
     if (!sqlStorage) {
         qDebug() << "Core::migrateDb(): only SQL based backends can be migrated!";
         return nullptr;
index dc6f037..0a7faa1 100644 (file)
@@ -27,7 +27,7 @@
 CoreAliasManager::CoreAliasManager(CoreSession *parent)
     : AliasManager(parent)
 {
 CoreAliasManager::CoreAliasManager(CoreSession *parent)
     : AliasManager(parent)
 {
-    CoreSession *session = qobject_cast<CoreSession *>(parent);
+    auto *session = qobject_cast<CoreSession *>(parent);
     if (!session) {
         qWarning() << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!";
         loadDefaults();
     if (!session) {
         qWarning() << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!";
         loadDefaults();
@@ -45,7 +45,7 @@ CoreAliasManager::CoreAliasManager(CoreSession *parent)
 
 void CoreAliasManager::save() const
 {
 
 void CoreAliasManager::save() const
 {
-    CoreSession *session = qobject_cast<CoreSession *>(parent());
+    auto *session = qobject_cast<CoreSession *>(parent());
     if (!session) {
         qWarning() << "CoreAliasManager: unable to save Aliases. Parent is not a Coresession!";
         return;
     if (!session) {
         qWarning() << "CoreAliasManager: unable to save Aliases. Parent is not a Coresession!";
         return;
index a4baf5f..369a134 100644 (file)
@@ -86,8 +86,8 @@ void CoreAuthHandler::onReadyRead()
         socket()->read((char*)&data, 4);
         data = qFromBigEndian<quint32>(data);
 
         socket()->read((char*)&data, 4);
         data = qFromBigEndian<quint32>(data);
 
-        Protocol::Type type = static_cast<Protocol::Type>(data & 0xff);
-        quint16 protoFeatures = static_cast<quint16>(data>>8 & 0xffff);
+        auto type = static_cast<Protocol::Type>(data & 0xff);
+        auto protoFeatures = static_cast<quint16>(data>>8 & 0xffff);
         _supportedProtos.append(PeerFactory::ProtoDescriptor(type, protoFeatures));
 
         if (data >= 0x80000000) { // last protocol
         _supportedProtos.append(PeerFactory::ProtoDescriptor(type, protoFeatures));
 
         if (data >= 0x80000000) { // last protocol
@@ -270,7 +270,7 @@ void CoreAuthHandler::handle(const Login &msg)
 void CoreAuthHandler::startSsl()
 {
     #ifdef HAVE_SSL
 void CoreAuthHandler::startSsl()
 {
     #ifdef HAVE_SSL
-    QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket());
+    auto *sslSocket = qobject_cast<QSslSocket *>(socket());
     Q_ASSERT(sslSocket);
 
     qDebug() << qPrintable(tr("Starting encryption for Client:"))  << _peer->description();
     Q_ASSERT(sslSocket);
 
     qDebug() << qPrintable(tr("Starting encryption for Client:"))  << _peer->description();
@@ -284,7 +284,7 @@ void CoreAuthHandler::startSsl()
 #ifdef HAVE_SSL
 void CoreAuthHandler::onSslErrors()
 {
 #ifdef HAVE_SSL
 void CoreAuthHandler::onSslErrors()
 {
-    QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket());
+    auto *sslSocket = qobject_cast<QSslSocket *>(socket());
     Q_ASSERT(sslSocket);
     sslSocket->ignoreSslErrors();
 }
     Q_ASSERT(sslSocket);
     sslSocket->ignoreSslErrors();
 }
index c6c3a7a..0694b86 100644 (file)
@@ -26,7 +26,7 @@
 CoreIgnoreListManager::CoreIgnoreListManager(CoreSession *parent)
     : IgnoreListManager(parent)
 {
 CoreIgnoreListManager::CoreIgnoreListManager(CoreSession *parent)
     : IgnoreListManager(parent)
 {
-    CoreSession *session = qobject_cast<CoreSession *>(parent);
+    auto *session = qobject_cast<CoreSession *>(parent);
     if (!session) {
         qWarning() << "CoreIgnoreListManager: unable to load IgnoreList. Parent is not a Coresession!";
         //loadDefaults();
     if (!session) {
         qWarning() << "CoreIgnoreListManager: unable to load IgnoreList. Parent is not a Coresession!";
         //loadDefaults();
@@ -52,7 +52,7 @@ IgnoreListManager::StrictnessType CoreIgnoreListManager::match(const RawMessage
 
 void CoreIgnoreListManager::save() const
 {
 
 void CoreIgnoreListManager::save() const
 {
-    CoreSession *session = qobject_cast<CoreSession *>(parent());
+    auto *session = qobject_cast<CoreSession *>(parent());
     if (!session) {
         qWarning() << "CoreIgnoreListManager: unable to save IgnoreList. Parent is not a Coresession!";
         return;
     if (!session) {
         qWarning() << "CoreIgnoreListManager: unable to save IgnoreList. Parent is not a Coresession!";
         return;
index 8bce68f..faf249d 100644 (file)
@@ -29,7 +29,7 @@ CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network)
     _cipher = nullptr;
 
     // Get the cipher key from CoreNetwork if present
     _cipher = nullptr;
 
     // Get the cipher key from CoreNetwork if present
-    CoreNetwork *coreNetwork = qobject_cast<CoreNetwork *>(network);
+    auto *coreNetwork = qobject_cast<CoreNetwork *>(network);
     if (coreNetwork) {
         QByteArray key = coreNetwork->readChannelCipherKey(channelname);
         if (!key.isEmpty()) {
     if (coreNetwork) {
         QByteArray key = coreNetwork->readChannelCipherKey(channelname);
         if (!key.isEmpty()) {
@@ -47,7 +47,7 @@ CoreIrcChannel::~CoreIrcChannel()
     // exists. There is no need to store the empty key if no cipher exists; no
     // key was present when instantiating and no key was set during the
     // channel's lifetime.
     // exists. There is no need to store the empty key if no cipher exists; no
     // key was present when instantiating and no key was set during the
     // channel's lifetime.
-    CoreNetwork *coreNetwork = qobject_cast<CoreNetwork *>(network());
+    auto *coreNetwork = qobject_cast<CoreNetwork *>(network());
     if (coreNetwork && _cipher) {
         coreNetwork->storeChannelCipherKey(name(), _cipher->key());
     }
     if (coreNetwork && _cipher) {
         coreNetwork->storeChannelCipherKey(name(), _cipher->key());
     }
index b9dd830..12ead6d 100644 (file)
@@ -27,7 +27,7 @@ CoreIrcUser::CoreIrcUser(const QString &hostmask, Network *network) : IrcUser(ho
     _cipher = nullptr;
 
     // Get the cipher key from CoreNetwork if present
     _cipher = nullptr;
 
     // Get the cipher key from CoreNetwork if present
-    CoreNetwork *coreNetwork = qobject_cast<CoreNetwork *>(network);
+    auto *coreNetwork = qobject_cast<CoreNetwork *>(network);
     if (coreNetwork) {
         QByteArray key = coreNetwork->readChannelCipherKey(nick().toLower());
         if (!key.isEmpty()) {
     if (coreNetwork) {
         QByteArray key = coreNetwork->readChannelCipherKey(nick().toLower());
         if (!key.isEmpty()) {
@@ -48,7 +48,7 @@ CoreIrcUser::~CoreIrcUser()
     // exists. There is no need to store the empty key if no cipher exists; no
     // key was present when instantiating and no key was set during the
     // channel's lifetime.
     // exists. There is no need to store the empty key if no cipher exists; no
     // key was present when instantiating and no key was set during the
     // channel's lifetime.
-    CoreNetwork *coreNetwork = qobject_cast<CoreNetwork *>(network());
+    auto *coreNetwork = qobject_cast<CoreNetwork *>(network());
     if (coreNetwork && _cipher) {
         coreNetwork->storeChannelCipherKey(nick().toLower(), _cipher->key());
     }
     if (coreNetwork && _cipher) {
         coreNetwork->storeChannelCipherKey(nick().toLower(), _cipher->key());
     }
index 143760f..f0a4e30 100644 (file)
@@ -443,11 +443,11 @@ Cipher *CoreNetwork::cipher(const QString &target)
     if (!Cipher::neededFeaturesAvailable())
         return nullptr;
 
     if (!Cipher::neededFeaturesAvailable())
         return nullptr;
 
-    CoreIrcChannel *channel = qobject_cast<CoreIrcChannel *>(ircChannel(target));
+    auto *channel = qobject_cast<CoreIrcChannel *>(ircChannel(target));
     if (channel) {
         return channel->cipher();
     }
     if (channel) {
         return channel->cipher();
     }
-    CoreIrcUser *user = qobject_cast<CoreIrcUser *>(ircUser(target));
+    auto *user = qobject_cast<CoreIrcUser *>(ircUser(target));
     if (user) {
         return user->cipher();
     } else if (!isChannelName(target)) {
     if (user) {
         return user->cipher();
     } else if (!isChannelName(target)) {
@@ -459,11 +459,11 @@ Cipher *CoreNetwork::cipher(const QString &target)
 
 QByteArray CoreNetwork::cipherKey(const QString &target) const
 {
 
 QByteArray CoreNetwork::cipherKey(const QString &target) const
 {
-    CoreIrcChannel *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
+    auto *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
     if (c)
         return c->cipher()->key();
 
     if (c)
         return c->cipher()->key();
 
-    CoreIrcUser *u = qobject_cast<CoreIrcUser*>(ircUser(target));
+    auto *u = qobject_cast<CoreIrcUser*>(ircUser(target));
     if (u)
         return u->cipher()->key();
 
     if (u)
         return u->cipher()->key();
 
@@ -473,14 +473,14 @@ QByteArray CoreNetwork::cipherKey(const QString &target) const
 
 void CoreNetwork::setCipherKey(const QString &target, const QByteArray &key)
 {
 
 void CoreNetwork::setCipherKey(const QString &target, const QByteArray &key)
 {
-    CoreIrcChannel *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
+    auto *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
     if (c) {
         c->setEncrypted(c->cipher()->setKey(key));
         coreSession()->setBufferCipher(networkId(), target, key);
         return;
     }
 
     if (c) {
         c->setEncrypted(c->cipher()->setKey(key));
         coreSession()->setBufferCipher(networkId(), target, key);
         return;
     }
 
-    CoreIrcUser *u = qobject_cast<CoreIrcUser*>(ircUser(target));
+    auto *u = qobject_cast<CoreIrcUser*>(ircUser(target));
     if (!u && !isChannelName(target))
         u = qobject_cast<CoreIrcUser*>(newIrcUser(target));
 
     if (!u && !isChannelName(target))
         u = qobject_cast<CoreIrcUser*>(newIrcUser(target));
 
@@ -494,10 +494,10 @@ void CoreNetwork::setCipherKey(const QString &target, const QByteArray &key)
 
 bool CoreNetwork::cipherUsesCBC(const QString &target)
 {
 
 bool CoreNetwork::cipherUsesCBC(const QString &target)
 {
-    CoreIrcChannel *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
+    auto *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
     if (c)
         return c->cipher()->usesCBC();
     if (c)
         return c->cipher()->usesCBC();
-    CoreIrcUser *u = qobject_cast<CoreIrcUser*>(ircUser(target));
+    auto *u = qobject_cast<CoreIrcUser*>(ircUser(target));
     if (u)
         return u->cipher()->usesCBC();
 
     if (u)
         return u->cipher()->usesCBC();
 
index 3ae0ae0..faab93e 100644 (file)
@@ -38,7 +38,7 @@ CoreNetworkConfig::CoreNetworkConfig(const QString &objectName, CoreSession *ses
 
 void CoreNetworkConfig::save()
 {
 
 void CoreNetworkConfig::save()
 {
-    CoreSession *session = qobject_cast<CoreSession *>(parent());
+    auto *session = qobject_cast<CoreSession *>(parent());
     if (!session) {
         qWarning() << Q_FUNC_INFO << "No CoreSession set, cannot save network configuration!";
         return;
     if (!session) {
         qWarning() << Q_FUNC_INFO << "No CoreSession set, cannot save network configuration!";
         return;
index faec85d..ab4859b 100644 (file)
@@ -275,7 +275,7 @@ void CoreSession::addClient(InternalPeer *peer)
 
 void CoreSession::removeClient(Peer *peer)
 {
 
 void CoreSession::removeClient(Peer *peer)
 {
-    RemotePeer *p = qobject_cast<RemotePeer *>(peer);
+    auto *p = qobject_cast<RemotePeer *>(peer);
     if (p)
         quInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
     _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
     if (p)
         quInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
     _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
@@ -344,7 +344,7 @@ void CoreSession::recvMessageFromServer(NetworkId networkId, Message::Type type,
 
 void CoreSession::recvStatusMsgFromServer(QString msg)
 {
 
 void CoreSession::recvStatusMsgFromServer(QString msg)
 {
-    CoreNetwork *net = qobject_cast<CoreNetwork *>(sender());
+    auto *net = qobject_cast<CoreNetwork *>(sender());
     Q_ASSERT(net);
     emit displayStatusMsg(net->networkName(), msg);
 }
     Q_ASSERT(net);
     emit displayStatusMsg(net->networkName(), msg);
 }
@@ -562,7 +562,7 @@ const QString CoreSession::strictCompliantIdent(const CoreIdentity *identity) {
 
 void CoreSession::createIdentity(const CoreIdentity &identity)
 {
 
 void CoreSession::createIdentity(const CoreIdentity &identity)
 {
-    CoreIdentity *coreIdentity = new CoreIdentity(identity, this);
+    auto *coreIdentity = new CoreIdentity(identity, this);
     _identities[identity.id()] = coreIdentity;
     // CoreIdentity has its own synchronize method since its "private" sslManager needs to be synced as well
     coreIdentity->synchronize(signalProxy());
     _identities[identity.id()] = coreIdentity;
     // CoreIdentity has its own synchronize method since its "private" sslManager needs to be synced as well
     coreIdentity->synchronize(signalProxy());
@@ -573,7 +573,7 @@ void CoreSession::createIdentity(const CoreIdentity &identity)
 
 void CoreSession::updateIdentityBySender()
 {
 
 void CoreSession::updateIdentityBySender()
 {
-    CoreIdentity *identity = qobject_cast<CoreIdentity *>(sender());
+    auto *identity = qobject_cast<CoreIdentity *>(sender());
     if (!identity)
         return;
     Core::updateIdentity(user(), *identity);
     if (!identity)
         return;
     Core::updateIdentity(user(), *identity);
index 04233f3..31e7cf2 100644 (file)
@@ -801,7 +801,7 @@ void CoreSessionEventProcessor::processKeyEvent(KeyEvent *e)
         emit newEvent(new MessageEvent(Message::Error, e->network(), tr("Unable to perform key exchange, missing qca-ossl plugin."), e->prefix(), e->target(), Message::None, e->timestamp()));
         return;
     }
         emit newEvent(new MessageEvent(Message::Error, e->network(), tr("Unable to perform key exchange, missing qca-ossl plugin."), e->prefix(), e->target(), Message::None, e->timestamp()));
         return;
     }
-    CoreNetwork *net = qobject_cast<CoreNetwork*>(e->network());
+    auto *net = qobject_cast<CoreNetwork*>(e->network());
     Cipher *c = net->cipher(e->target());
     if (!c) // happens when there is no CoreIrcChannel for the target (i.e. never?)
         return;
     Cipher *c = net->cipher(e->target());
     if (!c) // happens when there is no CoreIrcChannel for the target (i.e. never?)
         return;
@@ -1478,7 +1478,7 @@ void CoreSessionEventProcessor::handleEarlyNetsplitJoin(Network *net, const QStr
 
 void CoreSessionEventProcessor::handleNetsplitFinished()
 {
 
 void CoreSessionEventProcessor::handleNetsplitFinished()
 {
-    Netsplit *n = qobject_cast<Netsplit *>(sender());
+    auto *n = qobject_cast<Netsplit *>(sender());
     Q_ASSERT(n);
     QHash<QString, Netsplit *> splithash  = _netsplits.take(n->network());
     splithash.remove(splithash.key(n));
     Q_ASSERT(n);
     QHash<QString, Netsplit *> splithash  = _netsplits.take(n->network());
     splithash.remove(splithash.key(n));
index 5e72874..8a52520 100644 (file)
@@ -101,7 +101,7 @@ void IdentServer::incomingConnection()
 
 void IdentServer::respond()
 {
 
 void IdentServer::respond()
 {
-    QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
+    auto *socket = qobject_cast<QTcpSocket *>(sender());
     Q_ASSERT(socket);
 
     qint64 transactionId = _socketId;
     Q_ASSERT(socket);
 
     qint64 transactionId = _socketId;
index 25d16f8..5c6fce7 100644 (file)
@@ -82,7 +82,7 @@ QByteArray IrcParser::decrypt(Network *network, const QString &bufferName, const
 /* used to be handleServerMsg()                                  */
 void IrcParser::processNetworkIncoming(NetworkDataEvent *e)
 {
 /* used to be handleServerMsg()                                  */
 void IrcParser::processNetworkIncoming(NetworkDataEvent *e)
 {
-    CoreNetwork *net = qobject_cast<CoreNetwork *>(e->network());
+    auto *net = qobject_cast<CoreNetwork *>(e->network());
     if (!net) {
         qWarning() << "Received network event without valid network pointer!";
         return;
     if (!net) {
         qWarning() << "Received network event without valid network pointer!";
         return;
index 6b97104..c414b87 100644 (file)
@@ -1583,7 +1583,7 @@ int PostgreSqlStorage::highlightCount(BufferId bufferId, MsgId lastSeenMsgId)
     query.bindValue(":lastseenmsgid", lastSeenMsgId.toQint64());
     safeExec(query);
     watchQuery(query);
     query.bindValue(":lastseenmsgid", lastSeenMsgId.toQint64());
     safeExec(query);
     watchQuery(query);
-    int result = int(0);
+    auto result = int(0);
     if (query.first())
         result = query.value(0).toInt();
     return result;
     if (query.first())
         result = query.value(0).toInt();
     return result;
index 1d5a103..b8c010f 100644 (file)
@@ -73,7 +73,7 @@ QTcpSocket *SslServer::nextPendingConnection()
 
 void SslServer::incomingConnection(qintptr socketDescriptor)
 {
 
 void SslServer::incomingConnection(qintptr socketDescriptor)
 {
-    QSslSocket *serverSocket = new QSslSocket(this);
+    auto *serverSocket = new QSslSocket(this);
     if (serverSocket->setSocketDescriptor(socketDescriptor)) {
         if (isCertValid()) {
             serverSocket->setLocalCertificate(_cert);
     if (serverSocket->setSocketDescriptor(socketDescriptor)) {
         if (isCertValid()) {
             serverSocket->setLocalCertificate(_cert);
index aa700f9..f7af483 100644 (file)
@@ -75,26 +75,26 @@ BufferWidget::BufferWidget(QWidget *parent)
 
     ActionCollection *coll = QtUi::actionCollection();
 
 
     ActionCollection *coll = QtUi::actionCollection();
 
-    Action *zoomInChatview = coll->add<Action>("ZoomInChatView", this, SLOT(zoomIn()));
+    auto *zoomInChatview = coll->add<Action>("ZoomInChatView", this, SLOT(zoomIn()));
     zoomInChatview->setText(tr("Zoom In"));
     zoomInChatview->setIcon(icon::get("zoom-in"));
     zoomInChatview->setShortcut(QKeySequence::ZoomIn);
 
     zoomInChatview->setText(tr("Zoom In"));
     zoomInChatview->setIcon(icon::get("zoom-in"));
     zoomInChatview->setShortcut(QKeySequence::ZoomIn);
 
-    Action *zoomOutChatview = coll->add<Action>("ZoomOutChatView", this, SLOT(zoomOut()));
+    auto *zoomOutChatview = coll->add<Action>("ZoomOutChatView", this, SLOT(zoomOut()));
     zoomOutChatview->setIcon(icon::get("zoom-out"));
     zoomOutChatview->setText(tr("Zoom Out"));
     zoomOutChatview->setShortcut(QKeySequence::ZoomOut);
 
     zoomOutChatview->setIcon(icon::get("zoom-out"));
     zoomOutChatview->setText(tr("Zoom Out"));
     zoomOutChatview->setShortcut(QKeySequence::ZoomOut);
 
-    Action *zoomOriginalChatview = coll->add<Action>("ZoomOriginalChatView", this, SLOT(zoomOriginal()));
+    auto *zoomOriginalChatview = coll->add<Action>("ZoomOriginalChatView", this, SLOT(zoomOriginal()));
     zoomOriginalChatview->setIcon(icon::get("zoom-original"));
     zoomOriginalChatview->setText(tr("Actual Size"));
     //zoomOriginalChatview->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); // used for RTS switching
 
     zoomOriginalChatview->setIcon(icon::get("zoom-original"));
     zoomOriginalChatview->setText(tr("Actual Size"));
     //zoomOriginalChatview->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); // used for RTS switching
 
-    Action *setMarkerLine = coll->add<Action>("SetMarkerLineToBottom", this, SLOT(setMarkerLine()));
+    auto *setMarkerLine = coll->add<Action>("SetMarkerLineToBottom", this, SLOT(setMarkerLine()));
     setMarkerLine->setText(tr("Set Marker Line"));
     setMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
 
     setMarkerLine->setText(tr("Set Marker Line"));
     setMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
 
-    Action *jumpToMarkerLine = QtUi::actionCollection("Navigation")->add<Action>("JumpToMarkerLine", this, SLOT(jumpToMarkerLine()));
+    auto *jumpToMarkerLine = QtUi::actionCollection("Navigation")->add<Action>("JumpToMarkerLine", this, SLOT(jumpToMarkerLine()));
     jumpToMarkerLine->setText(tr("Go to Marker Line"));
     jumpToMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_K));
 
     jumpToMarkerLine->setText(tr("Go to Marker Line"));
     jumpToMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_K));
 
@@ -150,7 +150,7 @@ void BufferWidget::showChatView(BufferId id)
         ui.stackedWidget->setCurrentWidget(ui.page);
     }
     else {
         ui.stackedWidget->setCurrentWidget(ui.page);
     }
     else {
-        ChatView *view = qobject_cast<ChatView *>(_chatViews.value(id));
+        auto *view = qobject_cast<ChatView *>(_chatViews.value(id));
         Q_ASSERT(view);
         ui.stackedWidget->setCurrentWidget(view);
         _chatViewSearchController->setScene(view->scene());
         Q_ASSERT(view);
         ui.stackedWidget->setCurrentWidget(view);
         _chatViewSearchController->setScene(view->scene());
@@ -160,7 +160,7 @@ void BufferWidget::showChatView(BufferId id)
 
 void BufferWidget::scrollToHighlight(QGraphicsItem *highlightItem)
 {
 
 void BufferWidget::scrollToHighlight(QGraphicsItem *highlightItem)
 {
-    ChatView *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+    auto *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
     if (view) {
         view->centerOn(highlightItem);
     }
     if (view) {
         view->centerOn(highlightItem);
     }
@@ -169,7 +169,7 @@ void BufferWidget::scrollToHighlight(QGraphicsItem *highlightItem)
 
 void BufferWidget::zoomIn()
 {
 
 void BufferWidget::zoomIn()
 {
-    ChatView *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+    auto *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
     if (view)
         view->zoomIn();
 }
     if (view)
         view->zoomIn();
 }
@@ -177,7 +177,7 @@ void BufferWidget::zoomIn()
 
 void BufferWidget::zoomOut()
 {
 
 void BufferWidget::zoomOut()
 {
-    ChatView *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+    auto *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
     if (view)
         view->zoomOut();
 }
     if (view)
         view->zoomOut();
 }
@@ -185,7 +185,7 @@ void BufferWidget::zoomOut()
 
 void BufferWidget::zoomOriginal()
 {
 
 void BufferWidget::zoomOriginal()
 {
-    ChatView *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+    auto *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
     if (view)
         view->zoomOriginal();
 }
     if (view)
         view->zoomOriginal();
 }
@@ -207,9 +207,9 @@ bool BufferWidget::eventFilter(QObject *watched, QEvent *event)
     if (event->type() != QEvent::KeyPress)
         return false;
 
     if (event->type() != QEvent::KeyPress)
         return false;
 
-    QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+    auto *keyEvent = static_cast<QKeyEvent *>(event);
 
 
-    MultiLineEdit *inputLine = qobject_cast<MultiLineEdit *>(watched);
+    auto *inputLine = qobject_cast<MultiLineEdit *>(watched);
     if (!inputLine)
         return false;
 
     if (!inputLine)
         return false;
 
@@ -217,7 +217,7 @@ bool BufferWidget::eventFilter(QObject *watched, QEvent *event)
     if (keyEvent == QKeySequence::Copy) {
         if (inputLine->hasSelectedText())
             return false;
     if (keyEvent == QKeySequence::Copy) {
         if (inputLine->hasSelectedText())
             return false;
-        ChatView *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+        auto *view = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
         if (view)
             view->scene()->selectionToClipboard();
         return true;
         if (view)
             view->scene()->selectionToClipboard();
         return true;
@@ -245,12 +245,12 @@ bool BufferWidget::eventFilter(QObject *watched, QEvent *event)
 
 void BufferWidget::currentChanged(const QModelIndex &current, const QModelIndex &previous)
 {
 
 void BufferWidget::currentChanged(const QModelIndex &current, const QModelIndex &previous)
 {
-    ChatView *prevView = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+    auto *prevView = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
 
     AbstractBufferContainer::currentChanged(current, previous); // switch first to avoid a redraw
 
     // we need to hide the marker line if it's already/still at the bottom of the view (and not scrolled up)
 
     AbstractBufferContainer::currentChanged(current, previous); // switch first to avoid a redraw
 
     // we need to hide the marker line if it's already/still at the bottom of the view (and not scrolled up)
-    ChatView *curView = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
+    auto *curView = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget());
     if (curView) {
         BufferId curBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
         if (curBufferId.isValid()) {
     if (curView) {
         BufferId curBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
         if (curBufferId.isValid()) {
index b88ac27..cda1fd8 100644 (file)
@@ -297,7 +297,7 @@ QVector<QTextLayout::FormatRange> ChatItem::additionalFormats() const
     using Label = UiStyle::MessageLabel;
     using Format = UiStyle::Format;
 
     using Label = UiStyle::MessageLabel;
     using Format = UiStyle::Format;
 
-    Label itemLabel = data(ChatLineModel::MsgLabelRole).value<Label>();
+    auto itemLabel = data(ChatLineModel::MsgLabelRole).value<Label>();
     const auto &fmtList = formatList();
 
     struct LabelFormat {
     const auto &fmtList = formatList();
 
     struct LabelFormat {
@@ -660,7 +660,7 @@ void ContentsChatItem::clearCache()
 ContentsChatItemPrivate *ContentsChatItem::privateData() const
 {
     if (!_data) {
 ContentsChatItemPrivate *ContentsChatItem::privateData() const
 {
     if (!_data) {
-        ContentsChatItem *that = const_cast<ContentsChatItem *>(this);
+        auto *that = const_cast<ContentsChatItem *>(this);
         that->_data = new ContentsChatItemPrivate(ClickableList::fromString(data(ChatLineModel::DisplayRole).toString()), that);
     }
     return _data;
         that->_data = new ContentsChatItemPrivate(ClickableList::fromString(data(ChatLineModel::DisplayRole).toString()), that);
     }
     return _data;
index 5aba191..2c3cda5 100644 (file)
@@ -215,7 +215,7 @@ void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
     const QAbstractItemModel *model_ = model();
     QModelIndex myIdx = model_->index(row(), 0);
     Message::Type type = (Message::Type)myIdx.data(MessageModel::TypeRole).toInt();
     const QAbstractItemModel *model_ = model();
     QModelIndex myIdx = model_->index(row(), 0);
     Message::Type type = (Message::Type)myIdx.data(MessageModel::TypeRole).toInt();
-    UiStyle::MessageLabel label = myIdx.data(ChatLineModel::MsgLabelRole).value<UiStyle::MessageLabel>();
+    auto label = myIdx.data(ChatLineModel::MsgLabelRole).value<UiStyle::MessageLabel>();
 
     QTextCharFormat msgFmt = QtUi::style()->format({UiStyle::formatType(type), {}, {}}, label);
     if (msgFmt.hasProperty(QTextFormat::BackgroundBrush)) {
 
     QTextCharFormat msgFmt = QtUi::style()->format({UiStyle::formatType(type), {}, {}}, label);
     if (msgFmt.hasProperty(QTextFormat::BackgroundBrush)) {
index 0524d08..1451858 100644 (file)
@@ -79,7 +79,7 @@ QVariant ChatLineModelItem::data(int column, int role) const
         return QVariant::fromValue<UiStyle::MessageLabel>(messageLabel());
 
     QVariant variant;
         return QVariant::fromValue<UiStyle::MessageLabel>(messageLabel());
 
     QVariant variant;
-    MessageModel::ColumnType col = (MessageModel::ColumnType)column;
+    auto col = (MessageModel::ColumnType)column;
     switch (col) {
     case ChatLineModel::TimestampColumn:
         variant = timestampData(role);
     switch (col) {
     case ChatLineModel::TimestampColumn:
         variant = timestampData(role);
@@ -160,7 +160,7 @@ UiStyle::MessageLabel ChatLineModelItem::messageLabel() const
 {
     using MessageLabel = UiStyle::MessageLabel;
 
 {
     using MessageLabel = UiStyle::MessageLabel;
 
-    MessageLabel label = static_cast<MessageLabel>(_styledMsg.senderHash() << 16);
+    auto label = static_cast<MessageLabel>(_styledMsg.senderHash() << 16);
     if (_styledMsg.flags() & Message::Self)
         label |= MessageLabel::OwnMsg;
     if (_styledMsg.flags() & Message::Highlight)
     if (_styledMsg.flags() & Message::Self)
         label |= MessageLabel::OwnMsg;
     if (_styledMsg.flags() & Message::Highlight)
index 932e2ab..d337cfc 100644 (file)
@@ -101,7 +101,7 @@ void ChatMonitorView::mouseDoubleClickEvent(QMouseEvent *event)
 
 void ChatMonitorView::showFieldsChanged(bool checked)
 {
 
 void ChatMonitorView::showFieldsChanged(bool checked)
 {
-    QAction *showAction = qobject_cast<QAction *>(sender());
+    auto *showAction = qobject_cast<QAction *>(sender());
     if (!showAction)
         return;
 
     if (!showAction)
         return;
 
index 1544284..70c3b64 100644 (file)
@@ -80,7 +80,7 @@ ChatScene::ChatScene(QAbstractItemModel *model, QString idString, qreal width, C
     _clickHandled(true),
     _leftButtonPressed(false)
 {
     _clickHandled(true),
     _leftButtonPressed(false)
 {
-    MessageFilter *filter = qobject_cast<MessageFilter *>(model);
+    auto *filter = qobject_cast<MessageFilter *>(model);
     if (filter && filter->isSingleBufferFilter()) {
         _singleBufferId = filter->singleBufferId();
     }
     if (filter && filter->isSingleBufferFilter()) {
         _singleBufferId = filter->singleBufferId();
     }
@@ -185,7 +185,7 @@ ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange
     QList<ChatLine *>::ConstIterator end = _lines.end();
     QList<ChatLine *>::ConstIterator middle;
 
     QList<ChatLine *>::ConstIterator end = _lines.end();
     QList<ChatLine *>::ConstIterator middle;
 
-    int n = int(end - start);
+    auto n = int(end - start);
     int half;
 
     while (n > 0) {
     int half;
 
     while (n > 0) {
@@ -238,7 +238,7 @@ ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange
 ChatItem *ChatScene::chatItemAt(const QPointF &scenePos) const
 {
     foreach(QGraphicsItem *item, items(scenePos, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder)) {
 ChatItem *ChatScene::chatItemAt(const QPointF &scenePos) const
 {
     foreach(QGraphicsItem *item, items(scenePos, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder)) {
-        ChatLine *line = qgraphicsitem_cast<ChatLine *>(item);
+        auto *line = qgraphicsitem_cast<ChatLine *>(item);
         if (line)
             return line->itemAt(line->mapFromScene(scenePos));
     }
         if (line)
             return line->itemAt(line->mapFromScene(scenePos));
     }
@@ -248,7 +248,7 @@ ChatItem *ChatScene::chatItemAt(const QPointF &scenePos) const
 
 bool ChatScene::containsBuffer(const BufferId &id) const
 {
 
 bool ChatScene::containsBuffer(const BufferId &id) const
 {
-    MessageFilter *filter = qobject_cast<MessageFilter *>(model());
+    auto *filter = qobject_cast<MessageFilter *>(model());
     if (filter)
         return filter->containsBuffer(id);
     else
     if (filter)
         return filter->containsBuffer(id);
     else
@@ -370,7 +370,7 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end)
 
     if (atTop) {
         for (int i = end; i >= start; i--) {
 
     if (atTop) {
         for (int i = end; i >= start; i--) {
-            ChatLine *line = new ChatLine(i, model(),
+            auto *line = new ChatLine(i, model(),
                 width,
                 timestampWidth, senderWidth, contentsWidth,
                 senderPos, contentsPos);
                 width,
                 timestampWidth, senderWidth, contentsWidth,
                 senderPos, contentsPos);
@@ -382,7 +382,7 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end)
     }
     else {
         for (int i = start; i <= end; i++) {
     }
     else {
         for (int i = start; i <= end; i++) {
-            ChatLine *line = new ChatLine(i, model(),
+            auto *line = new ChatLine(i, model(),
                 width,
                 timestampWidth, senderWidth, contentsWidth,
                 senderPos, contentsPos);
                 width,
                 timestampWidth, senderWidth, contentsWidth,
                 senderPos, contentsPos);
@@ -735,8 +735,8 @@ void ChatScene::updateSelection(const QPointF &pos)
 {
     int curRow = rowByScenePos(pos);
     if (curRow < 0) return;
 {
     int curRow = rowByScenePos(pos);
     if (curRow < 0) return;
-    int curColumn = (int)columnByScenePos(pos);
-    ChatLineModel::ColumnType minColumn = (ChatLineModel::ColumnType)qMin(curColumn, _selectionStartCol);
+    auto curColumn = (int)columnByScenePos(pos);
+    auto minColumn = (ChatLineModel::ColumnType)qMin(curColumn, _selectionStartCol);
     if (minColumn != _selectionMinCol) {
         _selectionMinCol = minColumn;
         for (int l = qMin(_selectionStart, _selectionEnd); l <= qMax(_selectionStart, _selectionEnd); l++) {
     if (minColumn != _selectionMinCol) {
         _selectionMinCol = minColumn;
         for (int l = qMin(_selectionStart, _selectionEnd); l <= qMax(_selectionStart, _selectionEnd); l++) {
@@ -973,8 +973,8 @@ void ChatScene::handleClick(Qt::MouseButton button, const QPointF &scenePos)
 
 void ChatScene::initiateDrag(QWidget *source)
 {
 
 void ChatScene::initiateDrag(QWidget *source)
 {
-    QDrag *drag = new QDrag(source);
-    QMimeData *mimeData = new QMimeData;
+    auto *drag = new QDrag(source);
+    auto *mimeData = new QMimeData;
     mimeData->setText(selection());
     drag->setMimeData(mimeData);
 
     mimeData->setText(selection());
     drag->setMimeData(mimeData);
 
@@ -1124,7 +1124,7 @@ void ChatScene::webSearchOnSelection()
 
 void ChatScene::requestBacklog()
 {
 
 void ChatScene::requestBacklog()
 {
-    MessageFilter *filter = qobject_cast<MessageFilter *>(model());
+    auto *filter = qobject_cast<MessageFilter *>(model());
     if (filter)
         return filter->requestBacklog();
     return;
     if (filter)
         return filter->requestBacklog();
     return;
@@ -1148,7 +1148,7 @@ int ChatScene::rowByScenePos(qreal y) const
 
     // ChatLine should be at the bottom of the list
     for (int i = itemList.count()-1; i >= 0; i--) {
 
     // ChatLine should be at the bottom of the list
     for (int i = itemList.count()-1; i >= 0; i--) {
-        ChatLine *line = qgraphicsitem_cast<ChatLine *>(itemList.at(i));
+        auto *line = qgraphicsitem_cast<ChatLine *>(itemList.at(i));
         if (line)
             return line->row();
     }
         if (line)
             return line->row();
     }
index 46ec7be..7b60ba8 100644 (file)
@@ -40,7 +40,7 @@ ChatView::ChatView(BufferId bufferId, QWidget *parent)
 {
     QList<BufferId> filterList;
     filterList.append(bufferId);
 {
     QList<BufferId> filterList;
     filterList.append(bufferId);
-    MessageFilter *filter = new MessageFilter(Client::messageModel(), filterList, this);
+    auto *filter = new MessageFilter(Client::messageModel(), filterList, this);
     init(filter);
 }
 
     init(filter);
 }
 
@@ -94,7 +94,7 @@ void ChatView::init(MessageFilter *filter)
 bool ChatView::event(QEvent *event)
 {
     if (event->type() == QEvent::KeyPress) {
 bool ChatView::event(QEvent *event)
 {
     if (event->type() == QEvent::KeyPress) {
-        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+        auto *keyEvent = static_cast<QKeyEvent *>(event);
         switch (keyEvent->key()) {
         case Qt::Key_Up:
         case Qt::Key_Down:
         switch (keyEvent->key()) {
         case Qt::Key_Up:
         case Qt::Key_Down:
@@ -294,7 +294,7 @@ QSet<ChatLine *> ChatView::visibleChatLines(Qt::ItemSelectionMode mode) const
 {
     QSet<ChatLine *> result;
     foreach(QGraphicsItem *item, items(viewport()->rect().adjusted(-1, -1, 1, 1), mode)) {
 {
     QSet<ChatLine *> result;
     foreach(QGraphicsItem *item, items(viewport()->rect().adjusted(-1, -1, 1, 1), mode)) {
-        ChatLine *line = qgraphicsitem_cast<ChatLine *>(item);
+        auto *line = qgraphicsitem_cast<ChatLine *>(item);
         if (line)
             result.insert(line);
     }
         if (line)
             result.insert(line);
     }
@@ -369,7 +369,7 @@ void ChatView::jumpToMarkerLine(bool requestBacklog)
 void ChatView::addActionsToMenu(QMenu *menu, const QPointF &pos)
 {
     // zoom actions
 void ChatView::addActionsToMenu(QMenu *menu, const QPointF &pos)
 {
     // zoom actions
-    BufferWidget *bw = qobject_cast<BufferWidget *>(bufferContainer());
+    auto *bw = qobject_cast<BufferWidget *>(bufferContainer());
     if (bw) {
         bw->addActionsToMenu(menu, pos);
         menu->addSeparator();
     if (bw) {
         bw->addActionsToMenu(menu, pos);
         menu->addSeparator();
index 279e0e4..a8d4680 100644 (file)
@@ -43,7 +43,7 @@ ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
     QAction *toggleSearchBar = coll->action("ToggleSearchBar");
     connect(toggleSearchBar, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));
 
     QAction *toggleSearchBar = coll->action("ToggleSearchBar");
     connect(toggleSearchBar, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));
 
-    Action *hideSearchBar = coll->add<Action>("HideSearchBar", toggleSearchBar, SLOT(setChecked(bool)));
+    auto *hideSearchBar = coll->add<Action>("HideSearchBar", toggleSearchBar, SLOT(setChecked(bool)));
     hideSearchBar->setShortcutConfigurable(false);
     hideSearchBar->setShortcut(Qt::Key_Escape);
 
     hideSearchBar->setShortcutConfigurable(false);
     hideSearchBar->setShortcut(Qt::Key_Escape);
 
index 930aea5..2360913 100644 (file)
@@ -118,7 +118,7 @@ void ChatViewSearchController::updateHighlights(bool reuse)
     if (reuse) {
         QSet<ChatLine *> chatLines;
         foreach(SearchHighlightItem *highlightItem, _highlightItems) {
     if (reuse) {
         QSet<ChatLine *> chatLines;
         foreach(SearchHighlightItem *highlightItem, _highlightItems) {
-            ChatLine *line = qgraphicsitem_cast<ChatLine *>(highlightItem->parentItem());
+            auto *line = qgraphicsitem_cast<ChatLine *>(highlightItem->parentItem());
             if (line)
                 chatLines << line;
         }
             if (line)
                 chatLines << line;
         }
@@ -259,7 +259,7 @@ void ChatViewSearchController::updateHighlights(ChatLine *line)
     }
 
     foreach(QGraphicsItem *child, line->childItems()) {
     }
 
     foreach(QGraphicsItem *child, line->childItems()) {
-        SearchHighlightItem *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
+        auto *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
         if (!highlightItem)
             continue;
 
         if (!highlightItem)
             continue;
 
@@ -304,7 +304,7 @@ void ChatViewSearchController::repositionHighlights()
 {
     QSet<ChatLine *> chatLines;
     foreach(SearchHighlightItem *item, _highlightItems) {
 {
     QSet<ChatLine *> chatLines;
     foreach(SearchHighlightItem *item, _highlightItems) {
-        ChatLine *line = qgraphicsitem_cast<ChatLine *>(item->parentItem());
+        auto *line = qgraphicsitem_cast<ChatLine *>(item->parentItem());
         if (line)
             chatLines << line;
     }
         if (line)
             chatLines << line;
     }
@@ -319,7 +319,7 @@ void ChatViewSearchController::repositionHighlights(ChatLine *line)
 {
     QList<SearchHighlightItem *> searchHighlights;
     foreach(QGraphicsItem *child, line->childItems()) {
 {
     QList<SearchHighlightItem *> searchHighlights;
     foreach(QGraphicsItem *child, line->childItems()) {
-        SearchHighlightItem *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
+        auto *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
         if (highlightItem)
             searchHighlights << highlightItem;
     }
         if (highlightItem)
             searchHighlights << highlightItem;
     }
index c51bd85..4e45870 100644 (file)
@@ -99,7 +99,7 @@ QVariantMap propertiesFromFieldWidgets(QGroupBox *fieldBox, const std::vector<Fi
         QVariant value;
         switch (std::get<2>(fieldInfo).type()) {
             case QVariant::Int: {
         QVariant value;
         switch (std::get<2>(fieldInfo).type()) {
             case QVariant::Int: {
-                QSpinBox *spinBox = fieldBox->findChild<QSpinBox *>(key);
+                auto *spinBox = fieldBox->findChild<QSpinBox *>(key);
                 if (spinBox)
                     value = spinBox->value();
                 else
                 if (spinBox)
                     value = spinBox->value();
                 else
@@ -107,7 +107,7 @@ QVariantMap propertiesFromFieldWidgets(QGroupBox *fieldBox, const std::vector<Fi
                 break;
             }
             case QVariant::String: {
                 break;
             }
             case QVariant::String: {
-                QLineEdit *lineEdit = fieldBox->findChild<QLineEdit *>(key);
+                auto *lineEdit = fieldBox->findChild<QLineEdit *>(key);
                 if (lineEdit)
                     value = lineEdit->text();
                 else
                 if (lineEdit)
                     value = lineEdit->text();
                 else
@@ -477,13 +477,13 @@ void SyncPage::initializePage()
     emit completeChanged();
 
     // Fill in sync info about the storage layer.
     emit completeChanged();
 
     // Fill in sync info about the storage layer.
-    StorageSelectionPage *storagePage = qobject_cast<StorageSelectionPage *>(wizard()->page(CoreConfigWizard::StorageSelectionPage));
+    auto *storagePage = qobject_cast<StorageSelectionPage *>(wizard()->page(CoreConfigWizard::StorageSelectionPage));
     QString backend = storagePage->backend();
     QVariantMap backendProperties = storagePage->backendProperties();
     ui.backend->setText(storagePage->displayName());
 
     // Fill in sync info about the authentication layer.
     QString backend = storagePage->backend();
     QVariantMap backendProperties = storagePage->backendProperties();
     ui.backend->setText(storagePage->displayName());
 
     // Fill in sync info about the authentication layer.
-    AuthenticationSelectionPage *authPage = qobject_cast<AuthenticationSelectionPage *>(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage));
+    auto *authPage = qobject_cast<AuthenticationSelectionPage *>(wizard()->page(CoreConfigWizard::AuthenticationSelectionPage));
     QString authenticator = authPage->authenticator();
     QVariantMap authProperties = authPage->authProperties();
     ui.authenticator->setText(authPage->displayName());
     QString authenticator = authPage->authenticator();
     QVariantMap authProperties = authPage->authProperties();
     ui.authenticator->setText(authPage->displayName());
index 7bbcfd9..7c54efb 100644 (file)
@@ -41,10 +41,10 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent)
     setWindowTitle(tr("Connect to Core"));
     setWindowIcon(icon::get("network-disconnect"));
 
     setWindowTitle(tr("Connect to Core"));
     setWindowIcon(icon::get("network-disconnect"));
 
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     layout->addWidget(_settingsPage);
 
     layout->addWidget(_settingsPage);
 
-    QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
+    auto *buttonBox = new QDialogButtonBox(this);
     buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
     layout->addWidget(buttonBox);
 
     buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
     layout->addWidget(buttonBox);
 
index d7656df..e5a0ed5 100644 (file)
@@ -35,7 +35,7 @@ DebugBufferViewOverlay::DebugBufferViewOverlay(QWidget *parent)
 {
     ui.setupUi(this);
 
 {
     ui.setupUi(this);
 
-    BufferViewOverlayFilter *filter = new BufferViewOverlayFilter(Client::bufferModel(), Client::bufferViewOverlay());
+    auto *filter = new BufferViewOverlayFilter(Client::bufferModel(), Client::bufferViewOverlay());
 
     filter->setParent(ui.bufferView);
 
 
     filter->setParent(ui.bufferView);
 
@@ -46,7 +46,7 @@ DebugBufferViewOverlay::DebugBufferViewOverlay(QWidget *parent)
     ui.bufferView->resize(610, 300);
     ui.bufferView->show();
 
     ui.bufferView->resize(610, 300);
     ui.bufferView->show();
 
-    QFormLayout *layout = new QFormLayout(ui.overlayProperties);
+    auto *layout = new QFormLayout(ui.overlayProperties);
     layout->addRow(tr("BufferViews:"), _bufferViews = new QLineEdit(this));
     layout->addRow(tr("All Networks:"), _allNetworks = new QLabel(this));
     layout->addRow(tr("Networks:"), _networks = new QLineEdit(this));
     layout->addRow(tr("BufferViews:"), _bufferViews = new QLineEdit(this));
     layout->addRow(tr("All Networks:"), _allNetworks = new QLabel(this));
     layout->addRow(tr("Networks:"), _networks = new QLineEdit(this));
index 510abd2..53557fe 100644 (file)
@@ -180,7 +180,7 @@ SettingsPage *DockManagerNotificationBackend::createConfigWidget() const
 DockManagerNotificationBackend::ConfigWidget::ConfigWidget(bool enabled, QWidget *parent)
     : SettingsPage("Internal", "DockManagerNotification", parent)
 {
 DockManagerNotificationBackend::ConfigWidget::ConfigWidget(bool enabled, QWidget *parent)
     : SettingsPage("Internal", "DockManagerNotification", parent)
 {
-    QHBoxLayout *layout = new QHBoxLayout(this);
+    auto *layout = new QHBoxLayout(this);
     layout->addWidget(enabledBox = new QCheckBox(tr("Mark dockmanager entry"), this));
     enabledBox->setVisible(enabled);
 
     layout->addWidget(enabledBox = new QCheckBox(tr("Mark dockmanager entry"), this));
     enabledBox->setVisible(enabled);
 
index a832207..f843ece 100644 (file)
@@ -144,7 +144,7 @@ InputWidget::InputWidget(QWidget *parent)
 
     ActionCollection *coll = QtUi::actionCollection();
 
 
     ActionCollection *coll = QtUi::actionCollection();
 
-    Action *activateInputline = coll->add<Action>("FocusInputLine");
+    auto *activateInputline = coll->add<Action>("FocusInputLine");
     connect(activateInputline, SIGNAL(triggered()), SLOT(setFocus()));
     activateInputline->setText(tr("Focus Input Line"));
     activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
     connect(activateInputline, SIGNAL(triggered()), SLOT(setFocus()));
     activateInputline->setText(tr("Focus Input Line"));
     activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
@@ -232,10 +232,10 @@ bool InputWidget::eventFilter(QObject *watched, QEvent *event)
     if (event->type() != QEvent::KeyPress)
         return false;
 
     if (event->type() != QEvent::KeyPress)
         return false;
 
-    QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+    auto *keyEvent = static_cast<QKeyEvent *>(event);
 
     // keys from BufferView should be sent to (and focus) the input line
 
     // keys from BufferView should be sent to (and focus) the input line
-    BufferView *view = qobject_cast<BufferView *>(watched);
+    auto *view = qobject_cast<BufferView *>(watched);
     if (view) {
         if (keyEvent->text().length() == 1 && !(keyEvent->modifiers() & (Qt::ControlModifier ^ Qt::AltModifier))) { // normal key press
             QChar c = keyEvent->text().at(0);
     if (view) {
         if (keyEvent->text().length() == 1 && !(keyEvent->modifiers() & (Qt::ControlModifier ^ Qt::AltModifier))) { // normal key press
             QChar c = keyEvent->text().at(0);
@@ -304,11 +304,11 @@ void InputWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bot
 
         bool encrypted = false;
 
 
         bool encrypted = false;
 
-        IrcChannel *chan = qobject_cast<IrcChannel *>(Client::bufferModel()->data(selectionModel()->currentIndex(), NetworkModel::IrcChannelRole).value<QObject *>());
+        auto *chan = qobject_cast<IrcChannel *>(Client::bufferModel()->data(selectionModel()->currentIndex(), NetworkModel::IrcChannelRole).value<QObject *>());
         if (chan)
             encrypted = chan->encrypted();
 
         if (chan)
             encrypted = chan->encrypted();
 
-        IrcUser *user = qobject_cast<IrcUser *>(Client::bufferModel()->data(selectionModel()->currentIndex(), NetworkModel::IrcUserRole).value<QObject *>());
+        auto *user = qobject_cast<IrcUser *>(Client::bufferModel()->data(selectionModel()->currentIndex(), NetworkModel::IrcUserRole).value<QObject *>());
         if (user)
             encrypted = user->encrypted();
 
         if (user)
             encrypted = user->encrypted();
 
index 756caf8..1210b5c 100644 (file)
@@ -50,14 +50,14 @@ IrcConnectionWizard::IrcConnectionWizard(QWidget *parent, Qt::WindowFlags flags)
 
 QWizardPage *IrcConnectionWizard::createIntroductionPage(QWidget *parent)
 {
 
 QWizardPage *IrcConnectionWizard::createIntroductionPage(QWidget *parent)
 {
-    QWizardPage *page = new QWizardPage(parent);
+    auto *page = new QWizardPage(parent);
     page->setTitle(QObject::tr("Welcome to Quassel IRC"));
 
     QLabel *label = new QLabel(QObject::tr("This wizard will help you to set up your default identity and your IRC network connection.<br>"
                                            "This only covers basic settings. You can cancel this wizard any time and use the settings dialog for more detailed changes."), page);
     label->setWordWrap(true);
 
     page->setTitle(QObject::tr("Welcome to Quassel IRC"));
 
     QLabel *label = new QLabel(QObject::tr("This wizard will help you to set up your default identity and your IRC network connection.<br>"
                                            "This only covers basic settings. You can cancel this wizard any time and use the settings dialog for more detailed changes."), page);
     label->setWordWrap(true);
 
-    QVBoxLayout *layout = new QVBoxLayout;
+    auto *layout = new QVBoxLayout;
     layout->addWidget(label);
     page->setLayout(layout);
     return page;
     layout->addWidget(label);
     page->setLayout(layout);
     return page;
@@ -81,7 +81,7 @@ void IrcConnectionWizard::finishClicked()
 void IrcConnectionWizard::identityReady(IdentityId id)
 {
     disconnect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
 void IrcConnectionWizard::identityReady(IdentityId id)
 {
     disconnect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(identityReady(IdentityId)));
-    NetworkPage *networkPage = static_cast<NetworkPage *>(_networkPage);
+    auto *networkPage = static_cast<NetworkPage *>(_networkPage);
     NetworkInfo networkInfo = networkPage->networkInfo();
     QStringList channels = networkPage->channelList();
     networkInfo.identity = id;
     NetworkInfo networkInfo = networkPage->networkInfo();
     QStringList channels = networkPage->channelList();
     networkInfo.identity = id;
@@ -122,7 +122,7 @@ IdentityPage::IdentityPage(QWidget *parent)
 
     _identityEditWidget->displayIdentity(_identity);
     _identityEditWidget->showAdvanced(false);
 
     _identityEditWidget->displayIdentity(_identity);
     _identityEditWidget->showAdvanced(false);
-    QVBoxLayout *layout = new QVBoxLayout;
+    auto *layout = new QVBoxLayout;
     layout->addWidget(_identityEditWidget);
     setLayout(layout);
 }
     layout->addWidget(_identityEditWidget);
     setLayout(layout);
 }
@@ -154,7 +154,7 @@ NetworkPage::NetworkPage(QWidget *parent)
 
     setTitle(tr("Setup Network Connection"));
 
 
     setTitle(tr("Setup Network Connection"));
 
-    QVBoxLayout *layout = new QVBoxLayout;
+    auto *layout = new QVBoxLayout;
     layout->addWidget(_networkEditor);
     setLayout(layout);
 }
     layout->addWidget(_networkEditor);
     setLayout(layout);
 }
index 9ebda87..f85b44a 100644 (file)
@@ -32,7 +32,7 @@
 
 MainPage::MainPage(QWidget *parent) : QWidget(parent)
 {
 
 MainPage::MainPage(QWidget *parent) : QWidget(parent)
 {
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     layout->setAlignment(Qt::AlignCenter);
     QLabel *label = new QLabel(this);
     label->setPixmap(QPixmap(":/pics/quassel-logo.png"));
     layout->setAlignment(Qt::AlignCenter);
     QLabel *label = new QLabel(this);
     label->setPixmap(QPixmap(":/pics/quassel-logo.png"));
index e0ef6b9..6330e2c 100644 (file)
@@ -666,10 +666,10 @@ void MainWin::addBufferView(ClientBufferViewConfig *config)
         return;
 
     config->setLocked(QtUiSettings().value("LockLayout", false).toBool());
         return;
 
     config->setLocked(QtUiSettings().value("LockLayout", false).toBool());
-    BufferViewDock *dock = new BufferViewDock(config, this);
+    auto *dock = new BufferViewDock(config, this);
 
     //create the view and initialize it's filter
 
     //create the view and initialize it's filter
-    BufferView *view = new BufferView(dock);
+    auto *view = new BufferView(dock);
     view->setFilteredModel(Client::bufferModel(), config);
     view->installEventFilter(_inputWidget); // for key presses
 
     view->setFilteredModel(Client::bufferModel(), config);
     view->installEventFilter(_inputWidget); // for key presses
 
@@ -726,9 +726,9 @@ void MainWin::bufferViewToggled(bool enabled)
         // since this isn't our fault and we can't do anything about it, we suppress the resulting calls
         return;
     }
         // since this isn't our fault and we can't do anything about it, we suppress the resulting calls
         return;
     }
-    QAction *action = qobject_cast<QAction *>(sender());
+    auto *action = qobject_cast<QAction *>(sender());
     Q_ASSERT(action);
     Q_ASSERT(action);
-    BufferViewDock *dock = qobject_cast<BufferViewDock *>(action->parent());
+    auto *dock = qobject_cast<BufferViewDock *>(action->parent());
     Q_ASSERT(dock);
 
     // Make sure we don't toggle backlog fetch for a view we've already removed
     Q_ASSERT(dock);
 
     // Make sure we don't toggle backlog fetch for a view we've already removed
@@ -745,7 +745,7 @@ void MainWin::bufferViewToggled(bool enabled)
 void MainWin::bufferViewVisibilityChanged(bool visible)
 {
     Q_UNUSED(visible);
 void MainWin::bufferViewVisibilityChanged(bool visible)
 {
     Q_UNUSED(visible);
-    BufferViewDock *dock = qobject_cast<BufferViewDock *>(sender());
+    auto *dock = qobject_cast<BufferViewDock *>(sender());
     Q_ASSERT(dock);
     if ((!dock->isHidden() && !activeBufferView()) || (dock->isHidden() && dock->isActive()))
         nextBufferView();
     Q_ASSERT(dock);
     if ((!dock->isHidden() && !activeBufferView()) || (dock->isHidden() && dock->isActive()))
         nextBufferView();
@@ -991,7 +991,7 @@ void MainWin::setupChatMonitor()
     VerticalDock *dock = new VerticalDock(tr("Chat Monitor"), this);
     dock->setObjectName("ChatMonitorDock");
 
     VerticalDock *dock = new VerticalDock(tr("Chat Monitor"), this);
     dock->setObjectName("ChatMonitorDock");
 
-    ChatMonitorFilter *filter = new ChatMonitorFilter(Client::messageModel(), this);
+    auto *filter = new ChatMonitorFilter(Client::messageModel(), this);
     _chatMonitorView = new ChatMonitorView(filter, this);
     _chatMonitorView->show();
     dock->setWidget(_chatMonitorView);
     _chatMonitorView = new ChatMonitorView(filter, this);
     _chatMonitorView->show();
     dock->setWidget(_chatMonitorView);
@@ -1104,7 +1104,7 @@ void MainWin::setupStatusBar()
 
 void MainWin::setupHotList()
 {
 
 void MainWin::setupHotList()
 {
-    FlatProxyModel *flatProxy = new FlatProxyModel(this);
+    auto *flatProxy = new FlatProxyModel(this);
     flatProxy->setSourceModel(Client::bufferModel());
     _bufferHotList = new BufferHotListFilter(flatProxy);
 }
     flatProxy->setSourceModel(Client::bufferModel());
     _bufferHotList = new BufferHotListFilter(flatProxy);
 }
@@ -1450,7 +1450,7 @@ void MainWin::showCoreConnectionDlg()
 
 void MainWin::showCoreConfigWizard(const QVariantList &backends, const QVariantList &authenticators)
 {
 
 void MainWin::showCoreConfigWizard(const QVariantList &backends, const QVariantList &authenticators)
 {
-    CoreConfigWizard *wizard = new CoreConfigWizard(Client::coreConnection(), backends, authenticators, this);
+    auto *wizard = new CoreConfigWizard(Client::coreConnection(), backends, authenticators, this);
 
     wizard->show();
 }
 
     wizard->show();
 }
@@ -1459,7 +1459,7 @@ void MainWin::showCoreConfigWizard(const QVariantList &backends, const QVariantL
 void MainWin::showChannelList(NetworkId netId, const QString &channelFilters, bool listImmediately)
 {
     if (!netId.isValid()) {
 void MainWin::showChannelList(NetworkId netId, const QString &channelFilters, bool listImmediately)
 {
     if (!netId.isValid()) {
-        QAction *action = qobject_cast<QAction *>(sender());
+        auto *action = qobject_cast<QAction *>(sender());
         if (action)
             netId = action->data().value<NetworkId>();
         if (!netId.isValid()) {
         if (action)
             netId = action->data().value<NetworkId>();
         if (!netId.isValid()) {
@@ -1474,7 +1474,7 @@ void MainWin::showChannelList(NetworkId netId, const QString &channelFilters, bo
         }
     }
 
         }
     }
 
-    ChannelListDlg *channelListDlg = new ChannelListDlg(this);
+    auto *channelListDlg = new ChannelListDlg(this);
     channelListDlg->setAttribute(Qt::WA_DeleteOnClose);
     channelListDlg->setNetwork(netId);
     if (!channelFilters.isEmpty()) {
     channelListDlg->setAttribute(Qt::WA_DeleteOnClose);
     channelListDlg->setNetwork(netId);
     if (!channelFilters.isEmpty()) {
@@ -1516,7 +1516,7 @@ void MainWin::showAwayLog()
 {
     if (_awayLog)
         return;
 {
     if (_awayLog)
         return;
-    AwayLogFilter *filter = new AwayLogFilter(Client::messageModel());
+    auto *filter = new AwayLogFilter(Client::messageModel());
     _awayLog = new AwayLogView(filter, nullptr);
     filter->setParent(_awayLog);
     connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed()));
     _awayLog = new AwayLogView(filter, nullptr);
     filter->setParent(_awayLog);
     connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed()));
@@ -1533,7 +1533,7 @@ void MainWin::awayLogDestroyed()
 
 void MainWin::showSettingsDlg()
 {
 
 void MainWin::showSettingsDlg()
 {
-    SettingsDlg *dlg = new SettingsDlg(this);
+    auto *dlg = new SettingsDlg();
 
     //Category: Interface
     dlg->registerSettingsPage(new AppearanceSettingsPage(dlg));
 
     //Category: Interface
     dlg->registerSettingsPage(new AppearanceSettingsPage(dlg));
@@ -1594,7 +1594,7 @@ void MainWin::showNewTransferDlg(const QUuid &transferId)
     auto transfer = Client::transferManager()->transfer(transferId);
     if (transfer) {
         if (transfer->status() == Transfer::Status::New) {
     auto transfer = Client::transferManager()->transfer(transferId);
     if (transfer) {
         if (transfer->status() == Transfer::Status::New) {
-            ReceiveFileDlg *dlg = new ReceiveFileDlg(transfer, this);
+            auto *dlg = new ReceiveFileDlg(transfer, this);
             dlg->show();
         }
     }
             dlg->show();
         }
     }
@@ -1663,7 +1663,7 @@ void MainWin::resizeEvent(QResizeEvent *event)
 void MainWin::closeEvent(QCloseEvent *event)
 {
     QtUiSettings s;
 void MainWin::closeEvent(QCloseEvent *event)
 {
     QtUiSettings s;
-    QtUiApplication *app = qobject_cast<QtUiApplication *> qApp;
+    auto *app = qobject_cast<QtUiApplication *> qApp;
     Q_ASSERT(app);
     // On OSX it can happen that the closeEvent occurs twice. (Especially if packaged with Frameworks)
     // This messes up MainWinState/MainWinHidden save/restore.
     Q_ASSERT(app);
     // On OSX it can happen that the closeEvent occurs twice. (Especially if packaged with Frameworks)
     // This messes up MainWinState/MainWinHidden save/restore.
@@ -1749,7 +1749,7 @@ void MainWin::currentBufferChanged(BufferId buffer)
 void MainWin::clientNetworkCreated(NetworkId id)
 {
     const Network *net = Client::network(id);
 void MainWin::clientNetworkCreated(NetworkId id)
 {
     const Network *net = Client::network(id);
-    QAction *act = new QAction(net->networkName(), this);
+    auto *act = new QAction(net->networkName(), this);
     act->setObjectName(QString("NetworkAction-%1").arg(id.toInt()));
     act->setData(QVariant::fromValue<NetworkId>(id));
     connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
     act->setObjectName(QString("NetworkAction-%1").arg(id.toInt()));
     act->setData(QVariant::fromValue<NetworkId>(id));
     connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
@@ -1770,11 +1770,11 @@ void MainWin::clientNetworkCreated(NetworkId id)
 
 void MainWin::clientNetworkUpdated()
 {
 
 void MainWin::clientNetworkUpdated()
 {
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net)
         return;
 
     if (!net)
         return;
 
-    QAction *action = findChild<QAction *>(QString("NetworkAction-%1").arg(net->networkId().toInt()));
+    auto *action = findChild<QAction *>(QString("NetworkAction-%1").arg(net->networkId().toInt()));
     if (!action)
         return;
 
     if (!action)
         return;
 
@@ -1803,7 +1803,7 @@ void MainWin::clientNetworkUpdated()
 
 void MainWin::clientNetworkRemoved(NetworkId id)
 {
 
 void MainWin::clientNetworkRemoved(NetworkId id)
 {
-    QAction *action = findChild<QAction *>(QString("NetworkAction-%1").arg(id.toInt()));
+    auto *action = findChild<QAction *>(QString("NetworkAction-%1").arg(id.toInt()));
     if (!action)
         return;
 
     if (!action)
         return;
 
@@ -1813,7 +1813,7 @@ void MainWin::clientNetworkRemoved(NetworkId id)
 
 void MainWin::connectOrDisconnectFromNet()
 {
 
 void MainWin::connectOrDisconnectFromNet()
 {
-    QAction *act = qobject_cast<QAction *>(sender());
+    auto *act = qobject_cast<QAction *>(sender());
     if (!act) return;
     const Network *net = Client::network(act->data().value<NetworkId>());
     if (!net) return;
     if (!act) return;
     const Network *net = Client::network(act->data().value<NetworkId>());
     if (!net) return;
@@ -1897,7 +1897,7 @@ void MainWin::on_bufferSearch_triggered()
 
 void MainWin::onJumpKey()
 {
 
 void MainWin::onJumpKey()
 {
-    QAction *action = qobject_cast<QAction *>(sender());
+    auto *action = qobject_cast<QAction *>(sender());
     if (!action || !Client::bufferModel())
         return;
     int idx = action->property("Index").toInt();
     if (!action || !Client::bufferModel())
         return;
     int idx = action->property("Index").toInt();
@@ -1916,7 +1916,7 @@ void MainWin::onJumpKey()
 
 void MainWin::bindJumpKey()
 {
 
 void MainWin::bindJumpKey()
 {
-    QAction *action = qobject_cast<QAction *>(sender());
+    auto *action = qobject_cast<QAction *>(sender());
     if (!action || !Client::bufferModel())
         return;
     int idx = action->property("Index").toInt();
     if (!action || !Client::bufferModel())
         return;
     int idx = action->property("Index").toInt();
@@ -1928,7 +1928,7 @@ void MainWin::bindJumpKey()
 
 void MainWin::on_actionDebugNetworkModel_triggered()
 {
 
 void MainWin::on_actionDebugNetworkModel_triggered()
 {
-    QTreeView *view = new QTreeView;
+    auto *view = new QTreeView;
     view->setAttribute(Qt::WA_DeleteOnClose);
     view->setWindowTitle("Debug NetworkModel View");
     view->setModel(Client::networkModel());
     view->setAttribute(Qt::WA_DeleteOnClose);
     view->setWindowTitle("Debug NetworkModel View");
     view->setModel(Client::networkModel());
@@ -1945,7 +1945,7 @@ void MainWin::on_actionDebugHotList_triggered()
     _bufferHotList->invalidate();
     _bufferHotList->sort(0, Qt::DescendingOrder);
 
     _bufferHotList->invalidate();
     _bufferHotList->sort(0, Qt::DescendingOrder);
 
-    QTreeView *view = new QTreeView;
+    auto *view = new QTreeView;
     view->setAttribute(Qt::WA_DeleteOnClose);
     view->setModel(_bufferHotList);
     view->show();
     view->setAttribute(Qt::WA_DeleteOnClose);
     view->setModel(_bufferHotList);
     view->show();
@@ -1954,7 +1954,7 @@ void MainWin::on_actionDebugHotList_triggered()
 
 void MainWin::on_actionDebugBufferViewOverlay_triggered()
 {
 
 void MainWin::on_actionDebugBufferViewOverlay_triggered()
 {
-    DebugBufferViewOverlay *overlay = new DebugBufferViewOverlay(nullptr);
+    auto *overlay = new DebugBufferViewOverlay(nullptr);
     overlay->setAttribute(Qt::WA_DeleteOnClose);
     overlay->show();
 }
     overlay->setAttribute(Qt::WA_DeleteOnClose);
     overlay->show();
 }
@@ -1962,8 +1962,8 @@ void MainWin::on_actionDebugBufferViewOverlay_triggered()
 
 void MainWin::on_actionDebugMessageModel_triggered()
 {
 
 void MainWin::on_actionDebugMessageModel_triggered()
 {
-    QTableView *view = new QTableView(nullptr);
-    DebugMessageModelFilter *filter = new DebugMessageModelFilter(view);
+    auto *view = new QTableView(nullptr);
+    auto *filter = new DebugMessageModelFilter(view);
     filter->setSourceModel(Client::messageModel());
     view->setModel(filter);
     view->setAttribute(Qt::WA_DeleteOnClose, true);
     filter->setSourceModel(Client::messageModel());
     view->setModel(filter);
     view->setAttribute(Qt::WA_DeleteOnClose, true);
index f90a10f..d2b8fd5 100644 (file)
@@ -41,7 +41,7 @@ NickListWidget::NickListWidget(QWidget *parent)
 
 QDockWidget *NickListWidget::dock() const
 {
 
 QDockWidget *NickListWidget::dock() const
 {
-    QDockWidget *dock = qobject_cast<QDockWidget *>(parent());
+    auto *dock = qobject_cast<QDockWidget *>(parent());
     if (dock)
         return dock;
     else
     if (dock)
         return dock;
     else
@@ -58,7 +58,7 @@ void NickListWidget::hideEvent(QHideEvent *event)
 
 void NickListWidget::showEvent(QShowEvent *event)
 {
 
 void NickListWidget::showEvent(QShowEvent *event)
 {
-    NickView *view = qobject_cast<NickView *>(ui.stackedWidget->currentWidget());
+    auto *view = qobject_cast<NickView *>(ui.stackedWidget->currentWidget());
     if (view)
         emit nickSelectionChanged(view->selectedIndexes());
 
     if (view)
         emit nickSelectionChanged(view->selectedIndexes());
 
@@ -135,7 +135,7 @@ void NickListWidget::currentChanged(const QModelIndex &current, const QModelInde
     }
     else {
         view = new NickView(this);
     }
     else {
         view = new NickView(this);
-        NickViewFilter *filter = new NickViewFilter(newBufferId, Client::networkModel());
+        auto *filter = new NickViewFilter(newBufferId, Client::networkModel());
         view->setModel(filter);
         QModelIndex source_current = Client::bufferModel()->mapToSource(current);
         view->setRootIndex(filter->mapFromSource(source_current));
         view->setModel(filter);
         QModelIndex source_current = Client::bufferModel()->mapToSource(current);
         view->setRootIndex(filter->mapFromSource(source_current));
@@ -150,7 +150,7 @@ void NickListWidget::currentChanged(const QModelIndex &current, const QModelInde
 
 void NickListWidget::nickSelectionChanged()
 {
 
 void NickListWidget::nickSelectionChanged()
 {
-    NickView *view = qobject_cast<NickView *>(sender());
+    auto *view = qobject_cast<NickView *>(sender());
     Q_ASSERT(view);
     if (view != ui.stackedWidget->currentWidget()) {
         qDebug() << "Nick selection of hidden view changed!";
     Q_ASSERT(view);
     if (view != ui.stackedWidget->currentWidget()) {
         qDebug() << "Nick selection of hidden view changed!";
@@ -175,7 +175,7 @@ void NickListWidget::rowsAboutToBeRemoved(const QModelIndex &parent, int start,
             ui.stackedWidget->removeWidget(nickView);
             QAbstractItemModel *model = nickView->model();
             nickView->setModel(nullptr);
             ui.stackedWidget->removeWidget(nickView);
             QAbstractItemModel *model = nickView->model();
             nickView->setModel(nullptr);
-            if (QSortFilterProxyModel *filter = qobject_cast<QSortFilterProxyModel *>(model))
+            if (auto *filter = qobject_cast<QSortFilterProxyModel *>(model))
                 filter->setSourceModel(nullptr);
             model->deleteLater();
             nickView->deleteLater();
                 filter->setSourceModel(nullptr);
             model->deleteLater();
             nickView->deleteLater();
@@ -204,7 +204,7 @@ void NickListWidget::removeBuffer(BufferId bufferId)
     ui.stackedWidget->removeWidget(view);
     QAbstractItemModel *model = view->model();
     view->setModel(nullptr);
     ui.stackedWidget->removeWidget(view);
     QAbstractItemModel *model = view->model();
     view->setModel(nullptr);
-    if (QSortFilterProxyModel *filter = qobject_cast<QSortFilterProxyModel *>(model))
+    if (auto *filter = qobject_cast<QSortFilterProxyModel *>(model))
         filter->setSourceModel(nullptr);
     model->deleteLater();
     view->deleteLater();
         filter->setSourceModel(nullptr);
     model->deleteLater();
     view->deleteLater();
index 71db202..d9d81fe 100644 (file)
@@ -62,7 +62,7 @@ void SettingsDlg::coreConnectionStateChanged()
 
 void SettingsDlg::setItemState(QTreeWidgetItem *item)
 {
 
 void SettingsDlg::setItemState(QTreeWidgetItem *item)
 {
-    SettingsPage *sp = qobject_cast<SettingsPage *>(item->data(0, SettingsPageRole).value<QObject *>());
+    auto *sp = qobject_cast<SettingsPage *>(item->data(0, SettingsPageRole).value<QObject *>());
     Q_ASSERT(sp);
     bool disabledDueToConnection = !Client::isConnected() && sp->needsCoreConnection();
     bool disabledDueToOwnChoice = !sp->isSelectable();
     Q_ASSERT(sp);
     bool disabledDueToConnection = !Client::isConnected() && sp->needsCoreConnection();
     bool disabledDueToOwnChoice = !sp->isSelectable();
index 4a77807..b922705 100644 (file)
@@ -204,7 +204,7 @@ void BufferViewSettingsPage::coreConnectionStateChanged(bool state)
 
 void BufferViewSettingsPage::addBufferView(BufferViewConfig *config)
 {
 
 void BufferViewSettingsPage::addBufferView(BufferViewConfig *config)
 {
-    QListWidgetItem *item = new QListWidgetItem(config->bufferViewName(), ui.bufferViewList);
+    auto *item = new QListWidgetItem(config->bufferViewName(), ui.bufferViewList);
     item->setData(Qt::UserRole, qVariantFromValue<QObject *>(qobject_cast<QObject *>(config)));
     connect(config, SIGNAL(updatedRemotely()), this, SLOT(updateBufferView()));
     connect(config, SIGNAL(destroyed()), this, SLOT(bufferViewDeleted()));
     item->setData(Qt::UserRole, qVariantFromValue<QObject *>(qobject_cast<QObject *>(config)));
     connect(config, SIGNAL(updatedRemotely()), this, SLOT(updateBufferView()));
     connect(config, SIGNAL(destroyed()), this, SLOT(bufferViewDeleted()));
@@ -223,7 +223,7 @@ void BufferViewSettingsPage::addBufferView(int bufferViewId)
 
 void BufferViewSettingsPage::bufferViewDeleted()
 {
 
 void BufferViewSettingsPage::bufferViewDeleted()
 {
-    BufferViewConfig *config = static_cast<BufferViewConfig *>(sender());
+    auto *config = static_cast<BufferViewConfig *>(sender());
     QObject *obj;
     for (int i = 0; i < ui.bufferViewList->count(); i++) {
         obj = ui.bufferViewList->item(i)->data(Qt::UserRole).value<QObject *>();
     QObject *obj;
     for (int i = 0; i < ui.bufferViewList->count(); i++) {
         obj = ui.bufferViewList->item(i)->data(Qt::UserRole).value<QObject *>();
@@ -241,7 +241,7 @@ void BufferViewSettingsPage::newBufferView(const QString &bufferViewName)
 {
     // id's of newly created bufferviews are negative (-1, -2... -n)
     int fakeId = -1 * (_newBufferViews.count() + 1);
 {
     // id's of newly created bufferviews are negative (-1, -2... -n)
     int fakeId = -1 * (_newBufferViews.count() + 1);
-    BufferViewConfig *config = new BufferViewConfig(fakeId);
+    auto *config = new BufferViewConfig(fakeId);
     config->setBufferViewName(bufferViewName);
     config->setInitialized();
     QList<BufferId> bufferIds;
     config->setBufferViewName(bufferViewName);
     config->setInitialized();
     QList<BufferId> bufferIds;
@@ -278,7 +278,7 @@ int BufferViewSettingsPage::listPos(BufferViewConfig *config)
 BufferViewConfig *BufferViewSettingsPage::bufferView(int listPos)
 {
     if (listPos < ui.bufferViewList->count() && listPos >= 0) {
 BufferViewConfig *BufferViewSettingsPage::bufferView(int listPos)
 {
     if (listPos < ui.bufferViewList->count() && listPos >= 0) {
-        QObject *obj = ui.bufferViewList->item(listPos)->data(Qt::UserRole).value<QObject *>();
+        auto *obj = ui.bufferViewList->item(listPos)->data(Qt::UserRole).value<QObject *>();
         return qobject_cast<BufferViewConfig *>(obj);
     }
     else {
         return qobject_cast<BufferViewConfig *>(obj);
     }
     else {
@@ -303,7 +303,7 @@ bool BufferViewSettingsPage::selectBufferViewById(int bufferViewId)
 
 void BufferViewSettingsPage::updateBufferView()
 {
 
 void BufferViewSettingsPage::updateBufferView()
 {
-    BufferViewConfig *config = qobject_cast<BufferViewConfig *>(sender());
+    auto *config = qobject_cast<BufferViewConfig *>(sender());
     if (!config)
         return;
 
     if (!config)
         return;
 
@@ -385,7 +385,7 @@ void BufferViewSettingsPage::on_deleteBufferView_clicked()
 
     if (ret == QMessageBox::Yes) {
         ui.bufferViewList->removeItemWidget(currentItem);
 
     if (ret == QMessageBox::Yes) {
         ui.bufferViewList->removeItemWidget(currentItem);
-        BufferViewConfig *config = qobject_cast<BufferViewConfig *>(currentItem->data(Qt::UserRole).value<QObject *>());
+        auto *config = qobject_cast<BufferViewConfig *>(currentItem->data(Qt::UserRole).value<QObject *>());
         delete currentItem;
         if (viewId >= 0) {
             _deleteBufferViews << viewId;
         delete currentItem;
         if (viewId >= 0) {
             _deleteBufferViews << viewId;
@@ -540,7 +540,7 @@ BufferViewConfig *BufferViewSettingsPage::cloneConfig(BufferViewConfig *config)
     if (_changedBufferViews.contains(config))
         return _changedBufferViews[config];
 
     if (_changedBufferViews.contains(config))
         return _changedBufferViews[config];
 
-    BufferViewConfig *changedConfig = new BufferViewConfig(-1, this);
+    auto *changedConfig = new BufferViewConfig(-1, this);
     changedConfig->fromVariantMap(config->toVariantMap());
     changedConfig->setInitialized();
     _changedBufferViews[config] = changedConfig;
     changedConfig->fromVariantMap(config->toVariantMap());
     changedConfig->setInitialized();
     _changedBufferViews[config] = changedConfig;
@@ -553,7 +553,7 @@ BufferViewConfig *BufferViewSettingsPage::cloneConfig(BufferViewConfig *config)
 
     changedConfig->setProperty("OriginalBufferList", toVariantList<BufferId>(config->bufferList()));
     // if this is the currently displayed view we have to change the config of the preview filter
 
     changedConfig->setProperty("OriginalBufferList", toVariantList<BufferId>(config->bufferList()));
     // if this is the currently displayed view we have to change the config of the preview filter
-    BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(ui.bufferViewPreview->model());
+    auto *filter = qobject_cast<BufferViewFilter *>(ui.bufferViewPreview->model());
     if (filter && filter->config() == config)
         filter->setConfig(changedConfig);
     ui.bufferViewPreview->setConfig(changedConfig);
     if (filter && filter->config() == config)
         filter->setConfig(changedConfig);
     ui.bufferViewPreview->setConfig(changedConfig);
index f62462c..ec3526a 100644 (file)
@@ -280,7 +280,7 @@ void ChatMonitorSettingsPage::on_deactivateBuffer_clicked()
 */
 void ChatMonitorSettingsPage::switchOperationMode(int idx)
 {
 */
 void ChatMonitorSettingsPage::switchOperationMode(int idx)
 {
-    ChatViewSettings::OperationMode mode = (ChatViewSettings::OperationMode)(idx + 1);
+    auto mode = (ChatViewSettings::OperationMode)(idx + 1);
     if (mode == ChatViewSettings::OptIn) {
         ui.labelActiveBuffers->setText(tr("Show:"));
     }
     if (mode == ChatViewSettings::OptIn) {
         ui.labelActiveBuffers->setText(tr("Show:"));
     }
index 59ffac3..b132896 100644 (file)
@@ -141,7 +141,7 @@ void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool en
         enableItem->setCheckState(Qt::Unchecked);
     enableItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
 
         enableItem->setCheckState(Qt::Unchecked);
     enableItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
 
-    QTableWidgetItem *nameItem = new QTableWidgetItem(name);
+    auto *nameItem = new QTableWidgetItem(name);
 
     QTableWidgetItem *regexItem = new QTableWidgetItem("");
     if (regex)
 
     QTableWidgetItem *regexItem = new QTableWidgetItem("");
     if (regex)
@@ -157,7 +157,7 @@ void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool en
         csItem->setCheckState(Qt::Unchecked);
     csItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
 
         csItem->setCheckState(Qt::Unchecked);
     csItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
 
-    QTableWidgetItem *chanNameItem = new QTableWidgetItem(chanName);
+    auto *chanNameItem = new QTableWidgetItem(chanName);
 
     enableItem->setToolTip(tr("Enable/disable this rule"));
     nameItem->setToolTip(tr("Phrase to match"));
 
     enableItem->setToolTip(tr("Enable/disable this rule"));
     nameItem->setToolTip(tr("Phrase to match"));
index 1e9244d..e2d94f1 100644 (file)
@@ -215,7 +215,7 @@ bool IdentitiesSettingsPage::aboutToSave()
 
 void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id)
 {
 
 void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id)
 {
-    CertIdentity *identity = new CertIdentity(*Client::identity(id), this);
+    auto *identity = new CertIdentity(*Client::identity(id), this);
 #ifdef HAVE_SSL
     identity->enableEditSsl(_editSsl);
 #endif
 #ifdef HAVE_SSL
     identity->enableEditSsl(_editSsl);
 #endif
@@ -332,7 +332,7 @@ void IdentitiesSettingsPage::on_addIdentity_clicked()
             if (!identities.keys().contains(-id.toInt())) break;
         }
         id = -id.toInt();
             if (!identities.keys().contains(-id.toInt())) break;
         }
         id = -id.toInt();
-        CertIdentity *newId = new CertIdentity(id, this);
+        auto *newId = new CertIdentity(id, this);
 #ifdef HAVE_SSL
         newId->enableEditSsl(_editSsl);
 #endif
 #ifdef HAVE_SSL
         newId->enableEditSsl(_editSsl);
 #endif
index 50b978e..82375bf 100644 (file)
@@ -139,7 +139,7 @@ void IgnoreListSettingsPage::newIgnoreRule(QString rule)
         enableOkButton = true;
     }
 
         enableOkButton = true;
     }
 
-    IgnoreListEditDlg *dlg = new IgnoreListEditDlg(newItem, this, enableOkButton);
+    auto *dlg = new IgnoreListEditDlg(newItem, this, enableOkButton);
     dlg->enableOkButton(enableOkButton);
     while (dlg->exec() == QDialog::Accepted) {
         if (!_ignoreListModel.newIgnoreRule(dlg->ignoreListItem())) {
     dlg->enableOkButton(enableOkButton);
     while (dlg->exec() == QDialog::Accepted) {
         if (!_ignoreListModel.newIgnoreRule(dlg->ignoreListItem())) {
index 61a2e4b..0a51f4a 100644 (file)
@@ -62,7 +62,7 @@ void ItemViewSettingsPage::save()
 
 void ItemViewSettingsPage::updateBufferViewPreview(QWidget *widget)
 {
 
 void ItemViewSettingsPage::updateBufferViewPreview(QWidget *widget)
 {
-    ColorButton *button = qobject_cast<ColorButton *>(widget);
+    auto *button = qobject_cast<ColorButton *>(widget);
     if (!button)
         return;
 
     if (!button)
         return;
 
index 4f4afb2..379dd1a 100644 (file)
@@ -164,7 +164,7 @@ void KeySequenceButton::keyReleaseEvent(QKeyEvent *e)
 KeySequenceWidget::KeySequenceWidget(QWidget *parent)
     : QWidget(parent)
 {
 KeySequenceWidget::KeySequenceWidget(QWidget *parent)
     : QWidget(parent)
 {
-    QHBoxLayout *layout = new QHBoxLayout(this);
+    auto *layout = new QHBoxLayout(this);
     layout->setMargin(0);
 
     _keyButton = new KeySequenceButton(this, this);
     layout->setMargin(0);
 
     _keyButton = new KeySequenceButton(this, this);
index bd77b35..b8b8474 100644 (file)
@@ -432,7 +432,7 @@ void NetworksSettingsPage::clientIdentityAdded(IdentityId id)
 
 void NetworksSettingsPage::clientIdentityUpdated()
 {
 
 void NetworksSettingsPage::clientIdentityUpdated()
 {
-    const Identity *identity = qobject_cast<const Identity *>(sender());
+    const auto *identity = qobject_cast<const Identity *>(sender());
     if (!identity) {
         qWarning() << "NetworksSettingsPage: Invalid identity to update!";
         return;
     if (!identity) {
         qWarning() << "NetworksSettingsPage: Invalid identity to update!";
         return;
@@ -493,7 +493,7 @@ void NetworksSettingsPage::clientNetworkAdded(NetworkId id)
 
 void NetworksSettingsPage::clientNetworkUpdated()
 {
 
 void NetworksSettingsPage::clientNetworkUpdated()
 {
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net) {
         qWarning() << "Update request for unknown network received!";
         return;
     if (!net) {
         qWarning() << "Update request for unknown network received!";
         return;
@@ -524,7 +524,7 @@ void NetworksSettingsPage::clientNetworkRemoved(NetworkId id)
 void NetworksSettingsPage::networkConnectionStateChanged(Network::ConnectionState state)
 {
     Q_UNUSED(state);
 void NetworksSettingsPage::networkConnectionStateChanged(Network::ConnectionState state)
 {
     Q_UNUSED(state);
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net) return;
     /*
     if(net->networkId() == currentId) {
     if (!net) return;
     /*
     if(net->networkId() == currentId) {
@@ -707,7 +707,7 @@ void NetworksSettingsPage::saveToNetworkInfo(NetworkInfo &info)
 void NetworksSettingsPage::clientNetworkCapsUpdated()
 {
     // Grab the updated network
 void NetworksSettingsPage::clientNetworkCapsUpdated()
 {
     // Grab the updated network
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net) {
         qWarning() << "Update request for unknown network received!";
         return;
     if (!net) {
         qWarning() << "Update request for unknown network received!";
         return;
index 2c164bc..5b9795a 100644 (file)
@@ -27,7 +27,7 @@
 NotificationsSettingsPage::NotificationsSettingsPage(QWidget *parent)
     : SettingsPage(tr("Interface"), tr("Notifications"), parent)
 {
 NotificationsSettingsPage::NotificationsSettingsPage(QWidget *parent)
     : SettingsPage(tr("Interface"), tr("Notifications"), parent)
 {
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     foreach(AbstractNotificationBackend *backend, QtUi::notificationBackends()) {
         SettingsPage *cw = backend->createConfigWidget();
         if (cw) {
     foreach(AbstractNotificationBackend *backend, QtUi::notificationBackends()) {
         SettingsPage *cw = backend->createConfigWidget();
         if (cw) {
index 66bd1a6..4eb5ab3 100644 (file)
@@ -30,14 +30,14 @@ ShortcutsModel::ShortcutsModel(const QHash<QString, ActionCollection *> &actionC
 {
     for (int r = 0; r < actionCollections.values().count(); r++) {
         ActionCollection *coll = actionCollections.values().at(r);
 {
     for (int r = 0; r < actionCollections.values().count(); r++) {
         ActionCollection *coll = actionCollections.values().at(r);
-        Item *item = new Item();
+        auto *item = new Item();
         item->row = r;
         item->collection = coll;
         for (int i = 0; i < coll->actions().count(); i++) {
         item->row = r;
         item->collection = coll;
         for (int i = 0; i < coll->actions().count(); i++) {
-            Action *action = qobject_cast<Action *>(coll->actions().at(i));
+            auto *action = qobject_cast<Action *>(coll->actions().at(i));
             if (!action)
                 continue;
             if (!action)
                 continue;
-            Item *actionItem = new Item();
+            auto *actionItem = new Item();
             actionItem->parentItem = item;
             actionItem->row = i;
             actionItem->collection = coll;
             actionItem->parentItem = item;
             actionItem->row = i;
             actionItem->collection = coll;
@@ -61,7 +61,7 @@ QModelIndex ShortcutsModel::parent(const QModelIndex &child) const
     if (!child.isValid())
         return QModelIndex();
 
     if (!child.isValid())
         return QModelIndex();
 
-    Item *item = static_cast<Item *>(child.internalPointer());
+    auto *item = static_cast<Item *>(child.internalPointer());
     Q_ASSERT(item);
 
     if (!item->parentItem)
     Q_ASSERT(item);
 
     if (!item->parentItem)
@@ -87,7 +87,7 @@ int ShortcutsModel::columnCount(const QModelIndex &parent) const
     if (!parent.isValid())
         return 2;
 
     if (!parent.isValid())
         return 2;
 
-    Item *item = static_cast<Item *>(parent.internalPointer());
+    auto *item = static_cast<Item *>(parent.internalPointer());
     Q_ASSERT(item);
 
     if (!item->parentItem)
     Q_ASSERT(item);
 
     if (!item->parentItem)
@@ -102,7 +102,7 @@ int ShortcutsModel::rowCount(const QModelIndex &parent) const
     if (!parent.isValid())
         return _categoryItems.count();
 
     if (!parent.isValid())
         return _categoryItems.count();
 
-    Item *item = static_cast<Item *>(parent.internalPointer());
+    auto *item = static_cast<Item *>(parent.internalPointer());
     Q_ASSERT(item);
 
     if (!item->parentItem)
     Q_ASSERT(item);
 
     if (!item->parentItem)
@@ -132,7 +132,7 @@ QVariant ShortcutsModel::data(const QModelIndex &index, int role) const
     if (!index.isValid())
         return QVariant();
 
     if (!index.isValid())
         return QVariant();
 
-    Item *item = static_cast<Item *>(index.internalPointer());
+    auto *item = static_cast<Item *>(index.internalPointer());
     Q_ASSERT(item);
 
     if (!item->parentItem) {
     Q_ASSERT(item);
 
     if (!item->parentItem) {
@@ -146,7 +146,7 @@ QVariant ShortcutsModel::data(const QModelIndex &index, int role) const
         }
     }
 
         }
     }
 
-    Action *action = qobject_cast<Action *>(item->action);
+    auto *action = qobject_cast<Action *>(item->action);
     Q_ASSERT(action);
 
     switch (role) {
     Q_ASSERT(action);
 
     switch (role) {
@@ -190,7 +190,7 @@ bool ShortcutsModel::setData(const QModelIndex &index, const QVariant &value, in
     if (!index.parent().isValid())
         return false;
 
     if (!index.parent().isValid())
         return false;
 
-    Item *item = static_cast<Item *>(index.internalPointer());
+    auto *item = static_cast<Item *>(index.internalPointer());
     Q_ASSERT(item);
 
     QKeySequence newSeq = value.value<QKeySequence>();
     Q_ASSERT(item);
 
     QKeySequence newSeq = value.value<QKeySequence>();
index 8bd842a..cf893fa 100644 (file)
@@ -27,7 +27,7 @@
 SonnetSettingsPage::SonnetSettingsPage(QWidget *parent)
     : SettingsPage(tr("Interface"), tr("Spell Checking"), parent)
 {
 SonnetSettingsPage::SonnetSettingsPage(QWidget *parent)
     : SettingsPage(tr("Interface"), tr("Spell Checking"), parent)
 {
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    auto *layout = new QVBoxLayout(this);
     _configWidget = new Sonnet::ConfigWidget(this);
     layout->addWidget(_configWidget);
     connect(_configWidget, SIGNAL(configChanged()), SLOT(widgetHasChanged()));
     _configWidget = new Sonnet::ConfigWidget(this);
     layout->addWidget(_configWidget);
     connect(_configWidget, SIGNAL(configChanged()), SLOT(widgetHasChanged()));
index 17778b7..138364c 100644 (file)
@@ -145,7 +145,7 @@ SystrayNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : Settin
     _showBubbleBox = new QCheckBox(tr("Show a message in a popup"));
     _showBubbleBox->setIcon(icon::get("dialog-information"));
     connect(_showBubbleBox, SIGNAL(toggled(bool)), this, SLOT(widgetChanged()));
     _showBubbleBox = new QCheckBox(tr("Show a message in a popup"));
     _showBubbleBox->setIcon(icon::get("dialog-information"));
     connect(_showBubbleBox, SIGNAL(toggled(bool)), this, SLOT(widgetChanged()));
-    QHBoxLayout *layout = new QHBoxLayout(this);
+    auto *layout = new QHBoxLayout(this);
     layout->addWidget(_showBubbleBox);
 }
 
     layout->addWidget(_showBubbleBox);
 }
 
index ef9736f..47109bc 100644 (file)
@@ -78,7 +78,7 @@ SettingsPage *TaskbarNotificationBackend::createConfigWidget() const
 
 TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "TaskbarNotification", parent)
 {
 
 TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "TaskbarNotification", parent)
 {
-    QHBoxLayout *layout = new QHBoxLayout(this);
+    auto *layout = new QHBoxLayout(this);
 #ifdef Q_OS_MAC
     layout->addWidget(enabledBox = new QCheckBox(tr("Activate dock entry, timeout:"), this));
 #else
 #ifdef Q_OS_MAC
     layout->addWidget(enabledBox = new QCheckBox(tr("Activate dock entry, timeout:"), this));
 #else
index 5426b08..1dcc0ee 100644 (file)
@@ -255,7 +255,7 @@ bool TopicWidget::eventFilter(QObject *obj, QEvent *event)
     if (event->type() != QEvent::KeyRelease)
         return QObject::eventFilter(obj, event);
 
     if (event->type() != QEvent::KeyRelease)
         return QObject::eventFilter(obj, event);
 
-    QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+    auto *keyEvent = static_cast<QKeyEvent *>(event);
 
     if (keyEvent->key() == Qt::Key_Escape) {
         switchPlain();
 
     if (keyEvent->key() == Qt::Key_Escape) {
         switchPlain();
index 2cc03e1..5000126 100644 (file)
@@ -68,7 +68,7 @@ Action *ActionCollection::addAction(const QString &name, Action *action)
 
 Action *ActionCollection::addAction(const QString &name, const QObject *receiver, const char *member)
 {
 
 Action *ActionCollection::addAction(const QString &name, const QObject *receiver, const char *member)
 {
-    Action *a = new Action(this);
+    auto *a = new Action(this);
     if (receiver && member)
         connect(a, SIGNAL(triggered(bool)), receiver, member);
     return addAction(name, a);
     if (receiver && member)
         connect(a, SIGNAL(triggered(bool)), receiver, member);
     return addAction(name, a);
@@ -151,7 +151,7 @@ void ActionCollection::readSettings()
     foreach(const QString &name, _actionByName.keys()) {
         if (!savedShortcuts.contains(name))
             continue;
     foreach(const QString &name, _actionByName.keys()) {
         if (!savedShortcuts.contains(name))
             continue;
-        Action *action = qobject_cast<Action *>(_actionByName.value(name));
+        auto *action = qobject_cast<Action *>(_actionByName.value(name));
         if (action)
             action->setShortcut(s.loadShortcut(name), Action::ActiveShortcut);
     }
         if (action)
             action->setShortcut(s.loadShortcut(name), Action::ActiveShortcut);
     }
@@ -162,7 +162,7 @@ void ActionCollection::writeSettings() const
 {
     ShortcutSettings s;
     foreach(const QString &name, _actionByName.keys()) {
 {
     ShortcutSettings s;
     foreach(const QString &name, _actionByName.keys()) {
-        Action *action = qobject_cast<Action *>(_actionByName.value(name));
+        auto *action = qobject_cast<Action *>(_actionByName.value(name));
         if (!action)
             continue;
         if (!action->isShortcutConfigurable())
         if (!action)
             continue;
         if (!action->isShortcutConfigurable())
@@ -176,7 +176,7 @@ void ActionCollection::writeSettings() const
 
 void ActionCollection::slotActionTriggered()
 {
 
 void ActionCollection::slotActionTriggered()
 {
-    QAction *action = qobject_cast<QAction *>(sender());
+    auto *action = qobject_cast<QAction *>(sender());
     if (action)
         emit actionTriggered(action);
 }
     if (action)
         emit actionTriggered(action);
 }
@@ -184,7 +184,7 @@ void ActionCollection::slotActionTriggered()
 
 void ActionCollection::slotActionHovered()
 {
 
 void ActionCollection::slotActionHovered()
 {
-    QAction *action = qobject_cast<QAction *>(sender());
+    auto *action = qobject_cast<QAction *>(sender());
     if (action)
         emit actionHovered(action);
 }
     if (action)
         emit actionHovered(action);
 }
@@ -193,7 +193,7 @@ void ActionCollection::slotActionHovered()
 void ActionCollection::actionDestroyed(QObject *obj)
 {
     // remember that this is not an QAction anymore at this point
 void ActionCollection::actionDestroyed(QObject *obj)
 {
     // remember that this is not an QAction anymore at this point
-    QAction *action = static_cast<QAction *>(obj);
+    auto *action = static_cast<QAction *>(obj);
 
     unlistAction(action);
 }
 
     unlistAction(action);
 }
index d26c357..fa1ef24 100644 (file)
@@ -82,7 +82,7 @@ public:
     template<class ActionType>
     ActionType *add(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr)
     {
     template<class ActionType>
     ActionType *add(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr)
     {
-        ActionType *a = new ActionType(this);
+        auto *a = new ActionType(this);
         if (receiver && member)
             connect(a, SIGNAL(triggered(bool)), receiver, member);
         addAction(name, a);
         if (receiver && member)
             connect(a, SIGNAL(triggered(bool)), receiver, member);
         addAction(name, a);
index 0925b50..f131695 100644 (file)
@@ -56,7 +56,7 @@ BufferView::BufferView(QWidget *parent)
     setSelectionMode(QAbstractItemView::ExtendedSelection);
 
     QAbstractItemDelegate *oldDelegate = itemDelegate();
     setSelectionMode(QAbstractItemView::ExtendedSelection);
 
     QAbstractItemDelegate *oldDelegate = itemDelegate();
-    BufferViewDelegate *tristateDelegate = new BufferViewDelegate(this);
+    auto *tristateDelegate = new BufferViewDelegate(this);
     setItemDelegate(tristateDelegate);
     delete oldDelegate;
 }
     setItemDelegate(tristateDelegate);
     delete oldDelegate;
 }
@@ -139,7 +139,7 @@ void BufferView::setModel(QAbstractItemModel *model)
 
 void BufferView::setFilteredModel(QAbstractItemModel *model_, BufferViewConfig *config)
 {
 
 void BufferView::setFilteredModel(QAbstractItemModel *model_, BufferViewConfig *config)
 {
-    BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(model());
+    auto *filter = qobject_cast<BufferViewFilter *>(model());
     if (filter) {
         filter->setConfig(config);
         setConfig(config);
     if (filter) {
         filter->setConfig(config);
         setConfig(config);
@@ -155,7 +155,7 @@ void BufferView::setFilteredModel(QAbstractItemModel *model_, BufferViewConfig *
         setModel(model_);
     }
     else {
         setModel(model_);
     }
     else {
-        BufferViewFilter *filter = new BufferViewFilter(model_, config);
+        auto *filter = new BufferViewFilter(model_, config);
         setModel(filter);
         connect(filter, SIGNAL(configChanged()), this, SLOT(on_configChanged()));
     }
         setModel(filter);
         connect(filter, SIGNAL(configChanged()), this, SLOT(on_configChanged()));
     }
@@ -410,7 +410,7 @@ void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bott
 
 void BufferView::toggleHeader(bool checked)
 {
 
 void BufferView::toggleHeader(bool checked)
 {
-    QAction *action = qobject_cast<QAction *>(sender());
+    auto *action = qobject_cast<QAction *>(sender());
     header()->setSectionHidden((action->property("column")).toInt(), !checked);
 }
 
     header()->setSectionHidden((action->property("column")).toInt(), !checked);
 }
 
@@ -447,7 +447,7 @@ void BufferView::addActionsToMenu(QMenu *contextMenu, const QModelIndex &index)
 
 void BufferView::addFilterActions(QMenu *contextMenu, const QModelIndex &index)
 {
 
 void BufferView::addFilterActions(QMenu *contextMenu, const QModelIndex &index)
 {
-    BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(model());
+    auto *filter = qobject_cast<BufferViewFilter *>(model());
     if (filter) {
         QList<QAction *> filterActions = filter->actions(index);
         if (!filterActions.isEmpty()) {
     if (filter) {
         QList<QAction *> filterActions = filter->actions(index);
         if (!filterActions.isEmpty()) {
@@ -588,7 +588,7 @@ void BufferView::hideCurrentBuffer()
 
 void BufferView::filterTextChanged(const QString& filterString)
 {
 
 void BufferView::filterTextChanged(const QString& filterString)
 {
-    BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(model());
+    auto *filter = qobject_cast<BufferViewFilter *>(model());
     if (!filter) {
         return;
     }
     if (!filter) {
         return;
     }
@@ -619,7 +619,7 @@ QSize BufferView::sizeHint() const
 void BufferView::changeHighlight(BufferView::Direction direction)
 {
     // If for some weird reason we get a new delegate
 void BufferView::changeHighlight(BufferView::Direction direction)
 {
     // If for some weird reason we get a new delegate
-    BufferViewDelegate *delegate = qobject_cast<BufferViewDelegate*>(itemDelegate(_currentHighlight));
+    auto delegate = qobject_cast<BufferViewDelegate*>(itemDelegate(_currentHighlight));
     if (delegate) {
         delegate->currentHighlight = QModelIndex();
     }
     if (delegate) {
         delegate->currentHighlight = QModelIndex();
     }
@@ -663,7 +663,7 @@ void BufferView::selectHighlighted()
 void BufferView::clearHighlight()
 {
     // If for some weird reason we get a new delegate
 void BufferView::clearHighlight()
 {
     // If for some weird reason we get a new delegate
-    BufferViewDelegate *delegate = qobject_cast<BufferViewDelegate*>(itemDelegate(_currentHighlight));
+    auto delegate = qobject_cast<BufferViewDelegate*>(itemDelegate(_currentHighlight));
     if (delegate) {
         delegate->currentHighlight = QModelIndex();
     }
     if (delegate) {
         delegate->currentHighlight = QModelIndex();
     }
@@ -712,12 +712,12 @@ bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, c
     initStyleOption(&viewOpt, index);
 
     QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
     initStyleOption(&viewOpt, index);
 
     QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
-    QMouseEvent *me = static_cast<QMouseEvent *>(event);
+    auto *me = static_cast<QMouseEvent *>(event);
 
     if (me->button() != Qt::LeftButton || !checkRect.contains(me->pos()))
         return QStyledItemDelegate::editorEvent(event, model, option, index);
 
 
     if (me->button() != Qt::LeftButton || !checkRect.contains(me->pos()))
         return QStyledItemDelegate::editorEvent(event, model, option, index);
 
-    Qt::CheckState state = static_cast<Qt::CheckState>(value.toInt());
+    auto state = static_cast<Qt::CheckState>(value.toInt());
     if (state == Qt::Unchecked)
         state = Qt::PartiallyChecked;
     else if (state == Qt::PartiallyChecked)
     if (state == Qt::Unchecked)
         state = Qt::PartiallyChecked;
     else if (state == Qt::PartiallyChecked)
@@ -834,7 +834,7 @@ bool BufferViewDock::eventFilter(QObject *object, QEvent *event)
            return true;
        }
    } else if (event->type() == QEvent::KeyRelease) {
            return true;
        }
    } else if (event->type() == QEvent::KeyRelease) {
-       QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+       auto keyEvent = static_cast<QKeyEvent*>(event);
 
        BufferView *view = bufferView();
        if (!view) {
 
        BufferView *view = bufferView();
        if (!view) {
index 51d9864..b8b78e2 100644 (file)
@@ -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!
         // 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;
             }
             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--;
             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);
             }
                 if (!clientConf || !clientConf->isLocked())
                     config()->requestMoveBuffer(bufferId, pos);
             }
index 6ef3868..79c9d19 100644 (file)
@@ -92,7 +92,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM
     registerAction(ShowNetworkConfig, tr("Configure"));
     registerAction(ShowIgnoreList, tr("Show Ignore List"));
 
     registerAction(ShowNetworkConfig, tr("Configure"));
     registerAction(ShowIgnoreList, tr("Show Ignore List"));
 
-    QMenu *hideEventsMenu = new QMenu();
+    auto *hideEventsMenu = new QMenu();
     hideEventsMenu->addAction(action(HideJoinPartQuit));
     hideEventsMenu->addSeparator();
     hideEventsMenu->addAction(action(HideJoin));
     hideEventsMenu->addAction(action(HideJoinPartQuit));
     hideEventsMenu->addSeparator();
     hideEventsMenu->addAction(action(HideJoin));
@@ -108,7 +108,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM
     _hideEventsMenuAction = new Action(tr("Hide Events"), nullptr);
     _hideEventsMenuAction->setMenu(hideEventsMenu);
 
     _hideEventsMenuAction = new Action(tr("Hide Events"), nullptr);
     _hideEventsMenuAction->setMenu(hideEventsMenu);
 
-    QMenu *nickCtcpMenu = new QMenu();
+    auto *nickCtcpMenu = new QMenu();
     nickCtcpMenu->addAction(action(NickCtcpPing));
     nickCtcpMenu->addAction(action(NickCtcpVersion));
     nickCtcpMenu->addAction(action(NickCtcpTime));
     nickCtcpMenu->addAction(action(NickCtcpPing));
     nickCtcpMenu->addAction(action(NickCtcpVersion));
     nickCtcpMenu->addAction(action(NickCtcpTime));
@@ -116,7 +116,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM
     _nickCtcpMenuAction = new Action(tr("CTCP"), nullptr);
     _nickCtcpMenuAction->setMenu(nickCtcpMenu);
 
     _nickCtcpMenuAction = new Action(tr("CTCP"), nullptr);
     _nickCtcpMenuAction->setMenu(nickCtcpMenu);
 
-    QMenu *nickModeMenu = new QMenu();
+    auto *nickModeMenu = new QMenu();
     nickModeMenu->addAction(action(NickOp));
     nickModeMenu->addAction(action(NickDeop));
     // this is where the halfops will be placed if available
     nickModeMenu->addAction(action(NickOp));
     nickModeMenu->addAction(action(NickDeop));
     // this is where the halfops will be placed if available
@@ -131,7 +131,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM
     _nickModeMenuAction = new Action(tr("Actions"), nullptr);
     _nickModeMenuAction->setMenu(nickModeMenu);
 
     _nickModeMenuAction = new Action(tr("Actions"), nullptr);
     _nickModeMenuAction->setMenu(nickModeMenu);
 
-    QMenu *ignoreMenu = new QMenu();
+    auto *ignoreMenu = new QMenu();
     _nickIgnoreMenuAction = new Action(tr("Ignore"), nullptr);
     _nickIgnoreMenuAction->setMenu(ignoreMenu);
 
     _nickIgnoreMenuAction = new Action(tr("Ignore"), nullptr);
     _nickIgnoreMenuAction->setMenu(ignoreMenu);
 
@@ -348,7 +348,7 @@ void ContextMenuActionProvider::addIrcUserActions(QMenu *menu, const QModelIndex
         addAction(_nickModeMenuAction, menu, itemType == NetworkModel::IrcUserItemType);
         addAction(_nickCtcpMenuAction, menu);
 
         addAction(_nickModeMenuAction, menu, itemType == NetworkModel::IrcUserItemType);
         addAction(_nickCtcpMenuAction, menu);
 
-        IrcUser *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
+        auto *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
         if (ircUser) {
             Network *network = ircUser->network();
             // only show entries for usermode +h if server supports it
         if (ircUser) {
             Network *network = ircUser->network();
             // only show entries for usermode +h if server supports it
@@ -508,7 +508,7 @@ void ContextMenuActionProvider::addIgnoreMenu(QMenu *menu, const QString &hostma
             ignoreMenu->addAction(_ignoreDescriptions.at(1));
         while (ruleIter != ignoreMap.constEnd()) {
             if (counter < 5) {
             ignoreMenu->addAction(_ignoreDescriptions.at(1));
         while (ruleIter != ignoreMap.constEnd()) {
             if (counter < 5) {
-                ActionType type = static_cast<ActionType>(NickIgnoreToggleEnabled0 + counter*0x100000);
+                auto type = static_cast<ActionType>(NickIgnoreToggleEnabled0 + counter*0x100000);
                 Action *act = action(type);
                 act->setText(ruleIter.key());
                 act->setProperty("ignoreRule", ruleIter.key());
                 Action *act = action(type);
                 act->setText(ruleIter.key());
                 act->setProperty("ignoreRule", ruleIter.key());
index 8088c13..8af5024 100644 (file)
@@ -179,7 +179,7 @@ QItemSelection FlatProxyModel::mapSelectionToSource(const QItemSelection &proxyS
 
         SourceItem *topLeftItem = nullptr;
         SourceItem *bottomRightItem = nullptr;
 
         SourceItem *topLeftItem = nullptr;
         SourceItem *bottomRightItem = nullptr;
-        SourceItem *currentItem = static_cast<SourceItem *>(range.topLeft().internalPointer());
+        auto *currentItem = static_cast<SourceItem *>(range.topLeft().internalPointer());
         int row = range.topLeft().row();
         int left = range.topLeft().column();
         int right = range.bottomRight().column();
         int row = range.topLeft().row();
         int left = range.topLeft().column();
         int right = range.bottomRight().column();
index 868930a..d4a341c 100644 (file)
@@ -28,7 +28,7 @@
 
 FontSelector::FontSelector(QWidget *parent) : QWidget(parent)
 {
 
 FontSelector::FontSelector(QWidget *parent) : QWidget(parent)
 {
-    QHBoxLayout *layout = new QHBoxLayout(this);
+    auto *layout = new QHBoxLayout(this);
     QPushButton *chooseButton = new QPushButton(tr("Choose..."), this);
     connect(chooseButton, SIGNAL(clicked()), SLOT(chooseFont()));
 
     QPushButton *chooseButton = new QPushButton(tr("Choose..."), this);
     connect(chooseButton, SIGNAL(clicked()), SLOT(chooseFont()));
 
index 74ca040..2042fef 100644 (file)
@@ -69,7 +69,7 @@ ActionCollection *GraphicalUi::actionCollection(const QString &category, const Q
 {
     if (_actionCollections.contains(category))
         return _actionCollections.value(category);
 {
     if (_actionCollections.contains(category))
         return _actionCollections.value(category);
-    ActionCollection *coll = new ActionCollection(_mainWidget);
+    auto *coll = new ActionCollection(_mainWidget);
 
     if (!translatedCategory.isEmpty())
         coll->setProperty("Category", translatedCategory);
 
     if (!translatedCategory.isEmpty())
         coll->setProperty("Category", translatedCategory);
index e60d069..ac92235 100644 (file)
@@ -213,7 +213,7 @@ void MultiLineEdit::updateSizeHint()
 QSize MultiLineEdit::sizeHint() const
 {
     if (!_sizeHint.isValid()) {
 QSize MultiLineEdit::sizeHint() const
 {
     if (!_sizeHint.isValid()) {
-        MultiLineEdit *that = const_cast<MultiLineEdit *>(this);
+        auto *that = const_cast<MultiLineEdit *>(this);
         that->updateSizeHint();
     }
     return _sizeHint;
         that->updateSizeHint();
     }
     return _sizeHint;
@@ -298,7 +298,7 @@ bool MultiLineEdit::event(QEvent *e)
 {
     // We need to make sure that global shortcuts aren't eaten
     if (e->type() == QEvent::ShortcutOverride) {
 {
     // We need to make sure that global shortcuts aren't eaten
     if (e->type() == QEvent::ShortcutOverride) {
-        QKeyEvent *event = static_cast<QKeyEvent *>(e);
+        auto *event = static_cast<QKeyEvent *>(e);
         QKeySequence key = QKeySequence(event->key() | event->modifiers());
         foreach(QAction *action, GraphicalUi::actionCollection()->actions()) {
             if (action->shortcuts().contains(key)) {
         QKeySequence key = QKeySequence(event->key() | event->modifiers());
         foreach(QAction *action, GraphicalUi::actionCollection()->actions()) {
             if (action->shortcuts().contains(key)) {
index 3b29c93..a6edb66 100644 (file)
@@ -121,7 +121,7 @@ bool NetworkModelController::checkRequirements(const QModelIndex &index, ItemAct
 
 QString NetworkModelController::nickName(const QModelIndex &index) const
 {
 
 QString NetworkModelController::nickName(const QModelIndex &index) const
 {
-    IrcUser *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
+    auto *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
     if (ircUser)
         return ircUser->nick();
 
     if (ircUser)
         return ircUser->nick();
 
@@ -487,7 +487,7 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
             break;
         case NickIgnoreUser:
         {
             break;
         case NickIgnoreUser:
         {
-            IrcUser *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
+            auto *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
             if (!ircUser)
                 break;
             Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore,
             if (!ircUser)
                 break;
             Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore,
@@ -499,7 +499,7 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
         }
         case NickIgnoreHost:
         {
         }
         case NickIgnoreHost:
         {
-            IrcUser *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
+            auto *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
             if (!ircUser)
                 break;
             Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore,
             if (!ircUser)
                 break;
             Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore,
@@ -511,7 +511,7 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
         }
         case NickIgnoreDomain:
         {
         }
         case NickIgnoreDomain:
         {
-            IrcUser *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
+            auto *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
             if (!ircUser)
                 break;
             Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore,
             if (!ircUser)
                 break;
             Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore,
@@ -548,7 +548,7 @@ NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *pare
     setWindowIcon(icon::get("irc-join-channel"));
     setWindowTitle(tr("Join Channel"));
 
     setWindowIcon(icon::get("irc-join-channel"));
     setWindowTitle(tr("Join Channel"));
 
-    QGridLayout *layout = new QGridLayout(this);
+    auto *layout = new QGridLayout(this);
     layout->addWidget(new QLabel(tr("Network:")), 0, 0);
     layout->addWidget(networks = new QComboBox, 0, 1);
     layout->addWidget(new QLabel(tr("Channel:")), 1, 0);
     layout->addWidget(new QLabel(tr("Network:")), 0, 0);
     layout->addWidget(networks = new QComboBox, 0, 1);
     layout->addWidget(new QLabel(tr("Channel:")), 1, 0);
index d9e84ec..5adaf73 100644 (file)
@@ -141,7 +141,7 @@ void NickView::startQuery(const QModelIndex &index)
     if (index.data(NetworkModel::ItemTypeRole) != NetworkModel::IrcUserItemType)
         return;
 
     if (index.data(NetworkModel::ItemTypeRole) != NetworkModel::IrcUserItemType)
         return;
 
-    IrcUser *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
+    auto *ircUser = qobject_cast<IrcUser *>(index.data(NetworkModel::IrcUserRole).value<QObject *>());
     NetworkId networkId = index.data(NetworkModel::NetworkIdRole).value<NetworkId>();
     if (!ircUser || !networkId.isValid())
         return;
     NetworkId networkId = index.data(NetworkModel::NetworkIdRole).value<NetworkId>();
     if (!ircUser || !networkId.isValid())
         return;
index a068961..957ddb0 100644 (file)
@@ -179,7 +179,7 @@ bool TabCompleter::eventFilter(QObject *obj, QEvent *event)
     if (obj != _lineEdit || event->type() != QEvent::KeyPress)
         return QObject::eventFilter(obj, event);
 
     if (obj != _lineEdit || event->type() != QEvent::KeyPress)
         return QObject::eventFilter(obj, event);
 
-    QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+    auto *keyEvent = static_cast<QKeyEvent *>(event);
 
     if (keyEvent->key() == GraphicalUi::actionCollection("General")->action("TabCompletionKey")->shortcut()[0])
         complete();
 
     if (keyEvent->key() == GraphicalUi::actionCollection("General")->action("TabCompletionKey")->shortcut()[0])
         complete();
index 9342628..178ccc4 100644 (file)
@@ -210,7 +210,7 @@ void ToolBarActionProvider::networkUpdated(const Network *net)
 
 void ToolBarActionProvider::connectOrDisconnectNet()
 {
 
 void ToolBarActionProvider::connectOrDisconnectNet()
 {
-    QAction *act = qobject_cast<QAction *>(sender());
+    auto *act = qobject_cast<QAction *>(sender());
     if (!act)
         return;
     const Network *net = Client::network(act->data().value<NetworkId>());
     if (!act)
         return;
     const Network *net = Client::network(act->data().value<NetworkId>());
index f7edcbc..8b7a4f0 100644 (file)
@@ -709,7 +709,7 @@ UiStyle::StyledString UiStyle::styleString(const QString &s_, FormatType baseFor
         }
         else if (s[pos+1] == 'R') { // Reverse colors
             fgChar = (fgChar == 'f' ? 'b' : 'f');
         }
         else if (s[pos+1] == 'R') { // Reverse colors
             fgChar = (fgChar == 'f' ? 'b' : 'f');
-            quint32 orig = static_cast<quint32>(curfmt.type & 0xffc00000);
+            auto orig = static_cast<quint32>(curfmt.type & 0xffc00000);
             curfmt.type &= 0x003fffff;
             curfmt.type |= (orig & 0x00400000) <<1;
             curfmt.type |= (orig & 0x0f000000) <<4;
             curfmt.type &= 0x003fffff;
             curfmt.type |= (orig & 0x00400000) <<1;
             curfmt.type |= (orig & 0x0f000000) <<4;
@@ -1264,8 +1264,8 @@ UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemF
 QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList)
 {
     out << static_cast<quint16>(formatList.size());
 QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList)
 {
     out << static_cast<quint16>(formatList.size());
-    UiStyle::FormatList::const_iterator it = formatList.begin();
-    while (it != formatList.end()) {
+    auto it = formatList.cbegin();
+    while (it != formatList.cend()) {
         out << it->first
             << static_cast<quint32>(it->second.type)
             << it->second.foreground
         out << it->first
             << static_cast<quint32>(it->second.type)
             << it->second.foreground