From 39328183a6a87c6eb10a9dbbffcd5d65bf154a1f Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 6 Sep 2018 00:09:45 +0200 Subject: [PATCH] modernize: Use nullptr Let clang-tidy fix all occurrences where nullptr should be used instead of 0. --- src/client/abstractui.h | 2 +- src/client/buffermodel.h | 2 +- src/client/bufferviewoverlay.cpp | 4 +- src/client/bufferviewoverlay.h | 2 +- src/client/client.cpp | 32 ++++----- src/client/clientaliasmanager.h | 2 +- src/client/clientauthhandler.cpp | 4 +- src/client/clientauthhandler.h | 2 +- src/client/clientbacklogmanager.cpp | 4 +- src/client/clientbacklogmanager.h | 2 +- src/client/clientbufferviewconfig.h | 2 +- src/client/clientbufferviewmanager.h | 2 +- src/client/clientidentity.cpp | 6 +- src/client/clientidentity.h | 6 +- src/client/clientignorelistmanager.h | 2 +- src/client/clientirclisthelper.h | 2 +- src/client/clienttransfer.cpp | 8 +-- src/client/clienttransfer.h | 2 +- src/client/clientuserinputhandler.cpp | 2 +- src/client/clientuserinputhandler.h | 2 +- src/client/coreaccountmodel.h | 4 +- src/client/coreconnection.cpp | 16 ++--- src/client/coreconnection.h | 2 +- src/client/execwrapper.h | 2 +- src/client/irclistmodel.h | 2 +- src/client/messagefilter.h | 4 +- src/client/networkmodel.cpp | 70 +++++++++---------- src/client/networkmodel.h | 6 +- src/client/selectionmodelsynchronizer.cpp | 24 +++---- src/client/selectionmodelsynchronizer.h | 2 +- src/client/transfermodel.cpp | 4 +- src/client/treemodel.cpp | 12 ++-- src/client/treemodel.h | 8 +-- src/common/aliasmanager.h | 2 +- src/common/authhandler.cpp | 2 +- src/common/authhandler.h | 2 +- src/common/backlogmanager.h | 2 +- src/common/basichandler.cpp | 6 +- src/common/basichandler.h | 6 +- src/common/bufferviewconfig.h | 4 +- src/common/bufferviewmanager.cpp | 2 +- src/common/bufferviewmanager.h | 2 +- src/common/compressor.cpp | 4 +- src/common/compressor.h | 2 +- src/common/ctcpevent.cpp | 2 +- src/common/event.cpp | 8 +-- src/common/eventmanager.cpp | 2 +- src/common/eventmanager.h | 4 +- src/common/identity.h | 6 +- src/common/ignorelistmanager.h | 2 +- src/common/ircchannel.cpp | 10 +-- src/common/ircevent.cpp | 2 +- src/common/irclisthelper.h | 2 +- src/common/ircuser.cpp | 10 +-- src/common/logbacktrace_unix.cpp | 2 +- src/common/messageevent.cpp | 2 +- src/common/network.cpp | 22 +++--- src/common/network.h | 2 +- src/common/networkconfig.h | 2 +- src/common/networkevent.cpp | 2 +- src/common/peer.h | 2 +- src/common/peerfactory.h | 4 +- .../protocols/datastream/datastreampeer.h | 2 +- src/common/protocols/legacy/legacypeer.h | 2 +- src/common/remotepeer.cpp | 6 +- src/common/remotepeer.h | 2 +- src/common/signalproxy.cpp | 14 ++-- src/common/signalproxy.h | 4 +- src/common/syncableobject.cpp | 2 +- src/common/syncableobject.h | 6 +- src/common/transfer.h | 8 +-- src/common/util.h | 2 +- src/core/abstractsqlstorage.cpp | 14 ++-- src/core/abstractsqlstorage.h | 4 +- src/core/core.cpp | 2 +- src/core/coreauthhandler.cpp | 8 +-- src/core/coreauthhandler.h | 2 +- src/core/corebacklogmanager.h | 2 +- src/core/corebasichandler.h | 2 +- src/core/corebufferviewconfig.h | 4 +- src/core/corebufferviewmanager.cpp | 2 +- src/core/coreidentity.h | 6 +- src/core/coreircchannel.cpp | 2 +- src/core/coreircuser.cpp | 2 +- src/core/corenetwork.cpp | 6 +- src/core/coresession.cpp | 24 +++---- src/core/coresession.h | 2 +- src/core/coretransfer.cpp | 4 +- src/core/coretransfer.h | 2 +- src/core/coreuserinputhandler.h | 6 +- src/core/ctcpparser.h | 4 +- src/core/keyevent.cpp | 2 +- src/core/ldapauthenticator.cpp | 32 ++++----- src/core/ldapauthenticator.h | 2 +- src/core/netsplit.h | 2 +- src/core/oidentdconfiggenerator.h | 2 +- src/core/postgresqlstorage.cpp | 2 +- src/core/postgresqlstorage.h | 2 +- src/core/sessionthread.h | 2 +- src/core/sqlauthenticator.h | 2 +- src/core/sqlitestorage.cpp | 2 +- src/core/sqlitestorage.h | 2 +- src/core/sslserver.cpp | 2 +- src/core/sslserver.h | 2 +- src/core/storage.h | 2 +- src/qtui/aboutdlg.h | 2 +- src/qtui/awaylogfilter.h | 2 +- src/qtui/awaylogview.h | 2 +- src/qtui/bufferwidget.cpp | 2 +- src/qtui/bufferwidget.h | 4 +- src/qtui/channellistdlg.cpp | 4 +- src/qtui/channellistdlg.h | 2 +- src/qtui/chatitem.cpp | 10 +-- src/qtui/chatitem.h | 4 +- src/qtui/chatline.cpp | 12 ++-- src/qtui/chatline.h | 6 +- src/qtui/chatlinemodel.h | 2 +- src/qtui/chatmonitorfilter.h | 2 +- src/qtui/chatscene.cpp | 30 ++++---- src/qtui/chatscene.h | 4 +- src/qtui/chatview.cpp | 8 +-- src/qtui/chatview.h | 4 +- src/qtui/chatviewsearchbar.h | 2 +- src/qtui/chatviewsearchcontroller.cpp | 8 +-- src/qtui/chatviewsearchcontroller.h | 6 +- src/qtui/columnhandleitem.h | 4 +- src/qtui/coreconfigwizard.h | 14 ++-- src/qtui/coreconnectdlg.h | 4 +- src/qtui/coreconnectionstatuswidget.h | 2 +- src/qtui/debugbufferviewoverlay.h | 2 +- src/qtui/debugconsole.h | 2 +- src/qtui/debuglogdlg.h | 2 +- src/qtui/debugmessagemodelfilter.h | 2 +- src/qtui/dockmanagernotificationbackend.cpp | 4 +- src/qtui/dockmanagernotificationbackend.h | 4 +- src/qtui/inputwidget.cpp | 6 +- src/qtui/inputwidget.h | 4 +- src/qtui/ircconnectionwizard.cpp | 8 +-- src/qtui/ircconnectionwizard.h | 8 +-- src/qtui/knotificationbackend.h | 4 +- src/qtui/mainpage.h | 2 +- src/qtui/mainwin.cpp | 26 +++---- src/qtui/mainwin.h | 2 +- src/qtui/markerlineitem.cpp | 2 +- src/qtui/markerlineitem.h | 4 +- src/qtui/msgprocessorstatuswidget.h | 2 +- src/qtui/nicklistwidget.cpp | 12 ++-- src/qtui/nicklistwidget.h | 4 +- src/qtui/qtmultimedianotificationbackend.h | 4 +- src/qtui/qtuistyle.h | 2 +- src/qtui/receivefiledlg.h | 2 +- src/qtui/settingsdlg.cpp | 8 +-- src/qtui/settingsdlg.h | 2 +- src/qtui/settingspagedlg.h | 2 +- src/qtui/settingspages/aliasesmodel.h | 2 +- src/qtui/settingspages/aliasessettingspage.h | 2 +- .../settingspages/appearancesettingspage.h | 2 +- src/qtui/settingspages/backlogsettingspage.h | 2 +- .../settingspages/bufferviewsettingspage.cpp | 2 +- .../settingspages/bufferviewsettingspage.h | 4 +- .../settingspages/chatmonitorsettingspage.cpp | 4 +- .../settingspages/chatmonitorsettingspage.h | 2 +- .../settingspages/chatviewcolorsettingspage.h | 2 +- src/qtui/settingspages/chatviewsettingspage.h | 2 +- .../settingspages/connectionsettingspage.h | 2 +- .../settingspages/coreaccountsettingspage.h | 6 +- .../coreconnectionsettingspage.h | 2 +- src/qtui/settingspages/dccsettingspage.cpp | 2 +- .../settingspages/highlightsettingspage.h | 2 +- .../settingspages/identitiessettingspage.cpp | 4 +- .../settingspages/identitiessettingspage.h | 6 +- src/qtui/settingspages/identityeditwidget.h | 6 +- src/qtui/settingspages/ignorelistmodel.h | 2 +- .../settingspages/ignorelistsettingspage.h | 6 +- .../settingspages/inputwidgetsettingspage.h | 2 +- src/qtui/settingspages/itemviewsettingspage.h | 2 +- src/qtui/settingspages/keysequencewidget.cpp | 2 +- src/qtui/settingspages/keysequencewidget.h | 4 +- .../settingspages/networkssettingspage.cpp | 6 +- src/qtui/settingspages/networkssettingspage.h | 12 ++-- .../settingspages/notificationssettingspage.h | 2 +- src/qtui/settingspages/previewbufferview.h | 2 +- src/qtui/settingspages/shortcutsmodel.h | 4 +- .../settingspages/shortcutssettingspage.h | 4 +- src/qtui/settingspages/sonnetsettingspage.h | 2 +- .../settingspages/topicwidgetsettingspage.h | 2 +- src/qtui/simplenetworkeditor.h | 2 +- src/qtui/sslinfodlg.h | 2 +- src/qtui/systraynotificationbackend.h | 4 +- src/qtui/taskbarnotificationbackend.h | 4 +- src/qtui/topicwidget.h | 2 +- src/qtui/verticaldock.cpp | 2 +- src/qtui/verticaldock.h | 4 +- src/qtui/webpreviewitem.cpp | 2 +- src/qtui/webpreviewitem.h | 2 +- src/uisupport/abstractitemview.cpp | 8 +-- src/uisupport/abstractitemview.h | 2 +- src/uisupport/action.h | 4 +- src/uisupport/actioncollection.cpp | 2 +- src/uisupport/actioncollection.h | 4 +- src/uisupport/bufferhotlistfilter.h | 2 +- src/uisupport/bufferview.cpp | 16 ++--- src/uisupport/bufferview.h | 4 +- src/uisupport/bufferviewfilter.cpp | 4 +- src/uisupport/bufferviewfilter.h | 2 +- src/uisupport/bufferviewoverlayfilter.cpp | 6 +- src/uisupport/bufferviewoverlayfilter.h | 2 +- src/uisupport/clearablelineedit.h | 2 +- src/uisupport/clickablelabel.h | 2 +- src/uisupport/colorbutton.h | 4 +- src/uisupport/contextmenuactionprovider.cpp | 12 ++-- src/uisupport/contextmenuactionprovider.h | 12 ++-- src/uisupport/flatproxymodel.cpp | 22 +++--- src/uisupport/flatproxymodel.h | 4 +- src/uisupport/fontselector.h | 2 +- src/uisupport/graphicalui.cpp | 8 +-- src/uisupport/graphicalui.h | 2 +- src/uisupport/multilineedit.h | 4 +- src/uisupport/networkmodelcontroller.cpp | 12 ++-- src/uisupport/networkmodelcontroller.h | 4 +- src/uisupport/nickview.cpp | 2 +- src/uisupport/nickview.h | 2 +- src/uisupport/nickviewfilter.h | 2 +- src/uisupport/resizingstackedwidget.h | 2 +- src/uisupport/settingspage.h | 2 +- src/uisupport/styledlabel.h | 2 +- src/uisupport/toolbaractionprovider.h | 4 +- src/uisupport/treeviewtouch.h | 2 +- src/uisupport/uistyle.h | 2 +- 229 files changed, 563 insertions(+), 563 deletions(-) diff --git a/src/client/abstractui.h b/src/client/abstractui.h index 44467fc5..ce70d33a 100644 --- a/src/client/abstractui.h +++ b/src/client/abstractui.h @@ -38,7 +38,7 @@ class CLIENT_EXPORT AbstractUi : public QObject Q_OBJECT public: - AbstractUi(QObject *parent = 0) : QObject(parent) {} + AbstractUi(QObject *parent = nullptr) : QObject(parent) {} virtual ~AbstractUi() {} virtual void init() = 0; // called after the client is initialized virtual MessageModel *createMessageModel(QObject *parent) = 0; diff --git a/src/client/buffermodel.h b/src/client/buffermodel.h index a8fada2f..4201f3d7 100644 --- a/src/client/buffermodel.h +++ b/src/client/buffermodel.h @@ -38,7 +38,7 @@ class CLIENT_EXPORT BufferModel : public QSortFilterProxyModel Q_OBJECT public: - BufferModel(NetworkModel *parent = 0); + BufferModel(NetworkModel *parent = nullptr); bool filterAcceptsRow(int sourceRow, const QModelIndex &parent) const; diff --git a/src/client/bufferviewoverlay.cpp b/src/client/bufferviewoverlay.cpp index f8d6cb88..d63a26d6 100644 --- a/src/client/bufferviewoverlay.cpp +++ b/src/client/bufferviewoverlay.cpp @@ -130,7 +130,7 @@ void BufferViewOverlay::removeView(int viewId) _bufferViewIds.remove(viewId); BufferViewConfig *config = Client::bufferViewManager()->bufferViewConfig(viewId); if (config) - disconnect(config, 0, this, 0); + disconnect(config, nullptr, this, nullptr); // update initialized State: bool wasInitialized = isInitialized(); @@ -209,7 +209,7 @@ void BufferViewOverlay::updateHelper() QSet tempRemovedBuffers; if (Client::bufferViewManager()) { - BufferViewConfig *config = 0; + BufferViewConfig *config = nullptr; QSet::const_iterator viewIter; for (viewIter = _bufferViewIds.constBegin(); viewIter != _bufferViewIds.constEnd(); ++viewIter) { config = Client::bufferViewManager()->bufferViewConfig(*viewIter); diff --git a/src/client/bufferviewoverlay.h b/src/client/bufferviewoverlay.h index 24e1101b..85b60c48 100644 --- a/src/client/bufferviewoverlay.h +++ b/src/client/bufferviewoverlay.h @@ -34,7 +34,7 @@ class CLIENT_EXPORT BufferViewOverlay : public QObject Q_OBJECT public: - BufferViewOverlay(QObject *parent = 0); + BufferViewOverlay(QObject *parent = nullptr); inline const QSet &bufferViewIds() { return _bufferViewIds; } bool allNetworks(); diff --git a/src/client/client.cpp b/src/client/client.cpp index 81a407b5..84e03c77 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -61,19 +61,19 @@ Client::Client(std::unique_ptr ui, QObject *parent) _mainUi(std::move(ui)), _networkModel(new NetworkModel(this)), _bufferModel(new BufferModel(_networkModel)), - _bufferSyncer(0), - _aliasManager(0), + _bufferSyncer(nullptr), + _aliasManager(nullptr), _backlogManager(new ClientBacklogManager(this)), - _bufferViewManager(0), + _bufferViewManager(nullptr), _bufferViewOverlay(new BufferViewOverlay(this)), _coreInfo(new CoreInfo(this)), - _dccConfig(0), + _dccConfig(nullptr), _ircListHelper(new ClientIrcListHelper(this)), _inputHandler(new ClientUserInputHandler(this)), - _networkConfig(0), - _ignoreListManager(0), - _highlightRuleManager(0), - _transferManager(0), + _networkConfig(nullptr), + _ignoreListManager(nullptr), + _highlightRuleManager(nullptr), + _transferManager(nullptr), _transferModel(new TransferModel(this)), _messageModel(_mainUi->createMessageModel(this)), _messageProcessor(_mainUi->createMessageProcessor(this)), @@ -187,7 +187,7 @@ QList Client::networkIds() const Network *Client::network(NetworkId networkid) { if (instance()->_networks.contains(networkid)) return instance()->_networks[networkid]; - else return 0; + else return nullptr; } @@ -257,7 +257,7 @@ QList Client::identityIds() const Identity *Client::identity(IdentityId id) { if (instance()->_identities.contains(id)) return instance()->_identities[id]; - else return 0; + else return nullptr; } @@ -492,26 +492,26 @@ void Client::setDisconnectedFromCore() if (_bufferSyncer) { _bufferSyncer->deleteLater(); - _bufferSyncer = 0; + _bufferSyncer = nullptr; } _coreInfo->reset(); if (_bufferViewManager) { _bufferViewManager->deleteLater(); - _bufferViewManager = 0; + _bufferViewManager = nullptr; } _bufferViewOverlay->reset(); if (_aliasManager) { _aliasManager->deleteLater(); - _aliasManager = 0; + _aliasManager = nullptr; } if (_ignoreListManager) { _ignoreListManager->deleteLater(); - _ignoreListManager = 0; + _ignoreListManager = nullptr; } if (_highlightRuleManager) { @@ -540,7 +540,7 @@ void Client::setDisconnectedFromCore() while (netIter != _networks.end()) { Network *net = netIter.value(); emit networkRemoved(net->networkId()); - disconnect(net, SIGNAL(destroyed()), this, 0); + disconnect(net, SIGNAL(destroyed()), this, nullptr); netIter = _networks.erase(netIter); net->deleteLater(); } @@ -557,7 +557,7 @@ void Client::setDisconnectedFromCore() if (_networkConfig) { _networkConfig->deleteLater(); - _networkConfig = 0; + _networkConfig = nullptr; } } diff --git a/src/client/clientaliasmanager.h b/src/client/clientaliasmanager.h index 2f0eda43..fe9a782c 100644 --- a/src/client/clientaliasmanager.h +++ b/src/client/clientaliasmanager.h @@ -29,7 +29,7 @@ class CLIENT_EXPORT ClientAliasManager : public AliasManager Q_OBJECT public: - explicit ClientAliasManager(QObject *parent = 0); + explicit ClientAliasManager(QObject *parent = nullptr); protected: const Network *network(NetworkId) const; diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index a29505f9..a3fc870d 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -411,10 +411,10 @@ void ClientAuthHandler::handle(const LoginSuccess &msg) void ClientAuthHandler::handle(const SessionState &msg) { - disconnect(socket(), 0, this, 0); // this is the last message we shall ever get + disconnect(socket(), nullptr, this, nullptr); // this is the last message we shall ever get // give up ownership of the peer; CoreSession takes responsibility now - _peer->setParent(0); + _peer->setParent(nullptr); emit handshakeComplete(_peer, msg); } diff --git a/src/client/clientauthhandler.h b/src/client/clientauthhandler.h index a43d9c8a..47b42a71 100644 --- a/src/client/clientauthhandler.h +++ b/src/client/clientauthhandler.h @@ -39,7 +39,7 @@ public: Latest=Sha2_512 }; - ClientAuthHandler(CoreAccount account, QObject *parent = 0); + ClientAuthHandler(CoreAccount account, QObject *parent = nullptr); Peer *peer() const; diff --git a/src/client/clientbacklogmanager.cpp b/src/client/clientbacklogmanager.cpp index c36763dd..afb9faa6 100644 --- a/src/client/clientbacklogmanager.cpp +++ b/src/client/clientbacklogmanager.cpp @@ -31,7 +31,7 @@ ClientBacklogManager::ClientBacklogManager(QObject *parent) : BacklogManager(parent), - _requester(0), + _requester(nullptr), _initBacklogRequested(false) { } @@ -181,7 +181,7 @@ void ClientBacklogManager::dispatchMessages(const MessageList &messages, bool so void ClientBacklogManager::reset() { delete _requester; - _requester = 0; + _requester = nullptr; _initBacklogRequested = false; _buffersRequested.clear(); } diff --git a/src/client/clientbacklogmanager.h b/src/client/clientbacklogmanager.h index 77ae36f1..3f4814b3 100644 --- a/src/client/clientbacklogmanager.h +++ b/src/client/clientbacklogmanager.h @@ -32,7 +32,7 @@ class CLIENT_EXPORT ClientBacklogManager : public BacklogManager Q_OBJECT public: - ClientBacklogManager(QObject *parent = 0); + ClientBacklogManager(QObject *parent = nullptr); // helper for the backlogRequester, as it isn't a QObject and can't emit itself inline void emitMessagesRequested(const QString &msg) const { emit messagesRequested(msg); } diff --git a/src/client/clientbufferviewconfig.h b/src/client/clientbufferviewconfig.h index 5c7d8b7f..8205d2bb 100644 --- a/src/client/clientbufferviewconfig.h +++ b/src/client/clientbufferviewconfig.h @@ -29,7 +29,7 @@ class CLIENT_EXPORT ClientBufferViewConfig : public BufferViewConfig Q_OBJECT public: - ClientBufferViewConfig(int bufferViewId, QObject *parent = 0); + ClientBufferViewConfig(int bufferViewId, QObject *parent = nullptr); inline bool isLocked() { return _locked || sortAlphabetically(); } inline void setLocked(bool locked) { _locked = locked; } diff --git a/src/client/clientbufferviewmanager.h b/src/client/clientbufferviewmanager.h index c44b7201..f619dfcc 100644 --- a/src/client/clientbufferviewmanager.h +++ b/src/client/clientbufferviewmanager.h @@ -32,7 +32,7 @@ class CLIENT_EXPORT ClientBufferViewManager : public BufferViewManager Q_OBJECT public: - ClientBufferViewManager(SignalProxy *proxy, QObject *parent = 0); + ClientBufferViewManager(SignalProxy *proxy, QObject *parent = nullptr); QList clientBufferViewConfigs() const; ClientBufferViewConfig *clientBufferViewConfig(int bufferViewId) const; diff --git a/src/client/clientidentity.cpp b/src/client/clientidentity.cpp index 04b946e3..16e1c424 100644 --- a/src/client/clientidentity.cpp +++ b/src/client/clientidentity.cpp @@ -26,7 +26,7 @@ CertIdentity::CertIdentity(IdentityId id, QObject *parent) : Identity(id, parent) #ifdef HAVE_SSL - , _certManager(0), + , _certManager(nullptr), _isDirty(false) #endif { @@ -36,7 +36,7 @@ CertIdentity::CertIdentity(IdentityId id, QObject *parent) CertIdentity::CertIdentity(const Identity &other, QObject *parent) : Identity(other, parent) #ifdef HAVE_SSL - , _certManager(0), + , _certManager(nullptr), _isDirty(false) #endif { @@ -46,7 +46,7 @@ CertIdentity::CertIdentity(const Identity &other, QObject *parent) CertIdentity::CertIdentity(const CertIdentity &other, QObject *parent) : Identity(other, parent) #ifdef HAVE_SSL - , _certManager(0), + , _certManager(nullptr), _isDirty(other._isDirty), _sslKey(other._sslKey), _sslCert(other._sslCert) diff --git a/src/client/clientidentity.h b/src/client/clientidentity.h index 2ff4cb83..5e589179 100644 --- a/src/client/clientidentity.h +++ b/src/client/clientidentity.h @@ -31,9 +31,9 @@ class CLIENT_EXPORT CertIdentity : public Identity Q_OBJECT public: - CertIdentity(IdentityId id = 0, QObject *parent = 0); - CertIdentity(const Identity &other, QObject *parent = 0); - CertIdentity(const CertIdentity &other, QObject *parent = 0); + CertIdentity(IdentityId id = 0, QObject *parent = nullptr); + CertIdentity(const Identity &other, QObject *parent = nullptr); + CertIdentity(const CertIdentity &other, QObject *parent = nullptr); #ifdef HAVE_SSL inline bool isDirty() const { return _isDirty; } diff --git a/src/client/clientignorelistmanager.h b/src/client/clientignorelistmanager.h index 36c1b47f..797235e3 100644 --- a/src/client/clientignorelistmanager.h +++ b/src/client/clientignorelistmanager.h @@ -30,7 +30,7 @@ class CLIENT_EXPORT ClientIgnoreListManager : public IgnoreListManager Q_OBJECT public: - explicit ClientIgnoreListManager(QObject *parent = 0); + explicit ClientIgnoreListManager(QObject *parent = nullptr); //! Fetch all matching ignore rules for a given hostmask /** \param hostmask The hostmask of the user diff --git a/src/client/clientirclisthelper.h b/src/client/clientirclisthelper.h index 47d18d79..385a910e 100644 --- a/src/client/clientirclisthelper.h +++ b/src/client/clientirclisthelper.h @@ -27,7 +27,7 @@ class ClientIrcListHelper : public IrcListHelper Q_OBJECT public: - inline ClientIrcListHelper(QObject *object = 0) : IrcListHelper(object) {}; + inline ClientIrcListHelper(QObject *object = nullptr) : IrcListHelper(object) {}; public slots: virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters); diff --git a/src/client/clienttransfer.cpp b/src/client/clienttransfer.cpp index 1eba7789..97bbbc70 100644 --- a/src/client/clienttransfer.cpp +++ b/src/client/clienttransfer.cpp @@ -24,7 +24,7 @@ ClientTransfer::ClientTransfer(const QUuid &uuid, QObject *parent) : Transfer(uuid, parent), - _file(0) + _file(nullptr) { connect(this, SIGNAL(statusChanged(Transfer::Status)), SLOT(onStatusChanged(Transfer::Status))); } @@ -44,7 +44,7 @@ void ClientTransfer::cleanUp() if (_file) { _file->close(); _file->deleteLater(); - _file = 0; + _file = nullptr; } } @@ -58,7 +58,7 @@ QString ClientTransfer::savePath() const void ClientTransfer::accept(const QString &savePath) const { _savePath = savePath; - PeerPtr ptr = 0; + PeerPtr ptr = nullptr; REQUEST_OTHER(requestAccepted, ARG(ptr)); emit accepted(); } @@ -66,7 +66,7 @@ void ClientTransfer::accept(const QString &savePath) const void ClientTransfer::reject() const { - PeerPtr ptr = 0; + PeerPtr ptr = nullptr; REQUEST_OTHER(requestRejected, ARG(ptr)); emit rejected(); } diff --git a/src/client/clienttransfer.h b/src/client/clienttransfer.h index 567797fa..9b27666d 100644 --- a/src/client/clienttransfer.h +++ b/src/client/clienttransfer.h @@ -31,7 +31,7 @@ class ClientTransfer : public Transfer Q_OBJECT public: - ClientTransfer(const QUuid &uuid, QObject *parent = 0); + ClientTransfer(const QUuid &uuid, QObject *parent = nullptr); QString savePath() const; diff --git a/src/client/clientuserinputhandler.cpp b/src/client/clientuserinputhandler.cpp index 6baf9524..6b466824 100644 --- a/src/client/clientuserinputhandler.cpp +++ b/src/client/clientuserinputhandler.cpp @@ -64,7 +64,7 @@ void ClientUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const if (!msg.startsWith('/')) { if (_nickRx.indexIn(msg) == 0) { const Network *net = Client::network(bufferInfo.networkId()); - IrcUser *user = net ? net->ircUser(_nickRx.cap(1)) : 0; + IrcUser *user = net ? net->ircUser(_nickRx.cap(1)) : nullptr; if (user) user->setLastSpokenTo(bufferInfo.bufferId(), QDateTime::currentDateTime().toUTC()); } diff --git a/src/client/clientuserinputhandler.h b/src/client/clientuserinputhandler.h index 5e26ddad..6df0da0f 100644 --- a/src/client/clientuserinputhandler.h +++ b/src/client/clientuserinputhandler.h @@ -31,7 +31,7 @@ class ClientUserInputHandler : public BasicHandler Q_OBJECT public: - ClientUserInputHandler(QObject *parent = 0); + ClientUserInputHandler(QObject *parent = nullptr); public slots: void handleUserInput(const BufferInfo &bufferInfo, const QString &msg); diff --git a/src/client/coreaccountmodel.h b/src/client/coreaccountmodel.h index 5b224b45..91082b2f 100644 --- a/src/client/coreaccountmodel.h +++ b/src/client/coreaccountmodel.h @@ -37,8 +37,8 @@ public: UuidRole }; - CoreAccountModel(QObject *parent = 0); - CoreAccountModel(const CoreAccountModel *other, QObject *parent = 0); + CoreAccountModel(QObject *parent = nullptr); + CoreAccountModel(const CoreAccountModel *other, QObject *parent = nullptr); inline int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; diff --git a/src/client/coreconnection.cpp b/src/client/coreconnection.cpp index 4127152c..90e02890 100644 --- a/src/client/coreconnection.cpp +++ b/src/client/coreconnection.cpp @@ -36,7 +36,7 @@ CoreConnection::CoreConnection(QObject *parent) : QObject(parent), - _authHandler(0), + _authHandler(nullptr), _state(Disconnected), _wantReconnect(false), _wasReconnect(false), @@ -286,17 +286,17 @@ void CoreConnection::resetConnection(bool wantReconnect) _wantReconnect = wantReconnect; if (_authHandler) { - disconnect(_authHandler, 0, this, 0); + disconnect(_authHandler, nullptr, this, nullptr); _authHandler->close(); _authHandler->deleteLater(); - _authHandler = 0; + _authHandler = nullptr; } if (_peer) { - disconnect(_peer, 0, this, 0); + disconnect(_peer, nullptr, this, nullptr); // peer belongs to the sigproxy and thus gets deleted by it _peer->close(); - _peer = 0; + _peer = nullptr; } _netsToSync.clear(); @@ -453,9 +453,9 @@ void CoreConnection::onHandshakeComplete(RemotePeer *peer, const Protocol::Sessi { updateProgress(100, 100); - disconnect(_authHandler, 0, this, 0); + disconnect(_authHandler, nullptr, this, nullptr); _authHandler->deleteLater(); - _authHandler = 0; + _authHandler = nullptr; _peer = peer; connect(peer, SIGNAL(disconnected()), SLOT(coreSocketDisconnected())); @@ -518,7 +518,7 @@ void CoreConnection::networkInitDone() { QObject *net = sender(); Q_ASSERT(net); - disconnect(net, 0, this, 0); + disconnect(net, nullptr, this, nullptr); _netsToSync.remove(net); updateProgress(_numNetsToSync - _netsToSync.count(), _numNetsToSync); checkSyncState(); diff --git a/src/client/coreconnection.h b/src/client/coreconnection.h index 7951a499..56a5a29e 100644 --- a/src/client/coreconnection.h +++ b/src/client/coreconnection.h @@ -56,7 +56,7 @@ public: Synchronized }; - CoreConnection(QObject *parent = 0); + CoreConnection(QObject *parent = nullptr); void init(); diff --git a/src/client/execwrapper.h b/src/client/execwrapper.h index 015b8a61..ce828479 100644 --- a/src/client/execwrapper.h +++ b/src/client/execwrapper.h @@ -30,7 +30,7 @@ class ExecWrapper : public QObject Q_OBJECT public: - ExecWrapper(QObject *parent = 0); + ExecWrapper(QObject *parent = nullptr); public slots: void start(const BufferInfo &info, const QString &command); diff --git a/src/client/irclistmodel.h b/src/client/irclistmodel.h index 8c522314..5cce869a 100644 --- a/src/client/irclistmodel.h +++ b/src/client/irclistmodel.h @@ -31,7 +31,7 @@ class CLIENT_EXPORT IrcListModel : public QAbstractItemModel Q_OBJECT public: - IrcListModel(QObject *parent = 0); + IrcListModel(QObject *parent = nullptr); virtual QVariant data(const QModelIndex &index, int role) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; diff --git a/src/client/messagefilter.h b/src/client/messagefilter.h index c7bd3d1d..2919704b 100644 --- a/src/client/messagefilter.h +++ b/src/client/messagefilter.h @@ -36,10 +36,10 @@ class CLIENT_EXPORT MessageFilter : public QSortFilterProxyModel Q_OBJECT protected: - MessageFilter(QAbstractItemModel *source, QObject *parent = 0); + MessageFilter(QAbstractItemModel *source, QObject *parent = nullptr); public: - MessageFilter(MessageModel *, const QList &buffers = QList(), QObject *parent = 0); + MessageFilter(MessageModel *, const QList &buffers = QList(), QObject *parent = nullptr); virtual QString idString() const; diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 5daec856..16349364 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -39,7 +39,7 @@ NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent) : PropertyMapItem(parent), _networkId(netid), - _statusBufferItem(0) + _statusBufferItem(nullptr) { // DO NOT EMIT dataChanged() DIRECTLY IN NetworkItem // use networkDataChanged() instead. Otherwise you will end up in a infinite loop @@ -91,7 +91,7 @@ QString NetworkItem::escapeHTML(const QString &string, bool useNonbreakingSpaces // FIXME shouldn't we check the bufferItemCache here? BufferItem *NetworkItem::findBufferItem(BufferId bufferId) { - BufferItem *bufferItem = 0; + BufferItem *bufferItem = nullptr; for (int i = 0; i < childCount(); i++) { bufferItem = qobject_cast(child(i)); @@ -100,7 +100,7 @@ BufferItem *NetworkItem::findBufferItem(BufferId bufferId) if (bufferItem->bufferId() == bufferId) return bufferItem; } - return 0; + return nullptr; } @@ -200,7 +200,7 @@ void NetworkItem::attachIrcChannel(IrcChannel *ircChannel) void NetworkItem::attachIrcUser(IrcUser *ircUser) { - QueryBufferItem *queryItem = 0; + QueryBufferItem *queryItem = nullptr; for (int i = 0; i < childCount(); i++) { queryItem = qobject_cast(child(i)); if (!queryItem) @@ -264,7 +264,7 @@ void NetworkItem::onBeginRemoveChilds(int start, int end) for (int i = start; i <= end; i++) { StatusBufferItem *statusBufferItem = qobject_cast(child(i)); if (statusBufferItem) { - _statusBufferItem = 0; + _statusBufferItem = nullptr; break; } } @@ -273,7 +273,7 @@ void NetworkItem::onBeginRemoveChilds(int start, int end) void NetworkItem::onNetworkDestroyed() { - _network = 0; + _network = nullptr; emit networkDataChanged(); removeAllChilds(); } @@ -498,7 +498,7 @@ QString StatusBufferItem::toolTip(int column) const *****************************************/ QueryBufferItem::QueryBufferItem(const BufferInfo &bufferInfo, NetworkItem *parent) : BufferItem(bufferInfo, parent), - _ircUser(0) + _ircUser(nullptr) { setFlags(flags() | Qt::ItemIsDropEnabled | Qt::ItemIsEditable); @@ -693,7 +693,7 @@ void QueryBufferItem::setIrcUser(IrcUser *ircUser) return; if (_ircUser) { - disconnect(_ircUser, 0, this, 0); + disconnect(_ircUser, nullptr, this, nullptr); } if (ircUser) { @@ -716,10 +716,10 @@ void QueryBufferItem::removeIrcUser() // SIGNAL destroyed(QObject*) to SLOT removeIrcUser(). // This fixes removing an active IrcUser if the user had quit then rejoined in a nonstandard // manner (e.g. updateNickFromHost calling newIrcUser, triggered by an away-notify message). - disconnect(_ircUser, 0, this, 0); + disconnect(_ircUser, nullptr, this, nullptr); // Clear IrcUser (only set to 0 if not already 0) - _ircUser = 0; + _ircUser = nullptr; // Only emit dataChanged() if data actually changed. This might serve as a small // optimization, but it can be moved outside the if statement if other behavior depends on @@ -734,7 +734,7 @@ void QueryBufferItem::removeIrcUser() *****************************************/ ChannelBufferItem::ChannelBufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent) : BufferItem(bufferInfo, parent), - _ircChannel(0) + _ircChannel(nullptr) { setFlags(flags() | Qt::ItemIsDropEnabled); } @@ -803,7 +803,7 @@ void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel) { if (_ircChannel) { qWarning() << Q_FUNC_INFO << "IrcChannel already set; cleanup failed!?"; - disconnect(_ircChannel, 0, this, 0); + disconnect(_ircChannel, nullptr, this, nullptr); } _ircChannel = ircChannel; @@ -847,8 +847,8 @@ QString ChannelBufferItem::nickChannelModes(const QString &nick) const void ChannelBufferItem::ircChannelParted() { Q_CHECK_PTR(_ircChannel); - disconnect(_ircChannel, 0, this, 0); - _ircChannel = 0; + disconnect(_ircChannel, nullptr, this, nullptr); + _ircChannel = nullptr; emit dataChanged(); removeAllChilds(); } @@ -857,7 +857,7 @@ void ChannelBufferItem::ircChannelParted() void ChannelBufferItem::ircChannelDestroyed() { if (_ircChannel) { - _ircChannel = 0; + _ircChannel = nullptr; emit dataChanged(); removeAllChilds(); } @@ -873,7 +873,7 @@ void ChannelBufferItem::join(const QList &ircUsers) UserCategoryItem *ChannelBufferItem::findCategoryItem(int categoryId) { - UserCategoryItem *categoryItem = 0; + UserCategoryItem *categoryItem = nullptr; for (int i = 0; i < childCount(); i++) { categoryItem = qobject_cast(child(i)); @@ -882,7 +882,7 @@ UserCategoryItem *ChannelBufferItem::findCategoryItem(int categoryId) if (categoryItem->categoryId() == categoryId) return categoryItem; } - return 0; + return nullptr; } @@ -899,7 +899,7 @@ void ChannelBufferItem::addUsersToCategory(const QList &ircUsers) QHash > categories; int categoryId = -1; - UserCategoryItem *categoryItem = 0; + UserCategoryItem *categoryItem = nullptr; foreach(IrcUser *ircUser, ircUsers) { categoryId = UserCategoryItem::categoryFromModes(_ircChannel->userModes(ircUser)); @@ -927,7 +927,7 @@ void ChannelBufferItem::part(IrcUser *ircUser) return; } - disconnect(ircUser, 0, this, 0); + disconnect(ircUser, nullptr, this, nullptr); removeUserFromCategory(ircUser); emit dataChanged(2); } @@ -942,7 +942,7 @@ void ChannelBufferItem::removeUserFromCategory(IrcUser *ircUser) return; } - UserCategoryItem *categoryItem = 0; + UserCategoryItem *categoryItem = nullptr; for (int i = 0; i < childCount(); i++) { categoryItem = qobject_cast(child(i)); if (categoryItem->removeUser(ircUser)) { @@ -972,7 +972,7 @@ void ChannelBufferItem::userModeChanged(IrcUser *ircUser) } // find the item that needs reparenting - IrcUserItem *ircUserItem = 0; + IrcUserItem *ircUserItem = nullptr; for (int i = 0; i < childCount(); i++) { UserCategoryItem *oldCategoryItem = qobject_cast(child(i)); Q_ASSERT(oldCategoryItem); @@ -1021,24 +1021,24 @@ QString UserCategoryItem::categoryName() const int n = childCount(); switch (_category) { case 0: - return tr("%n Owner(s)", 0, n); + return tr("%n Owner(s)", "", n); case 1: - return tr("%n Admin(s)", 0, n); + return tr("%n Admin(s)", "", n); case 2: - return tr("%n Operator(s)", 0, n); + return tr("%n Operator(s)", "", n); case 3: - return tr("%n Half-Op(s)", 0, n); + return tr("%n Half-Op(s)", "", n); case 4: - return tr("%n Voiced", 0, n); + return tr("%n Voiced", "", n); default: - return tr("%n User(s)", 0, n); + return tr("%n User(s)", "", n); } } IrcUserItem *UserCategoryItem::findIrcUser(IrcUser *ircUser) { - IrcUserItem *userItem = 0; + IrcUserItem *userItem = nullptr; for (int i = 0; i < childCount(); i++) { userItem = qobject_cast(child(i)); @@ -1047,7 +1047,7 @@ IrcUserItem *UserCategoryItem::findIrcUser(IrcUser *ircUser) if (userItem->ircUser() == ircUser) return userItem; } - return 0; + return nullptr; } @@ -1317,7 +1317,7 @@ bool NetworkModel::isBufferIndex(const QModelIndex &index) const int NetworkModel::networkRow(NetworkId networkId) const { - NetworkItem *netItem = 0; + NetworkItem *netItem = nullptr; for (int i = 0; i < rootItem->childCount(); i++) { netItem = qobject_cast(rootItem->child(i)); if (!netItem) @@ -1343,7 +1343,7 @@ NetworkItem *NetworkModel::findNetworkItem(NetworkId networkId) const { int netRow = networkRow(networkId); if (netRow == -1) - return 0; + return nullptr; else return qobject_cast(rootItem->child(netRow)); } @@ -1353,7 +1353,7 @@ NetworkItem *NetworkModel::networkItem(NetworkId networkId) { NetworkItem *netItem = findNetworkItem(networkId); - if (netItem == 0) { + if (netItem == nullptr) { netItem = new NetworkItem(networkId, rootItem); rootItem->newChild(netItem); } @@ -1384,7 +1384,7 @@ BufferItem *NetworkModel::findBufferItem(BufferId bufferId) const if (_bufferItemCache.contains(bufferId)) return _bufferItemCache[bufferId]; else - return 0; + return nullptr; } @@ -1563,7 +1563,7 @@ void NetworkModel::updateBufferActivity(Message &msg) case Message::Action: if (bufferType(msg.bufferId()) == BufferInfo::ChannelBuffer) { const Network *net = Client::network(msg.bufferInfo().networkId()); - IrcUser *user = net ? net->ircUser(nickFromMask(msg.sender())) : 0; + IrcUser *user = net ? net->ircUser(nickFromMask(msg.sender())) : nullptr; if (user) user->setLastChannelActivity(msg.bufferId(), msg.timestamp()); } @@ -1627,7 +1627,7 @@ const Network *NetworkModel::networkByIndex(const QModelIndex &index) const { QVariant netVariant = index.data(NetworkIdRole); if (!netVariant.isValid()) - return 0; + return nullptr; NetworkId networkId = netVariant.value(); return Client::network(networkId); diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 7f73b76a..a52c1b98 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -42,7 +42,7 @@ class NetworkItem : public PropertyMapItem Q_PROPERTY(int nickCount READ nickCount) public : - NetworkItem(const NetworkId &netid, AbstractTreeItem *parent = 0); + NetworkItem(const NetworkId &netid, AbstractTreeItem *parent = nullptr); virtual QStringList propertyOrder() const; @@ -109,7 +109,7 @@ class BufferItem : public PropertyMapItem Q_PROPERTY(int nickCount READ nickCount) public : - BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent = 0); + BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent = nullptr); virtual QStringList propertyOrder() const; @@ -345,7 +345,7 @@ public: }; Q_DECLARE_FLAGS(ItemTypes, ItemType) - NetworkModel(QObject *parent = 0); + NetworkModel(QObject *parent = nullptr); static QList defaultHeader(); static bool mimeContainsBufferList(const QMimeData *mimeData); diff --git a/src/client/selectionmodelsynchronizer.cpp b/src/client/selectionmodelsynchronizer.cpp index fe93c41b..6329572d 100644 --- a/src/client/selectionmodelsynchronizer.cpp +++ b/src/client/selectionmodelsynchronizer.cpp @@ -45,8 +45,8 @@ bool SelectionModelSynchronizer::checkBaseModel(QItemSelectionModel *selectionMo return false; const QAbstractItemModel *baseModel = selectionModel->model(); - const QAbstractProxyModel *proxyModel = 0; - while ((proxyModel = qobject_cast(baseModel)) != 0) { + const QAbstractProxyModel *proxyModel = nullptr; + while ((proxyModel = qobject_cast(baseModel)) != nullptr) { baseModel = proxyModel->sourceModel(); if (baseModel == model()) break; @@ -81,8 +81,8 @@ void SelectionModelSynchronizer::synchronizeSelectionModel(QItemSelectionModel * void SelectionModelSynchronizer::removeSelectionModel(QItemSelectionModel *model) { - disconnect(model, 0, this, 0); - disconnect(this, 0, model, 0); + disconnect(model, nullptr, this, nullptr); + disconnect(this, nullptr, model, nullptr); selectionModelDestroyed(model); } @@ -156,8 +156,8 @@ QModelIndex SelectionModelSynchronizer::mapFromSource(const QModelIndex &sourceI // make a list of all involved proxies, wie have to traverse backwards QList proxyModels; const QAbstractItemModel *baseModel = selectionModel->model(); - const QAbstractProxyModel *proxyModel = 0; - while ((proxyModel = qobject_cast(baseModel)) != 0) { + const QAbstractProxyModel *proxyModel = nullptr; + while ((proxyModel = qobject_cast(baseModel)) != nullptr) { if (baseModel == model()) break; proxyModels << proxyModel; @@ -182,8 +182,8 @@ QItemSelection SelectionModelSynchronizer::mapSelectionFromSource(const QItemSel // make a list of all involved proxies, wie have to traverse backwards QList proxyModels; const QAbstractItemModel *baseModel = selectionModel->model(); - const QAbstractProxyModel *proxyModel = 0; - while ((proxyModel = qobject_cast(baseModel)) != 0) { + const QAbstractProxyModel *proxyModel = nullptr; + while ((proxyModel = qobject_cast(baseModel)) != nullptr) { if (baseModel == model()) break; proxyModels << proxyModel; @@ -204,8 +204,8 @@ QModelIndex SelectionModelSynchronizer::mapToSource(const QModelIndex &index, QI QModelIndex sourceIndex = index; const QAbstractItemModel *baseModel = selectionModel->model(); - const QAbstractProxyModel *proxyModel = 0; - while ((proxyModel = qobject_cast(baseModel)) != 0) { + const QAbstractProxyModel *proxyModel = nullptr; + while ((proxyModel = qobject_cast(baseModel)) != nullptr) { sourceIndex = proxyModel->mapToSource(sourceIndex); baseModel = proxyModel->sourceModel(); if (baseModel == model()) @@ -221,8 +221,8 @@ QItemSelection SelectionModelSynchronizer::mapSelectionToSource(const QItemSelec QItemSelection sourceSelection = selection; const QAbstractItemModel *baseModel = selectionModel->model(); - const QAbstractProxyModel *proxyModel = 0; - while ((proxyModel = qobject_cast(baseModel)) != 0) { + const QAbstractProxyModel *proxyModel = nullptr; + while ((proxyModel = qobject_cast(baseModel)) != nullptr) { sourceSelection = proxyModel->mapSelectionToSource(sourceSelection); baseModel = proxyModel->sourceModel(); if (baseModel == model()) diff --git a/src/client/selectionmodelsynchronizer.h b/src/client/selectionmodelsynchronizer.h index b3d1214d..cad7edfa 100644 --- a/src/client/selectionmodelsynchronizer.h +++ b/src/client/selectionmodelsynchronizer.h @@ -32,7 +32,7 @@ class CLIENT_EXPORT SelectionModelSynchronizer : public QObject Q_OBJECT public: - SelectionModelSynchronizer(QAbstractItemModel *parent = 0); + SelectionModelSynchronizer(QAbstractItemModel *parent = nullptr); void synchronizeSelectionModel(QItemSelectionModel *selectionModel); void removeSelectionModel(QItemSelectionModel *selectionModel); diff --git a/src/client/transfermodel.cpp b/src/client/transfermodel.cpp index 85bd8e36..affd4871 100644 --- a/src/client/transfermodel.cpp +++ b/src/client/transfermodel.cpp @@ -106,7 +106,7 @@ QVariant TransferModel::data(const QModelIndex& index, int role) const void TransferModel::setManager(const TransferManager *manager) { if (_manager) { - disconnect(_manager, 0, this, 0); + disconnect(_manager, nullptr, this, nullptr); beginResetModel(); _transferIds.clear(); endResetModel(); @@ -152,7 +152,7 @@ void TransferModel::onTransferRemoved(const QUuid &transferId) // Check if the transfer object still exists, which means we still should disconnect auto transfer = _manager->transfer(transferId); if (transfer) - disconnect(transfer, 0, this, 0); + disconnect(transfer, nullptr, this, nullptr); for (auto row = 0; row < _transferIds.size(); ++row) { if (_transferIds[row] == transferId) { diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index 892ad5c8..fa66ba60 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -41,7 +41,7 @@ private: AbstractTreeItem::AbstractTreeItem(AbstractTreeItem *parent) : QObject(parent), _flags(Qt::ItemIsSelectable | Qt::ItemIsEnabled), - _treeItemFlags(0) + _treeItemFlags(nullptr) { } @@ -103,7 +103,7 @@ void AbstractTreeItem::removeAllChilds() childIter = _childItems.begin(); while (childIter != _childItems.end()) { child = *childIter; - child->setTreeItemFlags(0); // disable self deletion, as this would only fuck up consitency and the child gets deleted anyways + child->setTreeItemFlags(nullptr); // disable self deletion, as this would only fuck up consitency and the child gets deleted anyways child->removeAllChilds(); ++childIter; } @@ -182,7 +182,7 @@ bool AbstractTreeItem::reParent(AbstractTreeItem *newParent) AbstractTreeItem *AbstractTreeItem::child(int row) const { if (childCount() <= row) - return 0; + return nullptr; else return _childItems[row]; } @@ -323,7 +323,7 @@ TreeModel::TreeModel(const QList &data, QObject *parent) _childStatus(QModelIndex(), 0, 0, 0), _aboutToRemoveOrInsert(false) { - rootItem = new SimpleTreeItem(data, 0); + rootItem = new SimpleTreeItem(data, nullptr); connectItem(rootItem); if (Quassel::isOptionSet("debugmodel")) { @@ -376,7 +376,7 @@ QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) con QModelIndex TreeModel::indexByItem(AbstractTreeItem *item) const { - if (item == 0) { + if (item == nullptr) { qWarning() << "TreeModel::indexByItem(AbstractTreeItem *item) received NULL-Pointer"; return QModelIndex(); } @@ -564,7 +564,7 @@ void TreeModel::beginRemoveChilds(int firstRow, int lastRow) } for (int i = firstRow; i <= lastRow; i++) { - disconnect(parentItem->child(i), 0, this, 0); + disconnect(parentItem->child(i), nullptr, this, nullptr); } // consitency checks diff --git a/src/client/treemodel.h b/src/client/treemodel.h index 716e07c9..7e097eca 100644 --- a/src/client/treemodel.h +++ b/src/client/treemodel.h @@ -43,7 +43,7 @@ public: }; Q_DECLARE_FLAGS(TreeItemFlags, TreeItemFlag) - AbstractTreeItem(AbstractTreeItem *parent = 0); + AbstractTreeItem(AbstractTreeItem *parent = nullptr); bool newChild(AbstractTreeItem *child); bool newChilds(const QList &items); @@ -106,7 +106,7 @@ class CLIENT_EXPORT SimpleTreeItem : public AbstractTreeItem Q_OBJECT public: - SimpleTreeItem(const QList &data, AbstractTreeItem *parent = 0); + SimpleTreeItem(const QList &data, AbstractTreeItem *parent = nullptr); virtual ~SimpleTreeItem(); virtual QVariant data(int column, int role) const; @@ -127,7 +127,7 @@ class CLIENT_EXPORT PropertyMapItem : public AbstractTreeItem Q_OBJECT public: - PropertyMapItem(AbstractTreeItem *parent = 0); + PropertyMapItem(AbstractTreeItem *parent = nullptr); virtual QStringList propertyOrder() const = 0; @@ -152,7 +152,7 @@ public: UserRole }; - TreeModel(const QList &, QObject *parent = 0); + TreeModel(const QList &, QObject *parent = nullptr); virtual ~TreeModel(); AbstractTreeItem *root() const; diff --git a/src/common/aliasmanager.h b/src/common/aliasmanager.h index aaac54d3..ef3b512b 100644 --- a/src/common/aliasmanager.h +++ b/src/common/aliasmanager.h @@ -35,7 +35,7 @@ class COMMON_EXPORT AliasManager : public SyncableObject SYNCABLE_OBJECT public: - inline AliasManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); } + inline AliasManager(QObject *parent = nullptr) : SyncableObject(parent) { setAllowClientUpdates(true); } AliasManager &operator=(const AliasManager &other); struct Alias { diff --git a/src/common/authhandler.cpp b/src/common/authhandler.cpp index 4ff0f60f..b87400b8 100644 --- a/src/common/authhandler.cpp +++ b/src/common/authhandler.cpp @@ -24,7 +24,7 @@ AuthHandler::AuthHandler(QObject *parent) : QObject(parent), - _socket(0), + _socket(nullptr), _disconnectedSent(false) { diff --git a/src/common/authhandler.h b/src/common/authhandler.h index 7fb91277..d5c54716 100644 --- a/src/common/authhandler.h +++ b/src/common/authhandler.h @@ -33,7 +33,7 @@ class COMMON_EXPORT AuthHandler : public QObject Q_OBJECT public: - AuthHandler(QObject *parent = 0); + AuthHandler(QObject *parent = nullptr); QTcpSocket *socket() const; diff --git a/src/common/backlogmanager.h b/src/common/backlogmanager.h index e64f45a7..ad7c8061 100644 --- a/src/common/backlogmanager.h +++ b/src/common/backlogmanager.h @@ -31,7 +31,7 @@ class COMMON_EXPORT BacklogManager : public SyncableObject SYNCABLE_OBJECT public: - BacklogManager(QObject *parent = 0) : SyncableObject(parent) {} + BacklogManager(QObject *parent = nullptr) : SyncableObject(parent) {} public slots: virtual QVariantList requestBacklog(BufferId bufferId, MsgId first = -1, MsgId last = -1, int limit = -1, int additional = 0); diff --git a/src/common/basichandler.cpp b/src/common/basichandler.cpp index 6ad78289..6e7e4387 100644 --- a/src/common/basichandler.cpp +++ b/src/common/basichandler.cpp @@ -88,14 +88,14 @@ void BasicHandler::handle(const QString &member, QGenericArgument val0, return; } else { - void *param[] = { 0, Q_ARG(QString, member).data(), val0.data(), val1.data(), val2.data(), val3.data(), val4.data(), + void *param[] = { nullptr, Q_ARG(QString, member).data(), val0.data(), val1.data(), val2.data(), val3.data(), val4.data(), val5.data(), val6.data(), val7.data(), val8.data(), val8.data() }; qt_metacall(QMetaObject::InvokeMetaMethod, _defaultHandler, param); return; } } - void *param[] = { 0, val0.data(), val1.data(), val2.data(), val3.data(), val4.data(), - val5.data(), val6.data(), val7.data(), val8.data(), val8.data(), 0 }; + void *param[] = { nullptr, val0.data(), val1.data(), val2.data(), val3.data(), val4.data(), + val5.data(), val6.data(), val7.data(), val8.data(), val8.data(), nullptr }; qt_metacall(QMetaObject::InvokeMetaMethod, handlerHash()[handler], param); } diff --git a/src/common/basichandler.h b/src/common/basichandler.h index e48d6058..081e8df6 100644 --- a/src/common/basichandler.h +++ b/src/common/basichandler.h @@ -33,13 +33,13 @@ class COMMON_EXPORT BasicHandler : public QObject Q_OBJECT public: - BasicHandler(QObject *parent = 0); - BasicHandler(const QString &methodPrefix, QObject *parent = 0); + BasicHandler(QObject *parent = nullptr); + BasicHandler(const QString &methodPrefix, QObject *parent = nullptr); QStringList providesHandlers(); protected: - virtual void handle(const QString &member, QGenericArgument val0 = QGenericArgument(0), + virtual void handle(const QString &member, QGenericArgument val0 = QGenericArgument(nullptr), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), diff --git a/src/common/bufferviewconfig.h b/src/common/bufferviewconfig.h index 03debf80..0390ddb6 100644 --- a/src/common/bufferviewconfig.h +++ b/src/common/bufferviewconfig.h @@ -44,8 +44,8 @@ class COMMON_EXPORT BufferViewConfig : public SyncableObject Q_PROPERTY(bool showSearch READ showSearch WRITE setShowSearch) public : - BufferViewConfig(int bufferViewId, QObject *parent = 0); - BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0); + BufferViewConfig(int bufferViewId, QObject *parent = nullptr); + BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = nullptr); public slots: inline int bufferViewId() const { return _bufferViewId; } diff --git a/src/common/bufferviewmanager.cpp b/src/common/bufferviewmanager.cpp index ba1b6c2c..2287dda1 100644 --- a/src/common/bufferviewmanager.cpp +++ b/src/common/bufferviewmanager.cpp @@ -36,7 +36,7 @@ BufferViewConfig *BufferViewManager::bufferViewConfig(int bufferViewId) const if (_bufferViewConfigs.contains(bufferViewId)) return _bufferViewConfigs[bufferViewId]; else - return 0; + return nullptr; } diff --git a/src/common/bufferviewmanager.h b/src/common/bufferviewmanager.h index 0a4f280b..3c633960 100644 --- a/src/common/bufferviewmanager.h +++ b/src/common/bufferviewmanager.h @@ -36,7 +36,7 @@ class COMMON_EXPORT BufferViewManager : public SyncableObject SYNCABLE_OBJECT public: - BufferViewManager(SignalProxy *proxy, QObject *parent = 0); + BufferViewManager(SignalProxy *proxy, QObject *parent = nullptr); inline QList bufferViewConfigs() const { return _bufferViewConfigs.values(); } BufferViewConfig *bufferViewConfig(int bufferViewId) const; diff --git a/src/common/compressor.cpp b/src/common/compressor.cpp index 84b8f7fe..2b91bebe 100644 --- a/src/common/compressor.cpp +++ b/src/common/compressor.cpp @@ -30,8 +30,8 @@ Compressor::Compressor(QTcpSocket *socket, Compressor::CompressionLevel level, Q : QObject(parent), _socket(socket), _level(level), - _inflater(0), - _deflater(0) + _inflater(nullptr), + _deflater(nullptr) { connect(socket, SIGNAL(readyRead()), SLOT(readData())); diff --git a/src/common/compressor.h b/src/common/compressor.h index d80e41d8..1360b678 100644 --- a/src/common/compressor.h +++ b/src/common/compressor.h @@ -49,7 +49,7 @@ public: Flush }; - Compressor(QTcpSocket *socket, CompressionLevel level, QObject *parent = 0); + Compressor(QTcpSocket *socket, CompressionLevel level, QObject *parent = nullptr); ~Compressor(); CompressionLevel compressionLevel() const { return _level; } diff --git a/src/common/ctcpevent.cpp b/src/common/ctcpevent.cpp index 5d0dc08b..c4ca95fb 100644 --- a/src/common/ctcpevent.cpp +++ b/src/common/ctcpevent.cpp @@ -25,7 +25,7 @@ Event *CtcpEvent::create(EventManager::EventType type, QVariantMap &map, Network if (type == EventManager::CtcpEvent || type == EventManager::CtcpEventFlush) return new CtcpEvent(type, map, network); - return 0; + return nullptr; } diff --git a/src/common/event.cpp b/src/common/event.cpp index b933fa64..4d9a6def 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -86,16 +86,16 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network) // sanity check if we have a valid enum value if (EventManager::enumName(inttype).isEmpty()) { qWarning() << "Received a serialized event with unknown type" << inttype; - return 0; + return nullptr; } EventManager::EventType type = static_cast(inttype); if (type == EventManager::Invalid || type == EventManager::GenericEvent) - return 0; + return nullptr; EventManager::EventType group = static_cast(type & EventManager::EventGroupMask); - Event *e = 0; + Event *e = nullptr; // we use static create() functions to keep group-specific special cases in the files they belong // e.g. IrcEventRawMessage @@ -121,7 +121,7 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network) if (!e) { qWarning() << "Can't create event of type" << type; - return 0; + return nullptr; } if (!map.isEmpty()) { diff --git a/src/common/eventmanager.cpp b/src/common/eventmanager.cpp index f43f6edb..503babf3 100644 --- a/src/common/eventmanager.cpp +++ b/src/common/eventmanager.cpp @@ -301,7 +301,7 @@ void EventManager::dispatchEvent(Event *event) } // finally, deliverance! - void *param[] = { 0, Q_ARG(Event *, event).data() }; + void *param[] = { nullptr, Q_ARG(Event *, event).data() }; obj->qt_metacall(QMetaObject::InvokeMetaMethod, it->methodIndex, param); } diff --git a/src/common/eventmanager.h b/src/common/eventmanager.h index 246c58a7..d4bd14a1 100644 --- a/src/common/eventmanager.h +++ b/src/common/eventmanager.h @@ -122,7 +122,7 @@ public : KeyEvent = 0x00060000 }; - EventManager(QObject *parent = 0); + EventManager(QObject *parent = nullptr); static EventType eventTypeByName(const QString &name); static EventType eventGroupByName(const QString &name); @@ -160,7 +160,7 @@ private: int methodIndex; Priority priority; - explicit Handler(QObject *obj = 0, int method = 0, Priority prio = NormalPriority) + explicit Handler(QObject *obj = nullptr, int method = 0, Priority prio = NormalPriority) { object = obj; methodIndex = method; diff --git a/src/common/identity.h b/src/common/identity.h index 7cbd193a..4345642d 100644 --- a/src/common/identity.h +++ b/src/common/identity.h @@ -57,8 +57,8 @@ class COMMON_EXPORT Identity : public SyncableObject Q_PROPERTY(QString quitReason READ quitReason WRITE setQuitReason) public : - Identity(IdentityId id = 0, QObject *parent = 0); - Identity(const Identity &other, QObject *parent = 0); + Identity(IdentityId id = 0, QObject *parent = nullptr); + Identity(const Identity &other, QObject *parent = nullptr); void setToDefaults(); @@ -174,7 +174,7 @@ class COMMON_EXPORT CertManager : public SyncableObject Q_PROPERTY(QByteArray sslCert READ sslCertPem WRITE setSslCert) public : - CertManager(IdentityId id, QObject *parent = 0) : SyncableObject(QString::number(id.toInt()), parent) {} + CertManager(IdentityId id, QObject *parent = nullptr) : SyncableObject(QString::number(id.toInt()), parent) {} virtual const QSslKey &sslKey() const = 0; inline QByteArray sslKeyPem() const { return sslKey().toPem(); } diff --git a/src/common/ignorelistmanager.h b/src/common/ignorelistmanager.h index 3f73eb6f..a4fa3c38 100644 --- a/src/common/ignorelistmanager.h +++ b/src/common/ignorelistmanager.h @@ -36,7 +36,7 @@ class COMMON_EXPORT IgnoreListManager : public SyncableObject SYNCABLE_OBJECT public: - inline IgnoreListManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); } + inline IgnoreListManager(QObject *parent = nullptr) : SyncableObject(parent) { setAllowClientUpdates(true); } IgnoreListManager &operator=(const IgnoreListManager &other); enum IgnoreType { diff --git a/src/common/ircchannel.cpp b/src/common/ircchannel.cpp index 92a49449..dd47f851 100644 --- a/src/common/ircchannel.cpp +++ b/src/common/ircchannel.cpp @@ -37,8 +37,8 @@ IrcChannel::IrcChannel(const QString &channelname, Network *network) _topic(QString()), _encrypted(false), _network(network), - _codecForEncoding(0), - _codecForDecoding(0) + _codecForEncoding(nullptr), + _codecForDecoding(nullptr) { setObjectName(QString::number(network->networkId().toInt()) + "/" + channelname); } @@ -54,7 +54,7 @@ IrcChannel::~IrcChannel() // ==================== bool IrcChannel::isKnownUser(IrcUser *ircuser) const { - if (ircuser == 0) { + if (ircuser == nullptr) { qWarning() << "Channel" << name() << "received IrcUser Nullpointer!"; return false; } @@ -241,7 +241,7 @@ void IrcChannel::part(IrcUser *ircuser) ircuser->partChannel(this); // If you wonder why there is no counterpart to ircUserParted: // the joins are propagted by the ircuser. The signal ircUserParted is only for convenience - disconnect(ircuser, 0, this, 0); + disconnect(ircuser, nullptr, this, nullptr); emit ircUserParted(ircuser); if (network()->isMe(ircuser) || _userModes.isEmpty()) { @@ -250,7 +250,7 @@ void IrcChannel::part(IrcUser *ircuser) QList users = _userModes.keys(); _userModes.clear(); foreach(IrcUser *user, users) { - disconnect(user, 0, this, 0); + disconnect(user, nullptr, this, nullptr); user->partChannel(this); } emit parted(); diff --git a/src/common/ircevent.cpp b/src/common/ircevent.cpp index dcff52a1..797f4538 100644 --- a/src/common/ircevent.cpp +++ b/src/common/ircevent.cpp @@ -26,7 +26,7 @@ Event *IrcEvent::create(EventManager::EventType type, QVariantMap &map, Network return new IrcEventNumeric(type, map, network); if ((type & EventManager::EventGroupMask) != EventManager::IrcEvent) - return 0; + return nullptr; switch (type) { case EventManager::IrcEventRawPrivmsg: diff --git a/src/common/irclisthelper.h b/src/common/irclisthelper.h index 00128a31..b5d72dff 100644 --- a/src/common/irclisthelper.h +++ b/src/common/irclisthelper.h @@ -39,7 +39,7 @@ class COMMON_EXPORT IrcListHelper : public SyncableObject SYNCABLE_OBJECT public: - inline IrcListHelper(QObject *parent = 0) : SyncableObject(parent) { setInitialized(); }; + inline IrcListHelper(QObject *parent = nullptr) : SyncableObject(parent) { setInitialized(); }; struct ChannelDescription { QString channelName; diff --git a/src/common/ircuser.cpp b/src/common/ircuser.cpp index 18a066b5..16837006 100644 --- a/src/common/ircuser.cpp +++ b/src/common/ircuser.cpp @@ -43,8 +43,8 @@ IrcUser::IrcUser(const QString &hostmask, Network *network) : SyncableObject(net _whoisServiceReply(), _encrypted(false), _network(network), - _codecForEncoding(0), - _codecForDecoding(0) + _codecForEncoding(nullptr), + _codecForDecoding(nullptr) { updateObjectName(); _lastAwayMessageTime.setTimeSpec(Qt::UTC); @@ -328,7 +328,7 @@ void IrcUser::partChannel(IrcChannel *channel) { if (_channels.contains(channel)) { _channels.remove(channel); - disconnect(channel, 0, this, 0); + disconnect(channel, nullptr, this, nullptr); channel->part(this); QString channelName = channel->name(); SYNC_OTHER(partChannel, ARG(channelName)) @@ -341,7 +341,7 @@ void IrcUser::partChannel(IrcChannel *channel) void IrcUser::partChannel(const QString &channelname) { IrcChannel *channel = network()->ircChannel(channelname); - if (channel == 0) { + if (channel == nullptr) { qWarning() << "IrcUser::partChannel(): received part for unknown Channel" << channelname; } else { @@ -355,7 +355,7 @@ void IrcUser::quit() QList channels = _channels.toList(); _channels.clear(); foreach(IrcChannel *channel, channels) { - disconnect(channel, 0, this, 0); + disconnect(channel, nullptr, this, nullptr); channel->part(this); } network()->removeIrcUser(this); diff --git a/src/common/logbacktrace_unix.cpp b/src/common/logbacktrace_unix.cpp index 9001c476..c9bedd3d 100644 --- a/src/common/logbacktrace_unix.cpp +++ b/src/common/logbacktrace_unix.cpp @@ -62,7 +62,7 @@ void Quassel::logBacktrace(const QString &filename) QString funcName; if (info.dli_sname) { - char *func = abi::__cxa_demangle(info.dli_sname, 0, 0, 0); + char *func = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, nullptr); if (func) { funcName = QString(func); free(func); diff --git a/src/common/messageevent.cpp b/src/common/messageevent.cpp index 1befbbd7..01b4049a 100644 --- a/src/common/messageevent.cpp +++ b/src/common/messageevent.cpp @@ -25,7 +25,7 @@ Event *MessageEvent::create(EventManager::EventType type, QVariantMap &map, Netw if (type == EventManager::MessageEvent) return new MessageEvent(type, map, network); - return 0; + return nullptr; } diff --git a/src/common/network.cpp b/src/common/network.cpp index d7c0980e..f76cd30e 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -25,9 +25,9 @@ #include "network.h" #include "peer.h" -QTextCodec *Network::_defaultCodecForServer = 0; -QTextCodec *Network::_defaultCodecForEncoding = 0; -QTextCodec *Network::_defaultCodecForDecoding = 0; +QTextCodec *Network::_defaultCodecForServer = nullptr; +QTextCodec *Network::_defaultCodecForEncoding = nullptr; +QTextCodec *Network::_defaultCodecForDecoding = nullptr; // ==================== // Public: @@ -35,7 +35,7 @@ QTextCodec *Network::_defaultCodecForDecoding = 0; Network::Network(const NetworkId &networkid, QObject *parent) : SyncableObject(parent), - _proxy(0), + _proxy(nullptr), _networkId(networkid), _identity(0), _myNick(QString()), @@ -57,9 +57,9 @@ Network::Network(const NetworkId &networkid, QObject *parent) _messageRateBurstSize(5), _messageRateDelay(2200), _unlimitedMessageRate(false), - _codecForServer(0), - _codecForEncoding(0), - _codecForDecoding(0), + _codecForServer(nullptr), + _codecForEncoding(nullptr), + _codecForDecoding(nullptr), _autoAwayActive(false) { setObjectName(QString::number(networkid.toInt())); @@ -340,7 +340,7 @@ IrcUser *Network::ircUser(QString nickname) const if (_ircUsers.contains(nickname)) return _ircUsers[nickname]; else - return 0; + return nullptr; } @@ -351,7 +351,7 @@ void Network::removeIrcUser(IrcUser *ircuser) return; _ircUsers.remove(nick); - disconnect(ircuser, 0, this, 0); + disconnect(ircuser, nullptr, this, nullptr); ircuser->deleteLater(); } @@ -363,7 +363,7 @@ void Network::removeIrcChannel(IrcChannel *channel) return; _ircChannels.remove(chanName); - disconnect(channel, 0, this, 0); + disconnect(channel, nullptr, this, nullptr); channel->deleteLater(); } @@ -410,7 +410,7 @@ IrcChannel *Network::ircChannel(QString channelname) const if (_ircChannels.contains(channelname)) return _ircChannels[channelname]; else - return 0; + return nullptr; } diff --git a/src/common/network.h b/src/common/network.h index 410931fd..104abe7c 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -145,7 +145,7 @@ public : }; typedef QList ServerList; - Network(const NetworkId &networkid, QObject *parent = 0); + Network(const NetworkId &networkid, QObject *parent = nullptr); ~Network(); inline NetworkId networkId() const { return _networkId; } diff --git a/src/common/networkconfig.h b/src/common/networkconfig.h index 85d1f561..83574f97 100644 --- a/src/common/networkconfig.h +++ b/src/common/networkconfig.h @@ -39,7 +39,7 @@ class COMMON_EXPORT NetworkConfig : public SyncableObject Q_PROPERTY(bool standardCtcp READ standardCtcp WRITE setStandardCtcp) public : - NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = 0); + NetworkConfig(const QString &objectName = "GlobalNetworkConfig", QObject *parent = nullptr); public slots: inline bool pingTimeoutEnabled() const { return _pingTimeoutEnabled; } diff --git a/src/common/networkevent.cpp b/src/common/networkevent.cpp index 394bfc9a..eb8d76be 100644 --- a/src/common/networkevent.cpp +++ b/src/common/networkevent.cpp @@ -39,7 +39,7 @@ Event *NetworkEvent::create(EventManager::EventType type, QVariantMap &map, Netw return new NetworkSplitEvent(type, map, network); default: - return 0; + return nullptr; } } diff --git a/src/common/peer.h b/src/common/peer.h index 345889a3..62e7cc41 100644 --- a/src/common/peer.h +++ b/src/common/peer.h @@ -36,7 +36,7 @@ class COMMON_EXPORT Peer : public QObject Q_OBJECT public: - explicit Peer(AuthHandler *authHandler, QObject *parent = 0); + explicit Peer(AuthHandler *authHandler, QObject *parent = nullptr); virtual Protocol::Type protocol() const = 0; virtual QString description() const = 0; diff --git a/src/common/peerfactory.h b/src/common/peerfactory.h index f78cf0c4..ec7426e7 100644 --- a/src/common/peerfactory.h +++ b/src/common/peerfactory.h @@ -43,7 +43,7 @@ public: static ProtoList supportedProtocols(); - static RemotePeer *createPeer(const ProtoDescriptor &protocol, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0); - static RemotePeer *createPeer(const ProtoList &protocols, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0); + static RemotePeer *createPeer(const ProtoDescriptor &protocol, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr); + static RemotePeer *createPeer(const ProtoList &protocols, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr); }; diff --git a/src/common/protocols/datastream/datastreampeer.h b/src/common/protocols/datastream/datastreampeer.h index 98c26607..7e5f5d86 100644 --- a/src/common/protocols/datastream/datastreampeer.h +++ b/src/common/protocols/datastream/datastreampeer.h @@ -39,7 +39,7 @@ public: HeartBeatReply }; - DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent = 0); + DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent = nullptr); Protocol::Type protocol() const { return Protocol::DataStreamProtocol; } QString protocolName() const { return "the DataStream protocol"; } diff --git a/src/common/protocols/legacy/legacypeer.h b/src/common/protocols/legacy/legacypeer.h index 803b2b3a..f9e09541 100644 --- a/src/common/protocols/legacy/legacypeer.h +++ b/src/common/protocols/legacy/legacypeer.h @@ -37,7 +37,7 @@ public: HeartBeatReply }; - LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0); + LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr); Protocol::Type protocol() const { return Protocol::LegacyProtocol; } QString protocolName() const { return "the legacy protocol"; } diff --git a/src/common/remotepeer.cpp b/src/common/remotepeer.cpp index 36c56bae..31783dc0 100644 --- a/src/common/remotepeer.cpp +++ b/src/common/remotepeer.cpp @@ -39,7 +39,7 @@ RemotePeer::RemotePeer(::AuthHandler *authHandler, QTcpSocket *socket, Compresso : Peer(authHandler, parent), _socket(socket), _compressor(new Compressor(socket, level, this)), - _signalProxy(0), + _signalProxy(nullptr), _heartBeatTimer(new QTimer(this)), _heartBeatCount(0), _lag(0), @@ -121,8 +121,8 @@ void RemotePeer::setSignalProxy(::SignalProxy *proxy) if (!proxy) { _heartBeatTimer->stop(); - disconnect(signalProxy(), 0, this, 0); - _signalProxy = 0; + disconnect(signalProxy(), nullptr, this, nullptr); + _signalProxy = nullptr; if (isOpen()) close(); } diff --git a/src/common/remotepeer.h b/src/common/remotepeer.h index d29236cb..e9d85f59 100644 --- a/src/common/remotepeer.h +++ b/src/common/remotepeer.h @@ -42,7 +42,7 @@ public: using Peer::handle; using Peer::dispatch; - RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0); + RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = nullptr); void setSignalProxy(SignalProxy *proxy); diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index 721f32a4..52432eb2 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -70,7 +70,7 @@ private: int signalId; QByteArray signature; Signal(QObject *sender, int sigId, const QByteArray &signature) : sender(sender), signalId(sigId), signature(signature) {} - Signal() : sender(0), signalId(-1) {} + Signal() : sender(nullptr), signalId(-1) {} }; SignalProxy *_proxy; @@ -340,8 +340,8 @@ void SignalProxy::removePeer(Peer *peer) return; } - disconnect(peer, 0, this, 0); - peer->setSignalProxy(0); + disconnect(peer, nullptr, this, nullptr); + peer->setSignalProxy(nullptr); _peerMap.remove(peer->id()); emit peerRemoved(peer); @@ -398,7 +398,7 @@ SignalProxy::ExtendedMetaObject *SignalProxy::extendedMetaObject(const QMetaObje if (_extendedMetaObjects.contains(meta)) return _extendedMetaObjects[meta]; else - return 0; + return nullptr; } @@ -662,9 +662,9 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList return false; } - void *_a[] = { 0, // return type... - 0, 0, 0, 0, 0, // and 10 args - that's the max size qt can handle with signals and slots - 0, 0, 0, 0, 0 }; + void *_a[] = { nullptr, // return type... + nullptr, nullptr, nullptr, nullptr, nullptr, // and 10 args - that's the max size qt can handle with signals and slots + nullptr, nullptr, nullptr, nullptr, nullptr }; // check for argument compatibility and build params array for (int i = 0; i < numArgs; i++) { diff --git a/src/common/signalproxy.h b/src/common/signalproxy.h index d4e920ef..38bc00f0 100644 --- a/src/common/signalproxy.h +++ b/src/common/signalproxy.h @@ -177,8 +177,8 @@ private: template void handle(Peer *, T) { Q_ASSERT(0); } - bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms, QVariant &returnValue, Peer *peer = 0); - bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms = QVariantList(), Peer *peer = 0); + bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms, QVariant &returnValue, Peer *peer = nullptr); + bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms = QVariantList(), Peer *peer = nullptr); void requestInit(SyncableObject *obj); QVariantMap initData(SyncableObject *obj) const; diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index 93946595..2c42ea40 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -117,7 +117,7 @@ QVariantMap SyncableObject::toVariantMap() continue; } - QVariant value(variantType, (const void *)0); + QVariant value(variantType, (const void *)nullptr); QGenericReturnArgument genericvalue = QGenericReturnArgument(method.typeName(), value.data()); QMetaObject::invokeMethod(this, methodname.toLatin1(), genericvalue); diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index 91e1e70e..7b080432 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -57,9 +57,9 @@ class COMMON_EXPORT SyncableObject : public QObject Q_OBJECT public: - SyncableObject(QObject *parent = 0); - SyncableObject(const QString &objectName, QObject *parent = 0); - SyncableObject(const SyncableObject &other, QObject *parent = 0); + SyncableObject(QObject *parent = nullptr); + SyncableObject(const QString &objectName, QObject *parent = nullptr); + SyncableObject(const SyncableObject &other, QObject *parent = nullptr); ~SyncableObject() override; //! Stores the object's state into a QVariantMap. diff --git a/src/common/transfer.h b/src/common/transfer.h index aa9da69b..506d8834 100644 --- a/src/common/transfer.h +++ b/src/common/transfer.h @@ -61,8 +61,8 @@ public: }; Q_ENUMS(Direction) - Transfer(const QUuid &uuid, QObject *parent = 0); // for creating a syncable object client-side - Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0); + Transfer(const QUuid &uuid, QObject *parent = nullptr); // for creating a syncable object client-side + Transfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = nullptr); QUuid uuid() const; Status status() const; @@ -97,8 +97,8 @@ signals: void error(const QString &errorString); - void accepted(PeerPtr peer = 0) const; - void rejected(PeerPtr peer = 0) const; + void accepted(PeerPtr peer = nullptr) const; + void rejected(PeerPtr peer = nullptr) const; protected slots: void setStatus(Transfer::Status status); diff --git a/src/common/util.h b/src/common/util.h index ba73f4dc..63d724c9 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -46,7 +46,7 @@ COMMON_EXPORT QString secondsToString(int timeInSeconds); * \param codec The text codec we use if the input is not utf8 * \return The decoded string. */ -COMMON_EXPORT QString decodeString(const QByteArray &input, QTextCodec *codec = 0); +COMMON_EXPORT QString decodeString(const QByteArray &input, QTextCodec *codec = nullptr); COMMON_EXPORT uint editingDistance(const QString &s1, const QString &s2); diff --git a/src/core/abstractsqlstorage.cpp b/src/core/abstractsqlstorage.cpp index 149aabb1..7f5d115f 100644 --- a/src/core/abstractsqlstorage.cpp +++ b/src/core/abstractsqlstorage.cpp @@ -43,7 +43,7 @@ AbstractSqlStorage::~AbstractSqlStorage() QHash::iterator conIter; for (conIter = _connectionPool.begin(); conIter != _connectionPool.end(); ++conIter) { QSqlDatabase::removeDatabase(conIter.value()->name()); - disconnect(conIter.value(), 0, this, 0); + disconnect(conIter.value(), nullptr, this, nullptr); } } @@ -402,7 +402,7 @@ AbstractSqlStorage::Connection::~Connection() // AbstractSqlMigrator // ======================================== AbstractSqlMigrator::AbstractSqlMigrator() - : _query(0) + : _query(nullptr) { } @@ -418,7 +418,7 @@ void AbstractSqlMigrator::newQuery(const QString &query, QSqlDatabase db) void AbstractSqlMigrator::resetQuery() { delete _query; - _query = 0; + _query = nullptr; } @@ -490,7 +490,7 @@ void AbstractSqlMigrator::dumpStatus() // ======================================== AbstractSqlMigrationReader::AbstractSqlMigrationReader() : AbstractSqlMigrator(), - _writer(0) + _writer(nullptr) { } @@ -574,7 +574,7 @@ void AbstractSqlMigrationReader::abortMigration(const QString &errorMsg) rollback(); _writer->rollback(); - _writer = 0; + _writer = nullptr; } @@ -585,10 +585,10 @@ bool AbstractSqlMigrationReader::finalizeMigration() commit(); if (!_writer->commit()) { - _writer = 0; + _writer = nullptr; return false; } - _writer = 0; + _writer = nullptr; return true; } diff --git a/src/core/abstractsqlstorage.h b/src/core/abstractsqlstorage.h index ffdd89cb..9c371ff0 100644 --- a/src/core/abstractsqlstorage.h +++ b/src/core/abstractsqlstorage.h @@ -36,7 +36,7 @@ class AbstractSqlStorage : public Storage Q_OBJECT public: - AbstractSqlStorage(QObject *parent = 0); + AbstractSqlStorage(QObject *parent = nullptr); virtual ~AbstractSqlStorage(); virtual std::unique_ptr createMigrationReader() { return {}; } @@ -141,7 +141,7 @@ class AbstractSqlStorage::Connection : public QObject Q_OBJECT public: - Connection(const QString &name, QObject *parent = 0); + Connection(const QString &name, QObject *parent = nullptr); ~Connection(); inline QLatin1String name() const { return QLatin1String(_name); } diff --git a/src/core/core.cpp b/src/core/core.cpp index 339cbd38..6e77294b 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -783,7 +783,7 @@ void Core::setupClientSession(RemotePeer *peer, UserId uid) Q_ASSERT(handler); // From now on everything is handled by the client session - disconnect(handler, 0, this, 0); + disconnect(handler, nullptr, this, nullptr); _connectingClients.remove(handler); handler->deleteLater(); diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index 240954eb..a4baf5f4 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -31,7 +31,7 @@ using namespace Protocol; CoreAuthHandler::CoreAuthHandler(QTcpSocket *socket, QObject *parent) : AuthHandler(parent), - _peer(0), + _peer(nullptr), _magicReceived(false), _legacy(false), _clientRegistered(false), @@ -256,9 +256,9 @@ void CoreAuthHandler::handle(const Login &msg) quInfo() << qPrintable(tr("Client supports unknown features: %1").arg(clientFeatures.unknownFeatures().join(", "))); } - disconnect(socket(), 0, this, 0); - disconnect(_peer, 0, this, 0); - _peer->setParent(0); // Core needs to take care of this one now! + disconnect(socket(), nullptr, this, nullptr); + disconnect(_peer, nullptr, this, nullptr); + _peer->setParent(nullptr); // Core needs to take care of this one now! socket()->flush(); // Make sure all data is sent before handing over the peer (and socket) to the session thread (bug 682) emit handshakeComplete(_peer, uid); diff --git a/src/core/coreauthhandler.h b/src/core/coreauthhandler.h index 003d704e..1b4e6b91 100644 --- a/src/core/coreauthhandler.h +++ b/src/core/coreauthhandler.h @@ -31,7 +31,7 @@ class CoreAuthHandler : public AuthHandler Q_OBJECT public: - CoreAuthHandler(QTcpSocket *socket, QObject *parent = 0); + CoreAuthHandler(QTcpSocket *socket, QObject *parent = nullptr); signals: void handshakeComplete(RemotePeer *peer, UserId uid); diff --git a/src/core/corebacklogmanager.h b/src/core/corebacklogmanager.h index 801ca780..356660bd 100644 --- a/src/core/corebacklogmanager.h +++ b/src/core/corebacklogmanager.h @@ -29,7 +29,7 @@ class CoreBacklogManager : public BacklogManager Q_OBJECT public: - CoreBacklogManager(CoreSession *coreSession = 0); + CoreBacklogManager(CoreSession *coreSession = nullptr); CoreSession *coreSession() { return _coreSession; } diff --git a/src/core/corebasichandler.h b/src/core/corebasichandler.h index acd05c1f..39e41cb8 100644 --- a/src/core/corebasichandler.h +++ b/src/core/corebasichandler.h @@ -36,7 +36,7 @@ class CoreBasicHandler : public BasicHandler Q_OBJECT public: - CoreBasicHandler(CoreNetwork *parent = 0); + CoreBasicHandler(CoreNetwork *parent = nullptr); QString serverDecode(const QByteArray &string); QStringList serverDecode(const QList &stringlist); diff --git a/src/core/corebufferviewconfig.h b/src/core/corebufferviewconfig.h index 6723951b..d41205af 100644 --- a/src/core/corebufferviewconfig.h +++ b/src/core/corebufferviewconfig.h @@ -27,8 +27,8 @@ class CoreBufferViewConfig : public BufferViewConfig Q_OBJECT public: - CoreBufferViewConfig(int bufferViewId, QObject *parent = 0); - CoreBufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0); + CoreBufferViewConfig(int bufferViewId, QObject *parent = nullptr); + CoreBufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = nullptr); public slots: virtual inline void requestSetBufferViewName(const QString &bufferViewName) { setBufferViewName(bufferViewName); } diff --git a/src/core/corebufferviewmanager.cpp b/src/core/corebufferviewmanager.cpp index f1a73db1..76157552 100644 --- a/src/core/corebufferviewmanager.cpp +++ b/src/core/corebufferviewmanager.cpp @@ -32,7 +32,7 @@ CoreBufferViewManager::CoreBufferViewManager(SignalProxy *proxy, CoreSession *pa QVariantMap views = Core::getUserSetting(_coreSession->user(), "BufferViews").toMap(); QVariantMap::iterator iter = views.begin(); QVariantMap::iterator iterEnd = views.end(); - CoreBufferViewConfig *config = 0; + CoreBufferViewConfig *config = nullptr; while (iter != iterEnd) { config = new CoreBufferViewConfig(iter.key().toInt(), iter.value().toMap(), this); addBufferViewConfig(config); diff --git a/src/core/coreidentity.h b/src/core/coreidentity.h index 698cd4c9..9fbc24ea 100644 --- a/src/core/coreidentity.h +++ b/src/core/coreidentity.h @@ -67,9 +67,9 @@ class CoreIdentity : public Identity Q_OBJECT public: - CoreIdentity(IdentityId id, QObject *parent = 0); - CoreIdentity(const Identity &other, QObject *parent = 0); - CoreIdentity(const CoreIdentity &other, QObject *parent = 0); + CoreIdentity(IdentityId id, QObject *parent = nullptr); + CoreIdentity(const Identity &other, QObject *parent = nullptr); + CoreIdentity(const CoreIdentity &other, QObject *parent = nullptr); void synchronize(SignalProxy *proxy); diff --git a/src/core/coreircchannel.cpp b/src/core/coreircchannel.cpp index e6a48c9f..8bce68f4 100644 --- a/src/core/coreircchannel.cpp +++ b/src/core/coreircchannel.cpp @@ -26,7 +26,7 @@ CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network) _receivedWelcomeMsg(false) { #ifdef HAVE_QCA2 - _cipher = 0; + _cipher = nullptr; // Get the cipher key from CoreNetwork if present CoreNetwork *coreNetwork = qobject_cast(network); diff --git a/src/core/coreircuser.cpp b/src/core/coreircuser.cpp index 4dd946ea..b9dd830f 100644 --- a/src/core/coreircuser.cpp +++ b/src/core/coreircuser.cpp @@ -24,7 +24,7 @@ CoreIrcUser::CoreIrcUser(const QString &hostmask, Network *network) : IrcUser(hostmask, network) { #ifdef HAVE_QCA2 - _cipher = 0; + _cipher = nullptr; // Get the cipher key from CoreNetwork if present CoreNetwork *coreNetwork = qobject_cast(network); diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 4b32f2c8..143760f8 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -438,10 +438,10 @@ void CoreNetwork::removeChannelKey(const QString &channel) Cipher *CoreNetwork::cipher(const QString &target) { if (target.isEmpty()) - return 0; + return nullptr; if (!Cipher::neededFeaturesAvailable()) - return 0; + return nullptr; CoreIrcChannel *channel = qobject_cast(ircChannel(target)); if (channel) { @@ -453,7 +453,7 @@ Cipher *CoreNetwork::cipher(const QString &target) } else if (!isChannelName(target)) { return qobject_cast(newIrcUser(target))->cipher(); } - return 0; + return nullptr; } diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index c38c3d6b..faec85de 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -188,14 +188,14 @@ void CoreSession::onNetworkDisconnected(NetworkId networkId) CoreNetwork *CoreSession::network(NetworkId id) const { if (_networks.contains(id)) return _networks[id]; - return 0; + return nullptr; } CoreIdentity *CoreSession::identity(IdentityId id) const { if (_identities.contains(id)) return _identities[id]; - return 0; + return nullptr; } @@ -245,7 +245,7 @@ void CoreSession::saveSessionState() const void CoreSession::restoreSessionState() { QList nets = Core::connectedNetworks(user()); - CoreNetwork *net = 0; + CoreNetwork *net = nullptr; foreach(NetworkId id, nets) { net = network(id); Q_ASSERT(net); @@ -649,8 +649,8 @@ void CoreSession::removeNetwork(NetworkId id) if (net->connectionState() != Network::Disconnected) { // make sure we no longer receive data from the tcp buffer - disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, 0); - disconnect(net, SIGNAL(displayStatusMsg(QString)), this, 0); + disconnect(net, SIGNAL(displayMsg(NetworkId, Message::Type, BufferInfo::Type, const QString &, const QString &, const QString &, Message::Flags)), this, nullptr); + disconnect(net, SIGNAL(displayStatusMsg(QString)), this, nullptr); connect(net, SIGNAL(disconnected(NetworkId)), this, SLOT(destroyNetwork(NetworkId))); net->disconnectFromIrc(); } @@ -697,9 +697,9 @@ void CoreSession::renameBuffer(const NetworkId &networkId, const QString &newNam void CoreSession::clientsConnected() { QHash::iterator netIter = _networks.begin(); - Identity *identity = 0; - CoreNetwork *net = 0; - IrcUser *me = 0; + Identity *identity = nullptr; + CoreNetwork *net = nullptr; + IrcUser *me = nullptr; while (netIter != _networks.end()) { net = *netIter; ++netIter; @@ -723,9 +723,9 @@ void CoreSession::clientsConnected() void CoreSession::clientsDisconnected() { QHash::iterator netIter = _networks.begin(); - Identity *identity = 0; - CoreNetwork *net = 0; - IrcUser *me = 0; + Identity *identity = nullptr; + CoreNetwork *net = nullptr; + IrcUser *me = nullptr; QString awayReason; while (netIter != _networks.end()) { net = *netIter; @@ -755,7 +755,7 @@ void CoreSession::clientsDisconnected() void CoreSession::globalAway(const QString &msg, const bool skipFormatting) { QHash::iterator netIter = _networks.begin(); - CoreNetwork *net = 0; + CoreNetwork *net = nullptr; while (netIter != _networks.end()) { net = *netIter; ++netIter; diff --git a/src/core/coresession.h b/src/core/coresession.h index b4903ff4..176a23ca 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -63,7 +63,7 @@ class CoreSession : public QObject Q_OBJECT public: - CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject *parent = 0); + CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject *parent = nullptr); QList buffers() const; inline UserId user() const { return _user; } diff --git a/src/core/coretransfer.cpp b/src/core/coretransfer.cpp index 34443a04..209a800f 100644 --- a/src/core/coretransfer.cpp +++ b/src/core/coretransfer.cpp @@ -29,7 +29,7 @@ const qint64 chunkSize = 16 * 1024; CoreTransfer::CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 fileSize, QObject *parent) : Transfer(direction, nick, fileName, address, port, fileSize, parent), - _socket(0), + _socket(nullptr), _pos(0), _reading(false) { @@ -48,7 +48,7 @@ void CoreTransfer::cleanUp() if (_socket) { _socket->close(); _socket->deleteLater(); - _socket = 0; + _socket = nullptr; } _buffer.clear(); diff --git a/src/core/coretransfer.h b/src/core/coretransfer.h index 25e8ef9d..02c21c88 100644 --- a/src/core/coretransfer.h +++ b/src/core/coretransfer.h @@ -32,7 +32,7 @@ class CoreTransfer : public Transfer Q_OBJECT public: - CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0); + CoreTransfer(Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = nullptr); quint64 transferred() const override; diff --git a/src/core/coreuserinputhandler.h b/src/core/coreuserinputhandler.h index 75f9b8df..55539e64 100644 --- a/src/core/coreuserinputhandler.h +++ b/src/core/coreuserinputhandler.h @@ -32,7 +32,7 @@ class CoreUserInputHandler : public CoreBasicHandler Q_OBJECT public: - CoreUserInputHandler(CoreNetwork *parent = 0); + CoreUserInputHandler(CoreNetwork *parent = nullptr); inline CoreNetwork *coreNetwork() const { return qobject_cast(parent()); } void handleUserInput(const BufferInfo &bufferInfo, const QString &text); @@ -112,10 +112,10 @@ protected: private: void doMode(const BufferInfo& bufferInfo, const QChar &addOrRemove, const QChar &mode, const QString &nickList); void banOrUnban(const BufferInfo &bufferInfo, const QString &text, bool ban); - void putPrivmsg(const QString &target, const QString &message, std::function encodeFunc, Cipher *cipher = 0); + void putPrivmsg(const QString &target, const QString &message, std::function encodeFunc, Cipher *cipher = nullptr); #ifdef HAVE_QCA2 - QByteArray encrypt(const QString &target, const QByteArray &message, bool *didEncrypt = 0) const; + QByteArray encrypt(const QString &target, const QByteArray &message, bool *didEncrypt = nullptr) const; #endif struct Command { diff --git a/src/core/ctcpparser.h b/src/core/ctcpparser.h index f5e58608..5808a712 100644 --- a/src/core/ctcpparser.h +++ b/src/core/ctcpparser.h @@ -36,7 +36,7 @@ class CtcpParser : public QObject Q_OBJECT public: - CtcpParser(CoreSession *coreSession, QObject *parent = 0); + CtcpParser(CoreSession *coreSession, QObject *parent = nullptr); inline CoreSession *coreSession() const { return _coreSession; } @@ -88,7 +88,7 @@ private: QString bufferName; QList replies; - CtcpReply() : network(0) {} + CtcpReply() : network(nullptr) {} CtcpReply(CoreNetwork *net, const QString &buf) : network(net), bufferName(buf) {} }; diff --git a/src/core/keyevent.cpp b/src/core/keyevent.cpp index ff1ccb66..ab923255 100644 --- a/src/core/keyevent.cpp +++ b/src/core/keyevent.cpp @@ -25,7 +25,7 @@ Event *KeyEvent::create(EventManager::EventType type, QVariantMap &map, Network if (type == EventManager::KeyEvent) return new KeyEvent(type, map, network); - return 0; + return nullptr; } diff --git a/src/core/ldapauthenticator.cpp b/src/core/ldapauthenticator.cpp index b4204404..76db681a 100644 --- a/src/core/ldapauthenticator.cpp +++ b/src/core/ldapauthenticator.cpp @@ -43,15 +43,15 @@ LdapAuthenticator::LdapAuthenticator(QObject *parent) : Authenticator(parent), - _connection(0) + _connection(nullptr) { } LdapAuthenticator::~LdapAuthenticator() { - if (_connection != 0) { - ldap_unbind_ext(_connection, 0, 0); + if (_connection != nullptr) { + ldap_unbind_ext(_connection, nullptr, nullptr); } } @@ -183,7 +183,7 @@ Authenticator::State LdapAuthenticator::init(const QVariantMap &settings, // Method based on abustany LDAP quassel patch. bool LdapAuthenticator::ldapConnect() { - if (_connection != 0) { + if (_connection != nullptr) { ldapDisconnect(); } @@ -208,8 +208,8 @@ bool LdapAuthenticator::ldapConnect() if (res != LDAP_SUCCESS) { qWarning() << "Could not set LDAP protocol version to v3:" << ldap_err2string(res); - ldap_unbind_ext(_connection, 0, 0); - _connection = 0; + ldap_unbind_ext(_connection, nullptr, nullptr); + _connection = nullptr; return false; } @@ -219,12 +219,12 @@ bool LdapAuthenticator::ldapConnect() void LdapAuthenticator::ldapDisconnect() { - if (_connection == 0) { + if (_connection == nullptr) { return; } - ldap_unbind_ext(_connection, 0, 0); - _connection = 0; + ldap_unbind_ext(_connection, nullptr, nullptr); + _connection = nullptr; } @@ -237,7 +237,7 @@ bool LdapAuthenticator::ldapAuth(const QString &username, const QString &passwor int res; // Attempt to establish a connection. - if (_connection == 0) { + if (_connection == nullptr) { if (!ldapConnect()) { return false; } @@ -251,10 +251,10 @@ bool LdapAuthenticator::ldapAuth(const QString &username, const QString &passwor QByteArray baseDN = _baseDN.toLocal8Bit(); QByteArray uidAttribute = _uidAttribute.toLocal8Bit(); - cred.bv_val = (bindPassword.size() > 0 ? bindPassword.data() : NULL); + cred.bv_val = (bindPassword.size() > 0 ? bindPassword.data() : nullptr); cred.bv_len = bindPassword.size(); - res = ldap_sasl_bind_s(_connection, bindDN.size() > 0 ? bindDN.constData() : 0, LDAP_SASL_SIMPLE, &cred, 0, 0, 0); + res = ldap_sasl_bind_s(_connection, bindDN.size() > 0 ? bindDN.constData() : nullptr, LDAP_SASL_SIMPLE, &cred, nullptr, nullptr, nullptr); if (res != LDAP_SUCCESS) { qWarning() << "Refusing connection from" << username << "(LDAP bind failed:" << ldap_err2string(res) << ")"; @@ -262,11 +262,11 @@ bool LdapAuthenticator::ldapAuth(const QString &username, const QString &passwor return false; } - LDAPMessage *msg = NULL, *entry = NULL; + LDAPMessage *msg = nullptr, *entry = nullptr; const QByteArray ldapQuery = "(&(" + uidAttribute + '=' + username.toLocal8Bit() + ")" + _filter.toLocal8Bit() + ")"; - res = ldap_search_ext_s(_connection, baseDN.constData(), LDAP_SCOPE_SUBTREE, ldapQuery.constData(), 0, 0, 0, 0, 0, 0, &msg); + res = ldap_search_ext_s(_connection, baseDN.constData(), LDAP_SCOPE_SUBTREE, ldapQuery.constData(), nullptr, 0, nullptr, nullptr, nullptr, 0, &msg); if (res != LDAP_SUCCESS) { qWarning() << "Refusing connection from" << username << "(LDAP search failed:" << ldap_err2string(res) << ")"; @@ -281,7 +281,7 @@ bool LdapAuthenticator::ldapAuth(const QString &username, const QString &passwor entry = ldap_first_entry(_connection, msg); - if (entry == 0) { + if (entry == nullptr) { qWarning() << "Refusing connection from" << username << "(LDAP search returned no results)"; ldap_msgfree(msg); return false; @@ -293,7 +293,7 @@ bool LdapAuthenticator::ldapAuth(const QString &username, const QString &passwor char *userDN = ldap_get_dn(_connection, entry); - res = ldap_sasl_bind_s(_connection, userDN, LDAP_SASL_SIMPLE, &cred, 0, 0, 0); + res = ldap_sasl_bind_s(_connection, userDN, LDAP_SASL_SIMPLE, &cred, nullptr, nullptr, nullptr); if (res != LDAP_SUCCESS) { qWarning() << "Refusing connection from" << username << "(LDAP authentication failed)"; diff --git a/src/core/ldapauthenticator.h b/src/core/ldapauthenticator.h index 1b0b6394..c46b76cc 100644 --- a/src/core/ldapauthenticator.h +++ b/src/core/ldapauthenticator.h @@ -50,7 +50,7 @@ class LdapAuthenticator : public Authenticator Q_OBJECT public: - LdapAuthenticator(QObject *parent = 0); + LdapAuthenticator(QObject *parent = nullptr); ~LdapAuthenticator() override; public slots: diff --git a/src/core/netsplit.h b/src/core/netsplit.h index 1251f9e6..a5aa9955 100644 --- a/src/core/netsplit.h +++ b/src/core/netsplit.h @@ -32,7 +32,7 @@ class Netsplit : public QObject { Q_OBJECT public: - Netsplit(Network *network, QObject *parent = 0); + Netsplit(Network *network, QObject *parent = nullptr); inline Network *network() const { return _network; } diff --git a/src/core/oidentdconfiggenerator.h b/src/core/oidentdconfiggenerator.h index 7e13d585..c0d375b8 100644 --- a/src/core/oidentdconfiggenerator.h +++ b/src/core/oidentdconfiggenerator.h @@ -54,7 +54,7 @@ class OidentdConfigGenerator : public QObject { Q_OBJECT public: - explicit OidentdConfigGenerator(QObject *parent = 0); + explicit OidentdConfigGenerator(QObject *parent = nullptr); ~OidentdConfigGenerator(); public slots: diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index fb8157ac..5e6517cd 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -1496,7 +1496,7 @@ Message::Types PostgreSqlStorage::bufferActivity(BufferId bufferId, MsgId lastSe query.bindValue(":lastseenmsgid", lastSeenMsgId.toQint64()); safeExec(query); watchQuery(query); - Message::Types result = Message::Types(0); + Message::Types result = Message::Types(nullptr); if (query.first()) result = Message::Types(query.value(0).toInt()); return result; diff --git a/src/core/postgresqlstorage.h b/src/core/postgresqlstorage.h index ff6e7b8e..3643ecc3 100644 --- a/src/core/postgresqlstorage.h +++ b/src/core/postgresqlstorage.h @@ -30,7 +30,7 @@ class PostgreSqlStorage : public AbstractSqlStorage Q_OBJECT public: - PostgreSqlStorage(QObject *parent = 0); + PostgreSqlStorage(QObject *parent = nullptr); ~PostgreSqlStorage() override; std::unique_ptr createMigrationWriter() override; diff --git a/src/core/sessionthread.h b/src/core/sessionthread.h index 63bb2a59..5a9a8bcd 100644 --- a/src/core/sessionthread.h +++ b/src/core/sessionthread.h @@ -36,7 +36,7 @@ class SessionThread : public QObject Q_OBJECT public: - SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, QObject *parent = 0); + SessionThread(UserId user, bool restoreState, bool strictIdentEnabled, QObject *parent = nullptr); ~SessionThread(); public slots: diff --git a/src/core/sqlauthenticator.h b/src/core/sqlauthenticator.h index 79b204f2..2b79ef0a 100644 --- a/src/core/sqlauthenticator.h +++ b/src/core/sqlauthenticator.h @@ -27,7 +27,7 @@ class SqlAuthenticator : public Authenticator Q_OBJECT public: - SqlAuthenticator(QObject *parent = 0); + SqlAuthenticator(QObject *parent = nullptr); virtual ~SqlAuthenticator(); public slots: diff --git a/src/core/sqlitestorage.cpp b/src/core/sqlitestorage.cpp index e0f8fd80..bf6f3f7b 100644 --- a/src/core/sqlitestorage.cpp +++ b/src/core/sqlitestorage.cpp @@ -1612,7 +1612,7 @@ Message::Types SqliteStorage::bufferActivity(BufferId bufferId, MsgId lastSeenMs QSqlDatabase db = logDb(); db.transaction(); - Message::Types result = Message::Types(0); + Message::Types result = Message::Types(nullptr); { QSqlQuery query(db); query.prepare(queryString("select_buffer_bufferactivity")); diff --git a/src/core/sqlitestorage.h b/src/core/sqlitestorage.h index d52cdfa2..ab4c826d 100644 --- a/src/core/sqlitestorage.h +++ b/src/core/sqlitestorage.h @@ -31,7 +31,7 @@ class SqliteStorage : public AbstractSqlStorage Q_OBJECT public: - SqliteStorage(QObject *parent = 0); + SqliteStorage(QObject *parent = nullptr); ~SqliteStorage() override; std::unique_ptr createMigrationReader() override; diff --git a/src/core/sslserver.cpp b/src/core/sslserver.cpp index a1e090b7..83d7e603 100644 --- a/src/core/sslserver.cpp +++ b/src/core/sslserver.cpp @@ -66,7 +66,7 @@ SslServer::SslServer(QObject *parent) QTcpSocket *SslServer::nextPendingConnection() { if (_pendingConnections.isEmpty()) - return 0; + return nullptr; else return _pendingConnections.takeFirst(); } diff --git a/src/core/sslserver.h b/src/core/sslserver.h index 518db2e4..2e18aa1c 100644 --- a/src/core/sslserver.h +++ b/src/core/sslserver.h @@ -33,7 +33,7 @@ class SslServer : public QTcpServer Q_OBJECT public: - SslServer(QObject *parent = 0); + SslServer(QObject *parent = nullptr); bool hasPendingConnections() const override { return !_pendingConnections.isEmpty(); } QTcpSocket *nextPendingConnection() override; diff --git a/src/core/storage.h b/src/core/storage.h index df0a3a09..c0cddc16 100644 --- a/src/core/storage.h +++ b/src/core/storage.h @@ -33,7 +33,7 @@ class Storage : public QObject Q_OBJECT public: - Storage(QObject *parent = 0); + Storage(QObject *parent = nullptr); virtual ~Storage() {}; enum State { diff --git a/src/qtui/aboutdlg.h b/src/qtui/aboutdlg.h index 45ac5961..9a4eeddc 100644 --- a/src/qtui/aboutdlg.h +++ b/src/qtui/aboutdlg.h @@ -32,7 +32,7 @@ class AboutDlg : public QDialog Q_OBJECT public: - AboutDlg(QWidget *parent = 0); + AboutDlg(QWidget *parent = nullptr); private: Ui::AboutDlg ui; diff --git a/src/qtui/awaylogfilter.h b/src/qtui/awaylogfilter.h index 6c76936d..3b96c446 100644 --- a/src/qtui/awaylogfilter.h +++ b/src/qtui/awaylogfilter.h @@ -28,7 +28,7 @@ class AwayLogFilter : public ChatMonitorFilter Q_OBJECT public: - AwayLogFilter(MessageModel *model, QObject *parent = 0); + AwayLogFilter(MessageModel *model, QObject *parent = nullptr); virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; virtual QString idString() const { return "AwayLog"; } diff --git a/src/qtui/awaylogview.h b/src/qtui/awaylogview.h index 068d1fa0..ed7dba5e 100644 --- a/src/qtui/awaylogview.h +++ b/src/qtui/awaylogview.h @@ -30,7 +30,7 @@ class AwayLogView : public ChatMonitorView Q_OBJECT public: - AwayLogView(AwayLogFilter *filter, QWidget *parent = 0); + AwayLogView(AwayLogFilter *filter, QWidget *parent = nullptr); virtual void addActionsToMenu(QMenu *menu, const QPointF &pos); }; diff --git a/src/qtui/bufferwidget.cpp b/src/qtui/bufferwidget.cpp index 2d8e3a0d..aa700f9f 100644 --- a/src/qtui/bufferwidget.cpp +++ b/src/qtui/bufferwidget.cpp @@ -107,7 +107,7 @@ BufferWidget::BufferWidget(QWidget *parent) BufferWidget::~BufferWidget() { delete _chatViewSearchController; - _chatViewSearchController = 0; + _chatViewSearchController = nullptr; } diff --git a/src/qtui/bufferwidget.h b/src/qtui/bufferwidget.h index f5f5c3fe..e467ecc4 100644 --- a/src/qtui/bufferwidget.h +++ b/src/qtui/bufferwidget.h @@ -44,8 +44,8 @@ public: virtual inline bool autoMarkerLineOnLostFocus() const { return _autoMarkerLineOnLostFocus; } public slots: - virtual void setMarkerLine(ChatView *view = 0, bool allowGoingBack = true); - virtual void jumpToMarkerLine(ChatView *view = 0, bool requestBacklog = true); + virtual void setMarkerLine(ChatView *view = nullptr, bool allowGoingBack = true); + virtual void jumpToMarkerLine(ChatView *view = nullptr, bool requestBacklog = true); protected: virtual AbstractChatView *createChatView(BufferId); diff --git a/src/qtui/channellistdlg.cpp b/src/qtui/channellistdlg.cpp index d575dc7b..204590ed 100644 --- a/src/qtui/channellistdlg.cpp +++ b/src/qtui/channellistdlg.cpp @@ -33,7 +33,7 @@ ChannelListDlg::ChannelListDlg(QWidget *parent) _listFinished(true), _ircListModel(this), _sortFilter(this), - _simpleModeSpacer(0), + _simpleModeSpacer(nullptr), _advancedMode(false) { _sortFilter.setSourceModel(&_ircListModel); @@ -151,7 +151,7 @@ void ChannelListDlg::setAdvancedMode(bool advanced) if (_simpleModeSpacer) { ui.searchLayout->removeItem(_simpleModeSpacer); delete _simpleModeSpacer; - _simpleModeSpacer = 0; + _simpleModeSpacer = nullptr; } ui.advancedModeLabel->setPixmap(icon::get("edit-clear-locationbar-rtl").pixmap(16)); } diff --git a/src/qtui/channellistdlg.h b/src/qtui/channellistdlg.h index aa0708d5..5136ef3a 100644 --- a/src/qtui/channellistdlg.h +++ b/src/qtui/channellistdlg.h @@ -36,7 +36,7 @@ class ChannelListDlg : public QDialog Q_OBJECT public: - ChannelListDlg(QWidget *parent = 0); + ChannelListDlg(QWidget *parent = nullptr); void setNetwork(NetworkId netId); diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index bbd49bfc..79ee339b 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -49,7 +49,7 @@ ChatItem::ChatItem(const QRectF &boundingRect, ChatLine *parent) _boundingRect(boundingRect), _selectionMode(NoSelection), _selectionStart(-1), - _cachedLayout(0) + _cachedLayout(nullptr) { } @@ -141,7 +141,7 @@ QTextLayout *ChatItem::layout() const void ChatItem::clearCache() { delete _cachedLayout; - _cachedLayout = 0; + _cachedLayout = nullptr; } @@ -630,7 +630,7 @@ ContentsChatItem::ActionProxy ContentsChatItem::_actionProxy; ContentsChatItem::ContentsChatItem(const QPointF &pos, const qreal &width, ChatLine *parent) : ChatItem(QRectF(pos, QSizeF(width, 0)), parent), - _data(0) + _data(nullptr) { setPos(pos); setGeometryByWidth(width); @@ -652,7 +652,7 @@ ContentsChatItem::~ContentsChatItem() void ContentsChatItem::clearCache() { delete _data; - _data = 0; + _data = nullptr; ChatItem::clearCache(); } @@ -679,7 +679,7 @@ qreal ContentsChatItem::setGeometryByWidth(qreal w) qreal spacing = qMax(fontMetrics()->lineSpacing(), fontMetrics()->height()); // cope with negative leading() qreal h = lines * spacing; delete _data; - _data = 0; + _data = nullptr; if (w != width() || h != height()) setGeometry(w, h); diff --git a/src/qtui/chatitem.h b/src/qtui/chatitem.h index a6a94b2e..52f5c362 100644 --- a/src/qtui/chatitem.h +++ b/src/qtui/chatitem.h @@ -66,7 +66,7 @@ public: QPointF mapToScene(const QPointF &) const; QPointF mapFromScene(const QPointF &) const; - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); virtual inline int type() const { return ChatScene::ChatItemType; } QVariant data(int role) const; @@ -175,7 +175,7 @@ public: virtual void handleClick(const QPointF &pos, ChatScene::ClickMode clickMode); protected: - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); virtual inline int type() const { return ChatScene::SenderChatItemType; } virtual void initLayout(QTextLayout *layout) const; }; diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index 755d05ba..5aba1915 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -50,8 +50,8 @@ ChatLine::ChatLine(int row, QAbstractItemModel *model, _width(width), _height(_contentsItem.height()), _selection(0), - _mouseGrabberItem(0), - _hoverItem(0) + _mouseGrabberItem(nullptr), + _hoverItem(nullptr) { Q_ASSERT(model); QModelIndex index = model->index(row, ChatLineModel::ContentsColumn); @@ -78,7 +78,7 @@ ChatItem *ChatLine::item(ChatLineModel::ColumnType column) case ChatLineModel::ContentsColumn: return &_contentsItem; default: - return 0; + return nullptr; } } @@ -91,7 +91,7 @@ ChatItem *ChatLine::itemAt(const QPointF &pos) return &_senderItem; if (_timestampItem.boundingRect().contains(pos)) return &_timestampItem; - return 0; + return nullptr; } @@ -118,7 +118,7 @@ bool ChatLine::sceneEvent(QEvent *event) setMouseGrabberItem(itemAt(linePos)); } else if (event->type() == QEvent::UngrabMouse) { - setMouseGrabberItem(0); + setMouseGrabberItem(nullptr); } return QGraphicsItem::sceneEvent(event); } @@ -287,7 +287,7 @@ void ChatLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { if (_hoverItem) { _hoverItem->hoverLeaveEvent(event); - _hoverItem = 0; + _hoverItem = nullptr; } } diff --git a/src/qtui/chatline.h b/src/qtui/chatline.h index 3d95c5e0..ed2de36f 100644 --- a/src/qtui/chatline.h +++ b/src/qtui/chatline.h @@ -34,7 +34,7 @@ public: const qreal &width, const qreal ×tampWidth, const qreal &senderWidth, const qreal &contentsWidth, const QPointF &senderPos, const QPointF &contentsPos, - QGraphicsItem *parent = 0); + QGraphicsItem *parent = nullptr); virtual ~ChatLine(); @@ -49,7 +49,7 @@ public: inline const QAbstractItemModel *model() const { return _model; } inline ChatScene *chatScene() const { return qobject_cast(scene()); } - inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : 0; } + inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : nullptr; } inline qreal width() const { return _width; } inline qreal height() const { return _height; } @@ -60,7 +60,7 @@ public: inline ChatItem *senderItem() { return &_senderItem; } inline ContentsChatItem *contentsItem() { return &_contentsItem; } - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); enum { Type = ChatScene::ChatLineType }; virtual inline int type() const { return Type; } diff --git a/src/qtui/chatlinemodel.h b/src/qtui/chatlinemodel.h index 0c18ef1b..d2e976ca 100644 --- a/src/qtui/chatlinemodel.h +++ b/src/qtui/chatlinemodel.h @@ -37,7 +37,7 @@ public: SelectedBackgroundRole }; - ChatLineModel(QObject *parent = 0); + ChatLineModel(QObject *parent = nullptr); typedef ChatLineModelItem::Word Word; typedef ChatLineModelItem::WrapList WrapList; diff --git a/src/qtui/chatmonitorfilter.h b/src/qtui/chatmonitorfilter.h index a3344d02..c9ceb976 100644 --- a/src/qtui/chatmonitorfilter.h +++ b/src/qtui/chatmonitorfilter.h @@ -37,7 +37,7 @@ public: AllFields = 0xff }; - ChatMonitorFilter(MessageModel *model, QObject *parent = 0); + ChatMonitorFilter(MessageModel *model, QObject *parent = nullptr); virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; virtual QString idString() const { return "ChatMonitor"; } diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index 02f5faca..4e6b766d 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -71,7 +71,7 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w _markerLineJumpPending(false), _cutoffMode(CutoffRight), _alwaysBracketSender(false), - _selectingItem(0), + _selectingItem(nullptr), _selectionStart(-1), _isSelecting(false), _clickMode(NoClick), @@ -182,7 +182,7 @@ void ChatScene::resetColumnWidths() ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange) const { if (!_lines.count()) - return 0; + return nullptr; QList::ConstIterator start = _lines.begin(); QList::ConstIterator end = _lines.end(); @@ -207,10 +207,10 @@ ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange return *start; if (matchExact) - return 0; + return nullptr; if (start == _lines.begin()) // not (yet?) in our scene - return 0; + return nullptr; // if we didn't find the exact msgId, take the next-lower one (this makes sense for lastSeen) @@ -222,7 +222,7 @@ ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange if (_lines.at(i)->msgType() != Message::DayChange) return _lines.at(i); } - return 0; + return nullptr; } // return the next-lower line @@ -234,7 +234,7 @@ ChatLine *ChatScene::chatLine(MsgId msgId, bool matchExact, bool ignoreDayChange return *start; } while (start != _lines.begin()); - return 0; + return nullptr; } @@ -245,7 +245,7 @@ ChatItem *ChatScene::chatItemAt(const QPointF &scenePos) const if (line) return line->itemAt(line->mapFromScene(scenePos)); } - return 0; + return nullptr; } @@ -419,7 +419,7 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) // neither pre- or append means we have to do dirty work: move items... if (!(atTop || atBottom)) { - ChatLine *line = 0; + ChatLine *line = nullptr; for (int i = 0; i <= end; i++) { line = _lines.at(i); line->setPos(0, line->pos().y() - h); @@ -484,7 +484,7 @@ void ChatScene::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e if (_selectingItem) { int row = _selectingItem->row(); if (row >= start && row <= end) - setSelectingItem(0); + setSelectingItem(nullptr); } // remove items from scene @@ -492,7 +492,7 @@ void ChatScene::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e int lineCount = start; while (lineIter != _lines.end() && lineCount <= end) { if ((*lineIter) == markerLine()->chatLine()) - markerLine()->setChatLine(0); + markerLine()->setChatLine(nullptr); h += (*lineIter)->height(); delete *lineIter; lineIter = _lines.erase(lineIter); @@ -534,7 +534,7 @@ void ChatScene::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e moveStart = start; offset = -offset; } - ChatLine *line = 0; + ChatLine *line = nullptr; for (int i = moveStart; i <= moveEnd; i++) { line = _lines.at(i); line->setPos(0, line->pos().y() + offset); @@ -1227,7 +1227,7 @@ void ChatScene::loadWebPreview(ChatItem *parentItem, const QUrl &url, const QRec if (webPreview.previewItem->scene()) removeItem(webPreview.previewItem); delete webPreview.previewItem; - webPreview.previewItem = 0; + webPreview.previewItem = nullptr; } webPreview.previewState = WebPreview::NoPreview; } @@ -1297,9 +1297,9 @@ void ChatScene::webPreviewNextStep() case WebPreview::HidePreview: if (webPreview.previewItem) { delete webPreview.previewItem; - webPreview.previewItem = 0; + webPreview.previewItem = nullptr; } - webPreview.parentItem = 0; + webPreview.parentItem = nullptr; webPreview.url = QUrl(); webPreview.urlRect = QRectF(); webPreview.previewState = WebPreview::NoPreview; @@ -1316,7 +1316,7 @@ void ChatScene::clearWebPreview(ChatItem *parentItem) webPreview.previewState = WebPreview::NoPreview; // we haven't loaded anything yet break; case WebPreview::ShowPreview: - if (parentItem == 0 || webPreview.parentItem == parentItem) { + if (parentItem == nullptr || webPreview.parentItem == parentItem) { if (webPreview.previewItem && webPreview.previewItem->scene()) removeItem(webPreview.previewItem); } diff --git a/src/qtui/chatscene.h b/src/qtui/chatscene.h index 7f6bb75f..cec16a07 100644 --- a/src/qtui/chatscene.h +++ b/src/qtui/chatscene.h @@ -168,7 +168,7 @@ public slots: #if defined HAVE_WEBKIT || defined HAVE_WEBENGINE void loadWebPreview(ChatItem *parentItem, const QUrl &url, const QRectF &urlRect); - void clearWebPreview(ChatItem *parentItem = 0); + void clearWebPreview(ChatItem *parentItem = nullptr); #endif signals: @@ -292,7 +292,7 @@ private: QRectF urlRect; PreviewState previewState; QTimer timer; - WebPreview() : parentItem(0), previewItem(0), previewState(NoPreview) {} + WebPreview() : parentItem(nullptr), previewItem(nullptr), previewState(NoPreview) {} }; WebPreview webPreview; #endif // HAVE_WEBKIT || HAVE_WEBENGINE diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index 23703113..46ec7beb 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -55,7 +55,7 @@ ChatView::ChatView(MessageFilter *filter, QWidget *parent) void ChatView::init(MessageFilter *filter) { - _bufferContainer = 0; + _bufferContainer = nullptr; _currentScaleFactor = 1; _invalidateFilter = false; @@ -313,11 +313,11 @@ QList ChatView::visibleChatLinesSorted(Qt::ItemSelectionMode mode) c ChatLine *ChatView::lastVisibleChatLine(bool ignoreDayChange) const { if (!scene()) - return 0; + return nullptr; QAbstractItemModel *model = scene()->model(); if (!model || model->rowCount() == 0) - return 0; + return nullptr; int row = -1; @@ -330,7 +330,7 @@ ChatLine *ChatView::lastVisibleChatLine(bool ignoreDayChange) const if (row >= 0) return scene()->chatLine(row); - return 0; + return nullptr; } diff --git a/src/qtui/chatview.h b/src/qtui/chatview.h index 8b50c55e..cb34eded 100644 --- a/src/qtui/chatview.h +++ b/src/qtui/chatview.h @@ -39,8 +39,8 @@ class ChatView : public QGraphicsView, public AbstractChatView Q_OBJECT public: - ChatView(MessageFilter *, QWidget *parent = 0); - ChatView(BufferId bufferId, QWidget *parent = 0); + ChatView(MessageFilter *, QWidget *parent = nullptr); + ChatView(BufferId bufferId, QWidget *parent = nullptr); virtual MsgId lastMsgId() const; virtual MsgId lastVisibleMsgId() const; diff --git a/src/qtui/chatviewsearchbar.h b/src/qtui/chatviewsearchbar.h index df315691..f3c92b19 100644 --- a/src/qtui/chatviewsearchbar.h +++ b/src/qtui/chatviewsearchbar.h @@ -33,7 +33,7 @@ class ChatViewSearchBar : public QWidget Q_OBJECT public: - ChatViewSearchBar(QWidget *parent = 0); + ChatViewSearchBar(QWidget *parent = nullptr); inline QLineEdit *searchEditLine() const { return ui.searchEditLine; } inline QCheckBox *caseSensitiveBox() const { return ui.caseSensitiveBox; } diff --git a/src/qtui/chatviewsearchcontroller.cpp b/src/qtui/chatviewsearchcontroller.cpp index b1970c4a..bb6dc367 100644 --- a/src/qtui/chatviewsearchcontroller.cpp +++ b/src/qtui/chatviewsearchcontroller.cpp @@ -31,7 +31,7 @@ ChatViewSearchController::ChatViewSearchController(QObject *parent) : QObject(parent), - _scene(0), + _scene(nullptr), _currentHighlight(0), _caseSensitive(false), _searchSenders(false), @@ -65,8 +65,8 @@ void ChatViewSearchController::setScene(ChatScene *scene) return; if (_scene) { - disconnect(_scene, 0, this, 0); - disconnect(Client::messageModel(), 0, this, 0); + disconnect(_scene, nullptr, this, nullptr); + disconnect(Client::messageModel(), nullptr, this, nullptr); qDeleteAll(_highlightItems); _highlightItems.clear(); } @@ -357,7 +357,7 @@ void ChatViewSearchController::repositionHighlights(ChatLine *line) void ChatViewSearchController::sceneDestroyed() { // WARNING: don't call any methods on scene! - _scene = 0; + _scene = nullptr; // the items will be automatically deleted when the scene is destroyed // so we just have to clear the list; _highlightItems.clear(); diff --git a/src/qtui/chatviewsearchcontroller.h b/src/qtui/chatviewsearchcontroller.h index b85d3551..8c0aa5cc 100644 --- a/src/qtui/chatviewsearchcontroller.h +++ b/src/qtui/chatviewsearchcontroller.h @@ -39,7 +39,7 @@ class ChatViewSearchController : public QObject Q_OBJECT public: - ChatViewSearchController(QObject *parent = 0); + ChatViewSearchController(QObject *parent = nullptr); inline const QString &searchString() const { return _searchString; } @@ -93,10 +93,10 @@ class SearchHighlightItem : public QObject, public QGraphicsItem Q_INTERFACES(QGraphicsItem) public: - SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0); + SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = nullptr); virtual inline QRectF boundingRect() const { return _boundingRect; } void updateGeometry(qreal width, qreal height); - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); enum { Type = ChatScene::SearchHighlightType }; virtual inline int type() const { return Type; } diff --git a/src/qtui/columnhandleitem.h b/src/qtui/columnhandleitem.h index 84c84056..ef2636c9 100644 --- a/src/qtui/columnhandleitem.h +++ b/src/qtui/columnhandleitem.h @@ -33,7 +33,7 @@ class ColumnHandleItem : public QGraphicsObject Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) public : - ColumnHandleItem(qreal width, QGraphicsItem *parent = 0); + ColumnHandleItem(qreal width, QGraphicsItem *parent = nullptr); virtual inline int type() const { return ChatScene::ColumnHandleType; } inline qreal width() const { return _width; } @@ -46,7 +46,7 @@ public : void setXPos(qreal xpos); void setXLimits(qreal min, qreal max); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); public slots: void sceneRectChanged(const QRectF &); diff --git a/src/qtui/coreconfigwizard.h b/src/qtui/coreconfigwizard.h index 70512e70..da4a30c1 100644 --- a/src/qtui/coreconfigwizard.h +++ b/src/qtui/coreconfigwizard.h @@ -57,7 +57,7 @@ public: ConclusionPage }; - CoreConfigWizard(CoreConnection *connection, const QVariantList &backendInfos, const QVariantList &authInfos, QWidget *parent = 0); + CoreConfigWizard(CoreConnection *connection, const QVariantList &backendInfos, const QVariantList &authInfos, QWidget *parent = nullptr); inline CoreConnection *coreConnection() const { return _connection; } @@ -89,7 +89,7 @@ class IntroPage : public QWizardPage Q_OBJECT public: - IntroPage(QWidget *parent = 0); + IntroPage(QWidget *parent = nullptr); int nextId() const; private: Ui::CoreConfigWizardIntroPage ui; @@ -101,7 +101,7 @@ class AdminUserPage : public QWizardPage Q_OBJECT public: - AdminUserPage(QWidget *parent = 0); + AdminUserPage(QWidget *parent = nullptr); int nextId() const; bool isComplete() const; private: @@ -115,7 +115,7 @@ class AuthenticationSelectionPage : public QWizardPage using FieldInfo = std::tuple; public: - AuthenticationSelectionPage(const QVariantList &authInfos, QWidget *parent = 0); + AuthenticationSelectionPage(const QVariantList &authInfos, QWidget *parent = nullptr); int nextId() const; QString displayName() const; QString authenticator() const; @@ -137,7 +137,7 @@ class StorageSelectionPage : public QWizardPage using FieldInfo = std::tuple; public: - StorageSelectionPage(const QVariantList &backendInfos, QWidget *parent = 0); + StorageSelectionPage(const QVariantList &backendInfos, QWidget *parent = nullptr); int nextId() const; QString displayName() const; QString backend() const; @@ -158,7 +158,7 @@ class SyncPage : public QWizardPage Q_OBJECT public: - SyncPage(QWidget *parent = 0); + SyncPage(QWidget *parent = nullptr); void initializePage(); int nextId() const; bool isComplete() const; @@ -183,7 +183,7 @@ class SyncRelayPage : public QWizardPage Q_OBJECT public: - SyncRelayPage(QWidget *parent = 0); + SyncRelayPage(QWidget *parent = nullptr); int nextId() const; enum Mode { Success, Error }; diff --git a/src/qtui/coreconnectdlg.h b/src/qtui/coreconnectdlg.h index 7b31c839..b882c6e5 100644 --- a/src/qtui/coreconnectdlg.h +++ b/src/qtui/coreconnectdlg.h @@ -34,7 +34,7 @@ class CoreConnectDlg : public QDialog Q_OBJECT public: - CoreConnectDlg(QWidget *parent = 0); + CoreConnectDlg(QWidget *parent = nullptr); AccountId selectedAccount() const; void accept(); @@ -49,7 +49,7 @@ class CoreConnectAuthDlg : public QDialog Q_OBJECT public: - CoreConnectAuthDlg(CoreAccount *account, QWidget *parent = 0); + CoreConnectAuthDlg(CoreAccount *account, QWidget *parent = nullptr); void accept(); diff --git a/src/qtui/coreconnectionstatuswidget.h b/src/qtui/coreconnectionstatuswidget.h index a65b1f47..9c701613 100644 --- a/src/qtui/coreconnectionstatuswidget.h +++ b/src/qtui/coreconnectionstatuswidget.h @@ -32,7 +32,7 @@ class CoreConnectionStatusWidget : public QWidget Q_OBJECT public: - CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent = 0); + CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent = nullptr); inline CoreConnection *coreConnection() const { return _coreConnection; } diff --git a/src/qtui/debugbufferviewoverlay.h b/src/qtui/debugbufferviewoverlay.h index 90773637..540eb540 100644 --- a/src/qtui/debugbufferviewoverlay.h +++ b/src/qtui/debugbufferviewoverlay.h @@ -32,7 +32,7 @@ class DebugBufferViewOverlay : public QWidget Q_OBJECT public: - DebugBufferViewOverlay(QWidget *parent = 0); + DebugBufferViewOverlay(QWidget *parent = nullptr); private slots: void update(); diff --git a/src/qtui/debugconsole.h b/src/qtui/debugconsole.h index 7b8f429b..1ec0ee11 100644 --- a/src/qtui/debugconsole.h +++ b/src/qtui/debugconsole.h @@ -28,7 +28,7 @@ class DebugConsole : public QDialog Q_OBJECT public: - DebugConsole(QWidget *parent = 0); + DebugConsole(QWidget *parent = nullptr); virtual ~DebugConsole(); public slots: diff --git a/src/qtui/debuglogdlg.h b/src/qtui/debuglogdlg.h index faf0584b..bff47025 100644 --- a/src/qtui/debuglogdlg.h +++ b/src/qtui/debuglogdlg.h @@ -32,7 +32,7 @@ class DebugLogDlg : public QDialog Q_OBJECT public: - DebugLogDlg(QWidget *parent = 0); + DebugLogDlg(QWidget *parent = nullptr); private slots: void logUpdated(const Logger::LogEntry &msg); diff --git a/src/qtui/debugmessagemodelfilter.h b/src/qtui/debugmessagemodelfilter.h index 6974eae0..ef441b2c 100644 --- a/src/qtui/debugmessagemodelfilter.h +++ b/src/qtui/debugmessagemodelfilter.h @@ -28,7 +28,7 @@ class DebugMessageModelFilter : public QSortFilterProxyModel Q_OBJECT public: - DebugMessageModelFilter(QObject *parent = 0); + DebugMessageModelFilter(QObject *parent = nullptr); QVariant headerData(int section, Qt::Orientation orientation, int role) const; virtual QVariant data(const QModelIndex &index, int role) const; }; diff --git a/src/qtui/dockmanagernotificationbackend.cpp b/src/qtui/dockmanagernotificationbackend.cpp index 786593d2..bbeeff41 100644 --- a/src/qtui/dockmanagernotificationbackend.cpp +++ b/src/qtui/dockmanagernotificationbackend.cpp @@ -30,7 +30,7 @@ #include "clientbacklogmanager.h" DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent) - : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()), _dock(0), _item(0), _count(0) + : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()), _dock(nullptr), _item(nullptr), _count(0) { NotificationSettings notificationSettings; _enabled = notificationSettings.value("DockManager/Enabled", false).toBool(); @@ -110,7 +110,7 @@ void DockManagerNotificationBackend::updateProgress(int done, int total) int perc = 0; if (done == total) { - disconnect(Client::backlogManager(), 0, this, 0); + disconnect(Client::backlogManager(), nullptr, this, nullptr); perc = -1; } else perc = (done * 100) / total; diff --git a/src/qtui/dockmanagernotificationbackend.h b/src/qtui/dockmanagernotificationbackend.h index c59ffbbe..37ebd47c 100644 --- a/src/qtui/dockmanagernotificationbackend.h +++ b/src/qtui/dockmanagernotificationbackend.h @@ -34,7 +34,7 @@ class DockManagerNotificationBackend : public AbstractNotificationBackend Q_OBJECT public: - DockManagerNotificationBackend(QObject *parent = 0); + DockManagerNotificationBackend(QObject *parent = nullptr); void notify(const Notification &); void close(uint notificationId); @@ -63,7 +63,7 @@ class DockManagerNotificationBackend::ConfigWidget : public SettingsPage Q_OBJECT public: - ConfigWidget(bool enabled, QWidget *parent = 0); + ConfigWidget(bool enabled, QWidget *parent = nullptr); void save(); void load(); diff --git a/src/qtui/inputwidget.cpp b/src/qtui/inputwidget.cpp index 7a4b5ac3..3233f044 100644 --- a/src/qtui/inputwidget.cpp +++ b/src/qtui/inputwidget.cpp @@ -427,9 +427,9 @@ void InputWidget::setNetwork(NetworkId networkId) const Network *previousNet = Client::network(_networkId); if (previousNet) { - disconnect(previousNet, 0, this, 0); + disconnect(previousNet, nullptr, this, nullptr); if (previousNet->me()) - disconnect(previousNet->me(), 0, this, 0); + disconnect(previousNet->me(), nullptr, this, nullptr); } _networkId = networkId; @@ -472,7 +472,7 @@ void InputWidget::setIdentity(IdentityId identityId) const Identity *previousIdentity = Client::identity(_identityId); if (previousIdentity) - disconnect(previousIdentity, 0, this, 0); + disconnect(previousIdentity, nullptr, this, nullptr); _identityId = identityId; diff --git a/src/qtui/inputwidget.h b/src/qtui/inputwidget.h index 11512b27..831e094a 100644 --- a/src/qtui/inputwidget.h +++ b/src/qtui/inputwidget.h @@ -41,7 +41,7 @@ class InputWidget : public AbstractItemView Q_OBJECT public: - InputWidget(QWidget *parent = 0); + InputWidget(QWidget *parent = nullptr); virtual ~InputWidget(); const Network *currentNetwork() const; @@ -197,6 +197,6 @@ class MouseWheelFilter : public QObject Q_OBJECT public: - MouseWheelFilter(QObject *parent = 0); + MouseWheelFilter(QObject *parent = nullptr); virtual bool eventFilter(QObject *obj, QEvent *event); }; diff --git a/src/qtui/ircconnectionwizard.cpp b/src/qtui/ircconnectionwizard.cpp index b81c2097..d7e86587 100644 --- a/src/qtui/ircconnectionwizard.cpp +++ b/src/qtui/ircconnectionwizard.cpp @@ -29,9 +29,9 @@ IrcConnectionWizard::IrcConnectionWizard(QWidget *parent, Qt::WindowFlags flags) : QWizard(parent, flags), - _introductionPage(0), - _identityPage(0), - _networkPage(0) + _introductionPage(nullptr), + _identityPage(nullptr), + _networkPage(nullptr) { _introductionPage = createIntroductionPage(this); _identityPage = new IdentityPage(this); @@ -111,7 +111,7 @@ void IrcConnectionWizard::networkReady(NetworkId id) IdentityPage::IdentityPage(QWidget *parent) : QWizardPage(parent), _identityEditWidget(new IdentityEditWidget(this)), - _identity(0) + _identity(nullptr) { setTitle(tr("Setup Identity")); diff --git a/src/qtui/ircconnectionwizard.h b/src/qtui/ircconnectionwizard.h index 69836fbe..65509eb9 100644 --- a/src/qtui/ircconnectionwizard.h +++ b/src/qtui/ircconnectionwizard.h @@ -30,9 +30,9 @@ class IrcConnectionWizard : public QWizard Q_OBJECT public: - IrcConnectionWizard(QWidget *parent = 0, Qt::WindowFlags flags = 0); + IrcConnectionWizard(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr); - static QWizardPage *createIntroductionPage(QWidget *parent = 0); + static QWizardPage *createIntroductionPage(QWidget *parent = nullptr); private slots: void finishClicked(); @@ -60,7 +60,7 @@ class IdentityPage : public QWizardPage Q_OBJECT public: - IdentityPage(QWidget *parent = 0); + IdentityPage(QWidget *parent = nullptr); CertIdentity *identity(); @@ -80,7 +80,7 @@ class NetworkPage : public QWizardPage Q_OBJECT public: - NetworkPage(QWidget *parent = 0); + NetworkPage(QWidget *parent = nullptr); NetworkInfo networkInfo(); QStringList channelList(); diff --git a/src/qtui/knotificationbackend.h b/src/qtui/knotificationbackend.h index 93e15067..8932283f 100644 --- a/src/qtui/knotificationbackend.h +++ b/src/qtui/knotificationbackend.h @@ -34,7 +34,7 @@ class KNotificationBackend : public AbstractNotificationBackend Q_OBJECT public: - KNotificationBackend(QObject *parent = 0); + KNotificationBackend(QObject *parent = nullptr); void notify(const Notification &); void close(uint notificationId); @@ -60,7 +60,7 @@ class KNotificationBackend::ConfigWidget : public SettingsPage Q_OBJECT public: - ConfigWidget(QWidget *parent = 0); + ConfigWidget(QWidget *parent = nullptr); void save(); void load(); diff --git a/src/qtui/mainpage.h b/src/qtui/mainpage.h index a5d860ed..d8b649b8 100644 --- a/src/qtui/mainpage.h +++ b/src/qtui/mainpage.h @@ -30,7 +30,7 @@ class MainPage : public QWidget Q_OBJECT public: - MainPage(QWidget *parent = 0); + MainPage(QWidget *parent = nullptr); private slots: void showCoreConnectionDlg(); diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 2ce724b2..fc0e0617 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -162,7 +162,7 @@ MainWin::MainWin(QWidget *parent) _msgProcessorStatusWidget(new MsgProcessorStatusWidget(this)), _coreConnectionStatusWidget(new CoreConnectionStatusWidget(Client::coreConnection(), this)), _titleSetter(this), - _awayLog(0), + _awayLog(nullptr), _layoutLoaded(false), _activeBufferViewIndex(-1), _aboutToQuit(false) @@ -401,14 +401,14 @@ void MainWin::setupActions() connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool))); coll->addAction("ToggleSearchBar", new Action(icon::get("edit-find"), tr("Show &Search Bar"), coll, - 0, 0, QKeySequence::Find))->setCheckable(true); + nullptr, nullptr, QKeySequence::Find))->setCheckable(true); coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll, this, SLOT(showAwayLog()))); coll->addAction("ToggleMenuBar", new Action(icon::get("show-menu"), tr("Show &Menubar"), coll, - 0, 0))->setCheckable(true); + nullptr, nullptr))->setCheckable(true); coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll, - 0, 0))->setCheckable(true); + nullptr, nullptr))->setCheckable(true); #ifdef HAVE_KDE _fullScreenAction = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll); @@ -761,16 +761,16 @@ BufferView *MainWin::allBuffersView() const // "All Buffers" is always the first dock created if (_bufferViews.count() > 0) return _bufferViews[0]->bufferView(); - return 0; + return nullptr; } BufferView *MainWin::activeBufferView() const { if (_activeBufferViewIndex < 0 || _activeBufferViewIndex >= _bufferViews.count()) - return 0; + return nullptr; BufferViewDock *dock = _bufferViews.at(_activeBufferViewIndex); - return dock->isActive() ? dock->bufferView() : 0; + return dock->isActive() ? dock->bufferView() : nullptr; } @@ -1521,7 +1521,7 @@ void MainWin::showAwayLog() if (_awayLog) return; AwayLogFilter *filter = new AwayLogFilter(Client::messageModel()); - _awayLog = new AwayLogView(filter, 0); + _awayLog = new AwayLogView(filter, nullptr); filter->setParent(_awayLog); connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed())); _awayLog->setAttribute(Qt::WA_DeleteOnClose); @@ -1531,7 +1531,7 @@ void MainWin::showAwayLog() void MainWin::awayLogDestroyed() { - _awayLog = 0; + _awayLog = nullptr; } @@ -1691,7 +1691,7 @@ void MainWin::messagesInserted(const QModelIndex &parent, int start, int end) { Q_UNUSED(parent); - bool hasFocus = QApplication::activeWindow() != 0; + bool hasFocus = QApplication::activeWindow() != nullptr; for (int i = start; i <= end; i++) { QModelIndex idx = Client::messageModel()->index(i, ChatLineModel::ContentsColumn); @@ -1759,7 +1759,7 @@ void MainWin::clientNetworkCreated(NetworkId id) connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated())); connect(act, SIGNAL(triggered()), this, SLOT(connectOrDisconnectFromNet())); - QAction *beforeAction = 0; + QAction *beforeAction = nullptr; foreach(QAction *action, _networksMenu->actions()) { if (!action->data().isValid()) // ignore stock actions continue; @@ -1958,7 +1958,7 @@ void MainWin::on_actionDebugHotList_triggered() void MainWin::on_actionDebugBufferViewOverlay_triggered() { - DebugBufferViewOverlay *overlay = new DebugBufferViewOverlay(0); + DebugBufferViewOverlay *overlay = new DebugBufferViewOverlay(nullptr); overlay->setAttribute(Qt::WA_DeleteOnClose); overlay->show(); } @@ -1966,7 +1966,7 @@ void MainWin::on_actionDebugBufferViewOverlay_triggered() void MainWin::on_actionDebugMessageModel_triggered() { - QTableView *view = new QTableView(0); + QTableView *view = new QTableView(nullptr); DebugMessageModelFilter *filter = new DebugMessageModelFilter(view); filter->setSourceModel(Client::messageModel()); view->setModel(filter); diff --git a/src/qtui/mainwin.h b/src/qtui/mainwin.h index f9e53e39..9dacca61 100644 --- a/src/qtui/mainwin.h +++ b/src/qtui/mainwin.h @@ -65,7 +65,7 @@ class MainWin Q_OBJECT public: - MainWin(QWidget *parent = 0); + MainWin(QWidget *parent = nullptr); void init(); diff --git a/src/qtui/markerlineitem.cpp b/src/qtui/markerlineitem.cpp index be3f1afc..68c44ae1 100644 --- a/src/qtui/markerlineitem.cpp +++ b/src/qtui/markerlineitem.cpp @@ -26,7 +26,7 @@ MarkerLineItem::MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent) : QGraphicsObject(parent), _boundingRect(0, 0, sceneWidth, 1), - _chatLine(0) + _chatLine(nullptr) { setVisible(false); setZValue(8); diff --git a/src/qtui/markerlineitem.h b/src/qtui/markerlineitem.h index 98f7b6a9..516c0d2c 100644 --- a/src/qtui/markerlineitem.h +++ b/src/qtui/markerlineitem.h @@ -32,11 +32,11 @@ class MarkerLineItem : public QGraphicsObject Q_OBJECT public: - MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent = 0); + MarkerLineItem(qreal sceneWidth, QGraphicsItem *parent = nullptr); virtual inline int type() const { return ChatScene::MarkerLineType; } inline QRectF boundingRect() const { return _boundingRect; } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); inline ChatLine *chatLine() const { return _chatLine; } diff --git a/src/qtui/msgprocessorstatuswidget.h b/src/qtui/msgprocessorstatuswidget.h index c7c01d0d..69b1ba22 100644 --- a/src/qtui/msgprocessorstatuswidget.h +++ b/src/qtui/msgprocessorstatuswidget.h @@ -28,7 +28,7 @@ class MsgProcessorStatusWidget : public QWidget Q_OBJECT public: - MsgProcessorStatusWidget(QWidget *parent = 0); + MsgProcessorStatusWidget(QWidget *parent = nullptr); public slots: void setProgress(int value, int max); diff --git a/src/qtui/nicklistwidget.cpp b/src/qtui/nicklistwidget.cpp index dace3901..f90a10f8 100644 --- a/src/qtui/nicklistwidget.cpp +++ b/src/qtui/nicklistwidget.cpp @@ -45,7 +45,7 @@ QDockWidget *NickListWidget::dock() const if (dock) return dock; else - return 0; + return nullptr; } @@ -174,9 +174,9 @@ void NickListWidget::rowsAboutToBeRemoved(const QModelIndex &parent, int start, iter = nickViews.erase(iter); ui.stackedWidget->removeWidget(nickView); QAbstractItemModel *model = nickView->model(); - nickView->setModel(0); + nickView->setModel(nullptr); if (QSortFilterProxyModel *filter = qobject_cast(model)) - filter->setSourceModel(0); + filter->setSourceModel(nullptr); model->deleteLater(); nickView->deleteLater(); } @@ -203,9 +203,9 @@ void NickListWidget::removeBuffer(BufferId bufferId) NickView *view = nickViews.take(bufferId); ui.stackedWidget->removeWidget(view); QAbstractItemModel *model = view->model(); - view->setModel(0); + view->setModel(nullptr); if (QSortFilterProxyModel *filter = qobject_cast(model)) - filter->setSourceModel(0); + filter->setSourceModel(nullptr); model->deleteLater(); view->deleteLater(); } @@ -243,7 +243,7 @@ NickListDock::NickListDock(const QString &title, QWidget *parent) void NickListDock::setLocked(bool locked) { if (locked) { - setFeatures(0); + setFeatures(nullptr); } else { setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); diff --git a/src/qtui/nicklistwidget.h b/src/qtui/nicklistwidget.h index f6ed3dc7..a4e5ecbb 100644 --- a/src/qtui/nicklistwidget.h +++ b/src/qtui/nicklistwidget.h @@ -39,7 +39,7 @@ class NickListWidget : public AbstractItemView Q_OBJECT public: - NickListWidget(QWidget *parent = 0); + NickListWidget(QWidget *parent = nullptr); public slots: void showWidget(bool visible); @@ -77,7 +77,7 @@ class NickListDock : public QDockWidget Q_OBJECT public: - NickListDock(const QString &title, QWidget *parent = 0); + NickListDock(const QString &title, QWidget *parent = nullptr); // ~NickListDock(); void setLocked(bool locked); diff --git a/src/qtui/qtmultimedianotificationbackend.h b/src/qtui/qtmultimedianotificationbackend.h index eb614bf7..909791f8 100644 --- a/src/qtui/qtmultimedianotificationbackend.h +++ b/src/qtui/qtmultimedianotificationbackend.h @@ -34,7 +34,7 @@ class QtMultimediaNotificationBackend : public AbstractNotificationBackend Q_OBJECT public: - QtMultimediaNotificationBackend(QObject *parent = 0); + QtMultimediaNotificationBackend(QObject *parent = nullptr); void notify(const Notification &) override; void close(uint notificationId) override; @@ -58,7 +58,7 @@ class QtMultimediaNotificationBackend::ConfigWidget : public SettingsPage Q_OBJECT public: - ConfigWidget(QWidget *parent = 0); + ConfigWidget(QWidget *parent = nullptr); void save() override; void load() override; diff --git a/src/qtui/qtuistyle.h b/src/qtui/qtuistyle.h index 94549e53..80bf7f42 100644 --- a/src/qtui/qtuistyle.h +++ b/src/qtui/qtuistyle.h @@ -29,7 +29,7 @@ class QtUiStyle : public UiStyle Q_OBJECT public: - QtUiStyle(QObject *parent = 0); + QtUiStyle(QObject *parent = nullptr); virtual ~QtUiStyle(); virtual inline qreal firstColumnSeparator() const { return 6; } diff --git a/src/qtui/receivefiledlg.h b/src/qtui/receivefiledlg.h index e71fff23..512dba18 100644 --- a/src/qtui/receivefiledlg.h +++ b/src/qtui/receivefiledlg.h @@ -30,7 +30,7 @@ class ReceiveFileDlg : public QDialog Q_OBJECT public: - ReceiveFileDlg(const Transfer *transfer, QWidget *parent = 0); + ReceiveFileDlg(const Transfer *transfer, QWidget *parent = nullptr); private slots: void on_buttonBox_clicked(QAbstractButton *button); diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index 5e9ea6ec..13100afb 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -28,7 +28,7 @@ SettingsDlg::SettingsDlg(QWidget *parent) : QDialog(parent), - _currentPage(0) + _currentPage(nullptr) { ui.setupUi(this); setModal(true); @@ -107,7 +107,7 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp) void SettingsDlg::selectPage(SettingsPage *sp) { if (!sp) { - _currentPage = 0; + _currentPage = nullptr; ui.settingsStack->setCurrentIndex(0); ui.pageTitle->setText(tr("Settings")); return; @@ -118,7 +118,7 @@ void SettingsDlg::selectPage(SettingsPage *sp) pageIsLoaded[sp] = true; } - if (sp != currentPage() && currentPage() != 0 && currentPage()->hasChanged()) { + if (sp != currentPage() && currentPage() != nullptr && currentPage()->hasChanged()) { int ret = QMessageBox::warning(this, tr("Save changes"), tr("There are unsaved changes on the current configuration page. Would you like to apply your changes now?"), QMessageBox::Discard|QMessageBox::Save|QMessageBox::Cancel, QMessageBox::Cancel); @@ -151,7 +151,7 @@ void SettingsDlg::selectPage(SettingsPage *sp) void SettingsDlg::itemSelected() { QList items = ui.settingsTree->selectedItems(); - SettingsPage *sp = 0; + SettingsPage *sp = nullptr; if (!items.isEmpty()) { sp = qobject_cast(items[0]->data(0, SettingsPageRole).value()); } diff --git a/src/qtui/settingsdlg.h b/src/qtui/settingsdlg.h index dcebaf1b..483855b8 100644 --- a/src/qtui/settingsdlg.h +++ b/src/qtui/settingsdlg.h @@ -32,7 +32,7 @@ class SettingsDlg : public QDialog Q_OBJECT public: - SettingsDlg(QWidget *parent = 0); + SettingsDlg(QWidget *parent = nullptr); void registerSettingsPage(SettingsPage *); void unregisterSettingsPage(SettingsPage *); diff --git a/src/qtui/settingspagedlg.h b/src/qtui/settingspagedlg.h index d4cc744f..7f91071c 100644 --- a/src/qtui/settingspagedlg.h +++ b/src/qtui/settingspagedlg.h @@ -31,7 +31,7 @@ class SettingsPageDlg : public QDialog { Q_OBJECT public: - SettingsPageDlg(SettingsPage *page, QWidget *parent = 0); + SettingsPageDlg(SettingsPage *page, QWidget *parent = nullptr); SettingsPage *currentPage() const; diff --git a/src/qtui/settingspages/aliasesmodel.h b/src/qtui/settingspages/aliasesmodel.h index d70c63ae..61e68217 100644 --- a/src/qtui/settingspages/aliasesmodel.h +++ b/src/qtui/settingspages/aliasesmodel.h @@ -31,7 +31,7 @@ class AliasesModel : public QAbstractItemModel Q_OBJECT public: - AliasesModel(QObject *parent = 0); + AliasesModel(QObject *parent = nullptr); virtual QVariant data(const QModelIndex &index, int role) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); diff --git a/src/qtui/settingspages/aliasessettingspage.h b/src/qtui/settingspages/aliasessettingspage.h index 21892b7c..00621346 100644 --- a/src/qtui/settingspages/aliasessettingspage.h +++ b/src/qtui/settingspages/aliasessettingspage.h @@ -31,7 +31,7 @@ class AliasesSettingsPage : public SettingsPage Q_OBJECT public: - AliasesSettingsPage(QWidget *parent = 0); + AliasesSettingsPage(QWidget *parent = nullptr); virtual inline bool hasDefaults() const { return true; } virtual inline bool needsCoreConnection() const { return true; } diff --git a/src/qtui/settingspages/appearancesettingspage.h b/src/qtui/settingspages/appearancesettingspage.h index 825fc507..b2af5228 100644 --- a/src/qtui/settingspages/appearancesettingspage.h +++ b/src/qtui/settingspages/appearancesettingspage.h @@ -35,7 +35,7 @@ class AppearanceSettingsPage : public SettingsPage Q_OBJECT public: - AppearanceSettingsPage(QWidget *parent = 0); + AppearanceSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/settingspages/backlogsettingspage.h b/src/qtui/settingspages/backlogsettingspage.h index 407d11ee..17c98f0c 100644 --- a/src/qtui/settingspages/backlogsettingspage.h +++ b/src/qtui/settingspages/backlogsettingspage.h @@ -31,7 +31,7 @@ class BacklogSettingsPage : public SettingsPage Q_OBJECT public: - BacklogSettingsPage(QWidget *parent = 0); + BacklogSettingsPage(QWidget *parent = nullptr); inline QString settingsKey() const { return "Backlog"; } bool hasDefaults() const; diff --git a/src/qtui/settingspages/bufferviewsettingspage.cpp b/src/qtui/settingspages/bufferviewsettingspage.cpp index fff7b1e9..7323697b 100644 --- a/src/qtui/settingspages/bufferviewsettingspage.cpp +++ b/src/qtui/settingspages/bufferviewsettingspage.cpp @@ -284,7 +284,7 @@ BufferViewConfig *BufferViewSettingsPage::bufferView(int listPos) return qobject_cast(obj); } else { - return 0; + return nullptr; } } diff --git a/src/qtui/settingspages/bufferviewsettingspage.h b/src/qtui/settingspages/bufferviewsettingspage.h index 402c823d..aa1ad5f9 100644 --- a/src/qtui/settingspages/bufferviewsettingspage.h +++ b/src/qtui/settingspages/bufferviewsettingspage.h @@ -33,7 +33,7 @@ class BufferViewSettingsPage : public SettingsPage Q_OBJECT public: - BufferViewSettingsPage(QWidget *parent = 0); + BufferViewSettingsPage(QWidget *parent = nullptr); ~BufferViewSettingsPage(); public slots: @@ -94,7 +94,7 @@ class BufferViewEditDlg : public QDialog Q_OBJECT public: - BufferViewEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0); + BufferViewEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = nullptr); inline QString bufferViewName() const { return ui.bufferViewEdit->text(); } diff --git a/src/qtui/settingspages/chatmonitorsettingspage.cpp b/src/qtui/settingspages/chatmonitorsettingspage.cpp index e6f0435d..f62462c4 100644 --- a/src/qtui/settingspages/chatmonitorsettingspage.cpp +++ b/src/qtui/settingspages/chatmonitorsettingspage.cpp @@ -238,8 +238,8 @@ void ChatMonitorSettingsPage::toggleBuffers(BufferView *inView, BufferViewConfig This can probably be removed whenever BufferViewConfig::bulkAdd or something like that is available. */ - qobject_cast(outView->model())->setConfig(0); - qobject_cast(inView->model())->setConfig(0); + qobject_cast(outView->model())->setConfig(nullptr); + qobject_cast(inView->model())->setConfig(nullptr); // actually move the ids foreach(QList list, selectedBuffers) { diff --git a/src/qtui/settingspages/chatmonitorsettingspage.h b/src/qtui/settingspages/chatmonitorsettingspage.h index ceaad1e1..8324e32e 100644 --- a/src/qtui/settingspages/chatmonitorsettingspage.h +++ b/src/qtui/settingspages/chatmonitorsettingspage.h @@ -33,7 +33,7 @@ class ChatMonitorSettingsPage : public SettingsPage Q_OBJECT public: - ChatMonitorSettingsPage(QWidget *parent = 0); + ChatMonitorSettingsPage(QWidget *parent = nullptr); bool hasDefaults() const; public slots: diff --git a/src/qtui/settingspages/chatviewcolorsettingspage.h b/src/qtui/settingspages/chatviewcolorsettingspage.h index b230e012..f9e29930 100644 --- a/src/qtui/settingspages/chatviewcolorsettingspage.h +++ b/src/qtui/settingspages/chatviewcolorsettingspage.h @@ -35,7 +35,7 @@ public: * * @param parent Parent QWidget object, such as the settings dialog */ - explicit ChatViewColorSettingsPage(QWidget *parent = 0); + explicit ChatViewColorSettingsPage(QWidget *parent = nullptr); /** * Gets whether or not this settings page has defaults diff --git a/src/qtui/settingspages/chatviewsettingspage.h b/src/qtui/settingspages/chatviewsettingspage.h index a47db0ef..6a1b7af4 100644 --- a/src/qtui/settingspages/chatviewsettingspage.h +++ b/src/qtui/settingspages/chatviewsettingspage.h @@ -31,7 +31,7 @@ class ChatViewSettingsPage : public SettingsPage Q_OBJECT public: - ChatViewSettingsPage(QWidget *parent = 0); + ChatViewSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/settingspages/connectionsettingspage.h b/src/qtui/settingspages/connectionsettingspage.h index a697bfb4..4582f3fc 100644 --- a/src/qtui/settingspages/connectionsettingspage.h +++ b/src/qtui/settingspages/connectionsettingspage.h @@ -31,7 +31,7 @@ class ConnectionSettingsPage : public SettingsPage Q_OBJECT public: - ConnectionSettingsPage(QWidget *parent = 0); + ConnectionSettingsPage(QWidget *parent = nullptr); bool hasDefaults() const; bool needsCoreConnection() const { return true; } diff --git a/src/qtui/settingspages/coreaccountsettingspage.h b/src/qtui/settingspages/coreaccountsettingspage.h index 2413f45b..7570df37 100644 --- a/src/qtui/settingspages/coreaccountsettingspage.h +++ b/src/qtui/settingspages/coreaccountsettingspage.h @@ -39,7 +39,7 @@ class CoreAccountSettingsPage : public SettingsPage Q_OBJECT public: - CoreAccountSettingsPage(QWidget *parent = 0); + CoreAccountSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return false; } inline bool isStandAlone() const { return _standalone; } @@ -95,7 +95,7 @@ class CoreAccountEditDlg : public QDialog Q_OBJECT public: - CoreAccountEditDlg(const CoreAccount &account, QWidget *parent = 0); + CoreAccountEditDlg(const CoreAccount &account, QWidget *parent = nullptr); CoreAccount account(); @@ -124,7 +124,7 @@ class FilteredCoreAccountModel : public QSortFilterProxyModel Q_OBJECT public: - FilteredCoreAccountModel(CoreAccountModel *model, QObject *parent = 0); + FilteredCoreAccountModel(CoreAccountModel *model, QObject *parent = nullptr); protected: virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; diff --git a/src/qtui/settingspages/coreconnectionsettingspage.h b/src/qtui/settingspages/coreconnectionsettingspage.h index 9fd213ec..f9df6969 100644 --- a/src/qtui/settingspages/coreconnectionsettingspage.h +++ b/src/qtui/settingspages/coreconnectionsettingspage.h @@ -31,7 +31,7 @@ class CoreConnectionSettingsPage : public SettingsPage Q_OBJECT public: - CoreConnectionSettingsPage(QWidget *parent = 0); + CoreConnectionSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/settingspages/dccsettingspage.cpp b/src/qtui/settingspages/dccsettingspage.cpp index 829c8776..70d792e7 100644 --- a/src/qtui/settingspages/dccsettingspage.cpp +++ b/src/qtui/settingspages/dccsettingspage.cpp @@ -46,7 +46,7 @@ bool DccSettingsPage::isClientConfigValid() const void DccSettingsPage::setClientConfig(DccConfig *config) { if (_clientConfig) { - disconnect(_clientConfig, 0, this, 0); + disconnect(_clientConfig, nullptr, this, nullptr); } if (config && !isClientConfigValid()) { qWarning() << "Client DCC config is not valid/synchronized!"; diff --git a/src/qtui/settingspages/highlightsettingspage.h b/src/qtui/settingspages/highlightsettingspage.h index 57c0123b..6899c36e 100644 --- a/src/qtui/settingspages/highlightsettingspage.h +++ b/src/qtui/settingspages/highlightsettingspage.h @@ -32,7 +32,7 @@ class HighlightSettingsPage : public SettingsPage Q_OBJECT public: - HighlightSettingsPage(QWidget *parent = 0); + HighlightSettingsPage(QWidget *parent = nullptr); bool hasDefaults() const; diff --git a/src/qtui/settingspages/identitiessettingspage.cpp b/src/qtui/settingspages/identitiessettingspage.cpp index cf5ebc12..71e48cfd 100644 --- a/src/qtui/settingspages/identitiessettingspage.cpp +++ b/src/qtui/settingspages/identitiessettingspage.cpp @@ -303,13 +303,13 @@ void IdentitiesSettingsPage::removeIdentity(Identity *id) void IdentitiesSettingsPage::on_identityList_currentIndexChanged(int index) { - CertIdentity *previousIdentity = 0; + CertIdentity *previousIdentity = nullptr; if (currentId != 0 && identities.contains(currentId)) previousIdentity = identities[currentId]; if (index < 0) { //ui.identityList->setEditable(false); - ui.identityEditor->displayIdentity(0, previousIdentity); + ui.identityEditor->displayIdentity(nullptr, previousIdentity); currentId = 0; } else { diff --git a/src/qtui/settingspages/identitiessettingspage.h b/src/qtui/settingspages/identitiessettingspage.h index 84091ea7..e931d701 100644 --- a/src/qtui/settingspages/identitiessettingspage.h +++ b/src/qtui/settingspages/identitiessettingspage.h @@ -36,7 +36,7 @@ class IdentitiesSettingsPage : public SettingsPage Q_OBJECT public: - IdentitiesSettingsPage(QWidget *parent = 0); + IdentitiesSettingsPage(QWidget *parent = nullptr); virtual inline bool needsCoreConnection() const { return true; } @@ -98,7 +98,7 @@ class CreateIdentityDlg : public QDialog Q_OBJECT public: - CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = 0); + CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = nullptr); QString identityName() const; IdentityId duplicateId() const; @@ -116,7 +116,7 @@ class SaveIdentitiesDlg : public QDialog Q_OBJECT public: - SaveIdentitiesDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = 0); + SaveIdentitiesDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = nullptr); private slots: void clientEvent(); diff --git a/src/qtui/settingspages/identityeditwidget.h b/src/qtui/settingspages/identityeditwidget.h index e0927bf6..1d36987f 100644 --- a/src/qtui/settingspages/identityeditwidget.h +++ b/src/qtui/settingspages/identityeditwidget.h @@ -36,7 +36,7 @@ class IdentityEditWidget : public QWidget Q_OBJECT public: - IdentityEditWidget(QWidget *parent = 0); + IdentityEditWidget(QWidget *parent = nullptr); enum SslState { NoSsl, @@ -44,7 +44,7 @@ public: AllowSsl }; - void displayIdentity(CertIdentity *id, CertIdentity *saveId = 0); + void displayIdentity(CertIdentity *id, CertIdentity *saveId = nullptr); void saveToIdentity(CertIdentity *id); public slots: @@ -98,7 +98,7 @@ class NickEditDlg : public QDialog Q_OBJECT public: - NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0); + NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = nullptr); QString nick() const; diff --git a/src/qtui/settingspages/ignorelistmodel.h b/src/qtui/settingspages/ignorelistmodel.h index 01ca8169..f788fd4b 100644 --- a/src/qtui/settingspages/ignorelistmodel.h +++ b/src/qtui/settingspages/ignorelistmodel.h @@ -31,7 +31,7 @@ class IgnoreListModel : public QAbstractItemModel Q_OBJECT public: - IgnoreListModel(QObject *parent = 0); + IgnoreListModel(QObject *parent = nullptr); virtual QVariant data(const QModelIndex &index, int role) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); diff --git a/src/qtui/settingspages/ignorelistsettingspage.h b/src/qtui/settingspages/ignorelistsettingspage.h index 172ea3be..66a3205d 100644 --- a/src/qtui/settingspages/ignorelistsettingspage.h +++ b/src/qtui/settingspages/ignorelistsettingspage.h @@ -40,7 +40,7 @@ class IgnoreListDelegate : public QStyledItemDelegate Q_OBJECT public: - IgnoreListDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {} + IgnoreListDelegate(QWidget *parent = nullptr) : QStyledItemDelegate(parent) {} void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, @@ -53,7 +53,7 @@ class IgnoreListEditDlg : public QDialog Q_OBJECT public: - IgnoreListEditDlg(const IgnoreListManager::IgnoreListItem &item, QWidget *parent = 0, bool enabled = false); + IgnoreListEditDlg(const IgnoreListManager::IgnoreListItem &item, QWidget *parent = nullptr, bool enabled = false); inline IgnoreListManager::IgnoreListItem ignoreListItem() { return _ignoreListItem; } void enableOkButton(bool state); @@ -77,7 +77,7 @@ class IgnoreListSettingsPage : public SettingsPage Q_OBJECT public: - IgnoreListSettingsPage(QWidget *parent = 0); + IgnoreListSettingsPage(QWidget *parent = nullptr); ~IgnoreListSettingsPage(); virtual inline bool hasDefaults() const { return false; } virtual inline bool needsCoreConnection() const { return true; } diff --git a/src/qtui/settingspages/inputwidgetsettingspage.h b/src/qtui/settingspages/inputwidgetsettingspage.h index 10e10daa..7554820d 100644 --- a/src/qtui/settingspages/inputwidgetsettingspage.h +++ b/src/qtui/settingspages/inputwidgetsettingspage.h @@ -29,7 +29,7 @@ class InputWidgetSettingsPage : public SettingsPage Q_OBJECT public: - InputWidgetSettingsPage(QWidget *parent = 0); + InputWidgetSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/settingspages/itemviewsettingspage.h b/src/qtui/settingspages/itemviewsettingspage.h index 8cd584be..a8ef28d9 100644 --- a/src/qtui/settingspages/itemviewsettingspage.h +++ b/src/qtui/settingspages/itemviewsettingspage.h @@ -33,7 +33,7 @@ class ItemViewSettingsPage : public SettingsPage Q_OBJECT public: - ItemViewSettingsPage(QWidget *parent = 0); + ItemViewSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/settingspages/keysequencewidget.cpp b/src/qtui/settingspages/keysequencewidget.cpp index e65302fd..9e742c27 100644 --- a/src/qtui/settingspages/keysequencewidget.cpp +++ b/src/qtui/settingspages/keysequencewidget.cpp @@ -163,7 +163,7 @@ void KeySequenceButton::keyReleaseEvent(QKeyEvent *e) KeySequenceWidget::KeySequenceWidget(QWidget *parent) : QWidget(parent), - _shortcutsModel(0), + _shortcutsModel(nullptr), _isRecording(false), _modifierKeys(0) { diff --git a/src/qtui/settingspages/keysequencewidget.h b/src/qtui/settingspages/keysequencewidget.h index 1e58f751..5382ac90 100644 --- a/src/qtui/settingspages/keysequencewidget.h +++ b/src/qtui/settingspages/keysequencewidget.h @@ -44,7 +44,7 @@ class KeySequenceWidget : public QWidget { Q_OBJECT public: - KeySequenceWidget(QWidget *parent = 0); + KeySequenceWidget(QWidget *parent = nullptr); void setModel(ShortcutsModel *model); @@ -95,7 +95,7 @@ class KeySequenceButton : public QPushButton { Q_OBJECT public: - explicit KeySequenceButton(KeySequenceWidget *d, QWidget *parent = 0); + explicit KeySequenceButton(KeySequenceWidget *d, QWidget *parent = nullptr); protected: virtual bool event(QEvent *event); diff --git a/src/qtui/settingspages/networkssettingspage.cpp b/src/qtui/settingspages/networkssettingspage.cpp index 57d8ca0c..478acd14 100644 --- a/src/qtui/settingspages/networkssettingspage.cpp +++ b/src/qtui/settingspages/networkssettingspage.cpp @@ -40,7 +40,7 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("IRC"), tr("Networks"), parent) #ifdef HAVE_SSL - , _cid(0) + , _cid(nullptr) #endif { ui.setupUi(this); @@ -474,7 +474,7 @@ QListWidgetItem *NetworksSettingsPage::networkItem(NetworkId id) const QListWidgetItem *item = ui.networkList->item(i); if (item->data(Qt::UserRole).value() == id) return item; } - return 0; + return nullptr; } @@ -558,7 +558,7 @@ QListWidgetItem *NetworksSettingsPage::insertNetwork(NetworkId id) QListWidgetItem *NetworksSettingsPage::insertNetwork(const NetworkInfo &info) { - QListWidgetItem *item = 0; + QListWidgetItem *item = nullptr; QList items = ui.networkList->findItems(info.networkName, Qt::MatchExactly); if (!items.count()) item = new QListWidgetItem(disconnectedIcon, info.networkName, ui.networkList); else { diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h index 1e32ccd1..c1696ad5 100644 --- a/src/qtui/settingspages/networkssettingspage.h +++ b/src/qtui/settingspages/networkssettingspage.h @@ -38,7 +38,7 @@ class NetworksSettingsPage : public SettingsPage Q_OBJECT public: - NetworksSettingsPage(QWidget *parent = 0); + NetworksSettingsPage(QWidget *parent = nullptr); virtual inline bool needsCoreConnection() const { return true; } @@ -57,7 +57,7 @@ private slots: void networkConnectionError(const QString &msg); void displayNetwork(NetworkId); - void setItemState(NetworkId, QListWidgetItem *item = 0); + void setItemState(NetworkId, QListWidgetItem *item = nullptr); /** * Reset the capability-dependent settings to the default unknown states @@ -166,7 +166,7 @@ class NetworkAddDlg : public QDialog Q_OBJECT public: - NetworkAddDlg(const QStringList &existing = QStringList(), QWidget *parent = 0); + NetworkAddDlg(const QStringList &existing = QStringList(), QWidget *parent = nullptr); NetworkInfo networkInfo() const; @@ -195,7 +195,7 @@ class NetworkEditDlg : public QDialog Q_OBJECT public: - NetworkEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0); + NetworkEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = nullptr); QString networkName() const; @@ -214,7 +214,7 @@ class ServerEditDlg : public QDialog Q_OBJECT public: - ServerEditDlg(const Network::Server &server = Network::Server(), QWidget *parent = 0); + ServerEditDlg(const Network::Server &server = Network::Server(), QWidget *parent = nullptr); Network::Server serverData() const; @@ -241,7 +241,7 @@ class SaveNetworksDlg : public QDialog Q_OBJECT public: - SaveNetworksDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = 0); + SaveNetworksDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = nullptr); private slots: void clientEvent(); diff --git a/src/qtui/settingspages/notificationssettingspage.h b/src/qtui/settingspages/notificationssettingspage.h index c30396e9..7f899f63 100644 --- a/src/qtui/settingspages/notificationssettingspage.h +++ b/src/qtui/settingspages/notificationssettingspage.h @@ -34,7 +34,7 @@ class NotificationsSettingsPage : public SettingsPage Q_OBJECT public: - NotificationsSettingsPage(QWidget *parent = 0); + NotificationsSettingsPage(QWidget *parent = nullptr); bool hasDefaults() const; diff --git a/src/qtui/settingspages/previewbufferview.h b/src/qtui/settingspages/previewbufferview.h index 0d9873f7..8516d2ad 100644 --- a/src/qtui/settingspages/previewbufferview.h +++ b/src/qtui/settingspages/previewbufferview.h @@ -28,7 +28,7 @@ class PreviewBufferView : public BufferView Q_OBJECT public: - PreviewBufferView(QWidget *parent = 0) : BufferView(parent) {} + PreviewBufferView(QWidget *parent = nullptr) : BufferView(parent) {} protected: virtual void keyPressEvent(QKeyEvent *event) { QTreeView::keyPressEvent(event); } diff --git a/src/qtui/settingspages/shortcutsmodel.h b/src/qtui/settingspages/shortcutsmodel.h index b3da7418..a4a72daf 100644 --- a/src/qtui/settingspages/shortcutsmodel.h +++ b/src/qtui/settingspages/shortcutsmodel.h @@ -43,7 +43,7 @@ public: IsConfigurableRole }; - ShortcutsModel(const QHash &actionCollections, QObject *parent = 0); + ShortcutsModel(const QHash &actionCollections, QObject *parent = nullptr); ~ShortcutsModel(); QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; @@ -80,7 +80,7 @@ signals: private: struct Item { - inline Item() { parentItem = 0; collection = 0; action = 0; } + inline Item() { parentItem = nullptr; collection = nullptr; action = nullptr; } inline ~Item() { qDeleteAll(actionItems); } int row; Item *parentItem; diff --git a/src/qtui/settingspages/shortcutssettingspage.h b/src/qtui/settingspages/shortcutssettingspage.h index e6f27f84..13d8c098 100644 --- a/src/qtui/settingspages/shortcutssettingspage.h +++ b/src/qtui/settingspages/shortcutssettingspage.h @@ -34,7 +34,7 @@ class ShortcutsFilter : public QSortFilterProxyModel { Q_OBJECT public: - ShortcutsFilter(QObject *parent = 0); + ShortcutsFilter(QObject *parent = nullptr); public slots: void setFilterString(const QString &filterString); @@ -51,7 +51,7 @@ class ShortcutsSettingsPage : public SettingsPage { Q_OBJECT public: - ShortcutsSettingsPage(const QHash &actionCollections, QWidget *parent = 0); + ShortcutsSettingsPage(const QHash &actionCollections, QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/settingspages/sonnetsettingspage.h b/src/qtui/settingspages/sonnetsettingspage.h index 3256a67a..ef513cea 100644 --- a/src/qtui/settingspages/sonnetsettingspage.h +++ b/src/qtui/settingspages/sonnetsettingspage.h @@ -30,7 +30,7 @@ class SonnetSettingsPage : public SettingsPage Q_OBJECT public: - SonnetSettingsPage(QWidget *parent = 0); + SonnetSettingsPage(QWidget *parent = nullptr); bool hasDefaults() const; diff --git a/src/qtui/settingspages/topicwidgetsettingspage.h b/src/qtui/settingspages/topicwidgetsettingspage.h index dccb8567..2748bc27 100644 --- a/src/qtui/settingspages/topicwidgetsettingspage.h +++ b/src/qtui/settingspages/topicwidgetsettingspage.h @@ -29,7 +29,7 @@ class TopicWidgetSettingsPage : public SettingsPage Q_OBJECT public: - TopicWidgetSettingsPage(QWidget *parent = 0); + TopicWidgetSettingsPage(QWidget *parent = nullptr); inline bool hasDefaults() const { return true; } diff --git a/src/qtui/simplenetworkeditor.h b/src/qtui/simplenetworkeditor.h index b8140139..72c9349e 100644 --- a/src/qtui/simplenetworkeditor.h +++ b/src/qtui/simplenetworkeditor.h @@ -30,7 +30,7 @@ class SimpleNetworkEditor : public QWidget Q_OBJECT public: - SimpleNetworkEditor(QWidget *parent = 0); + SimpleNetworkEditor(QWidget *parent = nullptr); void displayNetworkInfo(const NetworkInfo &networkInfo); void saveToNetworkInfo(NetworkInfo &networkInfo); diff --git a/src/qtui/sslinfodlg.h b/src/qtui/sslinfodlg.h index 01129e98..a8a2acf8 100644 --- a/src/qtui/sslinfodlg.h +++ b/src/qtui/sslinfodlg.h @@ -37,7 +37,7 @@ class SslInfoDlg : public QDialog Q_OBJECT public: - SslInfoDlg(const QSslSocket *socket, QWidget *parent = 0); + SslInfoDlg(const QSslSocket *socket, QWidget *parent = nullptr); inline const QSslSocket *socket() const { return _socket; } private slots: diff --git a/src/qtui/systraynotificationbackend.h b/src/qtui/systraynotificationbackend.h index 64e6f9ce..ca858b80 100644 --- a/src/qtui/systraynotificationbackend.h +++ b/src/qtui/systraynotificationbackend.h @@ -31,7 +31,7 @@ class SystrayNotificationBackend : public AbstractNotificationBackend Q_OBJECT public: - SystrayNotificationBackend(QObject *parent = 0); + SystrayNotificationBackend(QObject *parent = nullptr); void notify(const Notification &); void close(uint notificationId); @@ -61,7 +61,7 @@ class SystrayNotificationBackend::ConfigWidget : public SettingsPage Q_OBJECT public: - ConfigWidget(QWidget *parent = 0); + ConfigWidget(QWidget *parent = nullptr); void save(); void load(); bool hasDefaults() const; diff --git a/src/qtui/taskbarnotificationbackend.h b/src/qtui/taskbarnotificationbackend.h index e92948e5..ca49ee93 100644 --- a/src/qtui/taskbarnotificationbackend.h +++ b/src/qtui/taskbarnotificationbackend.h @@ -33,7 +33,7 @@ class TaskbarNotificationBackend : public AbstractNotificationBackend Q_OBJECT public: - TaskbarNotificationBackend(QObject *parent = 0); + TaskbarNotificationBackend(QObject *parent = nullptr); void notify(const Notification &); void close(uint notificationId); @@ -56,7 +56,7 @@ class TaskbarNotificationBackend::ConfigWidget : public SettingsPage Q_OBJECT public: - ConfigWidget(QWidget *parent = 0); + ConfigWidget(QWidget *parent = nullptr); void save(); void load(); bool hasDefaults() const; diff --git a/src/qtui/topicwidget.h b/src/qtui/topicwidget.h index d9b429cb..f054ff5b 100644 --- a/src/qtui/topicwidget.h +++ b/src/qtui/topicwidget.h @@ -30,7 +30,7 @@ class TopicWidget : public AbstractItemView Q_OBJECT public: - TopicWidget(QWidget *parent = 0); + TopicWidget(QWidget *parent = nullptr); void setTopic(const QModelIndex &index); void setCustomFont(const QFont &); diff --git a/src/qtui/verticaldock.cpp b/src/qtui/verticaldock.cpp index 50167f1f..a4804670 100644 --- a/src/qtui/verticaldock.cpp +++ b/src/qtui/verticaldock.cpp @@ -95,7 +95,7 @@ void VerticalDock::setDefaultTitleWidget() void VerticalDock::showTitle(bool show) { QWidget *oldDockTitle = titleBarWidget(); - QWidget *newDockTitle = 0; + QWidget *newDockTitle = nullptr; if (show) newDockTitle = new VerticalDockTitle(this); diff --git a/src/qtui/verticaldock.h b/src/qtui/verticaldock.h index b5bce9d2..4194fa74 100644 --- a/src/qtui/verticaldock.h +++ b/src/qtui/verticaldock.h @@ -59,8 +59,8 @@ class VerticalDock : public QDockWidget Q_OBJECT public: - VerticalDock(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0); - VerticalDock(QWidget *parent = 0, Qt::WindowFlags flags = 0); + VerticalDock(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr); + VerticalDock(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr); void showTitle(bool show); void setDefaultTitleWidget(); diff --git a/src/qtui/webpreviewitem.cpp b/src/qtui/webpreviewitem.cpp index 37b5fa77..06c04881 100644 --- a/src/qtui/webpreviewitem.cpp +++ b/src/qtui/webpreviewitem.cpp @@ -58,7 +58,7 @@ public: #endif WebPreviewItem::WebPreviewItem(const QUrl &url) - : QGraphicsItem(0), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines + : QGraphicsItem(nullptr), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines _boundingRect(0, 0, 400, 300) { qreal frameWidth = 5; diff --git a/src/qtui/webpreviewitem.h b/src/qtui/webpreviewitem.h index 46f14e85..925d7d00 100644 --- a/src/qtui/webpreviewitem.h +++ b/src/qtui/webpreviewitem.h @@ -29,7 +29,7 @@ class WebPreviewItem : public QGraphicsItem { public: WebPreviewItem(const QUrl &url); - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); virtual inline QRectF boundingRect() const { return _boundingRect; } private: diff --git a/src/uisupport/abstractitemview.cpp b/src/uisupport/abstractitemview.cpp index 793b2937..c1076f8c 100644 --- a/src/uisupport/abstractitemview.cpp +++ b/src/uisupport/abstractitemview.cpp @@ -22,8 +22,8 @@ AbstractItemView::AbstractItemView(QWidget *parent) : QWidget(parent), - _model(0), - _selectionModel(0) + _model(nullptr), + _selectionModel(nullptr) { } @@ -31,7 +31,7 @@ AbstractItemView::AbstractItemView(QWidget *parent) void AbstractItemView::setModel(QAbstractItemModel *model) { if (_model) { - disconnect(_model, 0, this, 0); + disconnect(_model, nullptr, this, nullptr); } _model = model; connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), @@ -46,7 +46,7 @@ void AbstractItemView::setModel(QAbstractItemModel *model) void AbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel) { if (_selectionModel) { - disconnect(_selectionModel, 0, this, 0); + disconnect(_selectionModel, nullptr, this, nullptr); } _selectionModel = selectionModel; connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), diff --git a/src/uisupport/abstractitemview.h b/src/uisupport/abstractitemview.h index a981667c..785f4ad5 100644 --- a/src/uisupport/abstractitemview.h +++ b/src/uisupport/abstractitemview.h @@ -35,7 +35,7 @@ class UISUPPORT_EXPORT AbstractItemView : public QWidget Q_OBJECT public: - AbstractItemView(QWidget *parent = 0); + AbstractItemView(QWidget *parent = nullptr); inline QAbstractItemModel *model() { return _model; } void setModel(QAbstractItemModel *model); diff --git a/src/uisupport/action.h b/src/uisupport/action.h index ba03a245..8b580a28 100644 --- a/src/uisupport/action.h +++ b/src/uisupport/action.h @@ -47,8 +47,8 @@ public : Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType) explicit Action(QObject *parent); - Action(const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0); - Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0); + Action(const QString &text, QObject *parent, const QObject *receiver = nullptr, const char *slot = nullptr, const QKeySequence &shortcut = 0); + Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = nullptr, const char *slot = nullptr, const QKeySequence &shortcut = 0); QKeySequence shortcut(ShortcutTypes types = ActiveShortcut) const; void setShortcut(const QShortcut &shortcut, ShortcutTypes type = ShortcutTypes(ActiveShortcut | DefaultShortcut)); diff --git a/src/uisupport/actioncollection.cpp b/src/uisupport/actioncollection.cpp index 89280532..a3aa6d69 100644 --- a/src/uisupport/actioncollection.cpp +++ b/src/uisupport/actioncollection.cpp @@ -137,7 +137,7 @@ void ActionCollection::removeAction(QAction *action) QAction *ActionCollection::takeAction(QAction *action) { if (!unlistAction(action)) - return 0; + return nullptr; foreach(QWidget *widget, _associatedWidgets) { widget->removeAction(action); diff --git a/src/uisupport/actioncollection.h b/src/uisupport/actioncollection.h index a675fddd..5992eb89 100644 --- a/src/uisupport/actioncollection.h +++ b/src/uisupport/actioncollection.h @@ -75,13 +75,13 @@ public: QAction *addAction(const QString &name, QAction *action); Action *addAction(const QString &name, Action *action); - Action *addAction(const QString &name, const QObject *receiver = 0, const char *member = 0); + Action *addAction(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr); void removeAction(QAction *action); QAction *takeAction(QAction *action); /// Create new action under the given name, add it to the collection and connect its triggered(bool) signal to the specified receiver. template - ActionType *add(const QString &name, const QObject *receiver = 0, const char *member = 0) + ActionType *add(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr) { ActionType *a = new ActionType(this); if (receiver && member) diff --git a/src/uisupport/bufferhotlistfilter.h b/src/uisupport/bufferhotlistfilter.h index 60c80393..1ec95053 100644 --- a/src/uisupport/bufferhotlistfilter.h +++ b/src/uisupport/bufferhotlistfilter.h @@ -30,7 +30,7 @@ class UISUPPORT_EXPORT BufferHotListFilter : public QSortFilterProxyModel Q_OBJECT public: - BufferHotListFilter(QAbstractItemModel *source, QObject *parent = 0); + BufferHotListFilter(QAbstractItemModel *source, QObject *parent = nullptr); virtual inline int columnCount(const QModelIndex &) const { return 1; } BufferId hottestBuffer(); diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 969107cd..0925b501 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -147,8 +147,8 @@ void BufferView::setFilteredModel(QAbstractItemModel *model_, BufferViewConfig * } if (model()) { - disconnect(this, 0, model(), 0); - disconnect(model(), 0, this, 0); + disconnect(this, nullptr, model(), nullptr); + disconnect(model(), nullptr, this, nullptr); } if (!model_) { @@ -169,7 +169,7 @@ void BufferView::setConfig(BufferViewConfig *config) return; if (_config) { - disconnect(_config, 0, this, 0); + disconnect(_config, nullptr, this, nullptr); } _config = config; @@ -262,7 +262,7 @@ void BufferView::dropEvent(QDropEvent *event) return TreeViewTouch::dropEvent(event); // Confirm that the user really wants to merge the buffers before doing so - int res = QMessageBox::question(0, tr("Merge buffers permanently?"), + int res = QMessageBox::question(nullptr, tr("Merge buffers permanently?"), tr("Do you want to merge the buffer \"%1\" permanently into buffer \"%2\"?\n This cannot be reversed!").arg(Client::networkModel()->bufferName(bufferId2)).arg(Client::networkModel()->bufferName(bufferId1)), QMessageBox::Yes|QMessageBox::No, QMessageBox::No); if (res == QMessageBox::Yes) { @@ -734,7 +734,7 @@ bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, c // ============================== BufferViewDock::BufferViewDock(BufferViewConfig *config, QWidget *parent) : QDockWidget(parent), - _childWidget(0), + _childWidget(nullptr), _widget(new QWidget(parent)), _filterEdit(new QLineEdit(parent)), _active(false), @@ -764,7 +764,7 @@ BufferViewDock::BufferViewDock(BufferViewConfig *config, QWidget *parent) void BufferViewDock::setLocked(bool locked) { if (locked) { - setFeatures(0); + setFeatures(nullptr); } else { setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); @@ -791,7 +791,7 @@ void BufferViewDock::onFilterReturnPressed() { if (_oldFocusItem) { _oldFocusItem->setFocus(); - _oldFocusItem = 0; + _oldFocusItem = nullptr; } if (!config()->showSearch()) { @@ -894,7 +894,7 @@ BufferViewConfig *BufferViewDock::config() const { BufferView *view = bufferView(); if (!view) - return 0; + return nullptr; else return view->config(); } diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 52210cad..52d4ffa2 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -48,7 +48,7 @@ public: Backward = -1 }; - BufferView(QWidget *parent = 0); + BufferView(QWidget *parent = nullptr); void init(); void setModel(QAbstractItemModel *model); @@ -145,7 +145,7 @@ class BufferViewDelegate : public QStyledItemDelegate Q_OBJECT public: - BufferViewDelegate(QObject *parent = 0); + BufferViewDelegate(QObject *parent = nullptr); bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index a73b0917..51d98646 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -39,7 +39,7 @@ *****************************************/ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config) : QSortFilterProxyModel(model), - _config(0), + _config(nullptr), _sortOrder(Qt::AscendingOrder), _showServerQueries(false), _editMode(false), @@ -68,7 +68,7 @@ void BufferViewFilter::setConfig(BufferViewConfig *config) return; if (_config) { - disconnect(_config, 0, this, 0); + disconnect(_config, nullptr, this, nullptr); } _config = config; diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index f53662a1..69f8928e 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -52,7 +52,7 @@ public: }; Q_DECLARE_FLAGS(Modes, Mode) - BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = 0); + BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = nullptr); virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); diff --git a/src/uisupport/bufferviewoverlayfilter.cpp b/src/uisupport/bufferviewoverlayfilter.cpp index bf978983..e01a0be0 100644 --- a/src/uisupport/bufferviewoverlayfilter.cpp +++ b/src/uisupport/bufferviewoverlayfilter.cpp @@ -26,7 +26,7 @@ BufferViewOverlayFilter::BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay) : QSortFilterProxyModel(model), - _overlay(0) + _overlay(nullptr) { setOverlay(overlay); setSourceModel(model); @@ -41,7 +41,7 @@ void BufferViewOverlayFilter::setOverlay(BufferViewOverlay *overlay) return; if (_overlay) { - disconnect(_overlay, 0, this, 0); + disconnect(_overlay, nullptr, this, nullptr); } _overlay = overlay; @@ -59,7 +59,7 @@ void BufferViewOverlayFilter::setOverlay(BufferViewOverlay *overlay) void BufferViewOverlayFilter::overlayDestroyed() { - setOverlay(0); + setOverlay(nullptr); } diff --git a/src/uisupport/bufferviewoverlayfilter.h b/src/uisupport/bufferviewoverlayfilter.h index 2b43bf9b..721d6ccb 100644 --- a/src/uisupport/bufferviewoverlayfilter.h +++ b/src/uisupport/bufferviewoverlayfilter.h @@ -33,7 +33,7 @@ class UISUPPORT_EXPORT BufferViewOverlayFilter : public QSortFilterProxyModel Q_OBJECT public: - BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay = 0); + BufferViewOverlayFilter(QAbstractItemModel *model, BufferViewOverlay *overlay = nullptr); void setOverlay(BufferViewOverlay *overlay); diff --git a/src/uisupport/clearablelineedit.h b/src/uisupport/clearablelineedit.h index 53692223..7c01a40a 100644 --- a/src/uisupport/clearablelineedit.h +++ b/src/uisupport/clearablelineedit.h @@ -31,7 +31,7 @@ class UISUPPORT_EXPORT ClearableLineEdit : public QLineEdit Q_OBJECT public: - ClearableLineEdit(QWidget *parent = 0); + ClearableLineEdit(QWidget *parent = nullptr); protected: void resizeEvent(QResizeEvent *event); diff --git a/src/uisupport/clickablelabel.h b/src/uisupport/clickablelabel.h index 0bd20326..c68fde21 100644 --- a/src/uisupport/clickablelabel.h +++ b/src/uisupport/clickablelabel.h @@ -29,7 +29,7 @@ class UISUPPORT_EXPORT ClickableLabel : public QLabel Q_OBJECT public: - ClickableLabel(QWidget *parent = 0); + ClickableLabel(QWidget *parent = nullptr); signals: void clicked(); diff --git a/src/uisupport/colorbutton.h b/src/uisupport/colorbutton.h index 48811f6e..852717d2 100644 --- a/src/uisupport/colorbutton.h +++ b/src/uisupport/colorbutton.h @@ -30,8 +30,8 @@ class UISUPPORT_EXPORT ColorButton : public QToolButton Q_PROPERTY(QColor color READ color WRITE setColor USER true) public : - explicit ColorButton(QWidget *parent = 0); - explicit ColorButton(const QColor &c, QWidget *parent = 0); + explicit ColorButton(QWidget *parent = nullptr); + explicit ColorButton(const QColor &c, QWidget *parent = nullptr); void setColor(const QColor &color); QColor color() const; diff --git a/src/uisupport/contextmenuactionprovider.cpp b/src/uisupport/contextmenuactionprovider.cpp index 3bd7b3d9..6ef38684 100644 --- a/src/uisupport/contextmenuactionprovider.cpp +++ b/src/uisupport/contextmenuactionprovider.cpp @@ -105,7 +105,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM hideEventsMenu->addSeparator(); hideEventsMenu->addAction(action(HideApplyToAll)); hideEventsMenu->addAction(action(HideUseDefaults)); - _hideEventsMenuAction = new Action(tr("Hide Events"), 0); + _hideEventsMenuAction = new Action(tr("Hide Events"), nullptr); _hideEventsMenuAction->setMenu(hideEventsMenu); QMenu *nickCtcpMenu = new QMenu(); @@ -113,7 +113,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM nickCtcpMenu->addAction(action(NickCtcpVersion)); nickCtcpMenu->addAction(action(NickCtcpTime)); nickCtcpMenu->addAction(action(NickCtcpClientinfo)); - _nickCtcpMenuAction = new Action(tr("CTCP"), 0); + _nickCtcpMenuAction = new Action(tr("CTCP"), nullptr); _nickCtcpMenuAction->setMenu(nickCtcpMenu); QMenu *nickModeMenu = new QMenu(); @@ -128,11 +128,11 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM nickModeMenu->addAction(action(NickKick)); nickModeMenu->addAction(action(NickBan)); nickModeMenu->addAction(action(NickKickBan)); - _nickModeMenuAction = new Action(tr("Actions"), 0); + _nickModeMenuAction = new Action(tr("Actions"), nullptr); _nickModeMenuAction->setMenu(nickModeMenu); QMenu *ignoreMenu = new QMenu(); - _nickIgnoreMenuAction = new Action(tr("Ignore"), 0); + _nickIgnoreMenuAction = new Action(tr("Ignore"), nullptr); _nickIgnoreMenuAction->setMenu(ignoreMenu); // These are disabled actions used as descriptions @@ -171,7 +171,7 @@ void ContextMenuActionProvider::addActions(QMenu *menu, const QModelIndex &index { if (!index.isValid()) return; - addActions(menu, QList() << index, 0, QString(), receiver, method, isCustomBufferView); + addActions(menu, QList() << index, nullptr, QString(), receiver, method, isCustomBufferView); } @@ -191,7 +191,7 @@ void ContextMenuActionProvider::addActions(QMenu *menu, MessageFilter *filter, B void ContextMenuActionProvider::addActions(QMenu *menu, const QList &indexList, QObject *receiver, const char *method, bool isCustomBufferView) { - addActions(menu, indexList, 0, QString(), receiver, method, isCustomBufferView); + addActions(menu, indexList, nullptr, QString(), receiver, method, isCustomBufferView); } diff --git a/src/uisupport/contextmenuactionprovider.h b/src/uisupport/contextmenuactionprovider.h index a9c76bf0..c95a3c1a 100644 --- a/src/uisupport/contextmenuactionprovider.h +++ b/src/uisupport/contextmenuactionprovider.h @@ -29,7 +29,7 @@ class UISUPPORT_EXPORT ContextMenuActionProvider : public NetworkModelController Q_OBJECT public: - ContextMenuActionProvider(QObject *parent = 0); + ContextMenuActionProvider(QObject *parent = nullptr); virtual ~ContextMenuActionProvider(); //! Provide a list of actions applying to the given item @@ -44,11 +44,11 @@ public: * @param slot The receiving slot name; should be "mySlot" rather than SLOT(mySlot(QAction *)) * @return A list of actions applying to the given item */ - void addActions(QMenu *, const QModelIndex &index, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false); - void addActions(QMenu *, const QList &indexList, QObject *receiver = 0, const char *slot = 0, bool allowBufferHide = false); - void addActions(QMenu *, BufferId id, QObject *receiver = 0, const char *slot = 0); - void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, QObject *receiver = 0, const char *slot = 0); - void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, const QString &chanOrNick, QObject *receiver = 0, const char *slot = 0); + void addActions(QMenu *, const QModelIndex &index, QObject *receiver = nullptr, const char *slot = nullptr, bool allowBufferHide = false); + void addActions(QMenu *, const QList &indexList, QObject *receiver = nullptr, const char *slot = nullptr, bool allowBufferHide = false); + void addActions(QMenu *, BufferId id, QObject *receiver = nullptr, const char *slot = nullptr); + void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, QObject *receiver = nullptr, const char *slot = nullptr); + void addActions(QMenu *, MessageFilter *filter, BufferId msgBuffer, const QString &chanOrNick, QObject *receiver = nullptr, const char *slot = nullptr); private: diff --git a/src/uisupport/flatproxymodel.cpp b/src/uisupport/flatproxymodel.cpp index e93b6628..aef7b1b4 100644 --- a/src/uisupport/flatproxymodel.cpp +++ b/src/uisupport/flatproxymodel.cpp @@ -25,7 +25,7 @@ FlatProxyModel::FlatProxyModel(QObject *parent) : QAbstractProxyModel(parent), - _rootSourceItem(0) + _rootSourceItem(nullptr) { } @@ -96,7 +96,7 @@ QItemSelection FlatProxyModel::mapSelectionFromSource(const QItemSelection &sour QModelIndex currentParent = currentRange.topLeft().parent(); Q_ASSERT(currentParent == currentRange.bottomRight().parent()); - SourceItem *parentItem = 0; + SourceItem *parentItem = nullptr; if (!itemLookup.contains(currentParent)) { parentItem = sourceToInternal(currentParent); itemLookup[currentParent] = parentItem; @@ -178,8 +178,8 @@ QItemSelection FlatProxyModel::mapSelectionToSource(const QItemSelection &proxyS for (int i = 0; i < proxySelection.count(); i++) { const QItemSelectionRange &range = proxySelection[i]; - SourceItem *topLeftItem = 0; - SourceItem *bottomRightItem = 0; + SourceItem *topLeftItem = nullptr; + SourceItem *bottomRightItem = nullptr; SourceItem *currentItem = static_cast(range.topLeft().internalPointer()); int row = range.topLeft().row(); int left = range.topLeft().column(); @@ -195,8 +195,8 @@ QItemSelection FlatProxyModel::mapSelectionToSource(const QItemSelection &proxyS else { Q_ASSERT(topLeftItem && bottomRightItem); sourceSelection << QItemSelectionRange(mapToSource(createIndex(topLeftItem->pos(), left, topLeftItem)), mapToSource(createIndex(bottomRightItem->pos(), right, bottomRightItem))); - topLeftItem = 0; - bottomRightItem = 0; + topLeftItem = nullptr; + bottomRightItem = nullptr; } // update loop vars @@ -216,7 +216,7 @@ QItemSelection FlatProxyModel::mapSelectionToSource(const QItemSelection &proxyS void FlatProxyModel::setSourceModel(QAbstractItemModel *sourceModel) { if (QAbstractProxyModel::sourceModel()) { - disconnect(QAbstractProxyModel::sourceModel(), 0, this, 0); + disconnect(QAbstractProxyModel::sourceModel(), nullptr, this, nullptr); } QAbstractProxyModel::setSourceModel(sourceModel); @@ -271,7 +271,7 @@ void FlatProxyModel::insertSubTree(const QModelIndex &source_idx, bool emitInser SourceItem *lastItem = insertSubTreeHelper(newSubTree, newSubTree, source_idx); Q_ASSERT(lastItem); - Q_ASSERT(lastItem->next() == 0); + Q_ASSERT(lastItem->next() == nullptr); if (emitInsert) beginInsertRows(QModelIndex(), newSubTree->pos(), lastItem->pos()); @@ -310,7 +310,7 @@ void FlatProxyModel::insertSubTree(const QModelIndex &source_idx, bool emitInser FlatProxyModel::SourceItem *FlatProxyModel::insertSubTreeHelper(SourceItem *parentItem, SourceItem *lastItem_, const QModelIndex &source_idx) { SourceItem *lastItem = lastItem_; - SourceItem *newItem = 0; + SourceItem *newItem = nullptr; for (int row = 0; row < sourceModel()->rowCount(source_idx); row++) { newItem = new SourceItem(row, parentItem); newItem->setPos(lastItem->pos() + 1); @@ -525,7 +525,7 @@ void FlatProxyModel::on_rowsAboutToBeInserted(const QModelIndex &parent, int sta SourceItem *nextItem = prevItem->next(); - SourceItem *newItem = 0; + SourceItem *newItem = nullptr; int newPos = prevItem->pos() + 1; for (int row = start; row <= end; row++) { newItem = new SourceItem(row, sourceItem); @@ -685,7 +685,7 @@ void FlatProxyModel::checkChildCount(const QModelIndex &index, const SourceItem FlatProxyModel::SourceItem::SourceItem(int row, SourceItem *parent) : _parent(parent), _pos(-1), - _next(0) + _next(nullptr) { if (parent) { parent->_childs.insert(row, this); diff --git a/src/uisupport/flatproxymodel.h b/src/uisupport/flatproxymodel.h index ca362b99..aa594cc5 100644 --- a/src/uisupport/flatproxymodel.h +++ b/src/uisupport/flatproxymodel.h @@ -29,7 +29,7 @@ class UISUPPORT_EXPORT FlatProxyModel : public QAbstractProxyModel Q_OBJECT public: - FlatProxyModel(QObject *parent = 0); + FlatProxyModel(QObject *parent = nullptr); virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const; @@ -97,7 +97,7 @@ public: class FlatProxyModel::SourceItem { public: - SourceItem(int row = 0, SourceItem *parent = 0); + SourceItem(int row = 0, SourceItem *parent = nullptr); ~SourceItem(); inline SourceItem *parent() const { return _parent; } diff --git a/src/uisupport/fontselector.h b/src/uisupport/fontselector.h index 1359f7d0..c36a1fd9 100644 --- a/src/uisupport/fontselector.h +++ b/src/uisupport/fontselector.h @@ -31,7 +31,7 @@ class UISUPPORT_EXPORT FontSelector : public QWidget Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont) public : - FontSelector(QWidget *parent = 0); + FontSelector(QWidget *parent = nullptr); inline const QFont &selectedFont() const { return _font; } diff --git a/src/uisupport/graphicalui.cpp b/src/uisupport/graphicalui.cpp index 6136ecf4..74ca0400 100644 --- a/src/uisupport/graphicalui.cpp +++ b/src/uisupport/graphicalui.cpp @@ -32,11 +32,11 @@ # include #endif -QWidget *GraphicalUi::_mainWidget = 0; +QWidget *GraphicalUi::_mainWidget = nullptr; QHash GraphicalUi::_actionCollections; -ContextMenuActionProvider *GraphicalUi::_contextMenuActionProvider = 0; -ToolBarActionProvider *GraphicalUi::_toolBarActionProvider = 0; -UiStyle *GraphicalUi::_uiStyle = 0; +ContextMenuActionProvider *GraphicalUi::_contextMenuActionProvider = nullptr; +ToolBarActionProvider *GraphicalUi::_toolBarActionProvider = nullptr; +UiStyle *GraphicalUi::_uiStyle = nullptr; GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent), Singleton(this) diff --git a/src/uisupport/graphicalui.h b/src/uisupport/graphicalui.h index ebf98715..b97371e1 100644 --- a/src/uisupport/graphicalui.h +++ b/src/uisupport/graphicalui.h @@ -77,7 +77,7 @@ public: static bool isMainWidgetVisible(); protected: - GraphicalUi(QObject *parent = 0); + GraphicalUi(QObject *parent = nullptr); virtual void init(); //! This is the widget we associate global actions with, typically the main window diff --git a/src/uisupport/multilineedit.h b/src/uisupport/multilineedit.h index 63b67eb5..121a9598 100644 --- a/src/uisupport/multilineedit.h +++ b/src/uisupport/multilineedit.h @@ -49,7 +49,7 @@ public: MultiLine }; - MultiLineEdit(QWidget *parent = 0); + MultiLineEdit(QWidget *parent = nullptr); ~MultiLineEdit(); void setCustomFont(const QFont &); // should be used instead setFont(), so we can set our size correctly @@ -85,7 +85,7 @@ public slots: void setMaxHeight(int numLines); void setEmacsMode(bool enable = true); void setScrollBarsEnabled(bool enable = true); - void setPasteProtectionEnabled(bool enable = true, QWidget *msgBoxParent = 0); + void setPasteProtectionEnabled(bool enable = true, QWidget *msgBoxParent = nullptr); void setLineWrapEnabled(bool enable = false); inline void setHistory(QStringList history) { _history = history; } diff --git a/src/uisupport/networkmodelcontroller.cpp b/src/uisupport/networkmodelcontroller.cpp index 94dd8d9a..69797bc2 100644 --- a/src/uisupport/networkmodelcontroller.cpp +++ b/src/uisupport/networkmodelcontroller.cpp @@ -42,8 +42,8 @@ NetworkModelController::NetworkModelController(QObject *parent) : QObject(parent), _actionCollection(new ActionCollection(this)), - _messageFilter(0), - _receiver(0) + _messageFilter(nullptr), + _receiver(nullptr) { connect(_actionCollection, SIGNAL(actionTriggered(QAction *)), SLOT(actionTriggered(QAction *))); } @@ -175,7 +175,7 @@ void NetworkModelController::removeBuffers(const QModelIndexList &indexList) } QString msg; if (inactive.count()) { - msg = tr("Do you want to delete the following buffer(s) permanently?", 0, inactive.count()); + msg = tr("Do you want to delete the following buffer(s) permanently?", "", inactive.count()); msg += "
    "; int count = 0; foreach(BufferInfo info, inactive) { @@ -193,7 +193,7 @@ void NetworkModelController::removeBuffers(const QModelIndexList &indexList) if (inactive.count() != indexList.count()) msg += tr("
    Active channel buffers cannot be deleted, please part the channel first."); - if (QMessageBox::question(0, tr("Remove buffers permanently?"), msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { + if (QMessageBox::question(nullptr, tr("Remove buffers permanently?"), msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { foreach(BufferInfo info, inactive) Client::removeBuffer(info.bufferId()); } @@ -238,9 +238,9 @@ void NetworkModelController::actionTriggered(QAction *action) void NetworkModelController::handleNetworkAction(ActionType type, QAction *) { if (type == NetworkConnectAllWithDropdown || type == NetworkDisconnectAllWithDropdown || type == NetworkConnectAll || type == NetworkDisconnectAll) { - if (type == NetworkConnectAllWithDropdown && QMessageBox::question(0, tr("Question"), tr("Really Connect to all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) + if (type == NetworkConnectAllWithDropdown && QMessageBox::question(nullptr, tr("Question"), tr("Really Connect to all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) return; - if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(0, tr("Question"), tr("Really disconnect from all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) + if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(nullptr, tr("Question"), tr("Really disconnect from all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; foreach(NetworkId id, Client::networkIds()) { const Network *net = Client::network(id); diff --git a/src/uisupport/networkmodelcontroller.h b/src/uisupport/networkmodelcontroller.h index ea7ab659..c7351c46 100644 --- a/src/uisupport/networkmodelcontroller.h +++ b/src/uisupport/networkmodelcontroller.h @@ -37,7 +37,7 @@ class UISUPPORT_EXPORT NetworkModelController : public QObject Q_OBJECT public: - NetworkModelController(QObject *parent = 0); + NetworkModelController(QObject *parent = nullptr); virtual ~NetworkModelController(); // don't change enums without doublechecking masks etc. in code @@ -198,7 +198,7 @@ class NetworkModelController::JoinDlg : public QDialog Q_OBJECT public: - JoinDlg(const QModelIndex &index, QWidget *parent = 0); + JoinDlg(const QModelIndex &index, QWidget *parent = nullptr); QString channelName() const; QString channelPassword() const; diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index 2bd783b1..d9e84ec7 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -76,7 +76,7 @@ void NickView::init() void NickView::setModel(QAbstractItemModel *model_) { if (model()) - disconnect(model(), 0, this, 0); + disconnect(model(), nullptr, this, nullptr); TreeViewTouch::setModel(model_); init(); diff --git a/src/uisupport/nickview.h b/src/uisupport/nickview.h index 4bdc7d02..ee53d82a 100644 --- a/src/uisupport/nickview.h +++ b/src/uisupport/nickview.h @@ -32,7 +32,7 @@ class UISUPPORT_EXPORT NickView : public TreeViewTouch Q_OBJECT public: - NickView(QWidget *parent = 0); + NickView(QWidget *parent = nullptr); protected: virtual void rowsInserted(const QModelIndex &parent, int start, int end); diff --git a/src/uisupport/nickviewfilter.h b/src/uisupport/nickviewfilter.h index b8c05513..952271e8 100644 --- a/src/uisupport/nickviewfilter.h +++ b/src/uisupport/nickviewfilter.h @@ -34,7 +34,7 @@ class UISUPPORT_EXPORT NickViewFilter : public QSortFilterProxyModel Q_OBJECT public: - NickViewFilter(const BufferId &bufferId, NetworkModel *parent = 0); + NickViewFilter(const BufferId &bufferId, NetworkModel *parent = nullptr); virtual QVariant data(const QModelIndex &index, int role) const; QVariant icon(const QModelIndex &index) const; diff --git a/src/uisupport/resizingstackedwidget.h b/src/uisupport/resizingstackedwidget.h index 08baf2c1..4e8cff23 100644 --- a/src/uisupport/resizingstackedwidget.h +++ b/src/uisupport/resizingstackedwidget.h @@ -29,7 +29,7 @@ class UISUPPORT_EXPORT ResizingStackedWidget : public QStackedWidget Q_OBJECT public: - ResizingStackedWidget(QWidget *parent = 0); + ResizingStackedWidget(QWidget *parent = nullptr); virtual QSize sizeHint() const; diff --git a/src/uisupport/settingspage.h b/src/uisupport/settingspage.h index c6c28cd0..523cfa25 100644 --- a/src/uisupport/settingspage.h +++ b/src/uisupport/settingspage.h @@ -61,7 +61,7 @@ class UISUPPORT_EXPORT SettingsPage : public QWidget Q_OBJECT public: - SettingsPage(const QString &category, const QString &name, QWidget *parent = 0); + SettingsPage(const QString &category, const QString &name, QWidget *parent = nullptr); virtual ~SettingsPage() {}; //! The category of this settings page. diff --git a/src/uisupport/styledlabel.h b/src/uisupport/styledlabel.h index 6bcdb93c..2cd7390a 100644 --- a/src/uisupport/styledlabel.h +++ b/src/uisupport/styledlabel.h @@ -38,7 +38,7 @@ public: ResizeOnHover }; - StyledLabel(QWidget *parent = 0); + StyledLabel(QWidget *parent = nullptr); void setText(const QString &text); void setCustomFont(const QFont &font); diff --git a/src/uisupport/toolbaractionprovider.h b/src/uisupport/toolbaractionprovider.h index a341be9b..9ea36013 100644 --- a/src/uisupport/toolbaractionprovider.h +++ b/src/uisupport/toolbaractionprovider.h @@ -31,7 +31,7 @@ class UISUPPORT_EXPORT ToolBarActionProvider : public NetworkModelController Q_OBJECT public: - ToolBarActionProvider(QObject *parent = 0); + ToolBarActionProvider(QObject *parent = nullptr); virtual ~ToolBarActionProvider(); enum ToolBarType { @@ -54,7 +54,7 @@ protected: private slots: void networkCreated(NetworkId id); void networkRemoved(NetworkId id); - void networkUpdated(const Network *net = 0); + void networkUpdated(const Network *net = nullptr); void connectOrDisconnectNet(); void currentBufferChanged(const QModelIndex &); diff --git a/src/uisupport/treeviewtouch.h b/src/uisupport/treeviewtouch.h index 7b94039c..f089c962 100644 --- a/src/uisupport/treeviewtouch.h +++ b/src/uisupport/treeviewtouch.h @@ -32,7 +32,7 @@ class UISUPPORT_EXPORT TreeViewTouch : public QTreeView Q_OBJECT public: - explicit TreeViewTouch(QWidget *parent = 0); + explicit TreeViewTouch(QWidget *parent = nullptr); protected: diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 6febcd5b..9e58992c 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -46,7 +46,7 @@ class UISUPPORT_EXPORT UiStyle : public QObject Q_ENUMS(SenderPrefixModes) public: - UiStyle(QObject *parent = 0); + UiStyle(QObject *parent = nullptr); virtual ~UiStyle(); //! This enumerates the possible formats a text element may have. */ -- 2.20.1