first working showing post

This commit is contained in:
Jeena 2015-01-30 17:36:51 +01:00
parent 0405a8ba39
commit cc59671ff4
6 changed files with 22 additions and 7 deletions

View file

@ -1,5 +1,6 @@
#include "post.h"
#include <QDebug>
#include <QJsonDocument>
Post::Post(QObject *parent) : QObject(parent)
{
@ -22,6 +23,10 @@ Post::Post(QJsonObject post, QObject *parent) : QObject(parent)
mExcerpt = post.value("excerpt").toString().trimmed();
mStarred = post.value("marked").toBool();
mRead = !post.value("unread").toBool();
QJsonDocument doc(post);
QString result(doc.toJson(QJsonDocument::Indented));
mJsonString = result;
}
Post::~Post()