[Pkg-owncloud-commits] [owncloud-client] 381/470: Quota: Add branding option for the base folder (#4714)
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:29 UTC 2016
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 84ac2e64e0c975a95d2b896c0341c13a0125160a
Author: Olivier Goffart <olivier at woboq.com>
Date: Fri Apr 22 10:05:50 2016 +0200
Quota: Add branding option for the base folder (#4714)
As discussed on issue ##4460
Having the quote to be queried on subfolder is wrong in the generic case,
so add a branding option to configure it.
This partially reverts commit ff4cdc3161ddbb74a0fe10f969043ff898fbb93a
---
src/gui/quotainfo.cpp | 16 ++--------------
src/libsync/theme.cpp | 7 ++++---
src/libsync/theme.h | 10 ++++++++++
3 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/src/gui/quotainfo.cpp b/src/gui/quotainfo.cpp
index ba124de..6ba83ea 100644
--- a/src/gui/quotainfo.cpp
+++ b/src/gui/quotainfo.cpp
@@ -17,6 +17,7 @@
#include "networkjobs.h"
#include "folderman.h"
#include "creds/abstractcredentials.h"
+#include <theme.h>
#include <QTimer>
#include <QDebug>
@@ -82,20 +83,7 @@ bool QuotaInfo::canGetQuota() const
QString QuotaInfo::quotaBaseFolder() const
{
- // If there's exactly one folder, use its remote path.
- // Otherwise use /
- bool foundOne = false;
- QString path = "/";
- for (const auto & folder : FolderMan::instance()->map()) {
- if (folder->accountState() == _accountState) {
- if (foundOne)
- return "/";
- foundOne = true;
- path = folder->remotePath();
- }
- }
-
- return path;
+ return Theme::instance()->quotaBaseFolder();
}
void QuotaInfo::slotCheckQuota()
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index 6f96a72..572ccec 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -459,7 +459,8 @@ QString Theme::wizardUrlHint() const
return QString();
}
-
-
+QString Theme::quotaBaseFolder() const
+{
+ return QLatin1String("/");
+}
} // end namespace client
-
diff --git a/src/libsync/theme.h b/src/libsync/theme.h
index 9211511..9b77171 100644
--- a/src/libsync/theme.h
+++ b/src/libsync/theme.h
@@ -291,6 +291,16 @@ public:
*/
virtual QString wizardUrlHint() const;
+ /**
+ * @brief the server folder that should be queried for the quota information
+ *
+ * This can be configured to show the quota infromation for a different
+ * folder than the root. This is the folder on which the client will do
+ * PROPFIND calls to get "quota-available-bytes" and "quota-used-bytes"
+ *
+ * Defaults: "/"
+ */
+ QString quotaBaseFolder() const;
protected:
#ifndef TOKEN_AUTH_ONLY
--
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