Use Q_ENUM_NS for PinState
authorHannah von Reth <hannah.vonreth@owncloud.com>
Wed, 22 Apr 2020 10:08:30 +0000 (12:08 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:10 +0000 (10:59 +0100)
src/common/common.cmake
src/common/pinstate.cpp [new file with mode: 0644]
src/common/pinstate.h

index aaaed36af534dc05d17821b3bb850d332f54c8eb..5c7cd52c902bfe5b20d5776c6cd245b4e7f0abfc 100644 (file)
@@ -10,6 +10,7 @@ set(common_SOURCES
     ${CMAKE_CURRENT_LIST_DIR}/utility.cpp
     ${CMAKE_CURRENT_LIST_DIR}/remotepermissions.cpp
     ${CMAKE_CURRENT_LIST_DIR}/vfs.cpp
+    ${CMAKE_CURRENT_LIST_DIR}/pinstate.cpp
     ${CMAKE_CURRENT_LIST_DIR}/plugin.cpp
     ${CMAKE_CURRENT_LIST_DIR}/syncfilestatus.cpp
 )
diff --git a/src/common/pinstate.cpp b/src/common/pinstate.cpp
new file mode 100644 (file)
index 0000000..bb3e4e1
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "pinstate.h"
+#include "moc_pinstate.cpp"
index c86d11ae5e82ba3e2aa3e59721152efc24c2c543..a50ed7eab269c2b72f2ce1dc58005cde83f9e5b2 100644 (file)
 
 #include "ocsynclib.h"
 
+#include <QObject>
+
 namespace OCC {
 
+namespace PinStateEnums {
+OCSYNC_EXPORT Q_NAMESPACE
+
 /** Determines whether items should be available locally permanently or not
  *
  * The idea is that files and folders can be marked with the user intent
@@ -72,6 +77,7 @@ enum class PinState {
      */
     Unspecified = 3,
 };
+Q_ENUM_NS(PinState);
 
 /** A user-facing version of PinState.
  *
@@ -119,6 +125,9 @@ enum class VfsItemAvailability {
      */
     OnlineOnly = 4,
 };
+Q_ENUM_NS(VfsItemAvailability)
+}
+using namespace PinStateEnums;
 
 }