From c642c911fa29782e3a171c6b1a75595eeecd9398 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Sun, 7 Mar 2021 14:08:47 -0600 Subject: [PATCH] Feed number in notifications --- TODO.txt | 4 ++-- src/FeedListItem.cpp | 8 +++++--- src/Notifier.cpp | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/TODO.txt b/TODO.txt index 7be4121..3aaed7b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,9 +5,9 @@ Important Features: Important improvements: * Memory leaks - * ~50kb per feed on download (+2MB w 40 feeds) + * ~.05MB per feed on download (+2MB w 40 feeds) * This leak is in Util.ccp, fetch(). I'm stumped here. - * ~20kb per feed on parsing (+1MB w 40 feeds) + * ~.02MB per feed on parsing (+1MB w 40 feeds) * Fix background of Feeds List error status icon (it's black, not transparent) * Make UI friendly to whatever font-size you throw at it * Give a max size to the progress label in FeedsView diff --git a/src/FeedListItem.cpp b/src/FeedListItem.cpp index 82754ad..0d585f7 100644 --- a/src/FeedListItem.cpp +++ b/src/FeedListItem.cpp @@ -40,9 +40,11 @@ FeedListItem::DrawItem(BView* owner, BRect frame, bool complete) } case kErrorStatus: { - owner->MovePenTo(frame.right - imageHeight, frame.top); - owner->DrawBitmap(loadVectorIcon("error-status", imageHeight, - imageHeight)); + owner->MovePenTo(frame.right - 20, frame.top + BaselineOffset()); + owner->DrawString("X"); +// owner->MovePenTo(frame.right - imageHeight, frame.top); +// owner->DrawBitmap(loadVectorIcon("error-status", imageHeight, +// imageHeight)); break; } } diff --git a/src/Notifier.cpp b/src/Notifier.cpp index 119176a..33edf24 100644 --- a/src/Notifier.cpp +++ b/src/Notifier.cpp @@ -100,10 +100,10 @@ Notifier::_SendUpdatedNotification() BString entryNum,feedNum = ""; entryNum << fTotalEntries; - feedNum << fUpdatedFeeds->CountItems(); + feedNum << fUpdatedFeeds->CountItems() - 1; notifyText.ReplaceAll("%n%", entryNum); - notifyText.ReplaceAll("%m%", feedNum - 1); + notifyText.ReplaceAll("%m%", feedNum); notifyText.ReplaceAll("%source%", ((BString*)fUpdatedFeeds->ItemAt(0))->String()); @@ -134,9 +134,9 @@ Notifier::_SendFailedNotification() notifyText = "Failed to update %source% and %m% others"; BString feedNum = ""; - feedNum << fFailedFeeds->CountItems(); + feedNum << fFailedFeeds->CountItems() - 1; - notifyText.ReplaceAll("%m%", feedNum - 1); + notifyText.ReplaceAll("%m%", feedNum); notifyText.ReplaceAll("%source%", ((BString*)fFailedFeeds->ItemAt(0))->String());