[Pkg-owncloud-commits] [owncloud-client] 373/484: ShareDialog: Keep default server permissions by default (#4152)

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:07 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 887aa952fef94438d249e9a6c48b5eb4b5e4f9d5
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Nov 19 10:38:51 2015 +0100

    ShareDialog: Keep default server permissions by default (#4152)
---
 src/gui/ocssharejob.cpp          | 4 +++-
 src/gui/share.h                  | 5 +++--
 src/gui/shareusergroupwidget.cpp | 6 ++----
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gui/ocssharejob.cpp b/src/gui/ocssharejob.cpp
index 93c0c1d..256dfd7 100644
--- a/src/gui/ocssharejob.cpp
+++ b/src/gui/ocssharejob.cpp
@@ -122,7 +122,9 @@ void OcsShareJob::createShare(const QString& path,
     addParam(QString::fromLatin1("path"), path);
     addParam(QString::fromLatin1("shareType"), QString::number(shareType));
     addParam(QString::fromLatin1("shareWith"), shareWith);
-    addParam(QString::fromLatin1("permissions"), QString::number(permissions));
+    if (!(permissions & Share::PermissionDefault)) {
+        addParam(QString::fromLatin1("permissions"), QString::number(permissions));
+    }
 
     start();
 }
diff --git a/src/gui/share.h b/src/gui/share.h
index 99e3e76..8ac7fae 100644
--- a/src/gui/share.h
+++ b/src/gui/share.h
@@ -51,7 +51,8 @@ public:
         PermissionUpdate =  2,
         PermissionCreate =  4,
         PermissionDelete =  8,
-        PermissionShare  = 16
+        PermissionShare  = 16,
+        PermissionDefault = 1 << 30
     };
     Q_DECLARE_FLAGS(Permissions, Permission)
 
@@ -62,7 +63,7 @@ public:
                    const QString& id,
                    const QString& path,
                    const ShareType shareType,
-                   const Permissions permissions,
+                   const Permissions permissions = PermissionDefault,
                    const QSharedPointer<Sharee> shareWith = QSharedPointer<Sharee>(NULL));
 
     /*
diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp
index 8ff7c76..ffc5bfb 100644
--- a/src/gui/shareusergroupwidget.cpp
+++ b/src/gui/shareusergroupwidget.cpp
@@ -170,10 +170,8 @@ void ShareUserGroupWidget::slotCompleterActivated(const QModelIndex & index)
         return;
     }
 
-    _manager->createShare(_sharePath,
-                          (Share::ShareType)sharee->type(),
-                          sharee->shareWith(),
-                          Share::PermissionRead);
+    _manager->createShare(_sharePath, Share::ShareType(sharee->type()),
+                          sharee->shareWith(), Share::PermissionDefault);
 
     _ui->shareeLineEdit->setText(QString());
 }

-- 
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