Also immediately emit debug messages to console even before the UI is
initialized.
And present a useful error if the OSCAR data folder can't be created.
This is transparent to the user and is recorded into a log directory within
the OSCAR_Data directory.
Also add log rotation so that these logs don't grow forever.
The only code change was to move XmlReplayEvent::s_factories into
a local static variable accessed by XmlReplayEvent::factories() to
ensure that it will be initialized before it is used.
Otherwise there is no guarantee in C++11 that global variables
in different source files (translation units) will be initialized
in any particular order.
This is significant now because it will allow accurate recording of
multiple simultaneous connections.
This is important for the future because it establishes the
necessary infrastructure for recording downloaded sessions into their
own files so that they can be saved as backups.
Now a replayed read() will return the response that follows the
matching write().
When calls are made in the same order as they were during recording,
this will have no effect, and the original ordering will be replayed.
However, minor changes to the code should still result in sensible
replay until a new recording can be made.
Calling openConnection will return an open connection or nullptr.
Deleting the connection will close it.
SerialPort now uses this under the hood, while still presenting
the QSerialPort-compatible interface.
If you are running a test version of OSCAR, it will first try to read versions.xml from your OSCAR_Data directory.
If that fails, it will go to www.sleepfiles.com/OSCAR/versions/versions.xml
The purpose of this approach is to allow you to test different settings in versions.xml
This debug feature will probably be removed, or changed, when a release version is built
Checks for updates to OSCAR at startup and profile close.
Also allows user to check with Help/Check for updates.
Updates controlled by versions.xml in www.sleepfiles.com/oscar/versions