From dc7d9b815f022bfd55ac967f3abfb101ead28e37 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 12 Jun 2019 21:00:49 +0200 Subject: [PATCH] Adapt to changes in c++utilities --- cli/application.cpp | 4 ++-- connector/global.h | 4 ++-- connector/syncthingconnection.cpp | 2 +- connector/syncthingconnection_requests.cpp | 6 +++--- connector/syncthingnotifier.cpp | 8 ++++---- fileitemactionplugin/global.h | 4 ++-- fileitemactionplugin/syncthingmenuaction.cpp | 8 ++++---- fileitemactionplugin/syncthingmenuaction.h | 2 +- libsyncthing/global.h | 4 ++-- model/global.h | 4 ++-- model/syncthingdevicemodel.cpp | 2 +- model/syncthingdirectorymodel.cpp | 2 +- plasmoid/lib/global.h | 4 ++-- testhelper/global.h | 4 ++-- widgets/global.h | 4 ++-- widgets/misc/syncthinglauncher.cpp | 10 +++++----- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/cli/application.cpp b/cli/application.cpp index 740e3d1..db4061e 100644 --- a/cli/application.cpp +++ b/cli/application.cpp @@ -294,8 +294,8 @@ void Application::handleResponse() void Application::handleError( const QString &message, SyncthingErrorCategory category, int networkError, const QNetworkRequest &request, const QByteArray &response) { - VAR_UNUSED(category) - VAR_UNUSED(networkError) + CPP_UTILITIES_UNUSED(category) + CPP_UTILITIES_UNUSED(networkError) // skip error handling for shell completion if (!m_argsRead) { diff --git a/connector/global.h b/connector/global.h index 926c206..ddd728b 100644 --- a/connector/global.h +++ b/connector/global.h @@ -10,8 +10,8 @@ #define LIB_SYNCTHING_CONNECTOR_EXPORT #define LIB_SYNCTHING_CONNECTOR_IMPORT #else -#define LIB_SYNCTHING_CONNECTOR_EXPORT LIB_EXPORT -#define LIB_SYNCTHING_CONNECTOR_IMPORT LIB_IMPORT +#define LIB_SYNCTHING_CONNECTOR_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define LIB_SYNCTHING_CONNECTOR_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/connector/syncthingconnection.cpp b/connector/syncthingconnection.cpp index 39715ca..7b2e020 100644 --- a/connector/syncthingconnection.cpp +++ b/connector/syncthingconnection.cpp @@ -765,7 +765,7 @@ void SyncthingConnection::setStatus(SyncthingStatus status) case SyncthingStatus::Disconnected: // disable (long) polling m_keepPolling = false; - FALLTHROUGH; + [[fallthrough]]; case SyncthingStatus::Reconnecting: m_devStatsPollTimer.stop(); m_trafficPollTimer.stop(); diff --git a/connector/syncthingconnection_requests.cpp b/connector/syncthingconnection_requests.cpp index 5377fce..2628c4c 100644 --- a/connector/syncthingconnection_requests.cpp +++ b/connector/syncthingconnection_requests.cpp @@ -1669,7 +1669,7 @@ void SyncthingConnection::readStatusChangedEvent(DateTime eventTime, const QJson */ void SyncthingConnection::readDownloadProgressEvent(DateTime eventTime, const QJsonObject &eventData) { - VAR_UNUSED(eventTime) + CPP_UTILITIES_UNUSED(eventTime) for (SyncthingDir &dirInfo : m_dirs) { // disappearing implies that the download has been finished so just wipe old entries dirInfo.downloadingItems.clear(); @@ -1832,8 +1832,8 @@ void SyncthingConnection::readDeviceEvent(DateTime eventTime, const QString &eve */ void SyncthingConnection::readItemStarted(DateTime eventTime, const QJsonObject &eventData) { - VAR_UNUSED(eventTime) - VAR_UNUSED(eventData) + CPP_UTILITIES_UNUSED(eventTime) + CPP_UTILITIES_UNUSED(eventData) } /*! diff --git a/connector/syncthingnotifier.cpp b/connector/syncthingnotifier.cpp index 9b00b82..66e3d68 100644 --- a/connector/syncthingnotifier.cpp +++ b/connector/syncthingnotifier.cpp @@ -61,7 +61,7 @@ void SyncthingNotifier::handleStatusChangedEvent(SyncthingStatus newStatus) void SyncthingNotifier::handleNewDevEvent(DateTime when, const QString &devId, const QString &address) { - VAR_UNUSED(when) + CPP_UTILITIES_UNUSED(when) // ignore if not enabled if (!(m_enabledNotifications & SyncthingHighLevelNotification::NewDevice)) { @@ -73,7 +73,7 @@ void SyncthingNotifier::handleNewDevEvent(DateTime when, const QString &devId, c void SyncthingNotifier::handleNewDirEvent(DateTime when, const QString &devId, const SyncthingDev *dev, const QString &dirId, const QString &dirLabel) { - VAR_UNUSED(when) + CPP_UTILITIES_UNUSED(when) // ignore if not enabled if (!(m_enabledNotifications & SyncthingHighLevelNotification::NewDir)) { @@ -173,8 +173,8 @@ void SyncthingNotifier::emitConnectedAndDisconnected(SyncthingStatus newStatus) */ void SyncthingNotifier::emitSyncComplete(CppUtilities::DateTime when, const SyncthingDir &dir, int index, const SyncthingDev *remoteDev) { - VAR_UNUSED(when) - VAR_UNUSED(index) + CPP_UTILITIES_UNUSED(when) + CPP_UTILITIES_UNUSED(index) // discard event for paused directories/devices if (dir.paused || (remoteDev && remoteDev->paused)) { diff --git a/fileitemactionplugin/global.h b/fileitemactionplugin/global.h index dd12afe..3ba0408 100644 --- a/fileitemactionplugin/global.h +++ b/fileitemactionplugin/global.h @@ -10,8 +10,8 @@ #define SYNCTHINGFILEITEMACTION_EXPORT #define SYNCTHINGFILEITEMACTION_IMPORT #else -#define SYNCTHINGFILEITEMACTION_EXPORT LIB_EXPORT -#define SYNCTHINGFILEITEMACTION_IMPORT LIB_IMPORT +#define SYNCTHINGFILEITEMACTION_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define SYNCTHINGFILEITEMACTION_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/fileitemactionplugin/syncthingmenuaction.cpp b/fileitemactionplugin/syncthingmenuaction.cpp index 4b0d466..df40325 100644 --- a/fileitemactionplugin/syncthingmenuaction.cpp +++ b/fileitemactionplugin/syncthingmenuaction.cpp @@ -5,14 +5,14 @@ #include "../connector/syncthingconnection.h" -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD #include #endif #include #include -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD #include #endif @@ -24,7 +24,7 @@ SyncthingMenuAction::SyncthingMenuAction(const KFileItemListProperties &properti , m_properties(properties) , m_notifier(SyncthingFileItemAction::staticData().connection()) { -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD std::cerr << EscapeCodes::Phrases::Info << "Creating SyncthingMenuAction: " << this << EscapeCodes::Phrases::EndFlush; #endif @@ -38,7 +38,7 @@ SyncthingMenuAction::SyncthingMenuAction(const KFileItemListProperties &properti connect(&m_notifier, &SyncthingNotifier::disconnected, this, &SyncthingMenuAction::handleConnectedChanged); } -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD SyncthingMenuAction::~SyncthingMenuAction() { std::cerr << EscapeCodes::Phrases::Info << "Destroying SyncthingMenuAction: " << this << EscapeCodes::Phrases::EndFlush; diff --git a/fileitemactionplugin/syncthingmenuaction.h b/fileitemactionplugin/syncthingmenuaction.h index 002aed7..d474561 100644 --- a/fileitemactionplugin/syncthingmenuaction.h +++ b/fileitemactionplugin/syncthingmenuaction.h @@ -20,7 +20,7 @@ class SyncthingMenuAction : public QAction { public: explicit SyncthingMenuAction(const KFileItemListProperties &properties = KFileItemListProperties(), const QList &actions = QList(), QObject *parent = nullptr); -#ifdef DEBUG_BUILD +#ifdef CPP_UTILITIES_DEBUG_BUILD ~SyncthingMenuAction() override; #endif diff --git a/libsyncthing/global.h b/libsyncthing/global.h index f1a23b8..57366ed 100644 --- a/libsyncthing/global.h +++ b/libsyncthing/global.h @@ -10,8 +10,8 @@ #define LIB_SYNCTHING_EXPORT #define LIB_SYNCTHING_IMPORT #else -#define LIB_SYNCTHING_EXPORT LIB_EXPORT -#define LIB_SYNCTHING_IMPORT LIB_IMPORT +#define LIB_SYNCTHING_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define LIB_SYNCTHING_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/model/global.h b/model/global.h index bc0d13e..1333dbf 100644 --- a/model/global.h +++ b/model/global.h @@ -10,8 +10,8 @@ #define LIB_SYNCTHING_MODEL_EXPORT #define LIB_SYNCTHING_MODEL_IMPORT #else -#define LIB_SYNCTHING_MODEL_EXPORT LIB_EXPORT -#define LIB_SYNCTHING_MODEL_IMPORT LIB_IMPORT +#define LIB_SYNCTHING_MODEL_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define LIB_SYNCTHING_MODEL_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/model/syncthingdevicemodel.cpp b/model/syncthingdevicemodel.cpp index 82dcd22..93b27c8 100644 --- a/model/syncthingdevicemodel.cpp +++ b/model/syncthingdevicemodel.cpp @@ -131,7 +131,7 @@ QVariant SyncthingDeviceModel::data(const QModelIndex &index, int role) const } break; } - FALLTHROUGH; + [[fallthrough]]; case DeviceDetail: if (index.column() == 1 || role == DeviceDetail) { // attribute values diff --git a/model/syncthingdirectorymodel.cpp b/model/syncthingdirectorymodel.cpp index abb70c9..855a7f1 100644 --- a/model/syncthingdirectorymodel.cpp +++ b/model/syncthingdirectorymodel.cpp @@ -143,7 +143,7 @@ QVariant SyncthingDirectoryModel::data(const QModelIndex &index, int role) const } break; } - FALLTHROUGH; + [[fallthrough]]; case DirectoryDetail: if (index.column() == 1 || role == DirectoryDetail) { // attribute values diff --git a/plasmoid/lib/global.h b/plasmoid/lib/global.h index c41817a..b24e1a9 100644 --- a/plasmoid/lib/global.h +++ b/plasmoid/lib/global.h @@ -10,8 +10,8 @@ #define SYNCTHINGPLASMOID_EXPORT #define SYNCTHINGPLASMOID_IMPORT #else -#define SYNCTHINGPLASMOID_EXPORT LIB_EXPORT -#define SYNCTHINGPLASMOID_IMPORT LIB_IMPORT +#define SYNCTHINGPLASMOID_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define SYNCTHINGPLASMOID_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/testhelper/global.h b/testhelper/global.h index efa4423..afc0058 100644 --- a/testhelper/global.h +++ b/testhelper/global.h @@ -10,8 +10,8 @@ #define SYNCTHINGTESTHELPER_EXPORT #define SYNCTHINGTESTHELPER_IMPORT #else -#define SYNCTHINGTESTHELPER_EXPORT LIB_EXPORT -#define SYNCTHINGTESTHELPER_IMPORT LIB_IMPORT +#define SYNCTHINGTESTHELPER_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define SYNCTHINGTESTHELPER_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/widgets/global.h b/widgets/global.h index f78cd7f..386d7eb 100644 --- a/widgets/global.h +++ b/widgets/global.h @@ -10,8 +10,8 @@ #define SYNCTHINGWIDGETS_EXPORT #define SYNCTHINGWIDGETS_IMPORT #else -#define SYNCTHINGWIDGETS_EXPORT LIB_EXPORT -#define SYNCTHINGWIDGETS_IMPORT LIB_IMPORT +#define SYNCTHINGWIDGETS_EXPORT CPP_UTILITIES_GENERIC_LIB_EXPORT +#define SYNCTHINGWIDGETS_IMPORT CPP_UTILITIES_GENERIC_LIB_IMPORT #endif /*! diff --git a/widgets/misc/syncthinglauncher.cpp b/widgets/misc/syncthinglauncher.cpp index a24c72d..1d3e672 100644 --- a/widgets/misc/syncthinglauncher.cpp +++ b/widgets/misc/syncthinglauncher.cpp @@ -130,9 +130,9 @@ void SyncthingLauncher::handleLoggingCallback(LibSyncthing::LogLevel level, cons emit outputAvailable(move(messageData)); #else - VAR_UNUSED(level) - VAR_UNUSED(message) - VAR_UNUSED(messageSize) + CPP_UTILITIES_UNUSED(level) + CPP_UTILITIES_UNUSED(message) + CPP_UTILITIES_UNUSED(messageSize) #endif } @@ -143,7 +143,7 @@ void SyncthingLauncher::runLibSyncthing(const LibSyncthing::RuntimeOptions &runt const auto exitCode = LibSyncthing::runSyncthing(runtimeOptions); emit exited(static_cast(exitCode), exitCode == 0 ? QProcess::NormalExit : QProcess::CrashExit); #else - VAR_UNUSED(runtimeOptions) + CPP_UTILITIES_UNUSED(runtimeOptions) emit outputAvailable("libsyncthing support not enabled"); emit exited(-1, QProcess::CrashExit); #endif @@ -156,7 +156,7 @@ void SyncthingLauncher::runLibSyncthing(const std::vector &arguments) const auto exitCode = LibSyncthing::runSyncthing(arguments); emit exited(static_cast(exitCode), exitCode == 0 ? QProcess::NormalExit : QProcess::CrashExit); #else - VAR_UNUSED(arguments) + CPP_UTILITIES_UNUSED(arguments) emit outputAvailable("libsyncthing support not enabled"); emit exited(-1, QProcess::CrashExit); #endif