fixed #444
This commit is contained in:
parent
868d75b182
commit
591c345d07
@ -43,7 +43,9 @@ FeedReader::FeedReader(QObject* parent)
|
||||
<< "Requesting update for all feeds on application startup.";
|
||||
QTimer::singleShot(qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::FeedsUpdateStartupDelay)).toDouble() * 1000,
|
||||
this,
|
||||
&FeedReader::updateAllFeeds);
|
||||
[this]() {
|
||||
updateFeeds(m_feedsModel->rootItem()->getSubAutoFetchingEnabledFeeds());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,6 +421,27 @@ QList<Feed*> RootItem::getSubTreeManuallyIntervaledFeeds() const {
|
||||
return children;
|
||||
}
|
||||
|
||||
QList<Feed*> RootItem::getSubAutoFetchingEnabledFeeds() const {
|
||||
QList<Feed*> children;
|
||||
QList<RootItem*> traversable_items;
|
||||
|
||||
traversable_items.append(const_cast<RootItem* const>(this));
|
||||
|
||||
// Iterate all nested items.
|
||||
while (!traversable_items.isEmpty()) {
|
||||
RootItem* active_item = traversable_items.takeFirst();
|
||||
|
||||
if (active_item->kind() == RootItem::Kind::Feed &&
|
||||
active_item->toFeed()->autoUpdateType() != Feed::AutoUpdateType::DontAutoUpdate) {
|
||||
children.append(active_item->toFeed());
|
||||
}
|
||||
|
||||
traversable_items.append(active_item->childItems());
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
ServiceRoot* RootItem::getParentServiceRoot() const {
|
||||
const RootItem* working_parent = this;
|
||||
|
||||
|
@ -144,6 +144,7 @@ class RSSGUARD_DLLSPEC RootItem : public QObject {
|
||||
QHash<QString, Feed*> getHashedSubTreeFeeds() const;
|
||||
QList<Feed*> getSubTreeFeeds() const;
|
||||
QList<Feed*> getSubTreeManuallyIntervaledFeeds() const;
|
||||
QList<Feed*> getSubAutoFetchingEnabledFeeds() const;
|
||||
|
||||
// Returns the service root node which is direct or indirect parent of current item.
|
||||
ServiceRoot* getParentServiceRoot() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user