Fix compile errors

pull/14/head
Tim Su 15 years ago
parent e8489b7996
commit 248791d378

@ -43,7 +43,7 @@ public class GtasksMetadata {
public static Metadata createEmptyMetadata(long taskId) { public static Metadata createEmptyMetadata(long taskId) {
Metadata metadata = new Metadata(); Metadata metadata = new Metadata();
metadata.setValue(Metadata.KEY, GtasksMetadata.METADATA_KEY); metadata.setValue(Metadata.KEY, GtasksMetadata.METADATA_KEY);
metadata.setValue(ID, (long)VALUE_UNSET); metadata.setValue(ID, ""); //$NON-NLS-1$
metadata.setValue(LIST_ID, Preferences.getStringValue(GtasksPreferenceService.PREF_DEFAULT_LIST)); metadata.setValue(LIST_ID, Preferences.getStringValue(GtasksPreferenceService.PREF_DEFAULT_LIST));
metadata.setValue(PARENT_TASK, (long)VALUE_UNSET); metadata.setValue(PARENT_TASK, (long)VALUE_UNSET);
metadata.setValue(INDENT, 0); metadata.setValue(INDENT, 0);

@ -3,9 +3,7 @@
*/ */
package com.todoroo.astrid.gtasks; package com.todoroo.astrid.gtasks;
import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
@ -18,6 +16,7 @@ import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.SyncAction; import com.todoroo.astrid.api.SyncAction;
import com.todoroo.gtasks.GoogleTaskListInfo;
/** /**
* Exposes sync action * Exposes sync action
@ -37,15 +36,11 @@ public class GtasksSyncActionExposer extends BroadcastReceiver {
if(intent.getBooleanExtra("setup", false)) { if(intent.getBooleanExtra("setup", false)) {
gtasksPreferenceService.setToken("haha"); gtasksPreferenceService.setToken("haha");
try { try {
JSONArray newLists = new JSONArray(); GoogleTaskListInfo[] newLists = new GoogleTaskListInfo[2];
JSONObject list = new JSONObject(); GoogleTaskListInfo list = new GoogleTaskListInfo("1", "Tim's Tasks");
list.put("id", "1"); newLists[0] = list;
list.put("title", "Tim's Tasks"); list = new GoogleTaskListInfo("2", "Travel");
newLists.put(list); newLists[1] = list;
list = new JSONObject();
list.put("id", "2");
list.put("title", "Travel");
newLists.put(list);
gtasksListService.updateLists(newLists); gtasksListService.updateLists(newLists);
} catch (JSONException e) { } catch (JSONException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

@ -48,10 +48,10 @@ import com.todoroo.astrid.sync.SyncProvider;
import com.todoroo.astrid.utility.Constants; import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.utility.Preferences; import com.todoroo.astrid.utility.Preferences;
import com.todoroo.gtasks.GoogleTaskService; import com.todoroo.gtasks.GoogleTaskService;
import com.todoroo.gtasks.GoogleTaskService.ConvenientTaskCreator;
import com.todoroo.gtasks.GoogleTaskTask; import com.todoroo.gtasks.GoogleTaskTask;
import com.todoroo.gtasks.GoogleTaskView; import com.todoroo.gtasks.GoogleTaskView;
import com.todoroo.gtasks.GoogleTasksException; import com.todoroo.gtasks.GoogleTasksException;
import com.todoroo.gtasks.GoogleTaskService.ConvenientTaskCreator;
import com.todoroo.gtasks.actions.Action; import com.todoroo.gtasks.actions.Action;
import com.todoroo.gtasks.actions.Actions; import com.todoroo.gtasks.actions.Actions;
import com.todoroo.gtasks.actions.GetTasksAction; import com.todoroo.gtasks.actions.GetTasksAction;
@ -160,13 +160,14 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
// check if we have a token & it works // check if we have a token & it works
if(authToken != null) { if(authToken != null) {
taskService.getTaskView(); taskService.getTaskView();
performSync(); performSync();
} else { } else {
if (email == null && password == null) { if (email == null && password == null) {
// we can't do anything, user is not logged in // we can't do anything, user is not logged in
} else { } else {
authToken = null; // TODO set up auth token //authToken = null; // TODO set up auth token
performSync(); performSync();
} }
} }

Loading…
Cancel
Save