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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 { | 119 { |
120 sb.append(DateUtils.formatDateTime(this.getContext(), timestamp, | 120 sb.append(DateUtils.formatDateTime(this.getContext(), timestamp, |
121 DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME)); | 121 DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME)); |
122 } | 122 } |
123 else | 123 else |
124 { | 124 { |
125 sb.append(this.getContext().getString(R.string.last_update_never)); | 125 sb.append(this.getContext().getString(R.string.last_update_never)); |
126 } | 126 } |
127 cbp.setSummary(sb.toString()); | 127 cbp.setSummary(sb.toString()); |
128 } | 128 } |
129 else if (sub.getType() == SubscriptionInfo.Type.CUSTOM && engine != null) | 129 else if (sub.getType() == SubscriptionInfo.Type.CUSTOM) |
130 { | 130 { |
131 engine.removeSubscriptionById(sub.getId()); | 131 if (engine != null) |
| 132 { |
| 133 engine.removeSubscriptionById(sub.getId()); |
| 134 } |
132 continue; | 135 continue; |
133 } | 136 } |
134 | 137 |
135 cbp.setTitle(resInt == null ? sub.getTitle() : getContext().getString(resI
nt)); | 138 cbp.setTitle(resInt == null ? sub.getTitle() : getContext().getString(resI
nt)); |
136 cbp.setChecked(sub.isEnabled()); | 139 cbp.setChecked(sub.isEnabled()); |
137 cbp.setPersistent(false); | 140 cbp.setPersistent(false); |
138 cbp.setKey(sub.getId()); | 141 cbp.setKey(sub.getId()); |
139 cbp.setOnPreferenceChangeListener(this); | 142 cbp.setOnPreferenceChangeListener(this); |
140 this.addPreference(cbp); | 143 this.addPreference(cbp); |
141 } | 144 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 249 } |
247 return true; | 250 return true; |
248 } | 251 } |
249 | 252 |
250 @Override | 253 @Override |
251 public void subscriptionAdded() | 254 public void subscriptionAdded() |
252 { | 255 { |
253 refreshEntries(); | 256 refreshEntries(); |
254 } | 257 } |
255 } | 258 } |
LEFT | RIGHT |