From fb840a544086203bcb3fbcb3e1b42659255f56d4 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 23 Nov 2021 12:53:02 +0100 Subject: [PATCH] some icon fixes, also fix crash #539 --- .../desktop/com.github.rssguard.appdata.xml | 2 +- resources/icons.qrc | 4 ++ .../gui/reusable/widgetwithstatus.cpp | 2 +- .../services/greader/greadernetwork.cpp | 56 ++++++++++++++++++- 4 files changed, 59 insertions(+), 5 deletions(-) diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index 6151e9995..20bf854da 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/resources/icons.qrc b/resources/icons.qrc index 5a5f30741..c01757f41 100644 --- a/resources/icons.qrc +++ b/resources/icons.qrc @@ -11,6 +11,7 @@ ./graphics/Breeze/actions/32/call-start.svg ./graphics/Breeze/status/64/dialog-error.svg ./graphics/Breeze/status/64/dialog-information.svg + ./graphics/Breeze/actions/32/dialog-ok.svg ./graphics/Breeze/status/64/dialog-password.svg ./graphics/Breeze/status/64/dialog-question.svg ./graphics/Breeze/status/64/dialog-warning.svg @@ -75,6 +76,7 @@ ./graphics/Breeze Dark/actions/32/call-start.svg ./graphics/Breeze Dark/status/64/dialog-error.svg ./graphics/Breeze Dark/status/64/dialog-information.svg + ./graphics/Breeze Dark/actions/32/dialog-ok.svg ./graphics/Breeze Dark/status/64/dialog-password.svg ./graphics/Breeze Dark/status/64/dialog-question.svg ./graphics/Breeze Dark/status/64/dialog-warning.svg @@ -138,6 +140,7 @@ ./graphics/Faenza/status/64/dialog-error.png ./graphics/Faenza/status/64/dialog-information.png ./graphics/Faenza/actions/64/dialog-no.png + ./graphics/Faenza/actions/64/dialog-ok.png ./graphics/Faenza/status/64/dialog-password.png ./graphics/Faenza/status/64/dialog-question.png ./graphics/Faenza/status/64/dialog-warning.png @@ -206,6 +209,7 @@ ./graphics/Numix/22/status/dialog-error.svg ./graphics/Numix/22/status/dialog-information.svg ./graphics/Numix/22/actions/dialog-no.svg + ./graphics/Numix/22/actions/dialog-ok.svg ./graphics/Numix/22/status/dialog-password.svg ./graphics/Numix/22/status/dialog-question.svg ./graphics/Numix/22/status/dialog-warning.svg diff --git a/src/librssguard/gui/reusable/widgetwithstatus.cpp b/src/librssguard/gui/reusable/widgetwithstatus.cpp index 6f1d7da62..31c115b63 100644 --- a/src/librssguard/gui/reusable/widgetwithstatus.cpp +++ b/src/librssguard/gui/reusable/widgetwithstatus.cpp @@ -16,7 +16,7 @@ WidgetWithStatus::WidgetWithStatus(QWidget* parent) m_iconInformation = qApp->icons()->fromTheme(QSL("dialog-information")); m_iconWarning = qApp->icons()->fromTheme(QSL("dialog-warning")); m_iconError = qApp->icons()->fromTheme(QSL("dialog-error")); - m_iconOk = qApp->icons()->fromTheme(QSL("dialog-yes")); + m_iconOk = qApp->icons()->fromTheme(QSL("dialog-yes"), QSL("dialog-ok")); m_iconQuestion = qApp->icons()->fromTheme(QSL("dialog-question")); // Set layout properties. diff --git a/src/librssguard/services/greader/greadernetwork.cpp b/src/librssguard/services/greader/greadernetwork.cpp index 4ee1dab67..c607fceb4 100644 --- a/src/librssguard/services/greader/greadernetwork.cpp +++ b/src/librssguard/services/greader/greadernetwork.cpp @@ -144,7 +144,6 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, m_prefetchedStatus = Feed::Status::Normal; try { - double perc_of_fetching = (feeds.size() * 1.0) / root->getSubTreeFeeds().size(); m_performGlobalFetching = perc_of_fetching > GREADER_GLOBAL_UPDATE_THRES; @@ -238,6 +237,24 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, } catch (const FeedFetchException& fex) { m_prefetchedStatus = fex.feedStatus(); + + qCriticalNN << LOGSEC_CORE + << "Failed to fetch item IDs for common stream:" + << QUOTE_W_SPACE_DOT(fex.message()); + } + catch (const NetworkException& nex) { + m_prefetchedStatus = Feed::Status::NetworkError; + + qCriticalNN << LOGSEC_CORE + << "Failed to fetch item IDs for common stream:" + << QUOTE_W_SPACE_DOT(nex.message()); + } + catch (const ApplicationException& aex) { + m_prefetchedStatus = Feed::Status::OtherError; + + qCriticalNN << LOGSEC_CORE + << "Failed to fetch item IDs for common stream:" + << QUOTE_W_SPACE_DOT(aex.message()); } } @@ -266,6 +283,40 @@ QList GreaderNetwork::getMessagesIntelligently(ServiceRoot* root, : itemIds(stream_id, false, proxy, -1, m_newerThanFilter); QStringList remote_unread_ids_list = itemIds(stream_id, true, proxy, -1, m_newerThanFilter); + try { + remote_all_ids_list = m_downloadOnlyUnreadMessages + ? QStringList() + : itemIds(stream_id, false, proxy, -1, m_newerThanFilter); + remote_unread_ids_list = itemIds(stream_id, true, proxy, -1, m_newerThanFilter); + } + catch (const FeedFetchException& fex) { + error = fex.feedStatus(); + + qCriticalNN << LOGSEC_CORE + << "Failed to fetch item IDs for specific stream:" + << QUOTE_W_SPACE_DOT(fex.message()); + + return msgs; + } + catch (const NetworkException& nex) { + error = Feed::Status::NetworkError; + + qCriticalNN << LOGSEC_CORE + << "Failed to fetch item IDs for specific stream:" + << QUOTE_W_SPACE_DOT(nex.message()); + + return msgs; + } + catch (const ApplicationException& aex) { + error = Feed::Status::OtherError; + + qCriticalNN << LOGSEC_CORE + << "Failed to fetch item IDs for specific stream:" + << QUOTE_W_SPACE_DOT(aex.message()); + + return msgs; + } + // Convert item IDs to long form. for (int i = 0; i < remote_all_ids_list.size(); i++) { remote_all_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_all_ids_list.at(i))); @@ -353,12 +404,11 @@ QNetworkReply::NetworkError GreaderNetwork::markMessagesStarred(RootItem::Import QStringList GreaderNetwork::itemIds(const QString& stream_id, bool unread_only, const QNetworkProxy& proxy, int max_count, QDate newer_than) { - QString continuation; - if (!ensureLogin(proxy)) { throw FeedFetchException(Feed::Status::AuthError, tr("login failed")); } + QString continuation; QStringList ids; do {