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

Unified Diff: shell/src/SubscriptionsCommand.cpp

Issue 10236010: Always work with pointers to filters and subscriptions, drop the references for API consistency (Closed)
Patch Set: Created April 11, 2013, 7:24 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
« no previous file with comments | « shell/src/FiltersCommand.cpp ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/SubscriptionsCommand.cpp
===================================================================
--- a/shell/src/SubscriptionsCommand.cpp
+++ b/shell/src/SubscriptionsCommand.cpp
@@ -73,31 +73,31 @@ std::string SubscriptionsCommand::GetUsa
void SubscriptionsCommand::ShowSubscriptions()
{
ShowSubscriptionList(filterEngine.GetListedSubscriptions());
}
void SubscriptionsCommand::AddSubscription(const std::string& url,
const std::string& title)
{
- AdblockPlus::Subscription& subscription = filterEngine.GetSubscription(url);
+ AdblockPlus::SubscriptionPtr subscription = filterEngine.GetSubscription(url);
if (title.size())
- subscription.SetProperty("title", title);
- subscription.AddToList();
+ subscription->SetProperty("title", title);
+ subscription->AddToList();
}
void SubscriptionsCommand::RemoveSubscription(const std::string& url)
{
- AdblockPlus::Subscription& subscription = filterEngine.GetSubscription(url);
- if (!subscription.IsListed())
+ AdblockPlus::SubscriptionPtr subscription = filterEngine.GetSubscription(url);
+ if (!subscription->IsListed())
{
std::cout << "No subscription with URL '" << url << "'" << std::endl;
return;
}
- subscription.RemoveFromList();
+ subscription->RemoveFromList();
}
void SubscriptionsCommand::UpdateSubscriptions()
{
const SubscriptionList& subscriptions = filterEngine.GetListedSubscriptions();
for (SubscriptionList::const_iterator it = subscriptions.begin();
it != subscriptions.end(); it++)
(*it)->UpdateFilters();
« no previous file with comments | « shell/src/FiltersCommand.cpp ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld