Gui: Fix Spaceball button list not updating on device reset#28956
Open
Maik-0000FF wants to merge 1 commit intoFreeCAD:mainfrom
Open
Gui: Fix Spaceball button list not updating on device reset#28956Maik-0000FF wants to merge 1 commit intoFreeCAD:mainfrom
Maik-0000FF wants to merge 1 commit intoFreeCAD:mainfrom
Conversation
ButtonModel::loadConfig() called goClear() which notified the view about removed rows, then load3DConnexionButtons() wrote new entries to user.cfg without any model notification. The view kept showing the old button list until the dialog was reopened. Use beginResetModel/endResetModel to wrap the entire clear and load operation so the view updates immediately. Fixes FreeCAD#19366
Contributor
Author
|
gentle ping — anything blocking review here? happy to rebase or address feedback if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you select a device from the dropdown in the Spaceball Buttons dialog and press Reset, the button list doesn't update. It keeps showing the old entries until you close and reopen the dialog.
The problem is in ButtonModel::loadConfig(). It calls goClear() which does beginRemoveRows/endRemoveRows, then load3DConnexionButtons() writes new button entries to user.cfg — but without calling beginInsertRows/endInsertRows. The view never learns about the new rows.
The fix wraps the whole operation in beginResetModel/endResetModel so the view refreshes in one go.
Tested on Arch Linux / KDE Plasma Wayland with SpaceNavigator (046d:c626). Selected "SpaceNavigator" from the dropdown, pressed Reset — the list now immediately updates from 31 entries to 2. Before the fix, the list stayed at 31 until the dialog was reopened.
Fixes #19366