Skip to content

Fix 424810

Simone Gaiarin requested to merge gaiarin/okular:fix-424810 into release/20.08

This fix the bug, even though the code is a bit complicated.

The problem was that only when a quick annotation is created using the "bookmark" button it was correctly assigned the attribute sourceId, while when it was created from the Settings page this attribute was not created. sourceId identifies the id of the corresponding built-in annotation (those in the toolbar). This attribute is used to check the built-in action corresponding to the triggered quick annotation.

Another problem I've noticed is that mapping the key AnnotationTools to QuickAnnotationTools with the okular.upd rule is not enough, because the sourceId attribute is missing. So either we parse the annotation tools one by one in this translation, or we go the brutal way where the AnnotationTools key is deleted.

TODO

  • Create an enum for the tool ids, instead of having hardcoded numbers.
  • Fix geometrical annotation not checked correctly, needs to call setDefaultAction.
  • Update okular.upd
  • Autotests

Test

  • Wipe okularpartrc as usual
  • Create a new quick annotation tool from the Settings page
  • Use the annotation tool

Result: the quick annotation tool can be used, no crash, the corresponding built-in tool action is checked

Corner cases to test in particular:

  • Straight line > Straight line tool should be checked
  • Straight line whose at least one of the line ending is not None > Arrow tool should be checked
  • Default stamp tool (e.g. Condidential) > The corresponding stamp tool should be checked
  • Custom stamp tool (e.g. pick a png image from the disk) > The corresponding stamp tool should be checked

BUG: 424810

Edited by Simone Gaiarin

Merge request reports