From: Klaas Freitag Date: Thu, 10 Sep 2015 13:38:40 +0000 (+0200) Subject: Account: Make sure that davPath() always comes with trailing slash. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1408^2~92^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=93e1ad088c2623240bf30ed37cf079a499f45b50;p=nextcloud-desktop.git Account: Make sure that davPath() always comes with trailing slash. --- 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();