summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-01 12:36:16 (GMT)
committerTobias Markmann <tm@ayena.de>2016-04-01 15:56:34 (GMT)
commiteddd92ed76ae68cb1e202602fd3ebd11b69191a2 (patch)
tree8d396e5801d77a2f0ee4ab8e4c5093d8cf8118e6 /Swift/QtUI/UserSearch
parenta79db8d446e152b715f435550c2a6e10a36ee532 (diff)
downloadswift-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/UserSearch')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp4
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp16
-rw-r--r--Swift/QtUI/UserSearch/UserSearchDelegate.h4
3 files changed, 12 insertions, 12 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp b/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp
index 3a82a62..3a6028d 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchFieldsPage.cpp
@@ -8,7 +8,7 @@
namespace Swift {
-QtUserSearchFieldsPage::QtUserSearchFieldsPage() : formWidget_(0) {
+QtUserSearchFieldsPage::QtUserSearchFieldsPage() : formWidget_(nullptr) {
setupUi(this);
}
@@ -27,7 +27,7 @@ QtFormWidget* QtUserSearchFieldsPage::getFormWidget() {
void QtUserSearchFieldsPage::setFormWidget(QtFormWidget *widget) {
if (formWidget_) {
delete formWidget_;
- formWidget_ = NULL;
+ formWidget_ = nullptr;
}
if (widget) {
formContainer_->layout()->addWidget(widget);
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index 1140b6e..09943c5 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.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.
*/
@@ -36,7 +36,7 @@
namespace Swift {
-QtUserSearchWindow::QtUserSearchWindow(UIEventStream* eventStream, UserSearchWindow::Type type, const std::set<std::string>& groups, SettingsProvider* settingsProvider) : eventStream_(eventStream), type_(type), model_(NULL), firstMultiJIDPage_(NULL), settings_(settingsProvider), searchNext_(false), supportsImpromptu_(false) {
+QtUserSearchWindow::QtUserSearchWindow(UIEventStream* eventStream, UserSearchWindow::Type type, const std::set<std::string>& groups, SettingsProvider* settingsProvider) : eventStream_(eventStream), type_(type), model_(nullptr), firstMultiJIDPage_(nullptr), settings_(settingsProvider), searchNext_(false), supportsImpromptu_(false) {
setupUi(this);
#ifndef Q_OS_MAC
#ifdef Q_OS_WIN32
@@ -339,7 +339,7 @@ void QtUserSearchWindow::setSearchFields(boost::shared_ptr<SearchPayload> fields
if (fields->getForm()) {
fieldsPage_->setFormWidget(new QtFormWidget(fields->getForm(), fieldsPage_));
} else {
- fieldsPage_->setFormWidget(NULL);
+ fieldsPage_->setFormWidget(nullptr);
bool enabled[8] = {!!fields->getNick(), !!fields->getNick(), !!fields->getFirst(), !!fields->getFirst(), !!fields->getLast(), !!fields->getLast(), !!fields->getEMail(), !!fields->getEMail()};
QWidget* legacySearchWidgets[8] = {fieldsPage_->nickInputLabel_, fieldsPage_->nickInput_, fieldsPage_->firstInputLabel_, fieldsPage_->firstInput_, fieldsPage_->lastInputLabel_, fieldsPage_->lastInput_, fieldsPage_->emailInputLabel_, fieldsPage_->emailInput_};
for (int i = 0; i < 8; i++) {
@@ -494,7 +494,7 @@ void QtUserSearchWindow::handleJIDEditingDone() {
}
void QtUserSearchWindow::setFirstPage(QString title) {
- if (page(1) != 0) {
+ if (page(1) != nullptr) {
removePage(1);
}
if (type_ == AddContact) {
@@ -524,7 +524,7 @@ void QtUserSearchWindow::setFirstPage(QString title) {
}
void QtUserSearchWindow::setSecondPage() {
- if (page(2) != 0) {
+ if (page(2) != nullptr) {
removePage(2);
}
fieldsPage_ = new QtUserSearchFieldsPage();
@@ -534,7 +534,7 @@ void QtUserSearchWindow::setSecondPage() {
}
void QtUserSearchWindow::setThirdPage() {
- if (page(3) != 0) {
+ if (page(3) != nullptr) {
removePage(3);
}
resultsPage_ = new QtUserSearchResultsPage();
@@ -585,9 +585,9 @@ void QtUserSearchWindow::clear() {
firstMultiJIDPage_->howLabel_->setText(howText);
}
clearForm();
- resultsPage_->results_->setModel(NULL);
+ resultsPage_->results_->setModel(nullptr);
delete model_;
- model_ = NULL;
+ model_ = nullptr;
restart();
lastPage_ = 1;
}
diff --git a/Swift/QtUI/UserSearch/UserSearchDelegate.h b/Swift/QtUI/UserSearch/UserSearchDelegate.h
index 8234689..a5639ec 100644
--- a/Swift/QtUI/UserSearch/UserSearchDelegate.h
+++ b/Swift/QtUI/UserSearch/UserSearchDelegate.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.
*/
@@ -17,7 +17,7 @@ namespace Swift {
Q_OBJECT
public:
- UserSearchDelegate(QObject* parent = 0);
+ UserSearchDelegate(QObject* parent = nullptr);
virtual ~UserSearchDelegate();
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;