Account: Make sure that davPath() always comes with trailing slash.

This commit is contained in:
Klaas Freitag 2015-09-10 15:38:40 +02:00
parent 16d6418d10
commit 93e1ad088c
2 changed files with 17 additions and 1 deletions

View file

@ -61,6 +61,17 @@ Account::~Account()
delete _am; 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) void Account::setSharedThis(AccountPtr sharedThis)
{ {
_sharedThis = sharedThis.toWeakRef(); _sharedThis = sharedThis.toWeakRef();

View file

@ -60,7 +60,12 @@ public:
class OWNCLOUDSYNC_EXPORT Account : public QObject { class OWNCLOUDSYNC_EXPORT Account : public QObject {
Q_OBJECT Q_OBJECT
public: 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; } void setDavPath(const QString&s) { _davPath = s; }
static AccountPtr create(); static AccountPtr create();