mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Added line breaks for improved readability.
This commit is contained in:
parent
7830bf2862
commit
a8cc72ebf4
1 changed files with 42 additions and 15 deletions
|
|
@ -284,27 +284,54 @@ open class CommonsApplicationModule(private val applicationContext: Context) {
|
||||||
)
|
)
|
||||||
|
|
||||||
val oldDbPath = appContext.getDatabasePath("commons.db").path
|
val oldDbPath = appContext.getDatabasePath("commons.db").path
|
||||||
val oldDb = SQLiteDatabase.openDatabase(oldDbPath, null, SQLiteDatabase.OPEN_READONLY)
|
val oldDb = SQLiteDatabase
|
||||||
|
.openDatabase(oldDbPath, null, SQLiteDatabase.OPEN_READONLY)
|
||||||
|
|
||||||
val cursor = oldDb.rawQuery("SELECT * FROM bookmarksLocations", null)
|
val cursor = oldDb.rawQuery("SELECT * FROM bookmarksLocations", null)
|
||||||
|
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
val locationName = cursor.getString(cursor.getColumnIndexOrThrow("location_name"))
|
val locationName =
|
||||||
val locationLanguage = cursor.getString(cursor.getColumnIndexOrThrow("location_language"))
|
cursor.getString(cursor.getColumnIndexOrThrow("location_name"))
|
||||||
val locationDescription = cursor.getString(cursor.getColumnIndexOrThrow("location_description"))
|
val locationLanguage =
|
||||||
val locationCategory = cursor.getString(cursor.getColumnIndexOrThrow("location_category"))
|
cursor.getString(cursor.getColumnIndexOrThrow("location_language"))
|
||||||
val locationLabelText = cursor.getString(cursor.getColumnIndexOrThrow("location_label_text"))
|
val locationDescription =
|
||||||
val locationLabelIcon = cursor.getInt(cursor.getColumnIndexOrThrow("location_label_icon"))
|
cursor.getString(cursor.getColumnIndexOrThrow("location_description"))
|
||||||
val locationLat = cursor.getDouble(cursor.getColumnIndexOrThrow("location_lat"))
|
val locationCategory =
|
||||||
val locationLong = cursor.getDouble(cursor.getColumnIndexOrThrow("location_long"))
|
cursor.getString(cursor.getColumnIndexOrThrow("location_category"))
|
||||||
|
val locationLabelText =
|
||||||
|
cursor.getString(cursor.getColumnIndexOrThrow("location_label_text"))
|
||||||
|
val locationLabelIcon =
|
||||||
|
cursor.getInt(cursor.getColumnIndexOrThrow("location_label_icon"))
|
||||||
|
val locationLat =
|
||||||
|
cursor.getDouble(cursor.getColumnIndexOrThrow("location_lat"))
|
||||||
|
val locationLong =
|
||||||
|
cursor.getDouble(cursor.getColumnIndexOrThrow("location_long"))
|
||||||
|
|
||||||
// Handle NULL values safely
|
// Handle NULL values safely
|
||||||
val locationImageUrl = cursor.getString(cursor.getColumnIndexOrThrow("location_image_url")) ?: ""
|
val locationImageUrl =
|
||||||
val locationWikipediaLink = cursor.getString(cursor.getColumnIndexOrThrow("location_wikipedia_link")) ?: ""
|
cursor.getString(
|
||||||
val locationWikidataLink = cursor.getString(cursor.getColumnIndexOrThrow("location_wikidata_link")) ?: ""
|
cursor.getColumnIndexOrThrow("location_image_url")
|
||||||
val locationCommonsLink = cursor.getString(cursor.getColumnIndexOrThrow("location_commons_link")) ?: ""
|
) ?: ""
|
||||||
val locationPic = cursor.getString(cursor.getColumnIndexOrThrow("location_pic")) ?: ""
|
val locationWikipediaLink =
|
||||||
val locationExists = cursor.getInt(cursor.getColumnIndexOrThrow("location_exists"))
|
cursor.getString(
|
||||||
|
cursor.getColumnIndexOrThrow("location_wikipedia_link")
|
||||||
|
) ?: ""
|
||||||
|
val locationWikidataLink =
|
||||||
|
cursor.getString(
|
||||||
|
cursor.getColumnIndexOrThrow("location_wikidata_link")
|
||||||
|
) ?: ""
|
||||||
|
val locationCommonsLink =
|
||||||
|
cursor.getString(
|
||||||
|
cursor.getColumnIndexOrThrow("location_commons_link")
|
||||||
|
) ?: ""
|
||||||
|
val locationPic =
|
||||||
|
cursor.getString(
|
||||||
|
cursor.getColumnIndexOrThrow("location_pic")
|
||||||
|
) ?: ""
|
||||||
|
val locationExists =
|
||||||
|
cursor.getInt(
|
||||||
|
cursor.getColumnIndexOrThrow("location_exists")
|
||||||
|
)
|
||||||
|
|
||||||
db.execSQL(
|
db.execSQL(
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue