From 300a542e94b62a06f3e4f7a977c019b9e18fb434 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 20 Aug 2011 23:17:42 +0200 Subject: [PATCH] Fix small issues --- OsmAnd/src/net/osmand/plus/SQLiteTileSource.java | 2 +- .../osmand/plus/activities/LocalIndexHelper.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java index 569cf167c4..addb29b666 100644 --- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java +++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java @@ -155,7 +155,7 @@ public class SQLiteTileSource implements ITileSource { if(db == null){ return false; } - Cursor cursor = db.rawQuery("SELECT 1 FROM tiles WHERE z = ?", new String[] {(17 - zoom)+""}); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ + Cursor cursor = db.rawQuery("SELECT 1 FROM tiles WHERE z = ? LIMIT 1", new String[] {(17 - zoom)+""}); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ try { boolean e = cursor.moveToFirst(); cursor.close(); diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java index b96f6bc5d7..110cca2dac 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java @@ -95,16 +95,16 @@ public class LocalIndexHelper { template.getUrlTemplate() != null, zooms.toString()); info.setDescription(descr); } else if(f.isFile() && f.getName().endsWith(SQLiteTileSource.EXT)){ - SQLiteTileSource template = new SQLiteTileSource(f, Collections.EMPTY_LIST); - Set zooms = new TreeSet(); - for(int i=1; i<22; i++){ - if(template.exists(i)){ - zooms.add(i); - } - } + SQLiteTileSource template = new SQLiteTileSource(f, TileSourceManager.getKnownSourceTemplates()); +// Set zooms = new TreeSet(); +// for(int i=1; i<22; i++){ +// if(template.exists(i)){ +// zooms.add(i); +// } +// } String descr = app.getString(R.string.local_index_tile_data, template.getName(), template.getMinimumZoomSupported(), template.getMaximumZoomSupported(), - template.couldBeDownloadedFromInternet(), zooms.toString()); + template.couldBeDownloadedFromInternet(), ""); info.setDescription(descr); } }