Skip to content

An unending loop when ApplicationSettings::shortcutChanged() signal is emitted. #11

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

Open
lokitkhemka opened this issue Feb 22, 2025 · 0 comments

Comments

@lokitkhemka
Copy link

lokitkhemka commented Feb 22, 2025

Basically,

I was trying to understand how shortcutChanged signal is perpetuated and I think, it is looping endlessly.

Consider the starting to be connection between ApplicationSettings::shortcutChanged signal and ActionList::changeShortcut in the file main_window.cpp. Eventually ActionList::changeShortcut emits a signal ActionDefinition::shortcutChanged via ActionDefinition::setShortcut method.

In application_settings.cpp, ActionDefinition::shortcutChanged is connected to ApplicationSettings::onShortcutChanged (in the file application_settings.cpp), which in turn emits ApplicationSettings::shortcutChanged signals and the cycle goes around.

I think to break the cycle, we just have to remove the signal emit from ActionDefinition::setShortcut and remove the connection between ActionDefinition::shortcutChanged and ApplicationSettings::onShortcutChanged.

Sorry, if it is too complicated. What do you think about my suggestion? Thank you.

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

No branches or pull requests

1 participant