Brewtarget crashes when pressing delete on keyboard

Bug #1418167 reported by mackanzx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Brewtarget
In Progress
Medium
Mik Firestone

Bug Description

Problem:
I thought the delete button on the keyboard would be identical to pressing the minus sign in the GUI.

You can delete recipes and folders with the delete button as intended.

But if you try to delete e.g. a mash step or fermentatable entry (with delete, not "minus"), it will still try to remove something from the recipe tree. With nothing selected, you get null, and then deletion doesn't null check.

It seems like selecting a folder in the recipe tree will save the program from crashing.

Revision history for this message
Mik Firestone (mikfire) wrote :

The keybindings likely need to be made aware of where the focus is when the keys are pressed. I don't think it will be too hard.

Changed in brewtarget:
assignee: nobody → Mik Firestone (mikfire)
status: New → In Progress
Revision history for this message
Mik Firestone (mikfire) wrote :

Of course, it raises the question of what is the expected behavior when the delete key is pressed. Should it refuse to work outside of the trees? Should it be context aware and delete from whatever widget is focused when it can? If it does that, what kind of feedback to we give the focused widget doesn't do deletes?

It is also appears that focus follows click in Qt. So if we were to implement the context aware delete, which context should we follow -- the context the mouse is pointed at, or the context where you last clicked.

For now, I will fix this so that nothing happens if you have clicked outside of a tree.

Changed in brewtarget:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.