diff --git a/app/src/main/java/com/etesync/syncadapter/App.kt b/app/src/main/java/com/etesync/syncadapter/App.kt index c5e15239..3d125410 100644 --- a/app/src/main/java/com/etesync/syncadapter/App.kt +++ b/app/src/main/java/com/etesync/syncadapter/App.kt @@ -158,22 +158,6 @@ class App : Application() { private fun update(fromVersion: Int) { Logger.log.info("Updating from version " + fromVersion + " to " + BuildConfig.VERSION_CODE) - if (fromVersion < 6) { - val data = this.data - - val dbHelper = ServiceDB.OpenHelper(this) - - val collections = readCollections(dbHelper) - for (info in collections) { - val journalEntity = JournalEntity(data, info) - data.insert(journalEntity) - } - - val db = dbHelper.writableDatabase - db.delete(ServiceDB.Collections._TABLE, null, null) - db.close() - } - if (fromVersion < 7) { /* Fix all of the etags to be non-null */ val am = AccountManager.get(this) @@ -234,21 +218,6 @@ class App : Application() { } - private fun readCollections(dbHelper: ServiceDB.OpenHelper): List { - val db = dbHelper.writableDatabase - val collections = LinkedList() - val cursor = db.query(ServiceDB.Collections._TABLE, null, null, null, null, null, null) - while (cursor.moveToNext()) { - val values = ContentValues() - DatabaseUtils.cursorRowToContentValues(cursor, values) - collections.add(CollectionInfo.fromDB(values)) - } - - db.close() - cursor.close() - return collections - } - fun migrateServices(dbHelper: ServiceDB.OpenHelper) { val db = dbHelper.readableDatabase val data = this.data diff --git a/app/src/main/java/com/etesync/syncadapter/model/CollectionInfo.kt b/app/src/main/java/com/etesync/syncadapter/model/CollectionInfo.kt index 72fbf6ad..9fd97fd6 100644 --- a/app/src/main/java/com/etesync/syncadapter/model/CollectionInfo.kt +++ b/app/src/main/java/com/etesync/syncadapter/model/CollectionInfo.kt @@ -48,23 +48,6 @@ class CollectionInfo : com.etesync.journalmanager.model.CollectionInfo() { return info } - fun fromDB(values: ContentValues): CollectionInfo { - val info = CollectionInfo() - info.id = values.getAsLong(Collections.ID)!! - info.serviceID = values.getAsInteger(Collections.SERVICE_ID)!! - - info.uid = values.getAsString(Collections.URL) - info.displayName = values.getAsString(Collections.DISPLAY_NAME) - info.description = values.getAsString(Collections.DESCRIPTION) - - info.color = values.getAsInteger(Collections.COLOR) - - info.timeZone = values.getAsString(Collections.TIME_ZONE) - - info.selected = values.getAsInteger(Collections.SYNC) != 0 - return info - } - fun fromJson(json: String): CollectionInfo { return GsonBuilder().excludeFieldsWithoutExposeAnnotation().create().fromJson(json, CollectionInfo::class.java) }