fix small issues
git-svn-id: https://osmand.googlecode.com/svn/trunk@744 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
b2ba27573e
commit
9fbc41ac08
3 changed files with 14 additions and 11 deletions
|
@ -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<String, String> 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<String, String> cookies = new HashMap<String, String>();
|
||||
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()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue