Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 if (!this.subscriptions.containsKey(id)) | 215 if (!this.subscriptions.containsKey(id)) |
216 { | 216 { |
217 this.subscriptions.put(id, sub); | 217 this.subscriptions.put(id, sub); |
218 return sub; | 218 return sub; |
219 } | 219 } |
220 return this.subscriptions.get(id); | 220 return this.subscriptions.get(id); |
221 } | 221 } |
222 | 222 |
223 public boolean remove(final String id) | 223 public boolean remove(final String id) |
224 { | 224 { |
225 if (this.subscriptions.containsKey(id)) | 225 return this.subscriptions.remove(id) != null; |
anton
2017/08/25 10:40:40
the whole method could be replaced with `return th
jens
2017/08/25 11:35:07
Acknowledged.
The return values is not needed yet
| |
226 { | |
227 this.subscriptions.remove(id); | |
228 return true; | |
229 } | |
230 return false; | |
231 } | 226 } |
232 | 227 |
233 public static Subscriptions initialize(final Engine engine, final File appFold er, | 228 public static Subscriptions initialize(final Engine engine, final File appFold er, |
234 final File cacheFolder) | 229 final File cacheFolder) |
235 { | 230 { |
236 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder) ; | 231 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder) ; |
237 | 232 |
238 subs.subscriptionFolder.mkdirs(); | 233 subs.subscriptionFolder.mkdirs(); |
239 subs.cacheFolder.mkdirs(); | 234 subs.cacheFolder.mkdirs(); |
240 | 235 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 if (sub != null) | 289 if (sub != null) |
295 { | 290 { |
296 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi le(sub), | 291 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi le(sub), |
297 this.getFiltersFile(sub))) | 292 this.getFiltersFile(sub))) |
298 { | 293 { |
299 this.engine.requestUpdateBroadcast(); | 294 this.engine.requestUpdateBroadcast(); |
300 } | 295 } |
301 } | 296 } |
302 } | 297 } |
303 } | 298 } |
LEFT | RIGHT |