From: Damyan Ivanov Date: Sat, 12 Jan 2019 11:48:18 +0000 (+0000) Subject: toCamelCase X-Git-Tag: v0.3~55 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=dcd151c241104f520aae69c2074a6559e897b625;p=mobile-ledger.git toCamelCase --- diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index b13b9050..a6b88c91 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -353,7 +353,7 @@ public class RetrieveTransactionsTask Log.d("db", "Updating transaction value stamp"); Date now = new Date(); - profile.set_option_value(MLDB.OPT_LAST_SCRAPE, now.getTime()); + profile.setLongOption(MLDB.OPT_LAST_SCRAPE, now.getTime()); Data.lastUpdateDate.set(now); TransactionListViewModel.scheduleTransactionListReload(); } diff --git a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java index 6fc2551f..6e5ac129 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java @@ -221,7 +221,7 @@ public final class MobileLedgerProfile { } Log.d("profile", String.format("Transaction %d stored", tr.getId())); } - public String get_option_value(String name, String default_value) { + public String getOption(String name, String default_value) { SQLiteDatabase db = MLDB.getReadableDatabase(); try (Cursor cursor = db.rawQuery("select value from options where profile = ? and name=?", new String[]{uuid, name})) @@ -244,9 +244,9 @@ public final class MobileLedgerProfile { return default_value; } } - public long get_option_value(String name, long default_value) { + public long getLongOption(String name, long default_value) { long longResult; - String result = get_option_value(name, ""); + String result = getOption(name, ""); if ((result == null) || result.isEmpty()) { Log.d("profile", String.format("Returning default value for option %s", name)); longResult = default_value; @@ -264,14 +264,14 @@ public final class MobileLedgerProfile { return longResult; } - public void set_option_value(String name, String value) { + public void setOption(String name, String value) { Log.d("profile", String.format("setting option %s=%s", name, value)); SQLiteDatabase db = MLDB.getWritableDatabase(); db.execSQL("insert or replace into options(profile, name, value) values(?, ?, ?);", new String[]{uuid, name, value}); } - public void set_option_value(String name, long value) { - set_option_value(name, String.valueOf(value)); + public void setLongOption(String name, long value) { + setOption(name, String.valueOf(value)); } public void removeFromDB() { SQLiteDatabase db = MLDB.getWritableDatabase(); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 20460186..07e5cbf0 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -311,7 +311,7 @@ public class MainActivity extends AppCompatActivity { } public void updateLastUpdateTextFromDB() { { - long last_update = Data.profile.get().get_option_value(MLDB.OPT_LAST_SCRAPE, 0L); + long last_update = Data.profile.get().getLongOption(MLDB.OPT_LAST_SCRAPE, 0L); Log.d("transactions", String.format("Last update = %d", last_update)); if (last_update == 0) {