From e9ba66729e2351106b92b29110e60eda4309b8a6 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Thu, 18 Feb 2021 23:31:52 -0600 Subject: [PATCH] Switch from printf to cout --- src/AtomFeed.cpp | 8 +++++--- src/FeedController.cpp | 6 +++--- src/FeedsView.cpp | 2 +- src/MainWindow.cpp | 4 ++-- src/RssFeed.cpp | 8 +++++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/AtomFeed.cpp b/src/AtomFeed.cpp index 90ef5d4..44ef198 100644 --- a/src/AtomFeed.cpp +++ b/src/AtomFeed.cpp @@ -7,6 +7,8 @@ #include +#include + #include "App.h" #include "Entry.h" #include "Util.h" @@ -65,8 +67,8 @@ AtomFeed::RootParse(tinyxml2::XMLElement* xfeed) if (!set && xentry) set = SetDate(xentry->FirstChildElement("published")); - printf("Channel '%s' at '%s':\n", title.String(), - xmlUrl.UrlString().String()); + std::cout << "Channel '" << title << "' at '" << xmlUrl.UrlString() + << "':\n"; } @@ -117,7 +119,7 @@ AtomFeed::ParseEntries(tinyxml2::XMLElement* xfeed) int entryCount = xmlCountSiblings(xentry, "entry"); entries = BList(entryCount); - printf("\t-%i entries-\n", entryCount); + std::cout << "\t-" << entryCount << "-\n"; while (xentry) { EntryParse(xentry); diff --git a/src/FeedController.cpp b/src/FeedController.cpp index 1e074dd..aabbe13 100644 --- a/src/FeedController.cpp +++ b/src/FeedController.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include "App.h" #include "AtomFeed.h" @@ -121,8 +121,8 @@ FeedController::_DownloadLoop(void* ignored) Feed* feedBuffer = new Feed(); while (receive_data(&sender, (void*)feedBuffer, sizeof(Feed)) != 0) { - printf( "Downloading feed from %s...\n", - feedBuffer->GetXmlUrl().UrlString().String()); + std::cout << "Downloading feed from " + << feedBuffer->GetXmlUrl().UrlString() << "…\n"; BMessage* downloadInit = new BMessage(kDownloadStart); downloadInit->AddString("feed", feedBuffer->GetTitle()); diff --git a/src/FeedsView.cpp b/src/FeedsView.cpp index aeeb25f..ae3ca58 100644 --- a/src/FeedsView.cpp +++ b/src/FeedsView.cpp @@ -93,7 +93,7 @@ FeedsView::_InitInterface() _PopulateFeedList(); - fProgressLabel = new BStringView("progressLabel", "Progress…"); + fProgressLabel = new BStringView("progressLabel", ""); // Add, Remove, Edit fAddButton = new BButton("addFeed", "+", new BMessage(kFeedsAddButton)); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index d7ebc4c..25082e2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include "App.h" #include "EntriesView.h" @@ -123,7 +123,7 @@ MainWindow::_UpdateProgress(int32 max, int32 current) fStatusBar->SetMaxValue(max); fStatusBar->SetTo(prog); - printf("%i / %i\n", prog, max); +// std::cout << prog << "/" << max << std::endl; } diff --git a/src/RssFeed.cpp b/src/RssFeed.cpp index e5a876e..80c7e24 100644 --- a/src/RssFeed.cpp +++ b/src/RssFeed.cpp @@ -5,6 +5,8 @@ #include "RssFeed.h" +#include + #include "App.h" #include "Entry.h" #include "Util.h" @@ -49,8 +51,8 @@ RssFeed::RootParse(tinyxml2::XMLElement* xchan) SetTitle(xchan->FirstChildElement("title")); SetDate(xchan->FirstChildElement("lastBuildDate")); - printf("Channel '%s' at '%s':\n", title.String(), - xmlUrl.UrlString().String()); + std::cout << "Channel '" << title.String() << "' at '" << xmlUrl.UrlString() + << ":\n"; } @@ -84,7 +86,7 @@ RssFeed::ParseEntries(tinyxml2::XMLElement* xchan) int entryCount = xmlCountSiblings(xitem, "item"); entries = BList(entryCount); - printf("\t-%i entries-\n", entryCount); + std::cout << "\t-" << entryCount << " entries-\n"; while (xitem) { EntryParse(xitem);