Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: shell/src/SubscriptionsCommand.cpp

Issue 10171027: Compile subscriptions.xml into the libadblockplus build and make itusable (Closed)
Patch Set: Created April 19, 2013, 7:59 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: shell/src/SubscriptionsCommand.cpp
===================================================================
--- a/shell/src/SubscriptionsCommand.cpp
+++ b/shell/src/SubscriptionsCommand.cpp
@@ -6,17 +6,24 @@
namespace
{
typedef std::vector<AdblockPlus::SubscriptionPtr> SubscriptionList;
void ShowSubscriptionList(const SubscriptionList& subscriptions)
{
for (SubscriptionList::const_iterator it = subscriptions.begin();
it != subscriptions.end(); it++)
- std::cout << (*it)->GetProperty("title", "(no title)") << " - " << (*it)->GetProperty("url", "") << std::endl;
+ {
+ std::cout << (*it)->GetProperty("title", "(no title)") << " - " << (*it)->GetProperty("url", "");
+ if ((*it)->GetProperty("author", "") != "")
+ std::cout << " - " << (*it)->GetProperty("author", "");
+ if ((*it)->GetProperty("specialization", "") != "")
+ std::cout << " - " << (*it)->GetProperty("specialization", "");
+ std::cout << std::endl;
+ }
}
}
SubscriptionsCommand::SubscriptionsCommand(
AdblockPlus::FilterEngine& filterEngine)
: Command("subscriptions"), filterEngine(filterEngine)
{
}
@@ -100,10 +107,10 @@ void SubscriptionsCommand::UpdateSubscri
const SubscriptionList& subscriptions = filterEngine.GetListedSubscriptions();
for (SubscriptionList::const_iterator it = subscriptions.begin();
it != subscriptions.end(); it++)
(*it)->UpdateFilters();
}
void SubscriptionsCommand::FetchSubscriptions()
{
- filterEngine.FetchAvailableSubscriptions(&ShowSubscriptionList);
+ ShowSubscriptionList(filterEngine.FetchAvailableSubscriptions());
}

Powered by Google App Engine
This is Rietveld