X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fasync%2FRetrieveTransactionsTask.java;h=db8f8de76a9b7b4d328b4f82b48e636bcebefa60;hb=d58f8f4a9edd8b96005d1900c51b589471424165;hp=d7c1996f51403c448d43278a57f45c4017c9f637;hpb=a5ee532b931532af956223ed31fd956c319445fd;p=mobile-ledger.git 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 d7c1996f..db8f8de7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Damyan Ivanov. + * Copyright © 2020 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 @@ -220,7 +220,7 @@ public class RetrieveTransactionsTask prevAccount = lastAccount; lastAccount = profile.tryLoadAccount(db, acct_name); if (lastAccount == null) - lastAccount = new LedgerAccount(acct_name); + lastAccount = new LedgerAccount(profile, acct_name); else lastAccount.removeAmounts(); profile.storeAccount(db, lastAccount); @@ -240,15 +240,14 @@ public class RetrieveTransactionsTask if (accountNames.containsKey(parentName)) break; toAppend.push(parentName); - parentName = new LedgerAccount(parentName).getParentName(); + parentName = new LedgerAccount(profile, parentName).getParentName(); } syntheticAccounts.clear(); while (!toAppend.isEmpty()) { String aName = toAppend.pop(); LedgerAccount acc = profile.tryLoadAccount(db, aName); if (acc == null) { - acc = new LedgerAccount(aName); - acc.setHiddenByStar(lastAccount.isHiddenByStar()); + acc = new LedgerAccount(profile, aName); acc.setExpanded(!lastAccount.hasSubAccounts() || lastAccount.isExpanded()); } @@ -484,7 +483,7 @@ public class RetrieveTransactionsTask LedgerAccount acc = profile.tryLoadAccount(db, parsedAccount.getAname()); if (acc == null) - acc = new LedgerAccount(parsedAccount.getAname()); + acc = new LedgerAccount(profile, parsedAccount.getAname()); else acc.removeAmounts();