Review Request 130018: Use compact format when saving runcommand commands

Kiril Vladimiroff kiril at vladimiroff.org
Thu Mar 16 15:32:44 UTC 2017


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130018/
-----------------------------------------------------------

Review request for kdeconnect.


Repository: kdeconnect-kde


Description
-------

The default value of `format` in `JSonDocument.toJson` is
`QJsonDocument::Indented`, which causes new lines and spaces for
indentation to be saved in `kdeconnect_runcommand`'s config. For
instance:

    --> cat ~/.config/kdeconnect/<device-id>/kdeconnect_runcommand/config
    [General]
    commands="@ByteArray({\n    \"{ac4ff155-1990-4f27-a5b8-52d2667c708f}\": {\n        \"command\": \"konsole\",\n        \"name\": \"Konsole\"\n    },\n    \"{fa66896c-6ffc-48e9-a242-8b32bf6588bd}\": {\n        \"command\": \"dolphin\",\n        \"name\": \"Dolphin\"\n    }\n}\n)"

The result with passed ``QJsonDocument::Compact`` is a bit nicer:

    --> cat ~/.config/kdeconnect/<device-id>/kdeconnect_runcommand/config
    [General]
    commands="@ByteArray({\"{ac4ff155-1990-4f27-a5b8-52d2667c708f}\":{\"command\":\"konsole\",\"name\":\"Konsole\"},\"{fa66896c-6ffc-48e9-a242-8b32bf6588bd}\":{\"command\":\"dolphin\",\"name\":\"Dolphin\"}})"


Diffs
-----

  plugins/runcommand/runcommand_config.cpp 722fa94 

Diff: https://git.reviewboard.kde.org/r/130018/diff/


Testing
-------

Observed compact JSON document in the config file:

    --> cat ~/.config/kdeconnect/<device-id>/kdeconnect_runcommand/config
    [General]
    commands="@ByteArray({\"{ac4ff155-1990-4f27-a5b8-52d2667c708f}\":{\"command\":\"konsole\",\"name\":\"Konsole\"},\"{fa66896c-6ffc-48e9-a242-8b32bf6588bd}\":{\"command\":\"dolphin\",\"name\":\"Dolphin\"}})"


Thanks,

Kiril Vladimiroff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20170316/f8ed1b31/attachment.html>


More information about the KDEConnect mailing list