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/ChatListModel.cpp | |
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/ChatListModel.cpp')
-rw-r--r-- | Swift/QtUI/ChatList/ChatListModel.cpp | 14 |
1 files changed, 7 insertions, 7 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 { |