| |
---|
| | entry = new SaoriViewEntry(j.toObject()["id"].toString().toLongLong(),ui->scrollAreaWidgetContents); |
---|
| | connect(entry,&SaoriViewEntry::anchorClicked,this,&SaoriView::linkClicked); |
---|
| | m_entries.insert(i,entry); |
---|
| | qobject_cast<QBoxLayout*>(ui->scrollAreaWidgetContents->layout())->insertWidget(i,entry); |
---|
| | if (m_viewname == "notifications") entry->setContent(notificationParser(j.toObject())); |
---|
| | else if ((m_viewname.split(':')[0] == "accounts") && (m_viewname.split(':')[2] == "followers")) { |
---|
| | entry->setContent(followerParser(j.toObject())); |
---|
| | } else if ((m_viewname.split(':')[0] == "accounts") && (m_viewname.split(':')[2] == "following")) { |
---|
| | entry->setContent(followerParser(j.toObject())); |
---|
| | } else { |
---|
| | bool cw = !j.toObject()["spoiler_text"].toString().isEmpty(); |
---|
| | if (!j.toObject()["reblog"].isNull()) |
---|
| | cw = !j.toObject()["reblog"].toObject()["spoiler_text"].toString().isEmpty(); |
---|
| | entry->setContent(statusParser(j.toObject()),cw); |
---|
| | } |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | // NOTE:ここから |
---|
| | if (m_viewname == "notifications") entry->setContent(notificationParser(j.toObject())); |
---|
| | else if ((m_viewname.split(':')[0] == "accounts") && (m_viewname.split(':')[2] == "followers")) { |
---|
| | entry->setContent(followerParser(j.toObject())); |
---|
| | } else if ((m_viewname.split(':')[0] == "accounts") && (m_viewname.split(':')[2] == "following")) { |
---|
| | entry->setContent(followerParser(j.toObject())); |
---|
| | } else { |
---|
| | bool cw = !j.toObject()["spoiler_text"].toString().isEmpty(); |
---|
| | if (!j.toObject()["reblog"].isNull()) |
---|
| | cw = !j.toObject()["reblog"].toObject()["spoiler_text"].toString().isEmpty(); |
---|
| | entry->setContent(statusParser(j.toObject()),cw); |
---|
| | } |
---|
| | // NOTE:ここまでを上ifに含めると取得済みエントリを再描画しなくなる。 |
---|
| | } |
---|
| | if (m_entries.count()) { |
---|
| | if (m_entries.first()->id() > m_maxid) reload(); |
---|
| | } |
---|
| |
---|
| | |