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

Unified Diff: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java

Issue 29559597: Issue 5810 - Use "specialization" as Subscription display title (Closed)
Patch Set: fix Created Sept. 29, 2017, 8:38 p.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
Index: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
diff --git a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
index a67707259bda5a0042cba75cf078a7f27fe87e9b..514eb0ffef3f8032cb96f9dfcb28503ad2321cfc 100644
--- a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
+++ b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
@@ -34,6 +34,7 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
private static final String SETTINGS_SUBSCRIPTIONS_KEY = "subscriptions";
private static final String SETTINGS_SUBSCRIPTION_KEY = "subscription";
private static final String SETTINGS_SUBSCRIPTION_URL_KEY = "url";
+ private static final String SETTINGS_SUBSCRIPTION_SPECIALIZATION_KEY = "specialization";
private static final String SETTINGS_SUBSCRIPTION_TITLE_KEY = "title";
private static final String SETTINGS_WL_DOMAINS_KEY = "whitelisted_domains";
private static final String SETTINGS_WL_DOMAIN_KEY = "domain";
@@ -115,6 +116,7 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
Subscription subscription = new Subscription();
subscription.title = prefs.getString(getSubscriptionTitleKey(i), "");
subscription.url = prefs.getString(getSubscriptionURLKey(i), "");
+ subscription.specialization = prefs.getString(getSubscriptionSpecializationKey(i), "");
subscriptions.add(subscription);
}
settings.setSubscriptions(subscriptions);
@@ -143,6 +145,11 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
return getArrayItemKey(index, SETTINGS_SUBSCRIPTION_KEY, SETTINGS_SUBSCRIPTION_URL_KEY);
}
+ private String getSubscriptionSpecializationKey(int index)
+ {
+ return getArrayItemKey(index, SETTINGS_SUBSCRIPTION_KEY, SETTINGS_SUBSCRIPTION_SPECIALIZATION_KEY);
+ }
+
@Override
public void save(AdblockSettings settings)
{
@@ -199,9 +206,10 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
{
Subscription eachSubscription = settings.getSubscriptions().get(i);
- // warning: saving `title` and `url` fields only
+ // warning: saving `title`, `url` and `specialization` fields only
editor.putString(getSubscriptionTitleKey(i), eachSubscription.title);
editor.putString(getSubscriptionURLKey(i), eachSubscription.url);
+ editor.putString(getSubscriptionSpecializationKey(i), eachSubscription.specialization);
}
}
}

Powered by Google App Engine
This is Rietveld