Fix typos found via `codespell --skip .git -w`
This commit is contained in:
parent
9f7a19eabc
commit
0ef3b80447
20
README.md
20
README.md
|
@ -168,7 +168,7 @@ it is usually started via "socket activation" (e.g. `/usr/lib/systemd/user/dbus.
|
||||||
D-Bus).
|
D-Bus).
|
||||||
|
|
||||||
All of this counts for the session D-Bus *and* for the system D-Bus although the startup of the session
|
All of this counts for the session D-Bus *and* for the system D-Bus although the startup of the session
|
||||||
D-Bus can be screwed up particularily easy. One easy way to screw it up is to start a second instance of
|
D-Bus can be screwed up particularly easy. One easy way to screw it up is to start a second instance of
|
||||||
the session D-Bus manually e.g. via `dbus-run-session`. When starting the session D-Bus this way the
|
the session D-Bus manually e.g. via `dbus-run-session`. When starting the session D-Bus this way the
|
||||||
systemd integration will *not* work and you will likely end up with two session D-Bus processes. It is
|
systemd integration will *not* work and you will likely end up with two session D-Bus processes. It is
|
||||||
also worth noticing that you do *not* need to set the `DBUS_SESSION_BUS_ADDRESS` variable manually
|
also worth noticing that you do *not* need to set the `DBUS_SESSION_BUS_ADDRESS` variable manually
|
||||||
|
@ -179,7 +179,7 @@ Note that the Plasma Wayland session screwed things up in the way I've described
|
||||||
but this change might not be available on older distributions.
|
but this change might not be available on older distributions.
|
||||||
|
|
||||||
### Build-time configuration
|
### Build-time configuration
|
||||||
The systemd integration can be explicitely enabled/disabled add compile time by adding
|
The systemd integration can be explicitly enabled/disabled add compile time by adding
|
||||||
`-DSYSTEMD_SUPPORT=ON/OFF` to the CMake arguments. If the systemd integration does not work be sure your
|
`-DSYSTEMD_SUPPORT=ON/OFF` to the CMake arguments. If the systemd integration does not work be sure your
|
||||||
version of Syncthing Tray has been compiled with systemd support.
|
version of Syncthing Tray has been compiled with systemd support.
|
||||||
|
|
||||||
|
@ -245,20 +245,20 @@ See the release section on GitHub.
|
||||||
|
|
||||||
## Build instructions
|
## Build instructions
|
||||||
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities) and
|
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities) and
|
||||||
[qtutilities](https://github.com/Martchus/qtutilities) and is built the same way as these libaries.
|
[qtutilities](https://github.com/Martchus/qtutilities) and is built the same way as these libraries.
|
||||||
For basic instructions checkout the README file of [c++utilities](https://github.com/Martchus/cpp-utilities).
|
For basic instructions checkout the README file of [c++utilities](https://github.com/Martchus/cpp-utilities).
|
||||||
For building this straight, see the section below. There's also documentation about
|
For building this straight, see the section below. There's also documentation about
|
||||||
[various build variables](https://github.com/Martchus/cpp-utilities/blob/master/doc/buildvariables.md) which
|
[various build variables](https://github.com/Martchus/cpp-utilities/blob/master/doc/buildvariables.md) which
|
||||||
can be passed to CMake to influence the build.
|
can be passed to CMake to influence the build.
|
||||||
|
|
||||||
### Further dependencies
|
### Further dependencies
|
||||||
The following Qt modules are requried (version 5.6 or newer): core network dbus gui widgets svg webenginewidgets/webkitwidgets
|
The following Qt modules are required (version 5.6 or newer): core network dbus gui widgets svg webenginewidgets/webkitwidgets
|
||||||
|
|
||||||
It is recommended to use at least Qt 5.14 to avoid limitations in previous versions (see *Known bugs* section).
|
It is recommended to use at least Qt 5.14 to avoid limitations in previous versions (see *Known bugs* section).
|
||||||
|
|
||||||
The built-in web view and therefore the modules webenginewidgets/webkitwidgets are optional (see section *Select Qt module for WebView*).
|
The built-in web view and therefore the modules webenginewidgets/webkitwidgets are optional (see section *Select Qt module for WebView*).
|
||||||
|
|
||||||
To build the plugin for Dolphin integration KIO is also requried. Additionally, the Dolphin plugin requires Qt 5.8 or newer. To skip
|
To build the plugin for Dolphin integration KIO is also required. Additionally, the Dolphin plugin requires Qt 5.8 or newer. To skip
|
||||||
building the plugin, add `-DNO_FILE_ITEM_ACTION_PLUGIN:BOOL=ON` to the CMake arguments.
|
building the plugin, add `-DNO_FILE_ITEM_ACTION_PLUGIN:BOOL=ON` to the CMake arguments.
|
||||||
|
|
||||||
To build the Plasmoid for the Plasma 5 desktop, the Qt module QML and the KF5 module
|
To build the Plasmoid for the Plasma 5 desktop, the Qt module QML and the KF5 module
|
||||||
|
@ -287,7 +287,7 @@ Building the testsuite requires CppUnit and Qt 5.8 or higher.
|
||||||
|
|
||||||
### Building this straight
|
### Building this straight
|
||||||
0. Install (preferably the latest version of) the CGG toolchain or Clang, the required Qt modules and CMake.
|
0. Install (preferably the latest version of) the CGG toolchain or Clang, the required Qt modules and CMake.
|
||||||
1. Get the sources. For the lastest version from Git clone the following repositories:
|
1. Get the sources. For the latest version from Git clone the following repositories:
|
||||||
```
|
```
|
||||||
cd $SOURCES
|
cd $SOURCES
|
||||||
git clone https://github.com/Martchus/cpp-utilities.git c++utilities
|
git clone https://github.com/Martchus/cpp-utilities.git c++utilities
|
||||||
|
@ -360,7 +360,7 @@ specify the directory manually, e.g. for Tumbleweed one would add
|
||||||
|
|
||||||
Also be sure that the version of the plasma framework the plasmoid was built against is *not* newer
|
Also be sure that the version of the plasma framework the plasmoid was built against is *not* newer
|
||||||
than the version actually installed on the system. That can for instance easily happen when using
|
than the version actually installed on the system. That can for instance easily happen when using
|
||||||
`tumbleweed-cli` for sticking to a previous snapshot but having the lastest version of the plasmoid
|
`tumbleweed-cli` for sticking to a previous snapshot but having the latest version of the plasmoid
|
||||||
from my home repository installed.
|
from my home repository installed.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -410,11 +410,11 @@ Translations for further locales can be added quite easily:
|
||||||
|
|
||||||
### Using backend libraries
|
### Using backend libraries
|
||||||
The contained backend libraries (which provide connecting to Syncthing, data models and more) are written for internal
|
The contained backend libraries (which provide connecting to Syncthing, data models and more) are written for internal
|
||||||
use whithin the components contained by this repository.
|
use within the components contained by this repository.
|
||||||
|
|
||||||
Hence those libraries do *not* provide a stable ABI/API. If you like to
|
Hence those libraries do *not* provide a stable ABI/API. If you like to
|
||||||
use them to develop Syncthing integration or tooling with Qt and C++, it makes most sense to contribute it as an additional component
|
use them to develop Syncthing integration or tooling with Qt and C++, it makes most sense to contribute it as an additional component
|
||||||
directly to this repository. Then I will be able to take it into account when changeing the API.
|
directly to this repository. Then I will be able to take it into account when changing the API.
|
||||||
|
|
||||||
### KDE integration
|
### KDE integration
|
||||||
Since the Dolphin integration and the Plasmoid are plugins, testing and debugging requires a few extra steps.
|
Since the Dolphin integration and the Plasmoid are plugins, testing and debugging requires a few extra steps.
|
||||||
|
@ -428,7 +428,7 @@ It is possible to turn on logging of the underlying library by setting environme
|
||||||
* `LIB_SYNCTHING_CONNECTOR_LOG_API_CALLS`: log calls to Syncthing's REST-API
|
* `LIB_SYNCTHING_CONNECTOR_LOG_API_CALLS`: log calls to Syncthing's REST-API
|
||||||
* `LIB_SYNCTHING_CONNECTOR_LOG_API_REPLIES`: log replies from Syncthing's REST-API (except events)
|
* `LIB_SYNCTHING_CONNECTOR_LOG_API_REPLIES`: log replies from Syncthing's REST-API (except events)
|
||||||
* `LIB_SYNCTHING_CONNECTOR_LOG_EVENTS`: log events emitted by Syncthing's events REST-API endpoint
|
* `LIB_SYNCTHING_CONNECTOR_LOG_EVENTS`: log events emitted by Syncthing's events REST-API endpoint
|
||||||
* `LIB_SYNCTHING_CONNECTOR_LOG_DIRS_OR_DEVS_RESETTED`: log when directories/devices are internally resetted
|
* `LIB_SYNCTHING_CONNECTOR_LOG_DIRS_OR_DEVS_RESETTED`: log when directories/devices are internally reset
|
||||||
|
|
||||||
## Planned features
|
## Planned features
|
||||||
The tray is still under development; the following features are under construction or planned:
|
The tray is still under development; the following features are under construction or planned:
|
||||||
|
|
|
@ -33,7 +33,7 @@ Args::Args()
|
||||||
{ "number" })
|
{ "number" })
|
||||||
, timeout("timeout", 't', "specifies how many milliseconds to wait at most", { "number" })
|
, timeout("timeout", 't', "specifies how many milliseconds to wait at most", { "number" })
|
||||||
, editor("editor", '\0', "specifies the editor to be opened", { "editor name", "editor option" })
|
, editor("editor", '\0', "specifies the editor to be opened", { "editor name", "editor option" })
|
||||||
, configFile("config-file", 'f', "specifies the Syncthing config file to read API key and URL from, when not explicitely specified", { "path" })
|
, configFile("config-file", 'f', "specifies the Syncthing config file to read API key and URL from, when not explicitly specified", { "path" })
|
||||||
, apiKey("api-key", 'k', "specifies the API key", { "key" })
|
, apiKey("api-key", 'k', "specifies the API key", { "key" })
|
||||||
, url("url", 'u', "specifies the Syncthing URL, default is http://localhost:8080", { "URL" })
|
, url("url", 'u', "specifies the Syncthing URL, default is http://localhost:8080", { "URL" })
|
||||||
, credentials("credentials", 'c', "specifies user name and password", { "user name", "password" })
|
, credentials("credentials", 'c', "specifies user name and password", { "user name", "password" })
|
||||||
|
|
|
@ -77,7 +77,7 @@ if (USE_BOOST_PROCESS)
|
||||||
use_package(TARGET_NAME Threads::Threads PACKAGE_NAME Threads PACKAGE_ARGS REQUIRED)
|
use_package(TARGET_NAME Threads::Threads PACKAGE_NAME Threads PACKAGE_ARGS REQUIRED)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# link also explicitely against the following Qt modules
|
# link also explicitly against the following Qt modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network)
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
||||||
set(META_PUBLIC_QT_MODULES Core ${ADDITIONAL_QT_MODULES})
|
set(META_PUBLIC_QT_MODULES Core ${ADDITIONAL_QT_MODULES})
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,11 @@ QNetworkAccessManager &networkAccessManager()
|
||||||
* \remarks All requests are performed asynchronously.
|
* \remarks All requests are performed asynchronously.
|
||||||
*
|
*
|
||||||
* The first thing to do when working with that class is setting the URL to connect to and the API key
|
* The first thing to do when working with that class is setting the URL to connect to and the API key
|
||||||
* via the constructor or setSyncthingUrl() and setApiKey(). Credentials for the HTTP authentification
|
* via the constructor or setSyncthingUrl() and setApiKey(). Credentials for the HTTP authentication
|
||||||
* can be set via setCredentials() if not included in the URL.
|
* can be set via setCredentials() if not included in the URL.
|
||||||
*
|
*
|
||||||
* Requests can then be done via the request...() methods, eg. requestConfig(). This would emit the
|
* Requests can then be done via the request...() methods, eg. requestConfig(). This would emit the
|
||||||
* newConfig() signal on success and the error() signal when an error occured. The other request...()
|
* newConfig() signal on success and the error() signal when an error occurred. The other request...()
|
||||||
* methods work in a similar way.
|
* methods work in a similar way.
|
||||||
*
|
*
|
||||||
* However, usually it is best to simply call the connect() method. It will do all required requests
|
* However, usually it is best to simply call the connect() method. It will do all required requests
|
||||||
|
@ -313,7 +313,7 @@ void SyncthingConnection::disconnect()
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Aborts status-relevant, pending requests.
|
* \brief Aborts status-relevant, pending requests.
|
||||||
* \remarks Status-relevant means that requests for tiggering actions like rescan() or restart() are excluded. requestQrCode() does not
|
* \remarks Status-relevant means that requests for triggering actions like rescan() or restart() are excluded. requestQrCode() does not
|
||||||
* contribute to the status as well and is excluded as well.
|
* contribute to the status as well and is excluded as well.
|
||||||
*/
|
*/
|
||||||
void SyncthingConnection::abortAllRequests()
|
void SyncthingConnection::abortAllRequests()
|
||||||
|
@ -1002,7 +1002,7 @@ void SyncthingConnection::handleFatalConnectionError()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Handles cancelation of additional requests done via continueConnecting() method.
|
* \brief Handles cancellation of additional requests done via continueConnecting() method.
|
||||||
*/
|
*/
|
||||||
void SyncthingConnection::handleAdditionalRequestCanceled()
|
void SyncthingConnection::handleAdditionalRequestCanceled()
|
||||||
{
|
{
|
||||||
|
@ -1119,25 +1119,25 @@ void SyncthingConnection::recalculateStatus()
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \fn SyncthingConnection::newConfigTriggered()
|
* \fn SyncthingConnection::newConfigTriggered()
|
||||||
* \brief Indicates a new configuration has posted sucessfully via postConfig().
|
* \brief Indicates a new configuration has posted successfully via postConfig().
|
||||||
* \remarks In contrast to newConfig(), this signal is only emitted for configuration changes internally posted via postConfig().
|
* \remarks In contrast to newConfig(), this signal is only emitted for configuration changes internally posted via postConfig().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \fn SyncthingConnection::rescanTriggered()
|
* \fn SyncthingConnection::rescanTriggered()
|
||||||
* \brief Indicates a rescan has been triggered sucessfully.
|
* \brief Indicates a rescan has been triggered successfully.
|
||||||
* \remarks Only emitted for rescans triggered internally via rescan() or rescanAll().
|
* \remarks Only emitted for rescans triggered internally via rescan() or rescanAll().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \fn SyncthingConnection::pauseTriggered()
|
* \fn SyncthingConnection::pauseTriggered()
|
||||||
* \brief Indicates a device has been paused sucessfully.
|
* \brief Indicates a device has been paused successfully.
|
||||||
* \remarks Only emitted for pausing triggered internally via pause() or pauseAll().
|
* \remarks Only emitted for pausing triggered internally via pause() or pauseAll().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \fn SyncthingConnection::resumeTriggered()
|
* \fn SyncthingConnection::resumeTriggered()
|
||||||
* \brief Indicates a device has been resumed sucessfully.
|
* \brief Indicates a device has been resumed successfully.
|
||||||
* \remarks Only emitted for resuming triggered internally via resume() or resumeAll().
|
* \remarks Only emitted for resuming triggered internally via resume() or resumeAll().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ enum class SyncthingConnectionLoggingFlags : quint64 {
|
||||||
ApiCalls = (1 << 1), /**< log calls to Syncthing's REST-API and responses */
|
ApiCalls = (1 << 1), /**< log calls to Syncthing's REST-API and responses */
|
||||||
ApiReplies = (1 << 2), /**< log replies fromm Syncthing's REST-API */
|
ApiReplies = (1 << 2), /**< log replies fromm Syncthing's REST-API */
|
||||||
Events = (1 << 3), /**< log events received via Syncthing's event API */
|
Events = (1 << 3), /**< log events received via Syncthing's event API */
|
||||||
DirsOrDevsResetted = (1 << 4), /**< log list of directories/devices when list is resetted */
|
DirsOrDevsResetted = (1 << 4), /**< log list of directories/devices when list is reset */
|
||||||
All = ApiCalls | ApiReplies | Events | DirsOrDevsResetted, /** log as much as possible */
|
All = ApiCalls | ApiReplies | Events | DirsOrDevsResetted, /** log as much as possible */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ inline SyncthingStatus SyncthingConnection::status() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns whether the connection to Syncthing has been established.
|
* \brief Returns whether the connection to Syncthing has been established.
|
||||||
*
|
*
|
||||||
* If ture, all information like dirInfo() and devInfo() has been populated and will be updated if it changes.
|
* If true, all information like dirInfo() and devInfo() has been populated and will be updated if it changes.
|
||||||
*/
|
*/
|
||||||
inline bool SyncthingConnection::isConnected() const
|
inline bool SyncthingConnection::isConnected() const
|
||||||
{
|
{
|
||||||
|
@ -534,7 +534,7 @@ inline void SyncthingConnection::setRequestingCompletionEnabled(bool requestingC
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Interanlly called to emit the notification with the specified \a message.
|
* \brief Internally called to emit the notification with the specified \a message.
|
||||||
* \remarks Ensures the unread notifications flag is set.
|
* \remarks Ensures the unread notifications flag is set.
|
||||||
*/
|
*/
|
||||||
inline void SyncthingConnection::emitNotification(CppUtilities::DateTime when, const QString &message)
|
inline void SyncthingConnection::emitNotification(CppUtilities::DateTime when, const QString &message)
|
||||||
|
|
|
@ -834,7 +834,7 @@ void SyncthingConnection::readErrors()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore any errors occured before connecting
|
// ignore any errors occurred before connecting
|
||||||
if (m_lastErrorTime.isNull()) {
|
if (m_lastErrorTime.isNull()) {
|
||||||
m_lastErrorTime = DateTime::now();
|
m_lastErrorTime = DateTime::now();
|
||||||
}
|
}
|
||||||
|
@ -1342,7 +1342,7 @@ void SyncthingConnection::readLog()
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Posts the specified \a rawConfig.
|
* \brief Posts the specified \a rawConfig.
|
||||||
* \remarks The signal newConfigTriggered() is emitted when the config has been posted sucessfully. In the error case, error() is emitted.
|
* \remarks The signal newConfigTriggered() is emitted when the config has been posted successfully. In the error case, error() is emitted.
|
||||||
* Besides, the newConfig() signal should be emitted as well, indicating Syncthing has actually applied the new configuration.
|
* Besides, the newConfig() signal should be emitted as well, indicating Syncthing has actually applied the new configuration.
|
||||||
*/
|
*/
|
||||||
void SyncthingConnection::postConfigFromJsonObject(const QJsonObject &rawConfig)
|
void SyncthingConnection::postConfigFromJsonObject(const QJsonObject &rawConfig)
|
||||||
|
@ -1354,7 +1354,7 @@ void SyncthingConnection::postConfigFromJsonObject(const QJsonObject &rawConfig)
|
||||||
/*!
|
/*!
|
||||||
* \brief Posts the specified \a rawConfig.
|
* \brief Posts the specified \a rawConfig.
|
||||||
* \param rawConfig A valid JSON document containing the configuration. It is directly passed to Syncthing.
|
* \param rawConfig A valid JSON document containing the configuration. It is directly passed to Syncthing.
|
||||||
* \remarks The signal newConfigTriggered() is emitted when the config has been posted sucessfully. In the error case, error() is emitted.
|
* \remarks The signal newConfigTriggered() is emitted when the config has been posted successfully. In the error case, error() is emitted.
|
||||||
* Besides, the newConfig() signal should be emitted as well, indicating Syncthing has actually applied the new configuration.
|
* Besides, the newConfig() signal should be emitted as well, indicating Syncthing has actually applied the new configuration.
|
||||||
*/
|
*/
|
||||||
void SyncthingConnection::postConfigFromByteArray(const QByteArray &rawConfig)
|
void SyncthingConnection::postConfigFromByteArray(const QByteArray &rawConfig)
|
||||||
|
|
|
@ -36,7 +36,7 @@ string readMockFile(const string &filePath)
|
||||||
try {
|
try {
|
||||||
return readFile(filePath);
|
return readFile(filePath);
|
||||||
} catch (const std::ios_base::failure &failure) {
|
} catch (const std::ios_base::failure &failure) {
|
||||||
cerr << Phrases::Error << "An IO error occured when reading mock config file \"" << filePath << "\": " << failure.what() << Phrases::EndFlush;
|
cerr << Phrases::Error << "An IO error occurred when reading mock config file \"" << filePath << "\": " << failure.what() << Phrases::EndFlush;
|
||||||
exit(-2);
|
exit(-2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ inline void SyncthingNotifier::setEnabledNotifications(SyncthingHighLevelNotific
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the number of seconds after startup or standby-wakeup to supress disconnect notifications.
|
* \brief Returns the number of seconds after startup or standby-wakeup to suppress disconnect notifications.
|
||||||
*/
|
*/
|
||||||
inline unsigned int SyncthingNotifier::ignoreInavailabilityAfterStart() const
|
inline unsigned int SyncthingNotifier::ignoreInavailabilityAfterStart() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,7 +116,7 @@ SyncthingProcess::~SyncthingProcess()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Splits the given arguments similar to how a shell would split it. So whitespaces are considered seperators unless quotes are used.
|
* \brief Splits the given arguments similar to how a shell would split it. So whitespaces are considered separators unless quotes are used.
|
||||||
*/
|
*/
|
||||||
QStringList SyncthingProcess::splitArguments(const QString &arguments)
|
QStringList SyncthingProcess::splitArguments(const QString &arguments)
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,7 +124,7 @@ inline bool SyncthingProcess::isActiveFor(unsigned int atLeastSeconds) const
|
||||||
|
|
||||||
/// \brief Returns whether the process has been manually stopped via SyncthingProcess::stopSyncthing(), SyncthingProcess::killSyncthing()
|
/// \brief Returns whether the process has been manually stopped via SyncthingProcess::stopSyncthing(), SyncthingProcess::killSyncthing()
|
||||||
/// or SyncthingProcess::restartSyncthing().
|
/// or SyncthingProcess::restartSyncthing().
|
||||||
/// \remarks Resetted on SyncthingProcess::startSyncthing() and SyncthingProcess::restartSyncthing().
|
/// \remarks Reset on SyncthingProcess::startSyncthing() and SyncthingProcess::restartSyncthing().
|
||||||
inline bool SyncthingProcess::isManuallyStopped() const
|
inline bool SyncthingProcess::isManuallyStopped() const
|
||||||
{
|
{
|
||||||
return m_manuallyStopped;
|
return m_manuallyStopped;
|
||||||
|
|
|
@ -291,7 +291,7 @@ void SyncthingService::setScopeAndUnitName(SystemdScope scope, const QString &un
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns whether systemd (and specificly its D-Bus interface for user services) is available.
|
* \brief Returns whether systemd (and specifically its D-Bus interface for user services) is available.
|
||||||
* \remarks The availability might not be instantly detected and may change at any time. Use the systemdAvailableChanged()
|
* \remarks The availability might not be instantly detected and may change at any time. Use the systemdAvailableChanged()
|
||||||
* to react to availability changes.
|
* to react to availability changes.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -337,9 +337,9 @@ void ConnectionTests::testErrorCases()
|
||||||
// check whether Syncthing is available
|
// check whether Syncthing is available
|
||||||
if ((errorMessage == QStringLiteral("Unable to request Syncthing status: Connection refused"))
|
if ((errorMessage == QStringLiteral("Unable to request Syncthing status: Connection refused"))
|
||||||
|| (errorMessage == QStringLiteral("Unable to request Syncthing config: Connection refused"))) {
|
|| (errorMessage == QStringLiteral("Unable to request Syncthing config: Connection refused"))) {
|
||||||
// consider test failed if we receive "Connection refused" when another error has already occured
|
// consider test failed if we receive "Connection refused" when another error has already occurred
|
||||||
if (syncthingAvailable) {
|
if (syncthingAvailable) {
|
||||||
CPPUNIT_FAIL("Syncthing became unavailable after another error had already occured");
|
CPPUNIT_FAIL("Syncthing became unavailable after another error had already occurred");
|
||||||
}
|
}
|
||||||
|
|
||||||
// consider test failed if Syncthing takes too long to come up (or we fail to connect)
|
// consider test failed if Syncthing takes too long to come up (or we fail to connect)
|
||||||
|
|
|
@ -143,13 +143,13 @@ void MiscTests::testUtils()
|
||||||
|
|
||||||
#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD
|
#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD
|
||||||
/*!
|
/*!
|
||||||
* \brief Tests SyncthingService class, but error case with non-existant service so far.
|
* \brief Tests SyncthingService class, but error case with non-existent service so far.
|
||||||
*/
|
*/
|
||||||
void MiscTests::testService()
|
void MiscTests::testService()
|
||||||
{
|
{
|
||||||
SyncthingService service;
|
SyncthingService service;
|
||||||
service.isSystemdAvailable();
|
service.isSystemdAvailable();
|
||||||
service.setUnitName(QStringLiteral("non-existant.service"));
|
service.setUnitName(QStringLiteral("non-existent.service"));
|
||||||
CPPUNIT_ASSERT(!service.isUnitAvailable());
|
CPPUNIT_ASSERT(!service.isUnitAvailable());
|
||||||
CPPUNIT_ASSERT_EQUAL(QString(), service.description());
|
CPPUNIT_ASSERT_EQUAL(QString(), service.description());
|
||||||
CPPUNIT_ASSERT(!service.isRunning());
|
CPPUNIT_ASSERT(!service.isRunning());
|
||||||
|
|
|
@ -61,7 +61,7 @@ QString directoryStatusString(const SyncthingStatistics &stats)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the "sync complete" notication message for the specified directories.
|
* \brief Returns the "sync complete" notification message for the specified directories.
|
||||||
*/
|
*/
|
||||||
QString syncCompleteString(const std::vector<const SyncthingDir *> &completedDirs, const SyncthingDev *remoteDevice)
|
QString syncCompleteString(const std::vector<const SyncthingDir *> &completedDirs, const SyncthingDev *remoteDevice)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ use_syncthingconnector()
|
||||||
find_package(syncthingmodel ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingmodel ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingmodel()
|
use_syncthingmodel()
|
||||||
|
|
||||||
# link also explicitely against the following Qt and KF modules
|
# link also explicitly against the following Qt and KF modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network)
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
||||||
list(APPEND ADDITIONAL_KF_MODULES KIO)
|
list(APPEND ADDITIONAL_KF_MODULES KIO)
|
||||||
set(KIO_MODULE_TARGETS KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM)
|
set(KIO_MODULE_TARGETS KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM)
|
||||||
|
|
|
@ -155,7 +155,7 @@ QList<QAction *> SyncthingFileItemAction::createActions(const KFileItemListPrope
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add actions for explicitely selected Syncthing dirs
|
// add actions for explicitly selected Syncthing dirs
|
||||||
if (!detectedDirs.isEmpty()) {
|
if (!detectedDirs.isEmpty()) {
|
||||||
|
|
||||||
// rescan item
|
// rescan item
|
||||||
|
|
|
@ -173,7 +173,7 @@ void InterfaceTests::testRun(const std::function<long long()> &runFunction, bool
|
||||||
const auto timeout((DateTime::gmtNow() - startTime) > TimeSpan::fromSeconds(30));
|
const auto timeout((DateTime::gmtNow() - startTime) > TimeSpan::fromSeconds(30));
|
||||||
if (!timeout && (!myIdAnnounced || !performanceAnnounced || (assertTestConfig && (!testDir1Ready || !testDev1Ready || !testDev2Ready)))) {
|
if (!timeout && (!myIdAnnounced || !performanceAnnounced || (assertTestConfig && (!testDir1Ready || !testDev1Ready || !testDev2Ready)))) {
|
||||||
// log status
|
// log status
|
||||||
cout << "still wating for:";
|
cout << "still waiting for:";
|
||||||
if (!myIdAnnounced) {
|
if (!myIdAnnounced) {
|
||||||
cout << " myIdAnnounced";
|
cout << " myIdAnnounced";
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ use_qt_utilities()
|
||||||
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingconnector(VISIBILITY PUBLIC)
|
use_syncthingconnector(VISIBILITY PUBLIC)
|
||||||
|
|
||||||
# link also explicitely against the following Qt modules
|
# link also explicitly against the following Qt modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network Gui Widgets Svg)
|
list(APPEND ADDITIONAL_QT_MODULES Network Gui Widgets Svg)
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
|
|
|
@ -28,7 +28,7 @@ use_syncthingmodel()
|
||||||
find_package(syncthingwidgets ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingwidgets ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingwidgets()
|
use_syncthingwidgets()
|
||||||
|
|
||||||
# link also explicitely against the following Qt modules
|
# link also explicitly against the following Qt modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network Qml)
|
list(APPEND ADDITIONAL_QT_MODULES Network Qml)
|
||||||
list(APPEND ADDITIONAL_KF_MODULES Plasma)
|
list(APPEND ADDITIONAL_KF_MODULES Plasma)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||||
set(META_PROJECT_NAME syncthingtesthelper)
|
set(META_PROJECT_NAME syncthingtesthelper)
|
||||||
set(META_PROJECT_TYPE library)
|
set(META_PROJECT_TYPE library)
|
||||||
set(META_APP_NAME "Syncthing Tray Test Helper")
|
set(META_APP_NAME "Syncthing Tray Test Helper")
|
||||||
set(META_APP_DESCRIPTION "Helper for testing compontents of Syncthing Tray")
|
set(META_APP_DESCRIPTION "Helper for testing components of Syncthing Tray")
|
||||||
set(META_PUBLIC_QT_MODULES Core)
|
set(META_PUBLIC_QT_MODULES Core)
|
||||||
set(META_NO_INSTALL_TARGETS ON)
|
set(META_NO_INSTALL_TARGETS ON)
|
||||||
set(META_NO_CPP_UNIT ON)
|
set(META_NO_CPP_UNIT ON)
|
||||||
|
@ -35,7 +35,7 @@ list(APPEND CMAKE_MODULE_PATH ${QT_UTILITIES_MODULE_DIRS})
|
||||||
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingconnector()
|
use_syncthingconnector()
|
||||||
|
|
||||||
# link also explicitely against the following Qt modules
|
# link also explicitly against the following Qt modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network)
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
|
|
|
@ -341,7 +341,7 @@ template <typename Action, typename... Signalinfo> bool waitForSignals(Action ac
|
||||||
* \brief Waits until the specified signals have been emitted when performing async operations triggered by \a action. Aborts when \a failure is emitted.
|
* \brief Waits until the specified signals have been emitted when performing async operations triggered by \a action. Aborts when \a failure is emitted.
|
||||||
* \arg action Specifies a method to trigger the action to run when waiting.
|
* \arg action Specifies a method to trigger the action to run when waiting.
|
||||||
* \arg timeout Specifies the max. time to wait in ms. Set to zero to wait forever.
|
* \arg timeout Specifies the max. time to wait in ms. Set to zero to wait forever.
|
||||||
* \arg failure Specifies the signal indicating an error occured.
|
* \arg failure Specifies the signal indicating an error occurred.
|
||||||
* \arg signalinfo Specifies the signals to wait for.
|
* \arg signalinfo Specifies the signals to wait for.
|
||||||
* \throws Fails if not all signals have been emitted in at least \a timeout milliseconds or when at least one of the
|
* \throws Fails if not all signals have been emitted in at least \a timeout milliseconds or when at least one of the
|
||||||
* required connections can not be established.
|
* required connections can not be established.
|
||||||
|
@ -384,14 +384,14 @@ bool waitForSignalsOrFail(Action action, int timeout, const SignalInfo &failure,
|
||||||
} while (!(failureEmitted = checkWhetherAllSignalsEmitted(failure)) && !(allSignalsEmitted = checkWhetherAllSignalsEmitted(signalinfo...))
|
} while (!(failureEmitted = checkWhetherAllSignalsEmitted(failure)) && !(allSignalsEmitted = checkWhetherAllSignalsEmitted(signalinfo...))
|
||||||
&& (!timeout || timer.isActive()));
|
&& (!timeout || timer.isActive()));
|
||||||
|
|
||||||
// check whether a timeout occured
|
// check whether a timeout occurred
|
||||||
const bool timeoutFailed(!allSignalsEmitted && timeout && !timer.isActive());
|
const bool timeoutFailed(!allSignalsEmitted && timeout && !timer.isActive());
|
||||||
#ifndef SYNCTHINGTESTHELPER_FOR_CLI
|
#ifndef SYNCTHINGTESTHELPER_FOR_CLI
|
||||||
if (failureEmitted) {
|
if (failureEmitted) {
|
||||||
CPPUNIT_FAIL(
|
CPPUNIT_FAIL(
|
||||||
argsToString("Signal(s) ", failedSignalNames(signalinfo...).data(), " has/have not emmitted before ", failure.signalName().data(), '.'));
|
argsToString("Signal(s) ", failedSignalNames(signalinfo...).data(), " has/have not emitted before ", failure.signalName().data(), '.'));
|
||||||
} else if (timeoutFailed) {
|
} else if (timeoutFailed) {
|
||||||
CPPUNIT_FAIL(argsToString("Signal(s) ", failedSignalNames(signalinfo...).data(), " has/have not emmitted within at least ", timer.interval(),
|
CPPUNIT_FAIL(argsToString("Signal(s) ", failedSignalNames(signalinfo...).data(), " has/have not emitted within at least ", timer.interval(),
|
||||||
" ms (set environment variable SYNCTHING_TEST_TIMEOUT_FACTOR to increase the timeout).",
|
" ms (set environment variable SYNCTHING_TEST_TIMEOUT_FACTOR to increase the timeout).",
|
||||||
timeoutFactor != 1.0 ? argsToString(" (original timeout: ", timeout, " ms)") : std::string()));
|
timeoutFactor != 1.0 ? argsToString(" (original timeout: ", timeout, " ms)") : std::string()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@ set(ICON_FILES resources/icons/hicolor/scalable/apps/${META_PROJECT_NAME}.svg)
|
||||||
|
|
||||||
set(DOC_FILES README.md)
|
set(DOC_FILES README.md)
|
||||||
|
|
||||||
# declare required icons; used when bundling icon themes
|
# declare required icons; used when bundling icon themes (Icons required by libraries the tray application depends on
|
||||||
# note: Icons required by libraries the tray application depends on need to be specified as well.
|
# need to be specified as well.)
|
||||||
set(REQUIRED_ICONS
|
set(REQUIRED_ICONS
|
||||||
color-profile
|
color-profile
|
||||||
dialog-cancel
|
dialog-cancel
|
||||||
|
@ -112,7 +112,7 @@ use_syncthingmodel()
|
||||||
find_package(syncthingwidgets ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingwidgets ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingwidgets()
|
use_syncthingwidgets()
|
||||||
|
|
||||||
# link also explicitely against the following Qt modules
|
# link also explicitly against the following Qt modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network)
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
||||||
|
|
||||||
# apply basic configuration
|
# apply basic configuration
|
||||||
|
|
|
@ -510,7 +510,7 @@ void TrayWidget::applySettings(const QString &connectionConfig)
|
||||||
m_menu->icon()->updateStatusIconAndText();
|
m_menu->icon()->updateStatusIconAndText();
|
||||||
}
|
}
|
||||||
|
|
||||||
// show warning when explicitely specified connection configuration was not found
|
// show warning when explicitly specified connection configuration was not found
|
||||||
if (!specifiedConnectionConfigFound && !connectionConfig.isEmpty()) {
|
if (!specifiedConnectionConfigFound && !connectionConfig.isEmpty()) {
|
||||||
auto *const msgBox = new QMessageBox(QMessageBox::Warning, QCoreApplication::applicationName(),
|
auto *const msgBox = new QMessageBox(QMessageBox::Warning, QCoreApplication::applicationName(),
|
||||||
tr("The specified connection configuration <em>%1</em> is not defined and hence ignored.").arg(connectionConfig));
|
tr("The specified connection configuration <em>%1</em> is not defined and hence ignored.").arg(connectionConfig));
|
||||||
|
|
|
@ -105,7 +105,7 @@ if (SYNCTHING_WIDGETS_LOG_JAVASCRIPT_CONSOLE)
|
||||||
message(WARNING "JavaScript console of web view will be logged to stderr")
|
message(WARNING "JavaScript console of web view will be logged to stderr")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# link also explicitely against the following Qt modules
|
# link also explicitly against the following Qt modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
|
list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
|
|
|
@ -105,7 +105,7 @@ void InternalErrorsDialog::internalAddError(const InternalError &error)
|
||||||
|
|
||||||
void InternalErrorsDialog::updateStatusLabel()
|
void InternalErrorsDialog::updateStatusLabel()
|
||||||
{
|
{
|
||||||
m_statusLabel->setText(tr("%1 error(s) occured", nullptr, static_cast<int>(min<size_t>(s_internalErrors.size(), numeric_limits<int>::max())))
|
m_statusLabel->setText(tr("%1 error(s) occurred", nullptr, static_cast<int>(min<size_t>(s_internalErrors.size(), numeric_limits<int>::max())))
|
||||||
.arg(s_internalErrors.size()));
|
.arg(s_internalErrors.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ SyncthingLauncher *SyncthingLauncher::s_mainInstance = nullptr;
|
||||||
* \remarks
|
* \remarks
|
||||||
* - This is *not* strictly a singleton class. However, one instance is supposed to be the "main instance" (see SyncthingLauncher::setMainInstance()).
|
* - This is *not* strictly a singleton class. However, one instance is supposed to be the "main instance" (see SyncthingLauncher::setMainInstance()).
|
||||||
* - A SyncthingLauncher instance can only launch one Syncthing instance at a time.
|
* - A SyncthingLauncher instance can only launch one Syncthing instance at a time.
|
||||||
* - Using Syncthing as library is still under development and must be explicitely enabled by setting the CMake variable USE_LIBSYNCTHING.
|
* - Using Syncthing as library is still under development and must be explicitly enabled by setting the CMake variable USE_LIBSYNCTHING.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -120,7 +120,7 @@ inline bool SyncthingLauncher::isActiveFor(unsigned int atLeastSeconds) const
|
||||||
|
|
||||||
/// \brief Returns whether the Syncthing instance has been manually stopped using SyncthingLauncher::terminate()
|
/// \brief Returns whether the Syncthing instance has been manually stopped using SyncthingLauncher::terminate()
|
||||||
/// or SyncthingLauncher::kill().
|
/// or SyncthingLauncher::kill().
|
||||||
/// \remarks This is resetted when calling SyncthingLauncher::launch().
|
/// \remarks This is reset when calling SyncthingLauncher::launch().
|
||||||
inline bool SyncthingLauncher::isManuallyStopped() const
|
inline bool SyncthingLauncher::isManuallyStopped() const
|
||||||
{
|
{
|
||||||
return m_manuallyStopped;
|
return m_manuallyStopped;
|
||||||
|
|
|
@ -62,7 +62,7 @@ QtGui::WebViewDialog::~WebViewDialog()
|
||||||
|
|
||||||
void QtGui::WebViewDialog::applySettings(const Data::SyncthingConnectionSettings &connectionSettings, bool aboutToShow)
|
void QtGui::WebViewDialog::applySettings(const Data::SyncthingConnectionSettings &connectionSettings, bool aboutToShow)
|
||||||
{
|
{
|
||||||
// delete the web view if currently hidden and the configuration to keep it running in the backround isn't enabled
|
// delete the web view if currently hidden and the configuration to keep it running in the background isn't enabled
|
||||||
const auto &settings(Settings::values());
|
const auto &settings(Settings::values());
|
||||||
if (!aboutToShow && !settings.webView.keepRunning && isHidden()) {
|
if (!aboutToShow && !settings.webView.keepRunning && isHidden()) {
|
||||||
deleteLater();
|
deleteLater();
|
||||||
|
|
Loading…
Reference in New Issue