replace all instances of NULL with nullptr

This commit is contained in:
Rasmus Karlsson
2017-06-11 09:37:30 +02:00
parent 1c6ff37e76
commit 9cd70877a5
15 changed files with 47 additions and 47 deletions
+5 -5
View File
@@ -65,7 +65,7 @@ void MainWindow::layoutVisibleChatWidgets(Channel *channel)
{
auto *page = _notebook.getSelectedPage();
if (page == NULL) {
if (page == nullptr) {
return;
}
@@ -74,7 +74,7 @@ void MainWindow::layoutVisibleChatWidgets(Channel *channel)
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
ChatWidget *widget = *it;
if (channel == NULL || channel == widget->getChannel().get()) {
if (channel == nullptr || channel == widget->getChannel().get()) {
widget->layoutMessages();
}
}
@@ -84,7 +84,7 @@ void MainWindow::repaintVisibleChatWidgets(Channel *channel)
{
auto *page = _notebook.getSelectedPage();
if (page == NULL) {
if (page == nullptr) {
return;
}
@@ -93,7 +93,7 @@ void MainWindow::repaintVisibleChatWidgets(Channel *channel)
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
ChatWidget *widget = *it;
if (channel == NULL || channel == widget->getChannel().get()) {
if (channel == nullptr || channel == widget->getChannel().get()) {
widget->layoutMessages();
}
}
@@ -103,7 +103,7 @@ void MainWindow::repaintGifEmotes()
{
auto *page = _notebook.getSelectedPage();
if (page == NULL) {
if (page == nullptr) {
return;
}
+1 -1
View File
@@ -67,7 +67,7 @@ void Notebook::removePage(NotebookPage *page)
int index = _pages.indexOf(page);
if (_pages.size() == 1) {
select(NULL);
select(nullptr);
} else if (index == _pages.count() - 1) {
select(_pages[index - 1]);
} else {
+1 -1
View File
@@ -98,7 +98,7 @@ void NotebookTab::moveAnimated(QPoint pos, bool animated)
{
_posAnimationDesired = pos;
if ((window() != NULL && !window()->isVisible()) || !animated || _posAnimated == false) {
if ((window() != nullptr && !window()->isVisible()) || !animated || _posAnimated == false) {
move(pos);
_posAnimated = true;
+6 -6
View File
@@ -41,7 +41,7 @@ ScrollBar::~ScrollBar()
{
auto highlight = _highlights;
while (highlight != NULL) {
while (highlight != nullptr) {
auto tmp = highlight->next;
delete highlight;
highlight = tmp;
@@ -52,12 +52,12 @@ void ScrollBar::removeHighlightsWhere(std::function<bool(ScrollBarHighlight &)>
{
_mutex.lock();
ScrollBarHighlight *last = NULL;
ScrollBarHighlight *last = nullptr;
ScrollBarHighlight *current = _highlights;
while (current != NULL) {
while (current != nullptr) {
if (func(*current)) {
if (last == NULL) {
if (last == nullptr) {
_highlights = current->next;
} else {
last->next = current->next;
@@ -79,7 +79,7 @@ void ScrollBar::addHighlight(ScrollBarHighlight *highlight)
{
_mutex.lock();
if (_highlights == NULL) {
if (_highlights == nullptr) {
_highlights = highlight;
} else {
highlight->next = _highlights->next;
@@ -224,7 +224,7 @@ void ScrollBar::paintEvent(QPaintEvent *)
// do {
// painter.fillRect();
// } while ((highlight = highlight->next()) != NULL);
// } while ((highlight = highlight->next()) != nullptr);
_mutex.unlock();
}
+1 -1
View File
@@ -289,7 +289,7 @@ void SettingsDialog::select(SettingsDialogTab *tab)
{
_pageStack.setCurrentWidget(tab->getWidget());
if (_selectedTab != NULL) {
if (_selectedTab != nullptr) {
_selectedTab->setSelected(false);
_selectedTab->setStyleSheet("color: #FFF");
}
+1 -1
View File
@@ -42,7 +42,7 @@ private:
void addTabs();
SettingsDialogTab *_selectedTab = NULL;
SettingsDialogTab *_selectedTab = nullptr;
/// Widget creation helpers
QCheckBox *createCheckbox(const QString &title, Setting<bool> &setting);
+1 -1
View File
@@ -15,7 +15,7 @@ class TextInputDialog : public QDialog
Q_OBJECT
public:
TextInputDialog(QWidget *parent = NULL);
TextInputDialog(QWidget *parent = nullptr);
QString getText() const
{