koreader icon indicating copy to clipboard operation
koreader copied to clipboard

Dispatcher: fix action deleted arg

Open hius07 opened this issue 9 months ago • 4 comments

Font file or user style tweak can be deleted (outside of the program) after assigning an action with them as arg. Fix displaying the action in Gesture manager / Profiles. Check for font/tweak existence before executing. Closes https://github.com/koreader/koreader/issues/13479.


This change is Reviewable

hius07 avatar Mar 30 '25 07:03 hius07

@poire-z minor nits in tweak id - a space at the end. Fixing will break users' settings. https://github.com/koreader/koreader/blob/2a10f7188ba4c6b7073d5201e3c26f78dfcaf40f/frontend/ui/data/css_tweaks.lua#L100 https://github.com/koreader/koreader/blob/2a10f7188ba4c6b7073d5201e3c26f78dfcaf40f/frontend/ui/data/css_tweaks.lua#L107 https://github.com/koreader/koreader/blob/2a10f7188ba4c6b7073d5201e3c26f78dfcaf40f/frontend/ui/data/css_tweaks.lua#L113

hius07 avatar Mar 30 '25 08:03 hius07

Oh, sorry for that :/ What would happen if we fix these, and users have them with spaces ? Crash or just not effect ? (These must be quite rarely used/enabled, and it will probably noticed if they were needed but have no longer effect.)

poire-z avatar Mar 30 '25 08:03 poire-z

With this PR, just no effect.

hius07 avatar Mar 30 '25 09:03 hius07

@poire-z minor nits in tweak id - a space at the end. Fixing will break users' settings.

https://github.com/koreader/koreader/blob/2a10f7188ba4c6b7073d5201e3c26f78dfcaf40f/frontend/ui/data/css_tweaks.lua#L100

https://github.com/koreader/koreader/blob/2a10f7188ba4c6b7073d5201e3c26f78dfcaf40f/frontend/ui/data/css_tweaks.lua#L107

https://github.com/koreader/koreader/blob/2a10f7188ba4c6b7073d5201e3c26f78dfcaf40f/frontend/ui/data/css_tweaks.lua#L113

Can’t one-time migration help?

mergen3107 avatar Mar 31 '25 03:03 mergen3107