diff options
author | Tobias Markmann <tm@ayena.de> | 2016-04-01 12:36:16 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-04-01 15:56:34 (GMT) |
commit | eddd92ed76ae68cb1e202602fd3ebd11b69191a2 (patch) | |
tree | 8d396e5801d77a2f0ee4ab8e4c5093d8cf8118e6 /Swift/QtUI/ChatList | |
parent | a79db8d446e152b715f435550c2a6e10a36ee532 (diff) | |
download | swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.zip swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.tar.bz2 |
Modernize code to use C++11 nullptr using clang-tidy
Run 'clang-tidy -fix -checks=modernize-use-nullptr' on all
source code files on OS X. This does not modernize platform
specific code on Linux and Windows
Test-Information:
Code builds and unit tests pass on OS X 10.11.4.
Change-Id: Ic43ffeb1b76c1a933a55af03db3c54977f5f60dd
Diffstat (limited to 'Swift/QtUI/ChatList')
-rw-r--r-- | Swift/QtUI/ChatList/ChatListModel.cpp | 14 | ||||
-rw-r--r-- | Swift/QtUI/ChatList/QtChatListWindow.cpp | 6 | ||||
-rw-r--r-- | Swift/QtUI/ChatList/QtChatListWindow.h | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/Swift/QtUI/ChatList/ChatListModel.cpp b/Swift/QtUI/ChatList/ChatListModel.cpp index 307cdea..e5e8963 100644 --- a/Swift/QtUI/ChatList/ChatListModel.cpp +++ b/Swift/QtUI/ChatList/ChatListModel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,8 +16,8 @@ namespace Swift { -ChatListModel::ChatListModel() : whiteboards_(NULL) { - root_ = new ChatListGroupItem("", NULL, false); +ChatListModel::ChatListModel() : whiteboards_(nullptr) { + root_ = new ChatListGroupItem("", nullptr, false); mucBookmarks_ = new ChatListGroupItem(tr("Bookmarked Rooms"), root_); recents_ = new ChatListGroupItem(tr("Recent Chats"), root_, false); #ifdef SWIFT_EXPERIMENTAL_WB @@ -106,7 +106,7 @@ void ChatListModel::setRecents(const std::list<ChatListWindow::Chat>& recents) { QMimeData* ChatListModel::mimeData(const QModelIndexList& indexes) const { QMimeData* data = QAbstractItemModel::mimeData(indexes); ChatListRecentItem *item = dynamic_cast<ChatListRecentItem*>(getItemForIndex(indexes.first())); - if (item == NULL) { + if (item == nullptr) { return data; } @@ -132,7 +132,7 @@ QMimeData* ChatListModel::mimeData(const QModelIndexList& indexes) const { } const ChatListMUCItem* ChatListModel::getChatListMUCItem(const JID& roomJID) const { - const ChatListMUCItem* mucItem = NULL; + const ChatListMUCItem* mucItem = nullptr; for (int i = 0; i < mucBookmarks_->rowCount(); i++) { ChatListMUCItem* item = dynamic_cast<ChatListMUCItem*>(mucBookmarks_->item(i)); if (item->getBookmark().getRoom() == roomJID) { @@ -148,7 +148,7 @@ int ChatListModel::columnCount(const QModelIndex& /*parent*/) const { } ChatListItem* ChatListModel::getItemForIndex(const QModelIndex& index) const { - return index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : NULL; + return index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : nullptr; } QVariant ChatListModel::data(const QModelIndex& index, int role) const { @@ -175,7 +175,7 @@ QModelIndex ChatListModel::parent(const QModelIndex& index) const { } int ChatListModel::rowCount(const QModelIndex& parentIndex) const { - ChatListGroupItem* parent = NULL; + ChatListGroupItem* parent = nullptr; if (parentIndex.isValid()) { parent = dynamic_cast<ChatListGroupItem*>(static_cast<ChatListItem*>(parentIndex.internalPointer())); } else { diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp index eddd0cd..1a121aa 100644 --- a/Swift/QtUI/ChatList/QtChatListWindow.cpp +++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -177,7 +177,7 @@ void QtChatListWindow::dragEnterEvent(QDragEnterEvent *event) { void QtChatListWindow::contextMenuEvent(QContextMenuEvent* event) { QModelIndex index = indexAt(event->pos()); - ChatListItem* baseItem = index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : NULL; + ChatListItem* baseItem = index.isValid() ? static_cast<ChatListItem*>(index.internalPointer()) : nullptr; contextMenuItem_ = baseItem; foreach(QAction* action, onlineOnlyActions_) { @@ -203,7 +203,7 @@ void QtChatListWindow::contextMenuEvent(QContextMenuEvent* event) { const ChatListWindow::Chat& chat = recentItem->getChat(); if (chat.isMUC) { QMenu mucRecentsMenu; - QAction* bookmarkAction = NULL; + QAction* bookmarkAction = nullptr; const ChatListMUCItem* mucItem = model_->getChatListMUCItem(chat.jid); if (mucItem) { contextMenuItem_ = mucItem; diff --git a/Swift/QtUI/ChatList/QtChatListWindow.h b/Swift/QtUI/ChatList/QtChatListWindow.h index 61f8391..834e318 100644 --- a/Swift/QtUI/ChatList/QtChatListWindow.h +++ b/Swift/QtUI/ChatList/QtChatListWindow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -19,7 +19,7 @@ namespace Swift { class QtChatListWindow : public QTreeView, public ChatListWindow { Q_OBJECT public: - QtChatListWindow(UIEventStream *uiEventStream, SettingsProvider* settings, QWidget* parent = NULL); + QtChatListWindow(UIEventStream *uiEventStream, SettingsProvider* settings, QWidget* parent = nullptr); virtual ~QtChatListWindow(); void addMUCBookmark(const MUCBookmark& bookmark); void removeMUCBookmark(const MUCBookmark& bookmark); |