[Pkg-owncloud-commits] [owncloud-client] 196/484: Added getPublicUpload to LinkShare
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:42 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 390daed3ded568f3eead02fe2313a40533dd50cd
Author: Roeland Jago Douma <rullzer at owncloud.com>
Date: Thu Oct 29 11:47:14 2015 +0100
Added getPublicUpload to LinkShare
so the gui does not have to know abou the internal permissions
---
src/gui/share.cpp | 6 ++++++
src/gui/share.h | 5 +++++
src/gui/sharedialog.cpp | 6 ++----
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/gui/share.cpp b/src/gui/share.cpp
index f749b59..abce0be 100644
--- a/src/gui/share.cpp
+++ b/src/gui/share.cpp
@@ -96,6 +96,12 @@ LinkShare::LinkShare(AccountPtr account,
}
+bool LinkShare::getPublicUpload()
+{
+ return ((_permissions & OcsShareJob::Permission::Update) &&
+ (_permissions & OcsShareJob::Permission::Create));
+}
+
void LinkShare::setPublicUpload(bool publicUpload)
{
OcsShareJob *job = new OcsShareJob(_account, this);
diff --git a/src/gui/share.h b/src/gui/share.h
index a275f04..7da2b06 100644
--- a/src/gui/share.h
+++ b/src/gui/share.h
@@ -113,6 +113,11 @@ public:
const QUrl getLink();
/*
+ * Get the publicUpload status of this share
+ */
+ bool getPublicUpload();
+
+ /*
* Set a share to be public upload
* This function can only be called on link shares
*
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index 086f300..54abbee 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -307,10 +307,8 @@ void ShareDialog::slotSharesFetched(const QList<QSharedPointer<Share>> &shares)
* Only directories can have public upload set
* For public links the server sets CREATE and UPDATE permissions.
*/
- if (!_isFile &&
- (_share->getPermissions() & static_cast<int>(OcsShareJob::Permission::Update)) &&
- (_share->getPermissions() & static_cast<int>(OcsShareJob::Permission::Create))) {
- _ui->checkBox_editing->setChecked(true);
+ if (!_isFile && _share->getPublicUpload()) {
+ _ui->checkBox_editing->setChecked(true);
}
setShareLink(_share->getLink().toString());
--
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