From 3aac9f082bfa15864abb8d4e9f2b997a1adaf5b6 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 6 Mar 2013 16:31:03 -0800 Subject: [PATCH] Kill featured lists --- .../actfm/sync/ActFmSyncV2Provider.java | 32 ------------------- .../actfm/sync/AstridNewSyncMigrator.java | 10 ++++++ astrid/res/values/keys.xml | 3 -- astrid/res/xml/preferences.xml | 4 --- .../astrid/activity/DefaultFilterMode.java | 6 +--- .../astrid/activity/EditPreferences.java | 10 +----- .../todoroo/astrid/ui/MainMenuPopover.java | 7 ---- .../utility/AstridDefaultPreferenceSpec.java | 1 - .../utility/AstridLitePreferenceSpec.java | 1 - .../astrid/utility/AstridPreferences.java | 13 +------- 10 files changed, 13 insertions(+), 74 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java index b2658609d..8f38be6ac 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncV2Provider.java @@ -6,9 +6,7 @@ package com.todoroo.astrid.actfm.sync; import java.io.IOException; -import java.util.concurrent.atomic.AtomicInteger; -import org.json.JSONException; import org.json.JSONObject; import com.timsu.astrid.GCMIntentService; @@ -73,8 +71,6 @@ public class ActFmSyncV2Provider extends SyncV2Provider { return actFmPreferenceService.isLoggedIn(); } - private static final String LAST_FEATURED_TAG_FETCH_TIME = "actfm_last_featuredTag"; //$NON-NLS-1$ - // --- synchronize active tasks @Override @@ -84,13 +80,9 @@ public class ActFmSyncV2Provider extends SyncV2Provider { new Thread(new Runnable() { public void run() { - final AtomicInteger finisher = new AtomicInteger(1); - updateUserStatus(); ActFmSyncThread.getInstance().setTimeForBackgroundSync(true); - - startFeaturedListFetcher(finisher); } }).start(); } @@ -129,30 +121,6 @@ public class ActFmSyncV2Provider extends SyncV2Provider { } } - /** fetch changes to tags */ - private void startFeaturedListFetcher(final AtomicInteger finisher) { - new Thread(new Runnable() { - @Override - public void run() { - int time = Preferences.getInt(LAST_FEATURED_TAG_FETCH_TIME, 0); - try { - if (Preferences.getBoolean(R.string.p_show_featured_lists, false)) { - time = actFmSyncService.fetchFeaturedLists(time); - Preferences.setInt(LAST_FEATURED_TAG_FETCH_TIME, time); - } - } catch (JSONException e) { - handler.handleException("actfm-sync", e, e.toString()); //$NON-NLS-1$ - } catch (IOException e) { - handler.handleException("actfm-sync", e, e.toString()); //$NON-NLS-1$ - } finally { - if(finisher.decrementAndGet() == 0) { - finishSync(null); - } - } - } - }).start(); - } - // --- synchronize list @Override public void synchronizeList(Object list, final boolean manual, diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java index 5f42d48d1..8fe916556 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java @@ -402,6 +402,16 @@ public class AstridNewSyncMigrator { Log.e(LOG_TAG, "Error validating task to tag metadata", e); } + // -------------- + // Delete all featured list data + // -------------- + try { + tagDataDao.deleteWhere(Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_FEATURED).gt(0)); + } catch (Exception e) { + Log.e(LOG_TAG, "Error deleting featured list data", e); + } + + // -------------- // Finally, create oustanding entries for tags on unsynced tasks // -------------- diff --git a/astrid/res/values/keys.xml b/astrid/res/values/keys.xml index 164f6e133..b426a2a19 100644 --- a/astrid/res/values/keys.xml +++ b/astrid/res/values/keys.xml @@ -64,8 +64,6 @@ force_phone_layout - - account @@ -90,7 +88,6 @@ p_menu_items p_show_menu_search p_show_menu_friends - p_show_featured_lists_labs p_show_menu_sync p_show_menu_sort p_show_menu_addons diff --git a/astrid/res/xml/preferences.xml b/astrid/res/xml/preferences.xml index 5a2007cd3..79f11accb 100644 --- a/astrid/res/xml/preferences.xml +++ b/astrid/res/xml/preferences.xml @@ -104,10 +104,6 @@ android:key="@string/p_show_menu_friends" android:title="@string/TLA_menu_friends" android:defaultValue="true"/> - featLists = PluginServices.getTagDataService().query(Query.select(TagData.ID) - .where(Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_FEATURED).gt(0)).limit(1)); - try { - showFeaturedLists = featLists.getCount() > 0; - } finally { - featLists.close(); - } - Preferences.setBoolean(FeaturedListFilterExposer.PREF_SHOULD_SHOW_FEATURED_LISTS, showFeaturedLists); + Preferences.setBoolean(FeaturedListFilterExposer.PREF_SHOULD_SHOW_FEATURED_LISTS, false); } /* ======================================================================