Commit 9fecb57f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify variable + initialize in header class

parent 51b57ddf
Pipeline #34757 passed with stage
in 6 minutes and 20 seconds
......@@ -22,8 +22,8 @@ class Q_DECL_HIDDEN BlogFetchJob::Private
Private(const QString &id, FetchBy fetchBy);
~Private();
QString id;
FetchBy fetchBy;
const QString id;
const FetchBy fetchBy;
};
BlogFetchJob::Private::Private(const QString &id_, FetchBy fetchBy_)
......
......@@ -24,10 +24,10 @@ class Q_DECL_HIDDEN CommentApproveJob::Private
const QString &commentId,
ApprovalAction action);
QString blogId;
QString postId;
QString commentId;
ApprovalAction action;
const QString blogId;
const QString postId;
const QString commentId;
const ApprovalAction action;
};
CommentApproveJob::Private::Private(const QString &blogId_,
......
......@@ -23,9 +23,9 @@ class Q_DECL_HIDDEN CommentDeleteContentJob::Private
const QString &postId,
const QString &commentId);
QString blogId;
QString postId;
QString commentId;
const QString blogId;
const QString postId;
const QString commentId;
};
CommentDeleteContentJob::Private::Private(const QString &blogId_,
......
......@@ -23,9 +23,9 @@ class Q_DECL_HIDDEN CommentDeleteJob::Private
const QString &postId,
const QString &commentId);
QString blogId;
QString postId;
QString commentId;
const QString blogId;
const QString postId;
const QString commentId;
};
......
......@@ -26,9 +26,9 @@ class Q_DECL_HIDDEN CommentFetchJob::Private
CommentFetchJob *parent);
~Private();
QString blogId;
QString postId;
QString commentId;
const QString blogId;
const QString postId;
const QString commentId;
uint maxResults;
QDateTime startDate;
QDateTime endDate;
......
......@@ -21,7 +21,7 @@ class Q_DECL_HIDDEN PageCreateJob::Private
public:
Private(const PagePtr &page);
PagePtr page;
const PagePtr page;
};
PageCreateJob::Private::Private(const PagePtr &page_)
......
......@@ -22,8 +22,8 @@ class Q_DECL_HIDDEN PageDeleteJob::Private
Private(const QString &blogId,
const QString &pageId);
QString blogId;
QString pageId;
const QString blogId;
const QString pageId;
};
PageDeleteJob::Private::Private(const QString &blogId_, const QString &pageId_)
......
......@@ -23,19 +23,17 @@ class Q_DECL_HIDDEN PageFetchJob::Private
Private(const QString &blogId,
const QString &pageId);
QString blogId;
QString pageId;
const QString blogId;
const QString pageId;
bool fetchContent;
StatusFilters statusFilter;
bool fetchContent = true;
StatusFilters statusFilter = All;
};
PageFetchJob::Private::Private(const QString &blogId_,
const QString &pageId_)
: blogId(blogId_)
, pageId(pageId_)
, fetchContent(true)
, statusFilter(All)
{
}
......
......@@ -21,7 +21,7 @@ class Q_DECL_HIDDEN PageModifyJob::Private
public:
Private(const PagePtr &page);
PagePtr page;
const PagePtr page;
};
PageModifyJob::Private::Private(const PagePtr &page_)
......
......@@ -31,20 +31,17 @@ class Q_DECL_HIDDEN Post::Private
QString authorName;
QUrl authorUrl;
QUrl authorImageUrl;
uint commentsCount;
uint commentsCount =0;
QStringList labels;
QVariant customMetaData;
QString location;
double latitude;
double longitude;
double latitude = -1;
double longitude = -1;
QList<QUrl> images;
QString status;
};
Post::Private::Private()
: commentsCount(0)
, latitude(-1)
, longitude(-1)
{
}
......
......@@ -23,8 +23,8 @@ class Q_DECL_HIDDEN PostCreateJob::Private
Private(const PostPtr &post,
bool isDraft);
PostPtr post;
bool isDraft;
const PostPtr post;
const bool isDraft;
};
PostCreateJob::Private::Private(const PostPtr &post_,
......
......@@ -21,8 +21,8 @@ class Q_DECL_HIDDEN PostDeleteJob::Private
Private(const QString &blogId,
const QString &postId);
QString blogId;
QString postId;
const QString blogId;
const QString postId;
};
PostDeleteJob::Private::Private(const QString &blogId_,
......
......@@ -27,13 +27,13 @@ class Q_DECL_HIDDEN PostFetchJob::Private
QString blogId;
QString postId;
bool fetchBodies;
bool fetchImages;
uint maxResults;
bool fetchBodies = true;
bool fetchImages = true;
uint maxResults = 0;
QStringList filterLabels;
QDateTime startDate;
QDateTime endDate;
StatusFilters statusFilter;
StatusFilters statusFilter = All;
private:
PostFetchJob *const q;
......@@ -44,10 +44,6 @@ PostFetchJob::Private::Private(const QString &blogId_,
PostFetchJob *parent)
: blogId(blogId_)
, postId(postId_)
, fetchBodies(true)
, fetchImages(true)
, maxResults(0)
, statusFilter(All)
, q(parent)
{
}
......
......@@ -21,7 +21,7 @@ class Q_DECL_HIDDEN PostModifyJob::Private
public:
Private(const PostPtr &post);
PostPtr post;
const PostPtr post;
};
PostModifyJob::Private::Private(const PostPtr &post_)
......
......@@ -26,10 +26,10 @@ class Q_DECL_HIDDEN PostPublishJob::Private
PostPublishJob::PublishAction action,
const QDateTime &publishDate = QDateTime());
QString blogId;
QString postId;
PublishAction action;
QDateTime publishDate;
const QString blogId;
const QString postId;
const PublishAction action;
const QDateTime publishDate;
ObjectPtr response;
};
......
......@@ -24,9 +24,9 @@ class Q_DECL_HIDDEN PostSearchJob::Private
const QString &query,
PostSearchJob *parent);
QString blogId;
QString query;
bool fetchBodies;
const QString blogId;
const QString query;
bool fetchBodies = true;
private:
PostSearchJob *const q;
......
......@@ -26,9 +26,9 @@ public:
, timeMax(timeMax)
{}
QString id;
QDateTime timeMin;
QDateTime timeMax;
const QString id;
const QDateTime timeMin;
const QDateTime timeMax;
FreeBusyQueryJob::BusyRangeList busy;
};
......
......@@ -22,11 +22,11 @@ class Q_DECL_HIDDEN Contact::Private
{
public:
Private() : deleted(false) { }
Private() { }
Private(const Private &other);
~Private() { }
bool deleted;
bool deleted = false;
QUrl photoUrl;
/* group URI, isDeleted */
......
......@@ -26,9 +26,9 @@ class Q_DECL_HIDDEN ContactFetchJob::Private
QNetworkRequest createRequest(const QUrl &url);
bool fetchDeleted;
bool fetchDeleted = true;
QString contactId;
quint64 timestamp;
quint64 timestamp = 0;
QString filter;
private:
......@@ -36,8 +36,6 @@ class Q_DECL_HIDDEN ContactFetchJob::Private
};
ContactFetchJob::Private::Private(ContactFetchJob *parent):
fetchDeleted(true),
timestamp(0),
q(parent)
{
}
......
......@@ -23,12 +23,11 @@ class Q_DECL_HIDDEN ContactsGroup::Private
QString title;
QString content;
QDateTime updated;
bool isSystemGroup;
bool isSystemGroup = false;
};
ContactsGroup::Private::Private():
isSystemGroup(false)
ContactsGroup::Private::Private()
{
}
......
Markdown is supported
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