]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/async/UpdateTransactionsTask.java
move DB access routines to the application class
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / async / UpdateTransactionsTask.java
index dc6536a167c58c74b5792dd0a4aee5d8b760f88e..5093d50c952287846284c1390e07da2259453b23 100644 (file)
@@ -21,12 +21,12 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.os.AsyncTask;
 
+import net.ktnx.mobileledger.App;
 import net.ktnx.mobileledger.model.Data;
 import net.ktnx.mobileledger.model.LedgerTransaction;
 import net.ktnx.mobileledger.model.MobileLedgerProfile;
 import net.ktnx.mobileledger.model.TransactionListItem;
 import net.ktnx.mobileledger.utils.Globals;
-import net.ktnx.mobileledger.utils.MLDB;
 
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -36,7 +36,7 @@ import static net.ktnx.mobileledger.utils.Logger.debug;
 
 public class UpdateTransactionsTask extends AsyncTask<String, Void, String> {
     protected String doInBackground(String[] filterAccName) {
-        final MobileLedgerProfile profile = Data.profile.get();
+        final MobileLedgerProfile profile = Data.profile.getValue();
         if (profile == null) return "Profile not configured";
 
         String profile_uuid = profile.getUuid();
@@ -63,7 +63,7 @@ public class UpdateTransactionsTask extends AsyncTask<String, Void, String> {
             }
 
             debug("UTT", sql);
-            SQLiteDatabase db = MLDB.getDatabase();
+            SQLiteDatabase db = App.getDatabase();
             String lastDateString = Globals.formatLedgerDate(new Date());
             Date lastDate = Globals.parseLedgerDate(lastDateString);
             boolean odd = true;