Fix date edition
This commit is contained in:
parent
0752a36dfa
commit
5fda6db8aa
2 changed files with 9 additions and 4 deletions
|
@ -53,7 +53,8 @@ public class CachedOsmandIndexes {
|
|||
}
|
||||
|
||||
FileIndex.Builder fileIndex = OsmandIndex.FileIndex.newBuilder();
|
||||
fileIndex.setDateModified(f.lastModified());
|
||||
long d = reader.getDateCreated();
|
||||
fileIndex.setDateModified(d== 0?f.lastModified() : d);
|
||||
fileIndex.setSize(f.length());
|
||||
fileIndex.setVersion(reader.getVersion());
|
||||
fileIndex.setFileName(f.getName());
|
||||
|
|
|
@ -58,14 +58,17 @@ public class LocalIndexHelper {
|
|||
}
|
||||
|
||||
public String getInstalledDate(File f){
|
||||
return app.getString(R.string.local_index_installed) + " : " + dateformat.format(new Object[]{new Date(f.lastModified())});
|
||||
return getInstalledDate(f.lastModified());
|
||||
}
|
||||
|
||||
public String getInstalledDate(long t){
|
||||
return app.getString(R.string.local_index_installed) + " : " + dateformat.format(new Object[]{new Date(t)});
|
||||
}
|
||||
|
||||
public void updateDescription(LocalIndexInfo info){
|
||||
File f = new File(info.getPathToData());
|
||||
if(info.getType() == LocalIndexType.MAP_DATA){
|
||||
updateObfFileInformation(info, f);
|
||||
info.setDescription(info.getDescription() + getInstalledDate(f));
|
||||
} else if(info.getType() == LocalIndexType.POI_DATA){
|
||||
checkPoiFileVersion(info, f);
|
||||
info.setDescription(getInstalledDate(f));
|
||||
|
@ -397,6 +400,7 @@ public class LocalIndexHelper {
|
|||
append(mi.getName()).append("\n");
|
||||
}
|
||||
}
|
||||
builder.append(getInstalledDate(reader.getDateCreated()));
|
||||
info.setDescription(builder.toString());
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in a new issue