9#include <QJsonDocument>
14using namespace KGAPI2::Blogger;
16class Q_DECL_HIDDEN Comment::Private
37Comment::Private::Private()
57void Comment::setId(
const QString &
id)
67void Comment::setPostId(
const QString &postId)
77void Comment::setBlogId(
const QString &blogId)
87void Comment::setPublished(
const QDateTime &published)
89 d->published = published;
97void Comment::setUpdated(
const QDateTime &updated)
102QString Comment::content()
const
107void Comment::setContent(
const QString &content)
109 d->content = content;
112QString Comment::authorId()
const
117void Comment::setAuthorId(
const QString &authorId)
119 d->authorId = authorId;
122QString Comment::authorName()
const
124 return d->authorName;
127void Comment::setAuthorName(
const QString &authorName)
129 d->authorName = authorName;
132QUrl Comment::authorUrl()
const
137void Comment::setAuthorUrl(
const QUrl &url)
142QUrl Comment::authorImageUrl()
const
144 return d->authorImageUrl;
147void Comment::setAuthorImageUrl(
const QUrl &authorImageUrl)
149 d->authorImageUrl = authorImageUrl;
152QString Comment::inReplyTo()
const
157void Comment::setInReplyTo(
const QString &inReplyTo)
159 d->inReplyTo = inReplyTo;
175 const QVariantMap
map = json.
toMap();
177 comment->d->id =
map[QStringLiteral(
"id")].toString();
178 comment->d->postId =
map[QStringLiteral(
"post")].toMap()[QStringLiteral(
"id")].toString();
179 comment->d->blogId =
map[QStringLiteral(
"blog")].toMap()[QStringLiteral(
"id")].toString();
182 comment->d->content =
map[QStringLiteral(
"content")].toString();
183 const QVariantMap author =
map[QStringLiteral(
"author")].toMap();
184 comment->d->authorId = author[QStringLiteral(
"id")].toString();
185 comment->d->authorName = author[QStringLiteral(
"displayName")].toString();
186 comment->d->authorUrl = author[QStringLiteral(
"url")].toUrl();
187 comment->d->authorImageUrl = author[QStringLiteral(
"image")].toMap()[QStringLiteral(
"url")].toUrl();
188 comment->d->inReplyTo =
map[QStringLiteral(
"inReplyTo")].toMap()[QStringLiteral(
"id")].toString();
189 comment->d->status =
map[QStringLiteral(
"status")].toString();
201 const QVariantMap
map = json.
toMap();
206 return Comment::Private::fromJSON(map);
216 const QVariantMap
map = json.
toMap();
222 if (!map[QStringLiteral(
"nextPageToken")].
toString().isEmpty()) {
225 query.removeQueryItem(QStringLiteral(
"pageToken"));
226 query.addQueryItem(QStringLiteral(
"pageToken"), map[QStringLiteral(
"nextPageToken")].
toString());
229 const QVariantList variantList =
map[QStringLiteral(
"items")].toList();
230 items.
reserve(variantList.size());
231 for (
const QVariant &v : variantList) {
232 items << Comment::Private::fromJSON(v);
Structure to store additional information about a feed.
QUrl requestUrl
Original URL of the request.
QUrl nextPageUrl
Link to next page of feed.
Base class for all objects.
Q_SCRIPTABLE CaptureState status()
char * toString(const EngineQuery &query)
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
A job to fetch a single map tile described by a StaticMapUrl.
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
QDateTime fromString(QStringView string, QStringView format, QCalendar cal)
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
bool isNull() const const
QVariant toVariant() const const
void reserve(qsizetype size)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
void setQuery(const QString &query, ParsingMode mode)
QMap< QString, QVariant > toMap() const const