Skip to content

Fix okular.upd file not processed by kconf_update

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

The okular.upd file was missing a Version=5 which caused kconf_update to skip it. Moreover the rule annotation-toolbar was missing the Group key, so was not applied.

BUG: 424616

Testing

My environment

  • I manually compiled Okular (not using kdesrc-build) and installed it in a custom prefix /opt/install_prefix/
  • I source prefix.sh
  • Edit ~/.config/QtProject/qtlogging.ini and add kf5.kconfig.update=true

Testing procedure

  • Edit ~/.config/kconf_updaterc and remove the block related to okular
  • Remove ~/.config/okularpartrc
  • Open old okular and edit the annotation tools (e.g. change their order)
  • (ensure you sourced prefix.sh)
  • Execute /usr/lib/kf5/kconf_update

Results

$ /usr/lib/kf5/kconf_update
kf5.kconfig.update: Checking update-file "/opt/install_prefix/share/kconf_update/okular.upd" for new updates
kf5.kconfig.update: "okular.upd" : Found new update "sep_settings"
kf5.kconfig.update: "okular.upd" : Found new update "annotation-toolbar"
kf5.kconfig.update: "okular.upd" : Updating "okularpartrc" : "Reviews" : "QuickAnnotationTools" to "<tool type=\"note-linked\" id=\"1\"><engine type=\"PickPoint\" color=\"#ffffff00\" hoverIcon=\"tool-note\"><annotation type=\"Text\" color=\"#ffffff00\" icon=\"Note\"/></engine><shortcut>1</shortcut></tool>,<tool type=\"note-inline\" id=\"2\"><engine type=\"PickPoint\" block=\"true\" color=\"#ffffff00\" hoverIcon=\"tool-note-inline\"><annotation type=\"FreeText\" color=\"#ffffff00\"/></engine><shortcut>2</shortcut></tool>,<tool type=\"highlight\" id=\"3\"><engine type=\"TextSelector\" color=\"#ffffff00\"><annotation type=\"Highlight\" color=\"#ffffff00\"/></engine><shortcut>3</shortcut></tool>,<tool type=\"straight-line\" id=\"4\"><engine type=\"PolyLine\" color=\"#ffffe000\" points=\"2\"><annotation type=\"Line\" color=\"#ffffe000\" width=\"1\"/></engine><shortcut>4</shortcut></tool>,<tool type=\"ink\" id=\"5\"><engine type=\"SmoothLine\" color=\"#ff00ff00\"><annotation type=\"Ink\" color=\"#ff00ff00\" width=\"2\"/></engine><shortcut>5</shortcut></tool>,<tool type=\"polygon\" id=\"6\"><engine type=\"PolyLine\" color=\"#ff007eee\" points=\"-1\"><annotation type=\"Line\" color=\"#ff007eee\" width=\"1\"/></engine><shortcut>6</shortcut></tool>,<tool type=\"stamp\" id=\"7\"><engine type=\"PickPoint\" size=\"64\" block=\"true\" hoverIcon=\"okular\"><annotation type=\"Stamp\" icon=\"okular\"/></engine><shortcut>7</shortcut></tool>,<tool type=\"underline\" id=\"8\"><engine type=\"TextSelector\" color=\"#ff000000\"><annotation type=\"Underline\" color=\"#ff000000\"/></engine><shortcut>8</shortcut></tool>,<tool type=\"ellipse\" id=\"9\"><engine type=\"PickPoint\" block=\"true\" color=\"#ff00ffff\"><annotation type=\"GeomCircle\" color=\"#ff00ffff\" width=\"5\"/></engine><shortcut>9</shortcut></tool>,<tool type=\"typewriter\" id=\"10\"><engine type=\"PickPoint\" block=\"true\"><annotation type=\"Typewriter\" textColor=\"#ff000000\" color=\"#00ffffff\" width=\"0\"/></engine></tool>"
$ cat ~/.config/kconf_updaterc
[okular.upd]
ctime=1595274160
done=sep_settings,annotation-toolbar
mtime=1594110005
$ cat ~/.config/okularpartrc
[$Version]
update_info=okular.upd:sep_settings,okular.upd:annotation-toolbar

[Reviews]
QuickAnnotationTools=<tool type="note-linked" id="1"><engine type="PickPoint" color="#ffffff00" hoverIcon="tool-note"><annotation type="Text" color="#ffffff00" icon="Note"/></engine><shortcut>1</shortcut></tool>,<tool type="note-inline" id="2"><engine type="PickPoint" block="true" color="#ffffff00" hoverIcon="tool-note-inline"><annotation type="FreeText" color="#ffffff00"/></engine><shortcut>2</shortcut></tool>,<tool type="highlight" id="3"><engine type="TextSelector" color="#ffffff00"><annotation type="Highlight" color="#ffffff00"/></engine><shortcut>3</shortcut></tool>,<tool type="straight-line" id="4"><engine type="PolyLine" color="#ffffe000" points="2"><annotation type="Line" color="#ffffe000" width="1"/></engine><shortcut>4</shortcut></tool>,<tool type="ink" id="5"><engine type="SmoothLine" color="#ff00ff00"><annotation type="Ink" color="#ff00ff00" width="2"/></engine><shortcut>5</shortcut></tool>,<tool type="polygon" id="6"><engine type="PolyLine" color="#ff007eee" points="-1"><annotation type="Line" color="#ff007eee" width="1"/></engine><shortcut>6</shortcut></tool>,<tool type="stamp" id="7"><engine type="PickPoint" size="64" block="true" hoverIcon="okular"><annotation type="Stamp" icon="okular"/></engine><shortcut>7</shortcut></tool>,<tool type="underline" id="8"><engine type="TextSelector" color="#ff000000"><annotation type="Underline" color="#ff000000"/></engine><shortcut>8</shortcut></tool>,<tool type="ellipse" id="9"><engine type="PickPoint" block="true" color="#ff00ffff"><annotation type="GeomCircle" color="#ff00ffff" width="5"/></engine><shortcut>9</shortcut></tool>,<tool type="typewriter" id="10"><engine type="PickPoint" block="true"><annotation type="Typewriter" textColor="#ff000000" color="#00ffffff" width="0"/></engine></tool>

On how kconf_update works

  1. When is /usr/lib/kf5/kconf_update called by KDE?

According to the documentation

Updating the configuration happens automatically, either when KDE gets started or when kded detects a new update file in the above mentioned location

Though given that in my test environment kded does not see the environment variables sourced from prefix.sh (I think), it means that /usr/lib/kf5/kconf_update is never called automatically and needs to be called manually to test the *.upd files. Is this right?

I'll try to update the kconf_update article on techbase, because the part regarding the testing is unclear.

Edited by Simone Gaiarin

Merge request reports