Proper const usage

This commit is contained in:
Roeland Jago Douma 2015-10-29 13:48:53 +01:00
parent 30a3498c22
commit cf8be7de91
2 changed files with 14 additions and 15 deletions

View file

@ -31,17 +31,17 @@ Share::Share(AccountPtr account, const QString& id, const QString& path, int sha
}
const QString Share::getId()
QString Share::getId() const
{
return _id;
}
int Share::getShareType()
int Share::getShareType() const
{
return _shareType;
}
int Share::getPermissions()
int Share::getPermissions() const
{
return _permissions;
}
@ -64,17 +64,17 @@ void Share::slotDeleted(const QVariantMap &reply)
emit shareDeleted();
}
const QUrl LinkShare::getLink()
QUrl LinkShare::getLink() const
{
return _url;
}
const QDate LinkShare::getExpireDate()
QDate LinkShare::getExpireDate() const
{
return _expireDate;
}
bool LinkShare::isPasswordSet()
bool LinkShare::isPasswordSet() const
{
return _passwordSet;
}
@ -254,12 +254,11 @@ void ShareManager::slotSharesFetched(const QVariantMap &reply)
LinkShare *ShareManager::parseLinkShare(const QVariantMap &data) {
QUrl url;
const QString versionString = _account->serverVersion();
// From ownCloud server 8.2 the url field is always set for public shares
if (data.contains("url")) {
url = QUrl(data.value("url").toString());
} else if (versionString.contains('.') && versionString.split('.')[0].toInt() >= 8) {
} else if (_account->serverVersionInt() >= (8 << 16)) {
// From ownCloud server version 8 on, a different share link scheme is used.
url = QUrl(Account::concatUrlPath(_account->url(), QString("index.php/s/%1").arg(data.value("token").toString())).toString());
} else {

View file

@ -31,7 +31,7 @@ class Share : public QObject {
public:
/*
* Constructor for link shares
* Constructor for shares
*/
explicit Share(AccountPtr account,
const QString& id,
@ -43,17 +43,17 @@ public:
/*
* Get the id
*/
const QString getId();
QString getId() const;
/*
* Get the shareType
*/
int getShareType();
int getShareType() const;
/*
* Get permissions
*/
int getPermissions();
int getPermissions() const;
/*
* Set the permissions of a share
@ -110,7 +110,7 @@ public:
/*
* Get the share link
*/
const QUrl getLink();
QUrl getLink() const;
/*
* Get the publicUpload status of this share
@ -137,12 +137,12 @@ public:
/*
* Is the password set?
*/
bool isPasswordSet();
bool isPasswordSet() const;
/*
* Get the expiration date
*/
const QDate getExpireDate();
QDate getExpireDate() const;
/*
* Set the expiration date