|
|
@ -105,7 +105,8 @@ FeedListWidget::FeedListWidget(QWidget *parent) |
|
|
|
m_rssToTreeItemMapping[RSS::Session::instance()->rootFolder()] = invisibleRootItem(); |
|
|
|
m_rssToTreeItemMapping[RSS::Session::instance()->rootFolder()] = invisibleRootItem(); |
|
|
|
|
|
|
|
|
|
|
|
m_unreadStickyItem = new FeedListItem(this); |
|
|
|
m_unreadStickyItem = new FeedListItem(this); |
|
|
|
m_unreadStickyItem->setData(0, Qt::UserRole, QVariant::fromValue(RSS::Session::instance()->rootFolder())); |
|
|
|
m_unreadStickyItem->setData(0, Qt::UserRole, QVariant::fromValue( |
|
|
|
|
|
|
|
reinterpret_cast<intptr_t>(RSS::Session::instance()->rootFolder()))); |
|
|
|
m_unreadStickyItem->setText(0, tr("Unread (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount())); |
|
|
|
m_unreadStickyItem->setText(0, tr("Unread (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount())); |
|
|
|
m_unreadStickyItem->setData(0, Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"mail-inbox"_qs)); |
|
|
|
m_unreadStickyItem->setData(0, Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"mail-inbox"_qs)); |
|
|
|
m_unreadStickyItem->setData(0, StickyItemTagRole, true); |
|
|
|
m_unreadStickyItem->setData(0, StickyItemTagRole, true); |
|
|
@ -211,9 +212,10 @@ QList<QTreeWidgetItem *> FeedListWidget::getAllOpenedFolders(QTreeWidgetItem *pa |
|
|
|
|
|
|
|
|
|
|
|
RSS::Item *FeedListWidget::getRSSItem(QTreeWidgetItem *item) const |
|
|
|
RSS::Item *FeedListWidget::getRSSItem(QTreeWidgetItem *item) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!item) return nullptr; |
|
|
|
if (!item) |
|
|
|
|
|
|
|
return nullptr; |
|
|
|
|
|
|
|
|
|
|
|
return item->data(0, Qt::UserRole).value<RSS::Item *>(); |
|
|
|
return reinterpret_cast<RSS::Item *>(item->data(0, Qt::UserRole).value<intptr_t>()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *FeedListWidget::mapRSSItem(RSS::Item *rssItem) const |
|
|
|
QTreeWidgetItem *FeedListWidget::mapRSSItem(RSS::Item *rssItem) const |
|
|
@ -275,7 +277,7 @@ QTreeWidgetItem *FeedListWidget::createItem(RSS::Item *rssItem, QTreeWidgetItem |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto *item = new FeedListItem; |
|
|
|
auto *item = new FeedListItem; |
|
|
|
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_qs.arg(rssItem->name(), QString::number(rssItem->unreadCount()))); |
|
|
|
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_qs.arg(rssItem->name(), QString::number(rssItem->unreadCount()))); |
|
|
|
item->setData(0, Qt::UserRole, QVariant::fromValue(rssItem)); |
|
|
|
item->setData(0, Qt::UserRole, QVariant::fromValue(reinterpret_cast<intptr_t>(rssItem))); |
|
|
|
m_rssToTreeItemMapping[rssItem] = item; |
|
|
|
m_rssToTreeItemMapping[rssItem] = item; |
|
|
|
|
|
|
|
|
|
|
|
QIcon icon; |
|
|
|
QIcon icon; |
|
|
|