OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace | 23 namespace |
24 { | 24 { |
25 typedef std::vector<AdblockPlus::SubscriptionPtr> SubscriptionList; | 25 typedef std::vector<AdblockPlus::SubscriptionPtr> SubscriptionList; |
26 | 26 |
27 void ShowSubscriptionList(const SubscriptionList& subscriptions) | 27 void ShowSubscriptionList(const SubscriptionList& subscriptions) |
28 { | 28 { |
29 for (SubscriptionList::const_iterator it = subscriptions.begin(); | 29 for (SubscriptionList::const_iterator it = subscriptions.begin(); |
30 it != subscriptions.end(); it++) | 30 it != subscriptions.end(); it++) |
31 { | 31 { |
32 std::cout << (*it)->GetProperty("title")->AsString(); | 32 std::cout << (*it)->GetProperty("title").AsString(); |
33 std::cout << " - " << (*it)->GetProperty("url")->AsString(); | 33 std::cout << " - " << (*it)->GetProperty("url").AsString(); |
34 if (!(*it)->GetProperty("author")->IsUndefined()) | 34 if (!(*it)->GetProperty("author").IsUndefined()) |
35 std::cout << " - " << (*it)->GetProperty("author")->AsString(); | 35 std::cout << " - " << (*it)->GetProperty("author").AsString(); |
36 if (!(*it)->GetProperty("specialization")->IsUndefined()) | 36 if (!(*it)->GetProperty("specialization").IsUndefined()) |
37 std::cout << " - " << (*it)->GetProperty("specialization")->AsString(); | 37 std::cout << " - " << (*it)->GetProperty("specialization").AsString(); |
38 std::cout << std::endl; | 38 std::cout << std::endl; |
39 } | 39 } |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 SubscriptionsCommand::SubscriptionsCommand( | 43 SubscriptionsCommand::SubscriptionsCommand( |
44 AdblockPlus::FilterEngine& filterEngine) | 44 AdblockPlus::FilterEngine& filterEngine) |
45 : Command("subscriptions"), filterEngine(filterEngine) | 45 : Command("subscriptions"), filterEngine(filterEngine) |
46 { | 46 { |
47 } | 47 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 const SubscriptionList& subscriptions = filterEngine.GetListedSubscriptions(); | 125 const SubscriptionList& subscriptions = filterEngine.GetListedSubscriptions(); |
126 for (SubscriptionList::const_iterator it = subscriptions.begin(); | 126 for (SubscriptionList::const_iterator it = subscriptions.begin(); |
127 it != subscriptions.end(); it++) | 127 it != subscriptions.end(); it++) |
128 (*it)->UpdateFilters(); | 128 (*it)->UpdateFilters(); |
129 } | 129 } |
130 | 130 |
131 void SubscriptionsCommand::FetchSubscriptions() | 131 void SubscriptionsCommand::FetchSubscriptions() |
132 { | 132 { |
133 ShowSubscriptionList(filterEngine.FetchAvailableSubscriptions()); | 133 ShowSubscriptionList(filterEngine.FetchAvailableSubscriptions()); |
134 } | 134 } |
OLD | NEW |