From 86c4ddb25cbc71da0fb6dbe2a05d7290261a4dc7 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 11 Oct 2022 22:13:50 +0200 Subject: [PATCH] declare ErrorCategory enum class and declare its metatype Signed-off-by: Matthieu Gallien --- src/common/pinstate.h | 3 --- src/libsync/discovery.cpp | 2 +- src/libsync/progressdispatcher.h | 3 +++ src/libsync/vfs/cfapi/cfapiwrapper.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/pinstate.h b/src/common/pinstate.h index 106d9385d..7d4222a01 100644 --- a/src/common/pinstate.h +++ b/src/common/pinstate.h @@ -21,7 +21,6 @@ namespace OCC { -namespace PinStateEnums { OCSYNC_EXPORT Q_NAMESPACE /** Determines whether items should be available locally permanently or not @@ -126,8 +125,6 @@ enum class VfsItemAvailability { OnlineOnly = 4, }; Q_ENUM_NS(VfsItemAvailability) -} -using namespace PinStateEnums; } diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 75912f4db..684c05606 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1178,7 +1178,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo( // either correct availability, or a result with error if the folder is new or otherwise has no availability set yet const auto folderPlaceHolderAvailability = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->availability(path._local) : Vfs::AvailabilityResult(Vfs::AvailabilityError::NoSuchItem); - const auto folderPinState = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->pinState(path._local) : Optional(PinState::Unspecified); + const auto folderPinState = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->pinState(path._local) : Optional(PinState::Unspecified); if (!isFilePlaceHolder && !folderPlaceHolderAvailability.isValid() && !folderPinState.isValid()) { // not a file placeholder and not a synced folder placeholder (new local folder) diff --git a/src/libsync/progressdispatcher.h b/src/libsync/progressdispatcher.h index 4280edcd9..4724fb7e4 100644 --- a/src/libsync/progressdispatcher.h +++ b/src/libsync/progressdispatcher.h @@ -27,6 +27,8 @@ namespace OCC { +OCSYNC_EXPORT Q_NAMESPACE + /** * @brief The ProgressInfo class * @ingroup libsync @@ -252,6 +254,7 @@ enum class ErrorCategory { Normal, InsufficientRemoteStorage, }; +Q_ENUM_NS(OCC::ErrorCategory) /** * @file progressdispatcher.h diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.cpp b/src/libsync/vfs/cfapi/cfapiwrapper.cpp index 059844395..8045c6148 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.cpp +++ b/src/libsync/vfs/cfapi/cfapiwrapper.cpp @@ -355,7 +355,7 @@ OCC::CfApiWrapper::PlaceHolderInfo::PlaceHolderInfo(CF_PLACEHOLDER_BASIC_INFO *d { } -OCC::Optional OCC::CfApiWrapper::PlaceHolderInfo::pinState() const +OCC::Optional OCC::CfApiWrapper::PlaceHolderInfo::pinState() const { Q_ASSERT(_data); if (!_data) { @@ -682,7 +682,7 @@ OCC::CfApiWrapper::PlaceHolderInfo OCC::CfApiWrapper::findPlaceholderInfo(const } } -OCC::Result OCC::CfApiWrapper::setPinState(const QString &path, OCC::PinStateEnums::PinState state, SetPinRecurseMode mode) +OCC::Result OCC::CfApiWrapper::setPinState(const QString &path, OCC::PinState state, SetPinRecurseMode mode) { const auto cfState = pinStateToCfPinState(state); const auto flags = pinRecurseModeToCfSetPinFlags(mode); -- 2.30.2