Apparently this is still problematic leading to errors like
`Qualifying with unknown namespace/class`. It seems that moving the enum to
a different header file works. The trick to use a macro to define
`enum class` ceased to work on the other hand.
Specifying a function with the namespace like
`void QtGui::FinalWizardPage::showResults()` leads to the same problem and
also needs to be avoided.
* Do *not* build Syncthing in addition as standalone executalbe
* Explose instead all of Syncthing's commands via the library
interface
* Make all of Syncthing's commands (including `serve`) accessible
via Syncthing Tray's executable
* Remove copied code for directory creation and instead use
upstream's code directly
* Do not blindly override existing auto start entry
* Warn if an auto start entry exists but points to a different executable
* Allow removing such an entry explicitly
* Avoid overriding argv/argc via `CMD_UTILS_CONVERT_ARGS_TO_UTF8` in
Windows-specific code when processing arguments from a 2nd instance
* Move the other startup code to main as well as they are not needed when
processing arguments from a 2nd instance
* Improve debug logging
* Use `waitForBytesWritten()` instead of `flush()` when passing args as
recommended by the documentation
* Avoid use of `bytesAvailable()` as it doesn't work as expected in this
situation on Windows (likely it doesn't really work reliably on all
platforms); calling `readAll()` works and is simpler anyways
* Tested that `--replace` works as well; also the
`waitUntilGone && QFile::exists(fullServerName)` block is entered and if
the previous instance is taking some time it really waits until it is
gone
* Make functions in `main.cpp` static as they are not used by
other units
* Delete the `TrayIcon` via an extra parent object that is
deleted before the `QNetworkAccessManager` is deleted; otherwise
the destruction of `SyncthingConnection` (which aborts pending
replies) might access dangling `QNetworkReply` objects
* Improve error handling in `SingleInstance` code
* Allow to replace the current instance via the new `--replace`
argument; this may be useful when creating an installer/updater
* This is now required after 843f164d which uses event IDs
instead of time stamps and event IDs reset when Syncthing has
been restarted.
* It is likely a good idea to cleanly re-connect anyways.
* This change re-introduces the previously uneffective and hence
removed code (see 8c74b240). It fixes the code to effectively
make sure a re-connect is continued once it has been started.
So this change should fix the re-connect not working in
certain cases.