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

Resolve C++20 deprecation warnings #10949

Merged
merged 1 commit into from Sep 23, 2022
Merged

Conversation

Zopolis4
Copy link
Contributor

@Zopolis4 Zopolis4 commented Aug 5, 2022

Now that all builds are on C++20 a couple of new deprecation warnings are generated.

The QKeySequence warning is an upstream issue, in the way that you are intended to call it, from what I can tell.

@Zopolis4 Zopolis4 force-pushed the reprecated branch 4 times, most recently from cf14354 to d0faa39 Compare August 5, 2022 04:46
@Zopolis4 Zopolis4 marked this pull request as ready for review August 5, 2022 04:50
@@ -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); });
Copy link
Contributor

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.

[=, 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;
}
});
Copy link
Contributor

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");
}
});
Copy link
Contributor

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

@JMC47 JMC47 merged commit b0ac5ac into dolphin-emu:master Sep 23, 2022
11 checks passed
@Zopolis4 Zopolis4 deleted the reprecated branch September 23, 2022 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants