From 4a271a922348590e999e209535f050fd861cac11 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 17 Aug 2014 00:46:04 +0200 Subject: Do not dump whole configuration to debug when selected or updated. closes #6 --- src/org/xapek/andiodine/config/ConfigDatabase.java | 8 +++----- src/org/xapek/andiodine/config/IodineConfiguration.java | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/org') diff --git a/src/org/xapek/andiodine/config/ConfigDatabase.java b/src/org/xapek/andiodine/config/ConfigDatabase.java index ffc1656..c4245ba 100644 --- a/src/org/xapek/andiodine/config/ConfigDatabase.java +++ b/src/org/xapek/andiodine/config/ConfigDatabase.java @@ -66,7 +66,6 @@ public class ConfigDatabase extends SQLiteOpenHelper { long id = writableDatabase.insertOrThrow(TABLE_NAME_CONF, null, config); writableDatabase.close(); config.put(COLUMN_CONF_ID, id); - Log.d(TAG, "Insert id=" + id); } @@ -77,7 +76,6 @@ public class ConfigDatabase extends SQLiteOpenHelper { int rows = writableDatabase.update(TABLE_NAME_CONF, config, COLUMN_CONF_ID + " = ?", new String[]{config.getAsString(COLUMN_CONF_ID)}); writableDatabase.close(); - Log.d(TAG, config.toString()); Log.d(TAG, "Update rows=" + rows); return rows; } @@ -96,11 +94,11 @@ public class ConfigDatabase extends SQLiteOpenHelper { SQLiteDatabase readableDatabase = getReadableDatabase(); Cursor query = readableDatabase.query(TABLE_NAME_CONF, null, COLUMN_CONF_ID + " = ?", new String[]{id.toString()}, null, null, null); - assert query.isLast(); query.moveToFirst(); DatabaseUtils.cursorRowToContentValues(query, v); - Log.d(TAG, "Selected: " + v.toString()); - return new IodineConfiguration(v); + IodineConfiguration iodineConfiguration = new IodineConfiguration(v); + Log.d(TAG, "Selected: " + iodineConfiguration); + return iodineConfiguration; } public List selectAll() throws SQLException { diff --git a/src/org/xapek/andiodine/config/IodineConfiguration.java b/src/org/xapek/andiodine/config/IodineConfiguration.java index c41621b..21aac6c 100644 --- a/src/org/xapek/andiodine/config/IodineConfiguration.java +++ b/src/org/xapek/andiodine/config/IodineConfiguration.java @@ -124,4 +124,9 @@ public class IodineConfiguration { public ContentValues getContentValues() { return v; } + + @Override + public String toString() { + return "[IodineConfiguration name=" + getName() + "]"; + } } -- cgit v1.2.1