Adapt to c++utilities v5

This commit is contained in:
Martchus 2019-03-13 19:12:23 +01:00
parent c34db3eb1c
commit d88df866d2
24 changed files with 76 additions and 106 deletions

View File

@ -34,6 +34,9 @@ option(NO_MODEL "whether building models should be skipped, implies NO_TRAY" OFF
option(NO_WIDGETS "whether building widgets should be skipped, implies NO_TRAY" OFF)
option(NO_PLASMOID "whether building the Plasma 5 plasmoid should be skipped" "${PLASMOID_DISABLED_BY_DEFAULT}")
# allow using non-default configuration
set(CONFIGURATION_PACKAGE_SUFFIX "" CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
# add subdirectories
enable_testing()
add_subdirectory(connector)

View File

@ -14,29 +14,24 @@ set(TEST_HEADER_FILES)
set(TEST_SRC_FILES tests/application.cpp)
# find c++utilities
find_package(c++utilities 4.17.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
use_cpp_utilities()
# find qtutilities
find_package(qtutilities 5.0.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${QT_UTILITIES_MODULE_DIRS})
list(APPEND PRIVATE_INCLUDE_DIRS ${QT_UTILITIES_INCLUDE_DIRS})
# find backend libraries
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
use_syncthingconnector()
find_package(syncthingtesthelper ${META_APP_VERSION} REQUIRED)
if (SYNCTHINGTESTHELPER_HAS_SHARED_LIB)
list(APPEND TEST_LIBRARIES syncthingtesthelper)
elseif (SYNCTHINGTESTHELPER_HAS_STATIC_LIB)
list(APPEND TEST_LIBRARIES syncthingtesthelper_static)
else ()
message(WARNING "Unable to build tests. Testhelper not found.")
endif ()
list(APPEND TEST_LIBRARIES ${SYNCTHINGTESTHELPER_LIB})
# include modules to apply configuration
include(BasicConfig)
include(JsProviderConfig)
include(QtJsProviderConfig)
if (JS_PROVIDER)
list(APPEND HEADER_FILES jsconsole.h)
list(APPEND SRC_FILES jsconsole.cpp)
@ -45,9 +40,7 @@ endif ()
include(QtConfig)
include(WindowsResources)
include(AppTarget)
if (SYNCTHINGTESTHELPER_HAS_SHARED_LIB OR SYNCTHINGTESTHELPER_HAS_STATIC_LIB)
include(TestTarget)
endif ()
include(TestTarget)
include(ShellCompletion)
include(Doxygen)
include(ConfigHeader)

View File

@ -73,9 +73,9 @@ Application::Application()
{
// take ownership over the global QNetworkAccessManager
networkAccessManager().setParent(this);
exitFunction = &exitApplication;
// setup argument callbacks
// setup callbacks
m_args.parser.setExitFunction(&exitApplication);
m_args.status.setCallback(bind(&Application::printStatus, this, _1));
m_args.log.setCallback(bind(&Application::requestLog, this, _1));
m_args.stop.setCallback(bind(&Application::requestShutdown, this, _1));
@ -124,7 +124,7 @@ int Application::exec(int argc, const char *const *argv)
}
// handle help argument
if (m_args.help.isPresent()) {
if (m_args.parser.helpArg().isPresent()) {
m_args.parser.printHelp(cout);
return 0;
}
@ -565,10 +565,10 @@ void Application::printDev(const SyncthingDev *dev) const
printProperty("Client version", dev->clientVersion);
printProperty("Last seen", dev->lastSeen);
if (dev->totalIncomingTraffic > 0) {
printProperty("Incoming traffic", dataSizeToString(static_cast<uint64>(dev->totalIncomingTraffic)).data());
printProperty("Incoming traffic", dataSizeToString(static_cast<std::uint64_t>(dev->totalIncomingTraffic)).data());
}
if (dev->totalOutgoingTraffic > 0) {
printProperty("Outgoing traffic", dataSizeToString(static_cast<uint64>(dev->totalOutgoingTraffic)).data());
printProperty("Outgoing traffic", dataSizeToString(static_cast<std::uint64_t>(dev->totalOutgoingTraffic)).data());
}
cout << '\n';
}

View File

@ -5,8 +5,7 @@
namespace Cli {
Args::Args()
: help(parser)
, status("status", 's', "shows the overall status and/or directory/device specific status")
: status("status", 's', "shows the overall status and/or directory/device specific status")
, log("log", 'l', "shows the Syncthing log")
, stop("stop", '\0', "stops Syncthing")
, restart("restart", '\0', "restarts Syncthing")
@ -75,7 +74,7 @@ Args::Args()
credentials.setExample(PROJECT_NAME " status --dir dir1 --credentials name supersecret");
parser.setMainArguments({ &status, &log, &stop, &restart, &rescan, &rescanAll, &pause, &resume, &waitForIdle, &pwd, &cat, &edit, &configFile,
&apiKey, &url, &credentials, &certificate, &noColor, &help });
&apiKey, &url, &credentials, &certificate, &parser.noColorArg(), &parser.helpArg() });
// allow setting default values via environment
configFile.setEnvironmentVariable("SYNCTHING_CTL_CONFIG_FILE");

View File

@ -10,8 +10,6 @@ using namespace ApplicationUtilities;
struct Args {
Args();
ArgumentParser parser;
HelpArgument help;
NoColorArgument noColor;
OperationArgument status, log, stop, restart, rescan, rescanAll, pause, resume, waitForIdle, pwd, cat, edit;
OperationArgument statusPwd, rescanPwd, pausePwd, resumePwd;
ConfigValueArgument script, jsLines, dryRun;

View File

@ -37,16 +37,13 @@ set(TEST_SRC_FILES tests/connectiontests.cpp tests/misctests.cpp)
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
# find c++utilities
find_package(c++utilities 4.17.0 REQUIRED)
use_cpp_utilities()
set(META_PUBLIC_SHARED_LIB_DEPENDS c++utilities)
set(META_PUBLIC_STATIC_LIB_DEPENDS c++utilities_static)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
use_cpp_utilities(VISIBILITY PUBLIC)
# find qtutilities (only headers and CMake modules used)
find_package(qtutilities 5.0.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${QT_UTILITIES_MODULE_DIRS})
list(APPEND PRIVATE_SHARED_INCLUDE_DIRS ${QT_UTILITIES_INCLUDE_DIRS})
list(APPEND PRIVATE_STATIC_INCLUDE_DIRS ${QT_UTILITIES_INCLUDE_DIRS})
list(APPEND PRIVATE_INCLUDE_DIRS ${QT_UTILITIES_INCLUDE_DIRS})
# link also explicitely against the following Qt 5 modules
list(APPEND ADDITIONAL_QT_MODULES Network)
@ -122,11 +119,7 @@ include(WindowsResources)
include(LibraryTarget)
# link tests against test helper (can't use find_package because testhelper target is not present at this point)
if (BUILD_SHARED_LIBS)
list(APPEND TEST_LIBRARIES syncthingtesthelper)
else ()
list(APPEND TEST_LIBRARIES syncthingtesthelper_static)
endif ()
list(APPEND TEST_LIBRARIES syncthingtesthelper)
include(TestTarget)
include(Doxygen)

View File

@ -133,11 +133,11 @@ public:
// getter for information retrieved from Syncthing
const QString &configDir() const;
const QString &myId() const;
uint64 totalIncomingTraffic() const;
uint64 totalOutgoingTraffic() const;
std::uint64_t totalIncomingTraffic() const;
std::uint64_t totalOutgoingTraffic() const;
double totalIncomingRate() const;
double totalOutgoingRate() const;
static constexpr uint64 unknownTraffic = std::numeric_limits<uint64>::max();
static constexpr std::uint64_t unknownTraffic = std::numeric_limits<std::uint64_t>::max();
const std::vector<SyncthingDir> &dirInfo() const;
const std::vector<SyncthingDev> &devInfo() const;
SyncthingOverallDirStatistics computeOverallDirStatistics() const;
@ -230,7 +230,7 @@ Q_SIGNALS:
void statusChanged(SyncthingStatus newStatus);
void configDirChanged(const QString &newConfigDir);
void myIdChanged(const QString &myNewId);
void trafficChanged(uint64 totalIncomingTraffic, uint64 totalOutgoingTraffic);
void trafficChanged(std::uint64_t totalIncomingTraffic, std::uint64_t totalOutgoingTraffic);
void newConfigTriggered();
void rescanTriggered(const QString &dirId);
void devicePauseTriggered(const QStringList &devIds);
@ -335,8 +335,8 @@ private:
unsigned int m_autoReconnectTries;
QString m_configDir;
QString m_myId;
uint64 m_totalIncomingTraffic;
uint64 m_totalOutgoingTraffic;
std::uint64_t m_totalIncomingTraffic;
std::uint64_t m_totalOutgoingTraffic;
double m_totalIncomingRate;
double m_totalOutgoingRate;
QNetworkReply *m_configReply;
@ -616,7 +616,7 @@ inline const QString &SyncthingConnection::myId() const
/*!
* \brief Returns the total incoming traffic in byte.
*/
inline uint64 SyncthingConnection::totalIncomingTraffic() const
inline std::uint64_t SyncthingConnection::totalIncomingTraffic() const
{
return m_totalIncomingTraffic;
}
@ -624,7 +624,7 @@ inline uint64 SyncthingConnection::totalIncomingTraffic() const
/*!
* \brief Returns the total outgoing traffic in byte.
*/
inline uint64 SyncthingConnection::totalOutgoingTraffic() const
inline std::uint64_t SyncthingConnection::totalOutgoingTraffic() const
{
return m_totalOutgoingTraffic;
}

View File

@ -743,8 +743,8 @@ void SyncthingConnection::readConnections()
// read traffic, the conversion to double is neccassary because toInt() doesn't work for high values
const QJsonValue totalIncomingTrafficValue(totalObj.value(QLatin1String("inBytesTotal")));
const QJsonValue totalOutgoingTrafficValue(totalObj.value(QLatin1String("outBytesTotal")));
const uint64 totalIncomingTraffic = totalIncomingTrafficValue.isDouble() ? jsonValueToInt(totalIncomingTrafficValue) : unknownTraffic;
const uint64 totalOutgoingTraffic = totalOutgoingTrafficValue.isDouble() ? jsonValueToInt(totalOutgoingTrafficValue) : unknownTraffic;
const std::uint64_t totalIncomingTraffic = totalIncomingTrafficValue.isDouble() ? jsonValueToInt(totalIncomingTrafficValue) : unknownTraffic;
const std::uint64_t totalOutgoingTraffic = totalOutgoingTrafficValue.isDouble() ? jsonValueToInt(totalOutgoingTrafficValue) : unknownTraffic;
double transferTime = 0.0;
const bool hasDelta
= !m_lastConnectionsUpdate.isNull() && ((transferTime = (DateTime::gmtNow() - m_lastConnectionsUpdate).totalSeconds()) != 0.0);
@ -1693,11 +1693,11 @@ void SyncthingConnection::readDownloadProgressEvent(DateTime eventTime, const QJ
dirInfo.downloadLabel
= QStringLiteral("%1 / %2 - %3 %")
.arg(QString::fromLatin1(dataSizeToString(dirInfo.blocksAlreadyDownloaded > 0
? static_cast<uint64>(dirInfo.blocksAlreadyDownloaded) * SyncthingItemDownloadProgress::syncthingBlockSize
? static_cast<std::uint64_t>(dirInfo.blocksAlreadyDownloaded) * SyncthingItemDownloadProgress::syncthingBlockSize
: 0)
.data()),
QString::fromLatin1(dataSizeToString(dirInfo.blocksToBeDownloaded > 0
? static_cast<uint64>(dirInfo.blocksToBeDownloaded) * SyncthingItemDownloadProgress::syncthingBlockSize
? static_cast<std::uint64_t>(dirInfo.blocksToBeDownloaded) * SyncthingItemDownloadProgress::syncthingBlockSize
: 0)
.data()),
QString::number(dirInfo.downloadPercentage));

View File

@ -31,8 +31,8 @@ struct LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingDev {
int progressRate = 0;
bool introducer = false;
bool paused = false;
uint64 totalIncomingTraffic = 0;
uint64 totalOutgoingTraffic = 0;
std::uint64_t totalIncomingTraffic = 0;
std::uint64_t totalOutgoingTraffic = 0;
QString connectionAddress;
QString connectionType;
QString clientVersion;

View File

@ -180,13 +180,13 @@ SyncthingItemDownloadProgress::SyncthingItemDownloadProgress(
, blocksReused(values.value(QLatin1String("Reused")).toInt())
, bytesAlreadyHandled(values.value(QLatin1String("BytesDone")).toInt())
, totalNumberOfBytes(values.value(QLatin1String("BytesTotal")).toInt())
, label(
QStringLiteral("%1 / %2 - %3 %")
.arg(QString::fromLatin1(
dataSizeToString(blocksAlreadyDownloaded > 0 ? static_cast<uint64>(blocksAlreadyDownloaded) * syncthingBlockSize : 0).data()),
QString::fromLatin1(
dataSizeToString(totalNumberOfBlocks > 0 ? static_cast<uint64>(totalNumberOfBlocks) * syncthingBlockSize : 0).data()),
QString::number(downloadPercentage)))
, label(QStringLiteral("%1 / %2 - %3 %")
.arg(QString::fromLatin1(
dataSizeToString(blocksAlreadyDownloaded > 0 ? static_cast<std::uint64_t>(blocksAlreadyDownloaded) * syncthingBlockSize : 0)
.data()),
QString::fromLatin1(
dataSizeToString(totalNumberOfBlocks > 0 ? static_cast<std::uint64_t>(totalNumberOfBlocks) * syncthingBlockSize : 0).data()),
QString::number(downloadPercentage)))
{
}

View File

@ -25,7 +25,7 @@ namespace Data {
QString agoString(DateTime dateTime)
{
const TimeSpan delta(DateTime::now() - dateTime);
if (!delta.isNegative() && static_cast<uint64>(delta.totalTicks()) > (TimeSpan::ticksPerMinute / 4uL)) {
if (!delta.isNegative() && static_cast<std::uint64_t>(delta.totalTicks()) > (TimeSpan::ticksPerMinute / 4uL)) {
return QCoreApplication::translate("Data::Utils", "%1 ago")
.arg(QString::fromUtf8(delta.toString(TimeSpanOutputFormat::WithMeasures, true).data()));
} else {
@ -38,7 +38,7 @@ QString agoString(DateTime dateTime)
*
* Eg. "10.2 GiB (45 kib/s)" or only "10.2 GiB" if rate is unknown or "unknown" if both values are unknown.
*/
QString trafficString(uint64 total, double rate)
QString trafficString(std::uint64_t total, double rate)
{
static const QString unknownStr(QCoreApplication::translate("Data::Utils", "unknown"));
if (rate != 0.0) {

View File

@ -3,7 +3,6 @@
#include "./global.h"
#include <c++utilities/conversion/types.h>
#include <c++utilities/misc/traits.h>
#include <QJsonValue>
@ -27,7 +26,7 @@ struct SyncthingDir;
struct SyncthingDev;
QString LIB_SYNCTHING_CONNECTOR_EXPORT agoString(ChronoUtilities::DateTime dateTime);
QString LIB_SYNCTHING_CONNECTOR_EXPORT trafficString(uint64 total, double rate);
QString LIB_SYNCTHING_CONNECTOR_EXPORT trafficString(std::uint64_t total, double rate);
QString LIB_SYNCTHING_CONNECTOR_EXPORT directoryStatusString(const Data::SyncthingStatistics &stats);
QString LIB_SYNCTHING_CONNECTOR_EXPORT syncCompleteString(
const std::vector<const SyncthingDir *> &completedDirs, const SyncthingDev *remoteDevice = nullptr);

View File

@ -22,11 +22,11 @@ set(SRC_FILES
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
# find c++utilities
find_package(c++utilities 4.6.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
# find qtutilities
find_package(qtutilities 5.10.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
use_qt_utilities()
# find backend libraries
@ -35,22 +35,21 @@ use_syncthingconnector()
find_package(syncthingmodel ${META_APP_VERSION} REQUIRED)
use_syncthingmodel()
# link also explicitely against the following Qt 5 modules
# link also explicitely against the following Qt and KF modules
list(APPEND ADDITIONAL_QT_MODULES Network)
list(APPEND ADDITIONAL_KF_MODULES KIO)
set(KIO_MODULE_TARGETS
KF5::KIOCore
KF5::KIOFileWidgets
KF5::KIOWidgets
KF5::KIONTLM
)
# include modules to apply configuration
include(BasicConfig)
include(QtGuiConfig)
include(QtConfig)
include(WindowsResources)
# KIO libs can not be determined automatically
list(REMOVE_ITEM PRIVATE_LIBRARIES KF5::KIO)
list(APPEND PRIVATE_LIBRARIES
KF5::KIOCore
KF5::KIOFileWidgets
KF5::KIOWidgets
KF5::KIONTLM)
include(LibraryTarget)
include(ConfigHeader)

View File

@ -20,6 +20,7 @@
#include <iostream>
#include "resources/config.h"
#include "resources/qtconfig.h"
using namespace std;
using namespace Dialogs;

View File

@ -138,11 +138,10 @@ elseif(UNIX)
endif()
# ensure we can find libsyncthing.h from Syncthing's source tree when building the interface
list(APPEND PRIVATE_SHARED_INCLUDE_DIRS "${SYNCTHING_PATH}/cmd/syncthing")
list(APPEND PRIVATE_STATIC_INCLUDE_DIRS "${SYNCTHING_PATH}/cmd/syncthing")
list(APPEND PRIVATE_INCLUDE_DIRS "${SYNCTHING_PATH}/cmd/syncthing")
# find c++utilities
find_package(c++utilities 4.17.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
list(APPEND PRIVATE_SHARED_INCLUDE_DIRS ${CPP_UTILITIES_INCLUDE_DIRS})
list(APPEND PRIVATE_STATIC_INCLUDE_DIRS ${CPP_UTILITIES_INCLUDE_DIRS})

View File

@ -7,8 +7,6 @@ set(META_APP_NAME "Data models of Syncthing Tray")
set(META_APP_DESCRIPTION "Data models of Syncthing Tray")
set(META_PROJECT_VARNAME_UPPER LIB_SYNCTHING_MODEL)
set(META_PUBLIC_QT_MODULES Gui Widgets)
set(META_PUBLIC_SHARED_LIB_DEPENDS syncthingconnector)
set(META_PUBLIC_STATIC_LIB_DEPENDS syncthingconnector_static)
# add project files
set(HEADER_FILES
@ -31,16 +29,16 @@ set(RES_FILES resources/${META_PROJECT_NAME}icons.qrc)
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
# find c++utilities
find_package(c++utilities 4.0.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
use_cpp_utilities()
# find qtutilities (only CMake modules used)
find_package(qtutilities 5.0.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
use_qt_utilities()
# find backend libraries
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
use_syncthingconnector()
use_syncthingconnector(VISIBILITY PUBLIC)
# link also explicitely against the following Qt 5 modules
list(APPEND ADDITIONAL_QT_MODULES

View File

@ -24,11 +24,11 @@ list(APPEND QML_SRC_FILES ${PLASMOID_FILES})
set(TS_FILES ../translations/${META_PROJECT_NAME}_de_DE.ts ../translations/${META_PROJECT_NAME}_en_US.ts)
# find c++utilities
find_package(c++utilities 4.10.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
# find qtutilities
find_package(qtutilities 5.13.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
use_qt_utilities()
# check whether qtutilities supports DBus notifications

View File

@ -17,6 +17,7 @@
#include "../../connector/utils.h"
#include "resources/config.h"
#include "resources/qtconfig.h"
#include <qtutilities/misc/desktoputils.h>
#include <qtutilities/misc/dialogutils.h>

View File

@ -21,13 +21,11 @@ set(TEST_SRC_FILES tests/manualtesting.cpp)
set(TS_FILES)
# find c++utilities
find_package(c++utilities 4.16.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
use_cpp_utilities()
set(META_PUBLIC_SHARED_LIB_DEPENDS c++utilities)
set(META_PUBLIC_STATIC_LIB_DEPENDS c++utilities_static)
# find qtutilities (only CMake modules used)
find_package(qtutilities 5.0.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${QT_UTILITIES_MODULE_DIRS})
# find syncthingconnector
@ -46,10 +44,5 @@ include(TestTarget)
include(Doxygen)
include(ConfigHeader)
# exclude the targets from 'all' target so it is only built when tests are built
foreach (TESTHELPER_TARGET "${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}"
"${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}_static")
if (TARGET "${TESTHELPER_TARGET}")
set_target_properties("${TESTHELPER_TARGET}" PROPERTIES EXCLUDE_FROM_ALL ON)
endif ()
endforeach ()
# exclude the target from 'all' target so it is only built when tests are built
set_target_properties("${META_TARGET_NAME}" PROPERTIES EXCLUDE_FROM_ALL ON)

View File

@ -81,11 +81,11 @@ set(REQUIRED_ICONS
# fallback icons can not replace built-in Breeze icons (yet) set(FALLBACK_ICON_THEME breeze)
# find c++utilities
find_package(c++utilities 4.11.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
use_cpp_utilities()
# find qtutilities
find_package(qtutilities 5.13.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
use_qt_utilities()
# find backend libraries

View File

@ -120,8 +120,6 @@ int runApplication(int argc, const char *const *argv)
SET_APPLICATION_INFO;
CMD_UTILS_CONVERT_ARGS_TO_UTF8;
ArgumentParser parser;
HelpArgument helpArg(parser);
NoColorArgument noColor;
// Qt configuration arguments
QT_CONFIG_ARGUMENTS qtConfigArgs;
Argument windowedArg("windowed", 'w', "opens the tray menu as a regular window");
@ -141,7 +139,7 @@ int runApplication(int argc, const char *const *argv)
widgetsGuiArg.addSubArgument(&waitForTrayArg);
widgetsGuiArg.addSubArgument(&connectionArg);
parser.setMainArguments({ &qtConfigArgs.qtWidgetsGuiArg(), &noColor, &helpArg });
parser.setMainArguments({ &qtConfigArgs.qtWidgetsGuiArg(), &parser.noColorArg(), &parser.helpArg() });
parser.parseArgsOrExit(argc, argv);
if (!qtConfigArgs.qtWidgetsGuiArg().isPresent()) {
return 0;

View File

@ -30,7 +30,7 @@ SingleInstance::SingleInstance(int argc, const char *const *argv, QObject *paren
cerr << Phrases::Info << "Application already running, sending args to previous instance" << Phrases::EndFlush;
if (argc >= 0 && argc <= 0xFFFF) {
char buffer[2];
BE::getBytes(static_cast<uint16>(argc), buffer);
BE::getBytes(static_cast<std::uint16_t>(argc), buffer);
socket.write(buffer, 2);
*buffer = '\0';
for (const char *const *end = argv + argc; argv != end; ++argv) {

View File

@ -6,8 +6,6 @@ set(META_PROJECT_TYPE library)
set(META_APP_NAME "Widgets of Syncthing Tray")
set(META_PUBLIC_QT_MODULES Gui Widgets)
set(META_WEBVIEW_SRC_DIR webview)
set(META_PUBLIC_SHARED_LIB_DEPENDS syncthingconnector syncthingmodel)
set(META_PUBLIC_STATIC_LIB_DEPENDS syncthingconnector_static syncthingmodel_static)
# add project files
set(WIDGETS_HEADER_FILES
@ -70,18 +68,18 @@ set(REQUIRED_ICONS
go-up)
# find c++utilities
find_package(c++utilities 4.6.0 REQUIRED)
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
use_cpp_utilities()
# find qtutilities
find_package(qtutilities 5.9.0 REQUIRED)
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
use_qt_utilities()
# find backend libraries
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
use_syncthingconnector()
use_syncthingconnector(VISIBILITY PUBLIC)
find_package(syncthingmodel ${META_APP_VERSION} REQUIRED)
use_syncthingmodel()
use_syncthingmodel(VISIBILITY PUBLIC)
# configure libsyncthing
option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launcher" OFF)
@ -104,9 +102,9 @@ list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
# include modules to apply configuration
include(BasicConfig)
include(QtGuiConfig)
include(QtWebViewProviderConfig)
include(QtConfig)
include(WindowsResources)
include(WebViewProviderConfig)
include(LibraryTarget)
include(Doxygen)
include(ConfigHeader)

View File

@ -6,8 +6,6 @@
#include <qtutilities/settingsdialog/qtsettings.h>
#include <c++utilities/conversion/types.h>
#include <QByteArray>
#include <QFrame>
#include <QHash>