]> git.ktnx.net Git - mobile-ledger.git/commitdiff
rename mergeAccountLists method to better reflect its purpose
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 16 Aug 2020 13:59:08 +0000 (16:59 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 16 Aug 2020 13:59:08 +0000 (16:59 +0300)
it is important to note that the data comes from hledger-web and not
as a result to some UI-induced change

app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java

index 7ae6b5a91b8d96a9c196fc52e362bee2d7e7e6bf..7214e2b0f8b2680a45723695fcda1453559f9fbe 100644 (file)
@@ -173,8 +173,8 @@ public final class MobileLedgerProfile {
             db.endTransaction();
         }
     }
-    public static ArrayList<LedgerAccount> mergeAccountLists(List<LedgerAccount> oldList,
-                                                             List<LedgerAccount> newList) {
+    public static ArrayList<LedgerAccount> mergeAccountListsFromWeb(List<LedgerAccount> oldList,
+                                                                    List<LedgerAccount> newList) {
         LedgerAccount oldAcc, newAcc;
         ArrayList<LedgerAccount> merged = new ArrayList<>();
 
@@ -224,10 +224,10 @@ public final class MobileLedgerProfile {
 
         return merged;
     }
-    public void mergeAccountList(List<LedgerAccount> newList) {
+    public void mergeAccountListFromWeb(List<LedgerAccount> newList) {
 
         try (LockHolder l = accountsLocker.lockForWriting()) {
-            allAccounts = mergeAccountLists(allAccounts, newList);
+            allAccounts = mergeAccountListsFromWeb(allAccounts, newList);
             updateAccountsMap(allAccounts);
         }
     }
@@ -691,7 +691,7 @@ public final class MobileLedgerProfile {
             db.endTransaction();
         }
 
-        mergeAccountList(list);
+        mergeAccountListFromWeb(list);
         updateDisplayedAccounts();
     }
     public synchronized Locker lockAccountsForWriting() {
@@ -728,7 +728,7 @@ public final class MobileLedgerProfile {
                                                             List<LedgerTransaction> transactions) {
         storeAccountAndTransactionListAsync(accounts, transactions, false);
 
-        mergeAccountList(accounts);
+        mergeAccountListFromWeb(accounts);
         updateDisplayedAccounts();
 
         allTransactions.postValue(transactions);