|
|
@ -320,7 +320,7 @@ void RSSImp::saveFoldersOpenState() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// refresh all streams by a button
|
|
|
|
// refresh all streams by a button
|
|
|
|
void RSSImp::on_updateAllButton_clicked() { |
|
|
|
void RSSImp::refreshAllFeeds() { |
|
|
|
foreach (QTreeWidgetItem *item, m_feedList->getAllFeedItems()) { |
|
|
|
foreach (QTreeWidgetItem *item, m_feedList->getAllFeedItems()) { |
|
|
|
item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
} |
|
|
|
} |
|
|
@ -402,24 +402,21 @@ void RSSImp::refreshSelectedItems() { |
|
|
|
RssFilePtr file = m_feedList->getRSSItem(item); |
|
|
|
RssFilePtr file = m_feedList->getRSSItem(item); |
|
|
|
// Update icons
|
|
|
|
// Update icons
|
|
|
|
if (item == m_feedList->stickyUnreadItem()) { |
|
|
|
if (item == m_feedList->stickyUnreadItem()) { |
|
|
|
foreach (QTreeWidgetItem *feed, m_feedList->getAllFeedItems()) { |
|
|
|
refreshAllFeeds(); |
|
|
|
feed->setData(0, Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
file->refresh(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
if (!file->refresh()) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
// Update UI
|
|
|
|
if (qSharedPointerDynamicCast<RssFeed>(file)) { |
|
|
|
if (qSharedPointerDynamicCast<RssFeed>(file)) { |
|
|
|
item->setData(0, Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
item->setData(0, Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
} else if (qSharedPointerDynamicCast<RssFolder>(file)) { |
|
|
|
} else if (qSharedPointerDynamicCast<RssFolder>(file)) { |
|
|
|
// Update feeds in the folder
|
|
|
|
// Update feeds in the folder
|
|
|
|
foreach (QTreeWidgetItem *feed, m_feedList->getAllFeedItems(item)) { |
|
|
|
foreach (QTreeWidgetItem *feed, m_feedList->getAllFeedItems(item)) |
|
|
|
feed->setData(0, Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
feed->setData(0, Qt::DecorationRole, QVariant(QIcon(":/Icons/loading.png"))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// Actually refresh
|
|
|
|
|
|
|
|
file->refresh(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void RSSImp::copySelectedFeedsURL() { |
|
|
|
void RSSImp::copySelectedFeedsURL() { |
|
|
@ -688,7 +685,8 @@ RSSImp::RSSImp(QWidget *parent) : QWidget(parent), m_rssManager(new RssManager) |
|
|
|
connect(actionUpdate, SIGNAL(triggered()), this, SLOT(refreshSelectedItems())); |
|
|
|
connect(actionUpdate, SIGNAL(triggered()), this, SLOT(refreshSelectedItems())); |
|
|
|
connect(actionNew_folder, SIGNAL(triggered()), this, SLOT(askNewFolder())); |
|
|
|
connect(actionNew_folder, SIGNAL(triggered()), this, SLOT(askNewFolder())); |
|
|
|
connect(actionNew_subscription, SIGNAL(triggered()), this, SLOT(on_newFeedButton_clicked())); |
|
|
|
connect(actionNew_subscription, SIGNAL(triggered()), this, SLOT(on_newFeedButton_clicked())); |
|
|
|
connect(actionUpdate_all_feeds, SIGNAL(triggered()), this, SLOT(on_updateAllButton_clicked())); |
|
|
|
connect(actionUpdate_all_feeds, SIGNAL(triggered()), this, SLOT(refreshAllFeeds())); |
|
|
|
|
|
|
|
connect(updateAllButton, SIGNAL(clicked()), SLOT(refreshAllFeeds())); |
|
|
|
connect(actionCopy_feed_URL, SIGNAL(triggered()), this, SLOT(copySelectedFeedsURL())); |
|
|
|
connect(actionCopy_feed_URL, SIGNAL(triggered()), this, SLOT(copySelectedFeedsURL())); |
|
|
|
connect(actionMark_items_read, SIGNAL(triggered()), this, SLOT(on_markReadButton_clicked())); |
|
|
|
connect(actionMark_items_read, SIGNAL(triggered()), this, SLOT(on_markReadButton_clicked())); |
|
|
|
// News list actions
|
|
|
|
// News list actions
|
|
|
@ -731,5 +729,5 @@ void RSSImp::on_rssDownloaderBtn_clicked() |
|
|
|
AutomatedRssDownloader dlg(m_rssManager, this); |
|
|
|
AutomatedRssDownloader dlg(m_rssManager, this); |
|
|
|
dlg.exec(); |
|
|
|
dlg.exec(); |
|
|
|
if (dlg.isRssDownloaderEnabled()) |
|
|
|
if (dlg.isRssDownloaderEnabled()) |
|
|
|
on_updateAllButton_clicked(); |
|
|
|
refreshAllFeeds(); |
|
|
|
} |
|
|
|
} |
|
|
|