When the calling code does not return to the event loop (like the CLI test)
we need to run the event loop internally to make sure `bufferOutput()` is
called as of ecd730fd49.
At least when using Qt 6 I could reproduce crashes very often when invoking
`syncthing -version` as part of the wizard's setup detection (inside
a `QIODevice::readAll()` call).
I suppose the problem is that the callback `bufferOutput()` is already
invoked on another thread and emitting the next `readyRead()` signal while
Qt is still handling the previous `readData()` call. Continuing reading
from the pipe only after `readData()` returns should fix it. At least it
does not crash anymore with that change in the wizard's setup detection.
* Read properties from unit interface only if it is valid and set a timeout
to prevent the UI from hanging
* Query the unit file state in case the unit itself cannot be queries so
the file state of disabled units with no status is shown correctly
* Reload unit status when starting a disabled unit with no status so the
effect is visible
Before one only gets the generic error "TLS handshake failed". Now one gets
more details error messages plus the problematic certificate. This should
be helpful for debugging.
A follow up to 0faacaa7c8 to cover the stop button within the launcher
and terminating Syncthing on shutdown/exit. To find the relevant connection
the connection settings are searched for a local URL where the port matches
the port from the Syncthing process log.
Syncthing can report an "idle" status despite pull errors. This still means
the directory is out-of-sync. With this change the out-of-sync status is
only cleared when reading a "FolderSummary" event without pull errors (or
temporarily if the directory is e.g. scanning).
Syncthing's official web UI also does the first query for events like this.
This should make loading times a bit faster and removes the possibility of
picking-up obsolete events (which was always problematic).
See comment; otherwise calls to `readAll()` with no `bytesAvailable()`
like done in the `syncthingctl` tests fail sporadically as async read
operations are started concurrently.