Skip to content

Commit b2407e7

Browse files
Merge branch 'main' into fix-empty-username
2 parents 4634eeb + 1c7dce9 commit b2407e7

29 files changed

+700
-942
lines changed

app/src/main/AndroidManifest.xml

-6
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@
232232
android:exported="false"
233233
android:label="@string/provider_bookmarks"
234234
android:syncable="false" />
235-
<provider
236-
android:name=".bookmarks.locations.BookmarkLocationsContentProvider"
237-
android:authorities="${applicationId}.bookmarks.locations.contentprovider"
238-
android:exported="false"
239-
android:label="@string/provider_bookmarks_location"
240-
android:syncable="false" />
241235
<provider
242236
android:name=".bookmarks.items.BookmarkItemsContentProvider"
243237
android:authorities="${applicationId}.bookmarks.items.contentprovider"

app/src/main/java/fr/free/nrw/commons/CommonsApplication.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,17 @@ class CommonsApplication : MultiDexApplication() {
247247
DBOpenHelper.CONTRIBUTIONS_TABLE
248248
) //Delete the contributions table in the existing db on older versions
249249

250+
dbOpenHelper.deleteTable(
251+
db,
252+
DBOpenHelper.BOOKMARKS_LOCATIONS
253+
)
254+
250255
try {
251256
contributionDao.deleteAll()
252257
} catch (e: SQLiteException) {
253258
Timber.e(e)
254259
}
255260
BookmarkPicturesDao.Table.onDelete(db)
256-
BookmarkLocationsDao.Table.onDelete(db)
257261
BookmarkItemsDao.Table.onDelete(db)
258262
}
259263

app/src/main/java/fr/free/nrw/commons/bookmarks/locations/BookmarkLocationsContentProvider.java

-119
This file was deleted.

app/src/main/java/fr/free/nrw/commons/bookmarks/locations/BookmarkLocationsController.java

-26
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package fr.free.nrw.commons.bookmarks.locations
2+
3+
import fr.free.nrw.commons.nearby.Place
4+
import kotlinx.coroutines.flow.Flow
5+
import kotlinx.coroutines.flow.flow
6+
import javax.inject.Inject
7+
import javax.inject.Singleton
8+
9+
@Singleton
10+
class BookmarkLocationsController @Inject constructor(
11+
private val bookmarkLocationDao: BookmarkLocationsDao
12+
) {
13+
14+
/**
15+
* Load bookmarked locations from the database.
16+
* @return a list of Place objects.
17+
*/
18+
suspend fun loadFavoritesLocations(): List<Place> =
19+
bookmarkLocationDao.getAllBookmarksLocationsPlace()
20+
}

0 commit comments

Comments
 (0)