X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2FMainModel.java;h=813e3a00b3ab54a49b480ccad5f9b5584d077cd5;hp=44a6f303be75fac7d193b16cee33400af49d5e9b;hb=93545c6fbf1244fbd96ecfc50e1115dbdc25f9ae;hpb=1c3647f273df2f15ef299896c24cda95c6119988 diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java index 44a6f303..813e3a00 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2021 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -286,7 +286,7 @@ public class MainModel extends ViewModel { @Override public void run() { Logger.debug("async-acc", "AccountListLoader::run() entered"); - String profileUUID = profile.getUuid(); + long profileId = profile.getId(); ArrayList list = new ArrayList<>(); HashMap map = new HashMap<>(); @@ -296,7 +296,7 @@ public class MainModel extends ViewModel { SQLiteDatabase db = App.getDatabase(); Logger.debug("async-acc", "AccountListLoader::run() connected to DB"); - try (Cursor cursor = db.rawQuery(sql, new String[]{profileUUID})) { + try (Cursor cursor = db.rawQuery(sql, new String[]{String.valueOf(profileId)})) { Logger.debug("async-acc", "AccountListLoader::run() executed query"); while (cursor.moveToNext()) { if (isInterrupted()) @@ -305,7 +305,7 @@ public class MainModel extends ViewModel { final String accName = cursor.getString(0); // debug("accounts", // String.format("Read account '%s' from DB [%s]", accName, -// profileUUID)); +// profileId)); String parentName = LedgerAccount.extractParentName(accName); LedgerAccount parent; if (parentName != null) { @@ -326,7 +326,7 @@ public class MainModel extends ViewModel { try (Cursor c2 = db.rawQuery( "SELECT value, currency FROM account_values WHERE profile = ?" + " " + - "AND account = ?", new String[]{profileUUID, accName})) + "AND account = ?", new String[]{String.valueOf(profileId), accName})) { while (c2.moveToNext()) { acc.addAmount(c2.getFloat(0), c2.getString(1));