Closed luiseeo closed 6 years ago
I don't think anyone depends or is attached to the Flat or JSON notations. But maybe someone is (?). The YAML notation is set as the default right now, so everyone should switch automatically. We can know if someone requires the older notations if someone complains.
Another reason to not get rid of the notations just yet is that I'm sure there are some edge cases where the YAML notation is not 100% compliant. Example: Strings with ':', '\n', or '"" can be tricky. I would like to fix them after I put the unit tests in place, as it is very easy to fix something but break something else right now. (Right now, comparing the formatting between notations helps me test)
I'm adding different options for displaying the events, aka "notations".
Original motivation: I got tired of looking at "qp-batch-summary" events, which are nested, and feeling lost.
So far, there's three notations:
The notations have 2 forms: SingleLine and Free. Singleline is the one used by the main window, where only the first line is visible. Free can use as many newlines as wanted and it's used by the details window. I found that creating functions for each of these forms was easier than trying to special-case a lot of places in the formatting logic.
For future: The functions in QJsonUtils are begging for unit tests, I think I might do that next in a separate branch (finally unit tests for TLV!) before doing any further improvement in the notations.
Finally, some before/after images!
Simple event (not much change or improvement)
Before (Flat)
After (YAML)
Complex event (a lot of change)
Before (Flat)
After (YAML)