- 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();
+ Log.d("db", String.format("removing progile %s from DB", uuid));
+ db.execSQL("delete from profiles where uuid=?", new Object[]{uuid});
+ }
+ public LedgerAccount loadAccount(String name) {
+ SQLiteDatabase db = MLDB.getReadableDatabase();
+ try (Cursor cursor = db.rawQuery("SELECT hidden from accounts where profile=? and name=?",
+ new String[]{uuid, name}))
+ {
+ if (cursor.moveToFirst()) {
+ LedgerAccount acc = new LedgerAccount(name);
+ acc.setHidden(cursor.getInt(0) == 1);
+
+ return acc;
+ }
+ }
+
+ return null;