declare ErrorCategory enum class and declare its metatype
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 11 Oct 2022 20:13:50 +0000 (22:13 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 8 Jun 2023 06:55:32 +0000 (08:55 +0200)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/common/pinstate.h
src/libsync/discovery.cpp
src/libsync/progressdispatcher.h
src/libsync/vfs/cfapi/cfapiwrapper.cpp

index 106d9385d370af1fea1443dc535d1807a1a0b868..7d4222a01ccc8bd79d309734995f75867972e726 100644 (file)
@@ -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;
 
 }
 
index 75912f4db14d41ca174ce77f4825606414c4d70c..684c0560633db58aa045226f46a82c677218b9f4 100644 (file)
@@ -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<PinStateEnums::PinState>(PinState::Unspecified);
+        const auto folderPinState = localEntry.isDirectory ? _discoveryData->_syncOptions._vfs->pinState(path._local) : Optional<PinState>(PinState::Unspecified);
 
         if (!isFilePlaceHolder && !folderPlaceHolderAvailability.isValid() && !folderPinState.isValid()) {
             // not a file placeholder and not a synced folder placeholder (new local folder)
index 4280edcd9c6e681793bf7e4bd27b56276f3c476b..4724fb7e4f63cb324ddb60598331fd1342ff137b 100644 (file)
@@ -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
index 059844395a0b4ba6382771a40e326149b06210a8..8045c61487a0d925664facfea1149abe6bb51f56 100644 (file)
@@ -355,7 +355,7 @@ OCC::CfApiWrapper::PlaceHolderInfo::PlaceHolderInfo(CF_PLACEHOLDER_BASIC_INFO *d
 {
 }
 
-OCC::Optional<OCC::PinStateEnums::PinState> OCC::CfApiWrapper::PlaceHolderInfo::pinState() const
+OCC::Optional<OCC::PinState> OCC::CfApiWrapper::PlaceHolderInfo::pinState() const
 {
     Q_ASSERT(_data);
     if (!_data) {
@@ -682,7 +682,7 @@ OCC::CfApiWrapper::PlaceHolderInfo OCC::CfApiWrapper::findPlaceholderInfo(const
     }
 }
 
-OCC::Result<OCC::Vfs::ConvertToPlaceholderResult, QString> OCC::CfApiWrapper::setPinState(const QString &path, OCC::PinStateEnums::PinState state, SetPinRecurseMode mode)
+OCC::Result<OCC::Vfs::ConvertToPlaceholderResult, QString> OCC::CfApiWrapper::setPinState(const QString &path, OCC::PinState state, SetPinRecurseMode mode)
 {
     const auto cfState = pinStateToCfPinState(state);
     const auto flags = pinRecurseModeToCfSetPinFlags(mode);