made possible to use doOperation with callback, added setRead, added settings for window position and size
This commit is contained in:
parent
ddb54f398c
commit
41e762445f
8 changed files with 94 additions and 47 deletions
14
post.cpp
14
post.cpp
|
@ -11,7 +11,7 @@ Post::Post(QJsonObject post, QObject *parent) : QObject(parent)
|
|||
{
|
||||
mTitle = post.value("title").toString().trimmed();
|
||||
mFeedTitle = post.value("feed_title").toString().trimmed();
|
||||
mId = post.value("id").toString().trimmed();
|
||||
mId = post.value("id").toInt();
|
||||
mFeedId = post.value("feed_id").toString().trimmed();
|
||||
mAuthor = post.value("author").toString().trimmed();
|
||||
QUrl url(post.value("link").toString().trimmed());
|
||||
|
@ -23,6 +23,7 @@ Post::Post(QJsonObject post, QObject *parent) : QObject(parent)
|
|||
mExcerpt = post.value("excerpt").toString().remove(QRegExp("<[^>]*>")).replace("…", " ...").trimmed().replace("(\\s+)", " ").replace("\n", "");
|
||||
mStarred = post.value("marked").toBool();
|
||||
mRead = !post.value("unread").toBool();
|
||||
mDontChangeRead = false;
|
||||
|
||||
QJsonDocument doc(post);
|
||||
QString result(doc.toJson(QJsonDocument::Indented));
|
||||
|
@ -36,6 +37,17 @@ Post::~Post()
|
|||
|
||||
void Post::setRead(bool r)
|
||||
{
|
||||
if(mRead == r) return;
|
||||
|
||||
mRead = r;
|
||||
emit readChanged(mRead);
|
||||
}
|
||||
|
||||
void Post::setDontChangeRead(bool r)
|
||||
{
|
||||
qDebug() << "setDontChangeRead " << r << " " << mDontChangeRead;
|
||||
if(mDontChangeRead == r) return;
|
||||
|
||||
mDontChangeRead = r;
|
||||
emit dontChangeReadChanged(mDontChangeRead);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue