Let room generate kotlin
This commit is contained in:
1 parent
bfb5752622
commit
f1c1f2dbe8
4 files changed
+9
-16
No files matched your search
@@ -188,7 +188,7 @@ dependencies {
|
||||
implementation("androidx.recyclerview:recyclerview:1.3.0")
|
||||
|
||||
// https://developer.android.com/jetpack/androidx/releases/room
|
||||
val room_version = "2.5.1"
|
||||
val room_version = "2.6.0-alpha01"
|
||||
ksp("androidx.room:room-compiler:$room_version")
|
||||
implementation("androidx.room:room-paging:$room_version")
|
||||
|
||||
@@ -233,5 +233,6 @@ configurations.all {
|
||||
}
|
||||
|
||||
ksp {
|
||||
arg("room.schemaLocation", projectDir.resolve("schemas").path)
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
arg("room.generateKotlin", "true")
|
||||
}
|
||||
@@ -243,7 +243,9 @@ object EhDB {
|
||||
@Synchronized
|
||||
fun deleteQuickSearch(quickSearch: QuickSearch?) {
|
||||
val dao = db.quickSearchDao()
|
||||
dao.delete(quickSearch)
|
||||
if (quickSearch != null) {
|
||||
dao.delete(quickSearch)
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
|
||||
@@ -12,18 +12,8 @@ class HistoryInfo() : BaseGalleryInfo() {
|
||||
var time: Long = 0
|
||||
|
||||
// Trick: Use MODE for favoriteSlot
|
||||
// Shadow its accessors
|
||||
@ColumnInfo(name = "MODE")
|
||||
private val mode: Int = 0
|
||||
|
||||
fun getMode(): Int {
|
||||
return favoriteSlot + 2
|
||||
}
|
||||
|
||||
fun setMode(mode: Int) {
|
||||
favoriteSlot = mode - 2
|
||||
}
|
||||
// Trick end
|
||||
override var favoriteSlot: Int = -2
|
||||
|
||||
constructor(galleryInfo: GalleryInfo) : this() {
|
||||
gid = galleryInfo.gid
|
||||
@@ -39,4 +29,4 @@ class HistoryInfo() : BaseGalleryInfo() {
|
||||
simpleLanguage = galleryInfo.simpleLanguage
|
||||
favoriteSlot = galleryInfo.favoriteSlot
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,5 +24,5 @@ interface QuickSearchDao : BasicDao<QuickSearch> {
|
||||
override fun insert(t: QuickSearch): Long
|
||||
|
||||
@Delete
|
||||
fun delete(quickSearch: QuickSearch?)
|
||||
fun delete(quickSearch: QuickSearch)
|
||||
}
|
||||
Reference in new issue
Block a user