Fixed up upgrade service to work

pull/14/head
Tim Su 16 years ago
parent 8444bce934
commit 42e9c57244

@ -4,7 +4,7 @@
<booleanAttribute key="ch.zork.quicklaunch" value="true"/> <booleanAttribute key="ch.zork.quicklaunch" value="true"/>
<stringAttribute key="ch.zork.quicklaunch.icon" value="14.gif"/> <stringAttribute key="ch.zork.quicklaunch.icon" value="14.gif"/>
<intAttribute key="ch.zork.quicklaunch.index" value="0"/> <intAttribute key="ch.zork.quicklaunch.index" value="0"/>
<stringAttribute key="ch.zork.quicklaunch.mode" value="run"/> <stringAttribute key="ch.zork.quicklaunch.mode" value="debug"/>
<intAttribute key="com.android.ide.eclipse.adt.action" value="0"/> <intAttribute key="com.android.ide.eclipse.adt.action" value="0"/>
<stringAttribute key="com.android.ide.eclipse.adt.avd" value="android-22"/> <stringAttribute key="com.android.ide.eclipse.adt.avd" value="android-22"/>
<stringAttribute key="com.android.ide.eclipse.adt.commandline" value="-scale 0.7"/> <stringAttribute key="com.android.ide.eclipse.adt.commandline" value="-scale 0.7"/>

@ -44,7 +44,7 @@ public final class Database extends AbstractDatabase {
// --- implementation // --- implementation
@Override @Override
protected String getName() { public String getName() {
return NAME; return NAME;
} }

@ -1,5 +1,6 @@
package com.todoroo.astrid.service; package com.todoroo.astrid.service;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -11,8 +12,8 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor; import android.content.SharedPreferences.Editor;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log; import android.util.Log;
import com.timsu.astrid.R; import com.timsu.astrid.R;
@ -103,6 +104,10 @@ public class Astrid2To3UpgradeHelper {
public void upgrade2To3() { public void upgrade2To3() {
Context context = ContextManager.getContext(); Context context = ContextManager.getContext();
// if there's already a database table, skip
if(Arrays.asList(context.databaseList()).contains(database.getName()))
return;
// pop up a progress dialog // pop up a progress dialog
ProgressDialog dialog = null; ProgressDialog dialog = null;
if(context instanceof Activity) if(context instanceof Activity)

@ -1,5 +1,7 @@
package com.todoroo.astrid.service; package com.todoroo.astrid.service;
import android.util.Log;
import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.data.Property.CountProperty; import com.todoroo.andlib.data.Property.CountProperty;

@ -65,9 +65,7 @@ public final class UpgradeService {
}); });
if(from <= 134) if(from <= 134)
newVersionString(changeLog, "3.0.0 (?/??/10)", new String[] { newVersionString(changeLog, "3.0.0 (?/??/10)", new String[] {
"Astrid is brand new under the hood! You won't see many " + "Astrid is brand new inside and out!",
"changes yet but Astrid received a much-needed makeover " +
"that allows it to do a lot of new tricks. Stay tuned!",
}); });
if(changeLog.length() == 0) if(changeLog.length() == 0)

Loading…
Cancel
Save