diff --git a/DataExtractionOSM/src/net/osmand/data/index/DownloaderIndexFromGoogleCode.java b/DataExtractionOSM/src/net/osmand/data/index/DownloaderIndexFromGoogleCode.java index e4dfa58c40..802618b1e9 100644 --- a/DataExtractionOSM/src/net/osmand/data/index/DownloaderIndexFromGoogleCode.java +++ b/DataExtractionOSM/src/net/osmand/data/index/DownloaderIndexFromGoogleCode.java @@ -55,7 +55,7 @@ public class DownloaderIndexFromGoogleCode { BINARY_MAP_VERSION + BINARY_MAP_INDEX_EXT_ZIP, VOICE_VERSION + VOICE_INDEX_EXT_ZIP); for(String s : files.keySet()){ - System.out.println(s); + System.out.println(s + " " + files.get(s)); //$NON-NLS-1$ } // IndexConstants.TRANSPORT_TABLE_VERSION + "" }); //$NON-NLS-1$ // Map indexFiles = DownloaderIndexFromGoogleCode.getIndexFiles( @@ -114,7 +114,7 @@ public class DownloaderIndexFromGoogleCode { } } } - log.info("Loaded indexes:" + files.size()); + log.info("Loaded indexes:" + files.size()); //$NON-NLS-1$ return files; } @@ -139,8 +139,8 @@ public class DownloaderIndexFromGoogleCode { if (prevFile != null && ((i = content.indexOf('{')) != -1)) { int j = content.indexOf('}'); if (j != -1 && j - i < 40) { - String description = content.substring(i, j + 1); - files.put(prevFile, description); + // String description = content.substring(i, j + 1); + files.put(prevFile, content); prevFile = null; } } @@ -160,8 +160,8 @@ public class DownloaderIndexFromGoogleCode { public static String deleteFileFromGoogleDownloads(String fileName, String token, String pagegen, String cookieHSID, String cookieSID) throws IOException { // prepare data Map cookies = new HashMap(); - cookies.put("HSID", cookieHSID); //$NON-NLS-1$//$NON-NLS-2$ - cookies.put("SID", cookieSID); //$NON-NLS-1$ //$NON-NLS-2$ + cookies.put("HSID", cookieHSID); //$NON-NLS-1$ + cookies.put("SID", cookieSID); //$NON-NLS-1$ StringBuilder cookieString = new StringBuilder(); int size = cookies.size(); for (String c : cookies.keySet()) { diff --git a/OsmAnd/src/net/osmand/AmenityIndexRepository.java b/OsmAnd/src/net/osmand/AmenityIndexRepository.java index d8202ce340..35969df074 100644 --- a/OsmAnd/src/net/osmand/AmenityIndexRepository.java +++ b/OsmAnd/src/net/osmand/AmenityIndexRepository.java @@ -16,7 +16,6 @@ import net.osmand.data.AmenityType; import net.osmand.data.index.IndexConstants; import net.osmand.osm.Entity; import net.osmand.osm.LatLon; -import net.osmand.osm.MapRenderingTypes; import net.osmand.osm.MapUtils; import net.osmand.osm.Node; import net.osmand.osm.io.IOsmStorageFilter; diff --git a/OsmAnd/src/net/osmand/activities/DownloadIndexActivity.java b/OsmAnd/src/net/osmand/activities/DownloadIndexActivity.java index a00f622fc6..542a486969 100644 --- a/OsmAnd/src/net/osmand/activities/DownloadIndexActivity.java +++ b/OsmAnd/src/net/osmand/activities/DownloadIndexActivity.java @@ -307,7 +307,7 @@ public class DownloadIndexActivity extends ListActivity { entry.unzip = unzipDir; entry.fileToUnzip = new File(parent, baseName + toCheckPostfix); // if(!fileToUnzip.exists()){ - // builder.setMessage(MessageFormat.format(getString(R.string.download_question), baseName, e.getValue())); + // builder.setMessage(MessageFormat.format(getString(R.string.download_question), baseName, extractDateAndSize(e.getValue()))); if (entry.fileToUnzip.exists()) { Builder builder = new AlertDialog.Builder(this); MessageFormat format; @@ -318,7 +318,7 @@ public class DownloadIndexActivity extends ListActivity { } String description = format .format(new Object[] { new Date(entry.fileToUnzip.lastModified()), ((float) entry.fileToUnzip.length() / MB) }); - builder.setMessage(MessageFormat.format(getString(R.string.download_question_exist), baseName, description, e.getValue())); + builder.setMessage(MessageFormat.format(getString(R.string.download_question_exist), baseName, description, extractDateAndSize(e.getValue()))); builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() { @Override @@ -577,6 +577,10 @@ public class DownloadIndexActivity extends ListActivity { } } + private static String extractDateAndSize(String m){ + return m.substring(m.indexOf('{')); + } + public void showWarning(final String messages){ runOnUiThread(new Runnable(){ @Override @@ -660,8 +664,8 @@ public class DownloadIndexActivity extends ListActivity { DownloadIndexActivity.this.onListItemClick(getListView(), row, position, getItemId(position)); } }); - item.setText(s.trim() + "\n " + name + "\n"); //$NON-NLS-1$ - description.setText(e.getValue().replace(':', '\n').trim()); + item.setText(s.trim() + "\n " + name); //$NON-NLS-1$ + description.setText(extractDateAndSize(e.getValue()).replace(':', '\n').trim()); return row; }