Keruspe / GPaste

Clipboard management system
BSD 2-Clause "Simplified" License
756 stars 54 forks source link

daemon: Improve warning for history parser state errors #399

Closed jtojnar closed 1 year ago

jtojnar commented 2 years ago

This will make it easier to fix corrupted history files.

For example, with this fix I get:

Expected state 5, but got 4 in file “/home/jtojnar/.local/share/GPaste/history.xml” at line 5117, column 1.

which pointed me to:

<item kind="Text" uuid="27eff152-c01a-49bd-8e55-4dbad47f63c9">
  <value><![CDATA[previousAttrs]]></value>
  <value mime="text-html"><![CDATA[]]></value>
</item>
jtojnar commented 2 years ago

Ideally, we would also use names for the parser states but that would probably require either manual conversion table or something like glib-mkenums.

Keruspe commented 2 years ago

Thanks, will give it a look next week