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

Side by Side Diff: shell/src/FiltersCommand.cpp

Issue 29416579: Issue 5034 - Part 1: Pass a JsValue directly to SetProperty() and return from GetProperty() (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 18, 2017, 9:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 case AdblockPlus::Filter::TYPE_COMMENT: 47 case AdblockPlus::Filter::TYPE_COMMENT:
48 type = "comment"; 48 type = "comment";
49 break; 49 break;
50 case AdblockPlus::Filter::TYPE_INVALID: 50 case AdblockPlus::Filter::TYPE_INVALID:
51 type = "invalid"; 51 type = "invalid";
52 break; 52 break;
53 default: 53 default:
54 type = "(unknown type)"; 54 type = "(unknown type)";
55 break; 55 break;
56 } 56 }
57 std::cout << (*it)->GetProperty("text")->AsString() << " - " << 57 std::cout << (*it)->GetProperty("text").AsString() << " - " <<
58 type << std::endl; 58 type << std::endl;
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 FiltersCommand::FiltersCommand(AdblockPlus::FilterEngine& filterEngine) 63 FiltersCommand::FiltersCommand(AdblockPlus::FilterEngine& filterEngine)
64 : Command("filters"), filterEngine(filterEngine) 64 : Command("filters"), filterEngine(filterEngine)
65 { 65 {
66 } 66 }
67 67
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void FiltersCommand::RemoveFilter(const std::string& text) 122 void FiltersCommand::RemoveFilter(const std::string& text)
123 { 123 {
124 AdblockPlus::FilterPtr filter = filterEngine.GetFilter(text); 124 AdblockPlus::FilterPtr filter = filterEngine.GetFilter(text);
125 if (!filter->IsListed()) 125 if (!filter->IsListed())
126 { 126 {
127 std::cout << "No such filter '" << text << "'" << std::endl; 127 std::cout << "No such filter '" << text << "'" << std::endl;
128 return; 128 return;
129 } 129 }
130 filter->RemoveFromList(); 130 filter->RemoveFromList();
131 } 131 }
OLDNEW
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | shell/src/MatchesCommand.cpp » ('j') | src/JsEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld