| |
---|
| | if (timeline != m_viewname) return; |
---|
| | qlonglong s = m_sinceid; |
---|
| | getIdsFromHeader(link); |
---|
| | QJsonArray json = QJsonDocument::fromJson(data).array(); |
---|
| | int news = 0; |
---|
| | for (auto j:json) { |
---|
| | int i = 0; |
---|
| | SaoriViewEntry *entry = nullptr; |
---|
| | for(;m_entries.count() > i;i ++) { |
---|
| |
---|
| | 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); |
---|
| | news ++; |
---|
| | } |
---|
| | |
---|
| | // NOTE:ここから |
---|
| | if (m_viewname == "notifications") entry->setContent(notificationParser(j.toObject())); |
---|
| |
---|
| | // NOTE:ここまでを上ifに含めると取得済みエントリを再描画しなくなる。 |
---|
| | } |
---|
| | if (s != m_sinceid) reload(); |
---|
| | viewEntriesAdjustment(); |
---|
| | if (news && ui->actionNotification->isChecked()) emit newEntryRecived(m_viewname,m_account,news); |
---|
| | } |
---|
| | |
---|
| | void SaoriView::linkClicked(const QUrl &url) |
---|
| | { |
---|
| |
---|
| | |