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

Android: Call OnConfigChanged when resetting a setting #10407

Merged
merged 1 commit into from Feb 26, 2022

Conversation

JosJuice
Copy link
Member

Otherwise the value of the setting won't be updated properly.

Otherwise the value of the setting won't be updated properly.
@AdmiralCurtiss
Copy link
Contributor

I wonder if it wouldn't be better to make a Delete() function in Config.h like Set() instead.

template <typename T>
void Set(LayerType layer, const Info<T>& info, const std::common_type_t<T>& value)
{
if (GetLayer(layer)->Set(info, value))
OnConfigChanged();
}

But I guess this works.

@JosJuice
Copy link
Member Author

JosJuice commented Feb 26, 2022

The Android code is currently not using that Set function because trying to construct the correct Info value gets messy. In particular, the Android C++ code currently doesn't know what the default value for each setting is. It certainly wouldn't be impossible to pass the default value from Java to C++, but it seems a little unnecessary when the default value isn't actually useful for anything when setting or deleting.

@AdmiralCurtiss
Copy link
Contributor

Ah, yeah I see what you mean. This is probably as good as it gets then.

@lioncash lioncash merged commit c474db9 into dolphin-emu:master Feb 26, 2022
10 checks passed
@JosJuice JosJuice deleted the android-reset-callback branch February 27, 2022 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants