[Pkg-owncloud-commits] [owncloud-client] 122/484: Sharing: change coding style of enum

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:27 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 c80e72da83978fa8d200e9ee34c4f4008062d2ba
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Oct 21 18:40:04 2015 +0200

    Sharing: change coding style of enum
    
    From all upper case to camel case
    
    This hopefully fix the Windows build which fails because DELETE seems
    to be a macro
---
 src/gui/ocssharejob.cpp |  2 +-
 src/gui/ocssharejob.h   | 20 ++++++++++----------
 src/gui/sharedialog.cpp | 10 +++++-----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/gui/ocssharejob.cpp b/src/gui/ocssharejob.cpp
index dea9b53..ea0529b 100644
--- a/src/gui/ocssharejob.cpp
+++ b/src/gui/ocssharejob.cpp
@@ -79,7 +79,7 @@ void OcsShareJob::setPublicUpload(int shareId, bool publicUpload)
     start();
 }
 
-void OcsShareJob::createShare(const QString &path, SHARETYPE shareType, const QString &password, const QDate &date)
+void OcsShareJob::createShare(const QString &path, ShareType shareType, const QString &password, const QDate &date)
 {
     setVerb("POST");
 
diff --git a/src/gui/ocssharejob.h b/src/gui/ocssharejob.h
index 1f16bf2..87043c0 100644
--- a/src/gui/ocssharejob.h
+++ b/src/gui/ocssharejob.h
@@ -35,20 +35,20 @@ public:
     /**
      * Support sharetypes
      */
-    enum class SHARETYPE : int {
-        LINK = 3
+    enum class ShareType : int {
+        Link = 3
     };
 
     /**
      * Possible permissions
      */
-    enum class PERMISSION : int {
-        READ = 1,
-        UPDATE = 2,
-        CREATE = 4,
-        DELETE = 8,
-        SHARE = 16,
-        ALL = 31
+    enum class Permission : int {
+        Read = 1,
+        Update = 2,
+        Create = 4,
+        Delete = 8,
+        Share = 16,
+        All = 31
     };
 
     /**
@@ -99,7 +99,7 @@ public:
      * @param password Optionally a password for the share
      * @param date Optionally an expire date for the share
      */
-    void createShare(const QString& path, SHARETYPE shareType, const QString& password = "", const QDate& date = QDate());
+    void createShare(const QString& path, ShareType shareType, const QString& password = "", const QDate& date = QDate());
 };
 
 }
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index 8c8dd57..e59888e 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -248,7 +248,7 @@ void ShareDialog::setPassword(const QString &password)
             date = _ui->calendar->date();
         }
 
-        job->createShare(_sharePath, OcsShareJob::SHARETYPE::LINK, password, date);
+        job->createShare(_sharePath, OcsShareJob::ShareType::Link, password, date);
     }
     _passwordJobRunning = true;
 }
@@ -304,7 +304,7 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply)
     Q_FOREACH(auto share, ShareDialog::_shares) {
         QVariantMap data = share.toMap();
 
-        if (data.value("share_type").toInt() == static_cast<int>(OcsShareJob::SHARETYPE::LINK)) {
+        if (data.value("share_type").toInt() == static_cast<int>(OcsShareJob::ShareType::Link)) {
             _public_share_id = data.value("id").toULongLong();
             _ui->pushButton_copy->show();
 
@@ -340,8 +340,8 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply)
                  * For public links the server sets CREATE and UPDATE permissions.
                  */
                 if (!_isFile && 
-                       (permissions & static_cast<int>(OcsShareJob::PERMISSION::UPDATE)) && 
-                       (permissions & static_cast<int>(OcsShareJob::PERMISSION::CREATE))) {
+                       (permissions & static_cast<int>(OcsShareJob::Permission::Update)) &&
+                       (permissions & static_cast<int>(OcsShareJob::Permission::Create))) {
                     _ui->checkBox_editing->setChecked(true);
                 }
             }
@@ -468,7 +468,7 @@ void ShareDialog::slotCheckBoxShareLinkClicked()
 
         OcsShareJob *job = new OcsShareJob(_account, this);
         connect(job, SIGNAL(jobFinished(QVariantMap)), this, SLOT(slotCreateShareFetched(QVariantMap)));
-        job->createShare(_sharePath, OcsShareJob::SHARETYPE::LINK);
+        job->createShare(_sharePath, OcsShareJob::ShareType::Link);
     } else {
         _pi_link->startAnimation();
         OcsShareJob *job = new OcsShareJob(_account, this);

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