Syncthing added shell completion in v1.27.3-rc.1 (commit
78db3af8c5e8bd08a9773b0c4da233a52ed4cfe6). This change integrates
that shell completion with Syncthing Tray's long existing completion (which
only supports Bash so far).
* 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
* 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
* Allow using icons from freedesktop.org icon theme for most ForkAwesome
icons if available
* Let's not use it for the nested list of details in the models for now
* See https://github.com/Martchus/syncthingtray/issues/121
So far the backend libraries' include paths were relative within this
repository. This means the header files could not be used at their
installed location.
This change replaces them with "<>" includes to fix that problem and adds
a new include directory so building everything at once still works.
With this change it should be easier to actually split some parts into
another repository if this one would become too big.
* Lazy initialize systemd interface and don't initialize it
at all if the unit name is empty
* Allow to supervise/control system-wide units in addition to
user units (see https://github.com/Martchus/syncthingtray/issues/61)
* Avoid redundant code
Add new SyncthingLauncher class which lauches Syncthing
under the hood via external SyncthingProcess or using
libsyncthing.
Note: Launching via libsyncthing is still experimental.
This includes refactoring TrayWidget::applySettings() which
is now a member function and only affects the current instance.
This prevents applying settings on every instance every time
a new tray widget is created.
To apply settings for all tray widgets, the static function
TrayWidget::applySettingsOnAllInstances() is used instead.