range3 icon indicating copy to clipboard operation
range3 copied to clipboard

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

Open lokitkhemka opened this issue 11 months ago • 0 comments

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.

lokitkhemka avatar Feb 22 '25 16:02 lokitkhemka