Fix compile errors

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

@ -43,7 +43,7 @@ public class GtasksMetadata {
public static Metadata createEmptyMetadata(long taskId) {
Metadata metadata = new Metadata();
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(PARENT_TASK, (long)VALUE_UNSET);
metadata.setValue(INDENT, 0);

@ -3,9 +3,7 @@
*/
package com.todoroo.astrid.gtasks;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@ -18,6 +16,7 @@ import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.SyncAction;
import com.todoroo.gtasks.GoogleTaskListInfo;
/**
* Exposes sync action
@ -37,15 +36,11 @@ public class GtasksSyncActionExposer extends BroadcastReceiver {
if(intent.getBooleanExtra("setup", false)) {
gtasksPreferenceService.setToken("haha");
try {
JSONArray newLists = new JSONArray();
JSONObject list = new JSONObject();
list.put("id", "1");
list.put("title", "Tim's Tasks");
newLists.put(list);
list = new JSONObject();
list.put("id", "2");
list.put("title", "Travel");
newLists.put(list);
GoogleTaskListInfo[] newLists = new GoogleTaskListInfo[2];
GoogleTaskListInfo list = new GoogleTaskListInfo("1", "Tim's Tasks");
newLists[0] = list;
list = new GoogleTaskListInfo("2", "Travel");
newLists[1] = list;
gtasksListService.updateLists(newLists);
} catch (JSONException 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.Preferences;
import com.todoroo.gtasks.GoogleTaskService;
import com.todoroo.gtasks.GoogleTaskService.ConvenientTaskCreator;
import com.todoroo.gtasks.GoogleTaskTask;
import com.todoroo.gtasks.GoogleTaskView;
import com.todoroo.gtasks.GoogleTasksException;
import com.todoroo.gtasks.GoogleTaskService.ConvenientTaskCreator;
import com.todoroo.gtasks.actions.Action;
import com.todoroo.gtasks.actions.Actions;
import com.todoroo.gtasks.actions.GetTasksAction;
@ -160,13 +160,14 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
// check if we have a token & it works
if(authToken != null) {
taskService.getTaskView();
performSync();
} else {
if (email == null && password == null) {
// we can't do anything, user is not logged in
} else {
authToken = null; // TODO set up auth token
//authToken = null; // TODO set up auth token
performSync();
}
}

Loading…
Cancel
Save