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
Resolve C++20 deprecation warnings #10949
Conversation
cf14354
to
d0faa39
Compare
| @@ -85,7 +85,7 @@ MenuBar::MenuBar(QWidget* parent) : QMenuBar(parent) | |||
| AddHelpMenu(); | |||
|
|
|||
| connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, | |||
| [=](Core::State state) { OnEmulationStateChanged(state); }); | |||
| [=, this](Core::State state) { OnEmulationStateChanged(state); }); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lambda is unnecessary; we can replace it with &MenuBar::OnEmulationStateChanged.
Source/Core/DolphinQt/MainWindow.cpp
Outdated
| [=, this](Core::State state) { | ||
| if (state == Core::State::Uninitialized) | ||
| OnStopComplete(); | ||
| if (state != Core::State::Uninitialized && NetPlay::IsNetPlayRunning() && | ||
| m_controllers_window) | ||
| m_controllers_window->reject(); | ||
|
|
||
| if (state == Core::State::Running && m_fullscreen_requested) | ||
| { | ||
| FullScreen(); | ||
| m_fullscreen_requested = false; | ||
| } | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should create MainWindow::OnEmulationStateChange and put the contents of this lambda there.
| [=, this](Core::State state) { | ||
| if (isVisible()) | ||
| { | ||
| GameStatusChanged(state != Core::State::Uninitialized); | ||
| if ((state == Core::State::Uninitialized || state == Core::State::Stopping) && | ||
| !m_got_stop_request) | ||
| { | ||
| Settings::Instance().GetNetPlayClient()->RequestStopGame(); | ||
| } | ||
| if (state == Core::State::Uninitialized) | ||
| DisplayMessage(tr("Stopped game"), "red"); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract lambda to new OnEmulationStateChange function
Now that all builds are on C++20 a couple of new deprecation warnings are generated.
The
QKeySequencewarning is an upstream issue, in the way that you are intended to call it, from what I can tell.