Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nullptr #221

Merged
merged 1 commit into from
Feb 8, 2020
Merged

Use nullptr #221

merged 1 commit into from
Feb 8, 2020

Conversation

luis-pereira
Copy link
Member

Drop 0 and NULL. It improves type safety and resolves ambiguous situations.

src/misc.cpp Outdated
@@ -782,7 +782,7 @@ void SearchBox::event_cursor_moved(QMouseEvent *e) { move(e->x(), e->y()); }

void SearchBox::event_xbutton_clicked()
{
QKeyEvent ke(QEvent::KeyPress, Qt::Key_Escape, 0); // temp..
QKeyEvent ke(QEvent::KeyPress, Qt::Key_Escape, nullptr); // temp..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't Qt::NoModifier better here, instead of nullptr? The c-tor is:

QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text = QString(), bool autorep = false, ushort count = 1)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course.
And there's some more mistakes.
Will update it and ping you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there's some more mistakes.

I didn't find any.

Will update it and ping you.

OK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was tricked by the variable name: size.... turns out that it's a pointer.
My first pass was right. Updating.

Drop 0 and NULL. It improves type safety and resolves ambiguous situations.
Copy link
Member

@tsujan tsujan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTM

@tsujan tsujan merged commit c603c8b into master Feb 8, 2020
@tsujan tsujan deleted the nullptr branch February 8, 2020 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants