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

Unified Diff: shell/src/FiltersCommand.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 | « include/AdblockPlus/FilterEngine.h ('k') | shell/src/SubscriptionsCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/FiltersCommand.cpp
===================================================================
--- a/shell/src/FiltersCommand.cpp
+++ b/shell/src/FiltersCommand.cpp
@@ -93,22 +93,22 @@ std::string FiltersCommand::GetUsage() c
void FiltersCommand::ShowFilters()
{
ShowFilterList(filterEngine.GetListedFilters());
}
void FiltersCommand::AddFilter(const std::string& text)
{
- AdblockPlus::Filter& filter = filterEngine.GetFilter(text);
- filter.AddToList();
+ AdblockPlus::FilterPtr filter = filterEngine.GetFilter(text);
+ filter->AddToList();
}
void FiltersCommand::RemoveFilter(const std::string& text)
{
- AdblockPlus::Filter& filter = filterEngine.GetFilter(text);
- if (!filter.IsListed())
+ AdblockPlus::FilterPtr filter = filterEngine.GetFilter(text);
+ if (!filter->IsListed())
{
std::cout << "No such filter '" << text << "'" << std::endl;
return;
}
- filter.RemoveFromList();
+ filter->RemoveFromList();
}
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | shell/src/SubscriptionsCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld