]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fill *_upper when updating account names and transaction descriptions
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 8 Dec 2018 19:22:04 +0000 (19:22 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 8 Dec 2018 19:22:04 +0000 (19:22 +0000)
app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java

index 1beb048ac648f2504cfca6a906a1f97633f23b66..16919b336b62fac88f73489492924c0178c35dfd 100644 (file)
@@ -68,7 +68,9 @@ abstract public class RetrieveAccountsTask extends android.os.AsyncTask<Void, In
                                 acct_name = acct_name.replace("\"", "");
                                 Log.d("account-parser", acct_name);
 
-                                db.execSQL("insert or replace into accounts(name, keep) values(?, 1)", new Object[]{acct_name} );
+                                db.execSQL("insert or replace into accounts(name, name_upper, " +
+                                                "keep) values(?, ?, 1)",
+                                        new Object[]{acct_name, acct_name.toUpperCase()});
                                 publishProgress(++count);
 
                                 last_account_name = acct_name;
@@ -109,7 +111,10 @@ abstract public class RetrieveAccountsTask extends android.os.AsyncTask<Void, In
                                     if (description.isEmpty()) continue;
 
                                     Log.d("db", String.format("Stored description: %s", description));
-                                    db.execSQL("insert or replace into description_history(description, keep) values(?, 1);", new Object[]{description});
+                                    db.execSQL("insert or replace into description_history" +
+                                                    "(description, description_upper, keep) " +
+                                                    "values(?, ?, 1);",
+                                            new Object[]{description, description.toUpperCase()});
                                 }
                             }
                         }