import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.AsyncTask;
-import android.util.Log;
+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;
import java.util.Date;
+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();
params = new String[]{profile_uuid, filterAccName[0]};
}
- Log.d("UTT", sql);
- SQLiteDatabase db = MLDB.getDatabase();
+ debug("UTT", sql);
+ SQLiteDatabase db = App.getDatabase();
String lastDateString = Globals.formatLedgerDate(new Date());
Date lastDate = Globals.parseLedgerDate(lastDateString);
boolean odd = true;
}
newList.add(
new TransactionListItem(new LedgerTransaction(transaction_id), odd));
-// Log.d("UTT", String.format("got transaction %d", transaction_id));
+// debug("UTT", String.format("got transaction %d", transaction_id));
lastDate = date;
lastDateString = dateString;
odd = !odd;
}
Data.transactions.setList(newList);
- Log.d("UTT", "transaction list value updated");
+ debug("UTT", "transaction list value updated");
}
return null;