diff --git a/TODO.txt b/TODO.txt index 08c8383..f4be570 100644 --- a/TODO.txt +++ b/TODO.txt @@ -13,7 +13,6 @@ Important improvements: * _Huge_ problem, but I haven't had luck figuring it out yet… * Move from BLists to BObjectLists where possible * Fix background of Feeds List error status icon (it's black, not transparent) -* Check if arg is a file or not (treat appropriately) * Make UI friendly to whatever font-size you throw at it * Give a max size to the progress label in FeedsView * Make fancy Markdown README diff --git a/src/AtomFeed.cpp b/src/AtomFeed.cpp index c943544..943f227 100644 --- a/src/AtomFeed.cpp +++ b/src/AtomFeed.cpp @@ -32,7 +32,7 @@ AtomFeed::AtomFeed(Feed* feed) void AtomFeed::Parse () { - entries = BList(); + entries = BObjectList(); tinyxml2::XMLDocument xml; xml.LoadFile(GetCachePath().String()); @@ -116,7 +116,7 @@ AtomFeed::ParseEntries(tinyxml2::XMLElement* xfeed) xentry = xfeed->FirstChildElement("entry"); int entryCount = xmlCountSiblings(xentry, "entry"); - entries = BList(entryCount); + entries = BObjectList(entryCount); std::cout << "\t-" << entryCount << "-\n"; diff --git a/src/Feed.cpp b/src/Feed.cpp index 1679be0..87bcc76 100644 --- a/src/Feed.cpp +++ b/src/Feed.cpp @@ -92,8 +92,6 @@ Feed::Feed() Feed::~Feed() { - for (int i = entries.CountItems(); i >= 0; i--) - delete ((Entry*)entries.RemoveItem(i)); } @@ -205,19 +203,19 @@ Feed::AddEntry (Entry* newEntry) } -BList +BObjectList Feed::GetEntries() { return entries; } -BList +BObjectList Feed::GetNewEntries() { - BList newEntries; + BObjectList newEntries; for (int i = 0; i < entries.CountItems(); i++) { - Entry* entry = ((Entry*)entries.ItemAt(i)); + Entry* entry = entries.ItemAt(i); if (entry->GetDate() > lastDate) newEntries.AddItem(entry); } diff --git a/src/Feed.h b/src/Feed.h index 6817dd1..01594c4 100644 --- a/src/Feed.h +++ b/src/Feed.h @@ -8,13 +8,14 @@ #include +#include + #include "Entry.h" class BDateTime; class BEntry; class BString; -class BList; class BUrl; @@ -31,8 +32,8 @@ public: virtual void Parse(); - BList GetEntries(); - BList GetNewEntries(); + BObjectList GetEntries(); + BObjectList GetNewEntries(); bool Fetch(); @@ -72,7 +73,7 @@ protected: BString hash; BString lastHash; - BList entries; + BObjectList entries; bool fetched; bool updated; }; diff --git a/src/FeedController.cpp b/src/FeedController.cpp index aeb2703..94b7141 100644 --- a/src/FeedController.cpp +++ b/src/FeedController.cpp @@ -237,7 +237,7 @@ FeedController::_ParseLoop(void* data) while (true) { int32 code = receive_data(&sender, (void*)feedBuffer, sizeof(Feed)); - BList entries; + BObjectList entries; int32 entriesCount; BString feedTitle; BUrl feedUrl = feedBuffer->GetXmlUrl(); diff --git a/src/RssFeed.cpp b/src/RssFeed.cpp index 250694d..409d190 100644 --- a/src/RssFeed.cpp +++ b/src/RssFeed.cpp @@ -31,7 +31,7 @@ void RssFeed::Parse() { tinyxml2::XMLDocument xml; - entries = BList(); + entries = BObjectList(); Feed::Parse(); @@ -83,7 +83,7 @@ RssFeed::ParseEntries(tinyxml2::XMLElement* xchan) xitem = xchan->FirstChildElement("item"); int entryCount = xmlCountSiblings(xitem, "item"); - entries = BList(entryCount); + entries = BObjectList(entryCount); std::cout << "\t-" << entryCount << " entries-\n";