From 93e1ad088c2623240bf30ed37cf079a499f45b50 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 10 Sep 2015 15:38:40 +0200 Subject: [PATCH] Account: Make sure that davPath() always comes with trailing slash. --- src/libsync/account.cpp | 11 +++++++++++ src/libsync/account.h | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 03089800b..86c808c74 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -61,6 +61,17 @@ Account::~Account() delete _am; } +QString Account::davPath() const +{ + // make sure to have a trailing slash + if( !_davPath.endsWith('/') ) { + QString dp(_davPath); + dp.append('/'); + return dp; + } + return _davPath; +} + void Account::setSharedThis(AccountPtr sharedThis) { _sharedThis = sharedThis.toWeakRef(); diff --git a/src/libsync/account.h b/src/libsync/account.h index 986bf85f5..a1b734c03 100644 --- a/src/libsync/account.h +++ b/src/libsync/account.h @@ -60,7 +60,12 @@ public: class OWNCLOUDSYNC_EXPORT Account : public QObject { Q_OBJECT public: - QString davPath() const { return _davPath; } + /** + * @brief The possibly themed dav path for the account. Is has + * a trailing slash. + * @returns the (themeable) dav path for the account. + */ + QString davPath() const; void setDavPath(const QString&s) { _davPath = s; } static AccountPtr create(); -- 2.30.2