[Pkg-owncloud-commits] [owncloud-client] 84/484: Move permissions to OcsShareJob

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit f95fea986636ed51deeb1f8d3e4060d9e7ae2db8
Author: Roeland Jago Douma <rullzer at owncloud.com>
Date:   Fri Oct 16 08:09:57 2015 +0200

    Move permissions to OcsShareJob
---
 src/gui/ocssharejob.h   | 12 ++++++++++++
 src/gui/sharedialog.cpp | 13 +++----------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/gui/ocssharejob.h b/src/gui/ocssharejob.h
index 135481b..5156a52 100644
--- a/src/gui/ocssharejob.h
+++ b/src/gui/ocssharejob.h
@@ -40,6 +40,18 @@ public:
     };
 
     /**
+     * Possible permissions
+     */
+    enum class PERMISSION : int {
+        READ = 1,
+        UPDATE = 2,
+        CREATE = 4,
+        DELETE = 8,
+        SHARE = 16,
+        ALL = 31
+    };
+
+    /**
      * Constructor for new shares or listing of shares
      */
     explicit OcsShareJob(AccountPtr account, QObject *parent = 0);
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index 5049d4e..8be6bf0 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -32,15 +32,6 @@
 #include <QClipboard>
 #include <QFileInfo>
 
-namespace {
-//    int PERMISSION_READ = 1;
-    int PERMISSION_UPDATE = 2;
-    int PERMISSION_CREATE = 4;
-//    int PERMISSION_DELETE = 8;
-//    int PERMISSION_SHARE = 16;
-//    int PERMISSION_ALL = 31;
-}
-
 namespace OCC {
 
 ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QString &localPath, bool resharingAllowed, QWidget *parent) :
@@ -348,7 +339,9 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply)
                  * Only directories can have public upload set
                  * For public links the server sets CREATE and UPDATE permissions.
                  */
-                if (!_isFile && (permissions & PERMISSION_UPDATE) && (permissions & PERMISSION_CREATE)) {
+                if (!_isFile && 
+                       (permissions & static_cast<int>(OcsShareJob::PERMISSION::UPDATE)) && 
+                       (permissions & static_cast<int>(OcsShareJob::PERMISSION::CREATE))) {
                     _ui->checkBox_editing->setChecked(true);
                 }
             }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list