@@ -86,8 +86,9 @@ static void to_json_dict_iter(const char *key, QObject *obj, void *opaque)
QString *qkey;
int j;
- if (s->count)
- qstring_append(s->str, ", ");
+ if (s->count) {
+ qstring_append(s->str, s->pretty ? "," : ", ");
+ }
if (s->pretty) {
qstring_append(s->str, "\n");
@@ -109,8 +110,9 @@ static void to_json_list_iter(QObject *obj, void *opaque)
ToJsonIterState *s = opaque;
int j;
- if (s->count)
- qstring_append(s->str, ", ");
+ if (s->count) {
+ qstring_append(s->str, s->pretty ? "," : ", ");
+ }
if (s->pretty) {
qstring_append(s->str, "\n");