Commit 4e7ba7af authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add missing q_required_result + const'ify variables

parent da987b35
......@@ -132,37 +132,37 @@ public:
Folder();
void setObjectStatus(ObjectStatus status);
ObjectStatus objectStatus() const;
Q_REQUIRED_RESULT ObjectStatus objectStatus() const;
void setTitle(const QString &title);
QString title() const;
Q_REQUIRED_RESULT QString title() const;
void setType(Type type);
Type type() const;
Q_REQUIRED_RESULT Type type() const;
void setModule(Module module);
Module module() const;
Q_REQUIRED_RESULT Module module() const;
void setObjectId(qlonglong id);
qlonglong objectId() const;
Q_REQUIRED_RESULT qlonglong objectId() const;
void setFolderId(qlonglong id);
qlonglong folderId() const;
Q_REQUIRED_RESULT qlonglong folderId() const;
void setIsDefaultFolder(bool value);
bool isDefaultFolder() const;
Q_REQUIRED_RESULT bool isDefaultFolder() const;
void setOwner(qlonglong id);
qlonglong owner() const;
Q_REQUIRED_RESULT qlonglong owner() const;
void setLastModified(const QString &timeStamp);
QString lastModified() const;
Q_REQUIRED_RESULT QString lastModified() const;
void setUserPermissions(const UserPermissions &permissions);
UserPermissions userPermissions() const;
Q_REQUIRED_RESULT UserPermissions userPermissions() const;
void setGroupPermissions(const GroupPermissions &permissions);
GroupPermissions groupPermissions() const;
Q_REQUIRED_RESULT GroupPermissions groupPermissions() const;
private:
ObjectStatus mObjectStatus;
......
......@@ -43,6 +43,6 @@ private Q_SLOTS:
void davJobFinished(KJob *);
private:
Folder mFolder;
const Folder mFolder;
};
}
......@@ -69,8 +69,8 @@ void FolderMoveJob::davJobFinished(KJob *job)
return;
}
QDomElement multistatus = document.documentElement();
QDomElement response = multistatus.firstChildElement(QStringLiteral("response"));
const QDomElement multistatus = document.documentElement();
const QDomElement response = multistatus.firstChildElement(QStringLiteral("response"));
const QDomNodeList props = response.elementsByTagName(QStringLiteral("prop"));
const QDomElement prop = props.at(0).toElement();
......
......@@ -50,7 +50,7 @@ public:
/**
* Returns the list of all requested folders.
*/
Folder::List folders() const;
Q_REQUIRED_RESULT Folder::List folders() const;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -38,31 +38,31 @@ public:
Object();
void setObjectStatus(ObjectStatus status);
ObjectStatus objectStatus() const;
Q_REQUIRED_RESULT ObjectStatus objectStatus() const;
void setObjectId(qlonglong id);
qlonglong objectId() const;
Q_REQUIRED_RESULT qlonglong objectId() const;
void setFolderId(qlonglong id);
qlonglong folderId() const;
Q_REQUIRED_RESULT qlonglong folderId() const;
void setLastModified(const QString &timeStamp);
QString lastModified() const;
Q_REQUIRED_RESULT QString lastModified() const;
void setModule(Folder::Module module);
Folder::Module module() const;
Q_REQUIRED_RESULT Folder::Module module() const;
void setContact(const KContacts::Addressee &contact);
KContacts::Addressee contact() const;
Q_REQUIRED_RESULT KContacts::Addressee contact() const;
void setContactGroup(const KContacts::ContactGroup &group);
KContacts::ContactGroup contactGroup() const;
Q_REQUIRED_RESULT KContacts::ContactGroup contactGroup() const;
void setEvent(const KCalendarCore::Incidence::Ptr &event);
KCalendarCore::Incidence::Ptr event() const;
Q_REQUIRED_RESULT KCalendarCore::Incidence::Ptr event() const;
void setTask(const KCalendarCore::Incidence::Ptr &task);
KCalendarCore::Incidence::Ptr task() const;
Q_REQUIRED_RESULT KCalendarCore::Incidence::Ptr task() const;
private:
ObjectStatus mObjectStatus = Created;
......
......@@ -90,8 +90,8 @@ void ObjectCreateJob::davJobFinished(KJob *job)
return;
}
QDomElement multistatus = document.documentElement();
QDomElement response = multistatus.firstChildElement(QStringLiteral("response"));
const QDomElement multistatus = document.documentElement();
const QDomElement response = multistatus.firstChildElement(QStringLiteral("response"));
const QDomNodeList props = response.elementsByTagName(QStringLiteral("prop"));
const QDomElement prop = props.at(0).toElement();
......
......@@ -24,7 +24,7 @@ public:
void start() override;
Object object() const;
Q_REQUIRED_RESULT Object object() const;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -23,7 +23,7 @@ public:
void start() override;
Object object() const;
Q_REQUIRED_RESULT Object object() const;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -42,12 +42,12 @@ public:
/**
* Returns the list of all added and modified objects.
*/
Object::List modifiedObjects() const;
Q_REQUIRED_RESULT Object::List modifiedObjects() const;
/**
* Returns the list of all deleted objects.
*/
Object::List deletedObjects() const;
Q_REQUIRED_RESULT Object::List deletedObjects() const;
private Q_SLOTS:
void fetchModifiedJobFinished(KJob *);
......
......@@ -41,7 +41,7 @@ public:
void start() override;
Object::List objects() const;
Q_REQUIRED_RESULT Object::List objects() const;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -15,18 +15,18 @@ namespace OXA
{
namespace OXUtils
{
QString writeBoolean(bool value);
QString writeNumber(qlonglong value);
QString writeString(const QString &value);
QString writeName(const QString &value);
QString writeDateTime(const QDateTime &value);
QString writeDate(QDate value);
Q_REQUIRED_RESULT QString writeBoolean(bool value);
Q_REQUIRED_RESULT QString writeNumber(qlonglong value);
Q_REQUIRED_RESULT QString writeString(const QString &value);
Q_REQUIRED_RESULT QString writeName(const QString &value);
Q_REQUIRED_RESULT QString writeDateTime(const QDateTime &value);
Q_REQUIRED_RESULT QString writeDate(QDate value);
bool readBoolean(const QString &text);
qlonglong readNumber(const QString &text);
QString readString(const QString &text);
QString readName(const QString &text);
QDateTime readDateTime(const QString &text);
QDate readDate(const QString &text);
Q_REQUIRED_RESULT bool readBoolean(const QString &text);
Q_REQUIRED_RESULT qlonglong readNumber(const QString &text);
Q_REQUIRED_RESULT QString readString(const QString &text);
Q_REQUIRED_RESULT QString readName(const QString &text);
Q_REQUIRED_RESULT QDateTime readDateTime(const QString &text);
Q_REQUIRED_RESULT QDate readDate(const QString &text);
}
}
......@@ -20,16 +20,16 @@ public:
User();
bool isValid() const;
Q_REQUIRED_RESULT bool isValid() const;
void setUid(qlonglong uid);
qlonglong uid() const;
Q_REQUIRED_RESULT qlonglong uid() const;
void setEmail(const QString &email);
QString email() const;
Q_REQUIRED_RESULT QString email() const;
void setName(const QString &name);
QString name() const;
Q_REQUIRED_RESULT QString name() const;
private:
qlonglong mUid = -1;
......
......@@ -21,7 +21,7 @@ public:
void start() override;
qlonglong userId() const;
Q_REQUIRED_RESULT qlonglong userId() const;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -26,7 +26,7 @@ public:
void init(const QString &identifier);
qlonglong currentUserId() const;
Q_REQUIRED_RESULT qlonglong currentUserId() const;
User lookupUid(qlonglong uid) const;
User lookupEmail(const QString &email) const;
......
......@@ -23,7 +23,7 @@ public:
void start() override;
User::List users() const;
Q_REQUIRED_RESULT User::List users() const;
private Q_SLOTS:
void davJobFinished(KJob *);
......
......@@ -220,8 +220,8 @@ void UIDListJob::slotData(const QByteArray &data)
qCWarning(POP3RESOURCE_LOG) << "Invalid response to the UIDL command:" << data.data();
qCWarning(POP3RESOURCE_LOG) << "Ignoring this entry.";
} else {
QByteArray idString = cleanData.left(space);
QByteArray uidString = cleanData.mid(space + 1);
const QByteArray idString = cleanData.left(space);
const QByteArray uidString = cleanData.mid(space + 1);
bool idIsNumber;
int id = QString::fromLatin1(idString).toInt(&idIsNumber);
if (idIsNumber) {
......
......@@ -40,15 +40,15 @@ public:
~CollectionFetchJob() override;
Type type() const;
Q_REQUIRED_RESULT Type type() const;
Collection collection() const;
Q_REQUIRED_RESULT Collection collection() const;
void setFetchScope(const CollectionFetchScope &fetchScope);
CollectionFetchScope &fetchScope();
Collection::List collections() const;
Q_REQUIRED_RESULT Collection::List collections() const;
bool accept(Visitor *visitor) override;
......
......@@ -33,7 +33,7 @@ public:
~CollectionModifyJob() override;
Collection collection() const;
Q_REQUIRED_RESULT Collection collection() const;
bool accept(Visitor *visitor) override;
......
......@@ -33,9 +33,9 @@ public:
~CollectionMoveJob() override;
Collection collection() const;
Q_REQUIRED_RESULT Collection collection() const;
Collection targetParent() const;
Q_REQUIRED_RESULT Collection targetParent() const;
bool accept(Visitor *visitor) override;
......
......@@ -28,18 +28,17 @@ public:
void setRemoteId(const QString &remoteId);
QString remoteId() const;
Q_REQUIRED_RESULT QString remoteId() const;
void setRemoteRevision(const QString &remoteRev);
QString remoteRevision() const;
Q_REQUIRED_RESULT QString remoteRevision() const;
public:
QByteArray type() const override;
Q_REQUIRED_RESULT QByteArray type() const override;
EntityCompactChangeAttribute *clone() const override;
QByteArray serialized() const override;
Q_REQUIRED_RESULT QByteArray serialized() const override;
void deserialize(const QByteArray &data) override;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment