diff --git a/src/librssguard/core/feeddownloader.cpp b/src/librssguard/core/feeddownloader.cpp index a560b726d..f66380491 100644 --- a/src/librssguard/core/feeddownloader.cpp +++ b/src/librssguard/core/feeddownloader.cpp @@ -308,15 +308,24 @@ void FeedDownloader::updateOneFeed(Feed* feed) { } } catch (const FeedFetchException& feed_ex) { - // TODO: logovat chybu, todo datachanged feed + qCriticalNN << LOGSEC_NETWORK + << "Error when fetching feed:" + << QUOTE_W_SPACE(feed_ex.feedStatus()) + << "message:" + << QUOTE_W_SPACE_DOT(feed_ex.message()); feed->setStatus(feed_ex.feedStatus()); + feed->getParentServiceRoot()->itemChanged({ feed }); } catch (const ApplicationException& app_ex) { - // TODO: logovat chybu, todo datachanged feed + qCriticalNN << LOGSEC_NETWORK + << "Unknown error when fetching feed:" + << "message:" + << QUOTE_W_SPACE_DOT(app_ex.message()); feed->setStatus(Feed::Status::OtherError); + feed->getParentServiceRoot()->itemChanged({ feed }); } m_feedsUpdated++; diff --git a/src/librssguard/gui/dialogs/formmessagefiltersmanager.cpp b/src/librssguard/gui/dialogs/formmessagefiltersmanager.cpp index 3e0f03746..c3fccb9f4 100644 --- a/src/librssguard/gui/dialogs/formmessagefiltersmanager.cpp +++ b/src/librssguard/gui/dialogs/formmessagefiltersmanager.cpp @@ -423,9 +423,6 @@ void FormMessageFiltersManager::processCheckedFeeds() { // Update messages in DB and reload selection. it->toFeed()->updateMessages(msgs, true); - - // TODO: ted hazi vyjimku, ošetřit - displayMessagesOfFeed(); } } diff --git a/src/librssguard/miscellaneous/feedreader.cpp b/src/librssguard/miscellaneous/feedreader.cpp index febf00339..f4c146bda 100644 --- a/src/librssguard/miscellaneous/feedreader.cpp +++ b/src/librssguard/miscellaneous/feedreader.cpp @@ -223,7 +223,7 @@ void FeedReader::updateAllFeeds() { } void FeedReader::updateManuallyIntervaledFeeds() { - updateFeeds(m_feedsModel->rootItem()->getSubTreeManuallyIntervaledFeeds()); + updateFeeds(m_feedsModel->rootItem()->getSubTreeAutoFetchingWithManualIntervalsFeeds()); } void FeedReader::stopRunningFeedUpdate() { diff --git a/src/librssguard/services/abstract/feed.cpp b/src/librssguard/services/abstract/feed.cpp index cdd4cfd93..2b44bde26 100755 --- a/src/librssguard/services/abstract/feed.cpp +++ b/src/librssguard/services/abstract/feed.cpp @@ -192,6 +192,7 @@ QPair Feed::updateMessages(const QList& messages, bool force_ QPair updated_messages = { 0, 0 }; if (messages.isEmpty()) { + qDebugNN << "No messages to be updated/added in DB."; return updated_messages; } @@ -203,20 +204,19 @@ QPair Feed::updateMessages(const QList& messages, bool force_ << QUOTE_W_SPACE_DOT(is_main_thread); bool ok = false; - - qDebugNN << LOGSEC_CORE - << "There are some messages to be updated/added to DB."; - QString custom_id = customId(); int account_id = getParentServiceRoot()->accountId(); QSqlDatabase database = is_main_thread ? qApp->database()->driver()->connection(metaObject()->className()) : qApp->database()->driver()->connection(QSL("feed_upd")); - updated_messages = DatabaseQueries::updateMessages(database, messages, custom_id, account_id, - source(), force_update, &ok); + updated_messages = DatabaseQueries::updateMessages(database, messages, + custom_id, account_id, + source(), force_update, + &ok); - if (ok && (updated_messages.first > 0 || updated_messages.second > 0)) { + if (updated_messages.first > 0 || updated_messages.second > 0) { + // Something was added or updated in the DB, update numbers. updateCounts(true); if (getParentServiceRoot()->recycleBin() != nullptr) { diff --git a/src/librssguard/services/abstract/feed.h b/src/librssguard/services/abstract/feed.h index d95b6a039..2c2cd9607 100644 --- a/src/librssguard/services/abstract/feed.h +++ b/src/librssguard/services/abstract/feed.h @@ -36,6 +36,8 @@ class Feed : public RootItem { OtherError = 5 }; + Q_ENUM(Status) + explicit Feed(RootItem* parent = nullptr); explicit Feed(const Feed& other); explicit Feed(const QString& title, const QString& custom_id, const QIcon& icon, RootItem* parent = nullptr); diff --git a/src/librssguard/services/abstract/rootitem.cpp b/src/librssguard/services/abstract/rootitem.cpp index 13de7f758..af25f80a8 100644 --- a/src/librssguard/services/abstract/rootitem.cpp +++ b/src/librssguard/services/abstract/rootitem.cpp @@ -400,7 +400,7 @@ QList RootItem::getSubTreeFeeds() const { return children; } -QList RootItem::getSubTreeManuallyIntervaledFeeds() const { +QList RootItem::getSubTreeAutoFetchingWithManualIntervalsFeeds() const { QList children; QList traversable_items; diff --git a/src/librssguard/services/abstract/rootitem.h b/src/librssguard/services/abstract/rootitem.h index 0dccd4214..ebea54c8e 100644 --- a/src/librssguard/services/abstract/rootitem.h +++ b/src/librssguard/services/abstract/rootitem.h @@ -143,7 +143,7 @@ class RSSGUARD_DLLSPEC RootItem : public QObject { // Returns list of feeds complemented by their own string CUSTOM ID. QHash getHashedSubTreeFeeds() const; QList getSubTreeFeeds() const; - QList getSubTreeManuallyIntervaledFeeds() const; + QList getSubTreeAutoFetchingWithManualIntervalsFeeds() const; QList getSubAutoFetchingEnabledFeeds() const; // Returns the service root node which is direct or indirect parent of current item.