aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/dbflow
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/dbflow')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/dbflow/DbUtils.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/dbflow/FbTabsDb.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/dbflow/NotificationDb.kt5
4 files changed, 10 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt
index 762dd4c1..e98020d4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/CookiesDb.kt
@@ -54,14 +54,16 @@ fun loadFbCookiesSync(): List<CookieModel> = (select from CookieModel::class).or
inline fun saveFbCookie(cookie: CookieModel, crossinline callback: (() -> Unit) = {}) {
cookie.async save {
- L.d("Fb cookie saved", cookie.toString())
+ L.d { "Fb cookie saved" }
+ L._d { cookie }
callback()
}
}
fun removeCookie(id: Long) {
loadFbCookie(id)?.async?.delete {
- L.d("Fb cookie deleted", id.toString())
+ L.d { "Fb cookie deleted" }
+ L._d { id }
}
}
@@ -71,7 +73,7 @@ inline fun CookieModel.fetchUsername(crossinline callback: (String) -> Unit) {
var result = ""
try {
result = frostJsoup(cookie, FbItem.PROFILE.url).title()
- L.d("Fetch username found", result)
+ L.d { "Fetch username found" }
} catch (e: Exception) {
if (e !is UnknownHostException)
e.logFrostAnswers("Fetch username failed")
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/DbUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/DbUtils.kt
index f5c962ed..e4aef2a9 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/DbUtils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/DbUtils.kt
@@ -18,7 +18,7 @@ object DbUtils {
}
inline fun <reified T : Any> List<T>.replace(dbName: String) {
- L.d("Replacing $dbName.db")
+ L.d { "Replacing $dbName.db" }
DbUtils.db(dbName).reset()
FastStoreModelTransaction.saveBuilder(FlowManager.getModelAdapter(T::class.java)).addAll(this).build()
} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/FbTabsDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/FbTabsDb.kt
index 18f0e2e8..827881e3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/FbTabsDb.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/FbTabsDb.kt
@@ -33,7 +33,7 @@ data class FbTabModel(@PrimaryKey var position: Int = -1, var tab: FbItem = FbIt
fun loadFbTabs(): List<FbItem> {
val tabs: List<FbTabModel>? = (select from (FbTabModel::class)).orderBy(FbTabModel_Table.position, true).queryList()
if (tabs?.size == TAB_COUNT) return tabs.map(FbTabModel::tab)
- L.d("No tabs (${tabs?.size}); loading default")
+ L.d { "No tabs (${tabs?.size}); loading default" }
return defaultTabs()
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/NotificationDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/NotificationDb.kt
index d3abb9a2..88a1383d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/dbflow/NotificationDb.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/dbflow/NotificationDb.kt
@@ -22,7 +22,7 @@ class NotificationMigration2(modelClass: Class<NotificationModel>) : AlterTableM
override fun onPreMigrate() {
super.onPreMigrate()
addColumn(SQLiteType.INTEGER, "epochIm")
- L.d("Added column")
+ L.d { "Added column" }
}
}
@@ -33,7 +33,8 @@ fun lastNotificationTime(id: Long): NotificationModel = (select from Notificatio
fun saveNotificationTime(notificationModel: NotificationModel, callback: (() -> Unit)? = null) {
notificationModel.async save {
- L.d("Fb notification model saved", notificationModel.toString())
+ L.d { "Fb notification model saved" }
+ L._d { notificationModel }
callback?.invoke()
}
} \ No newline at end of file