Fix date/time display for savestates

This commit is contained in:
Henrik Rydgård 2021-07-18 22:44:54 +02:00
parent e1b4a9175a
commit 15fafe5415
3 changed files with 13 additions and 5 deletions

View File

@ -124,7 +124,18 @@ static bool ParseFileInfo(const std::string &line, File::FileInfo *fileInfo) {
sscanf(parts[1].c_str(), "%" PRIu64, &fileInfo->size);
fileInfo->fullName = Path(parts[3]);
fileInfo->isWritable = true; // TODO: Should be passed as part of the string.
sscanf(parts[4].c_str(), "%" PRIu64, &fileInfo->lastModified);
fileInfo->access = 0777; // TODO: For read-only mappings, reflect that here, similarly as with isWritable.
uint64_t lastModifiedMs = 0;
sscanf(parts[4].c_str(), "%" PRIu64, &lastModifiedMs);
// Convert from milliseconds
uint32_t lastModified = lastModifiedMs / 1000;
// We don't have better information, so let's just spam lastModified into all the date/time fields.
fileInfo->mtime = lastModified;
fileInfo->ctime = lastModified;
fileInfo->atime = lastModified;
return true;
}

View File

@ -24,10 +24,6 @@ struct FileInfo {
uint64_t ctime = 0;
uint32_t access = 0; // st_mode & 0x1ff
// Currently only supported for Android storage files.
// Other places use different methods to get this.
uint64_t lastModified = 0;
bool operator <(const FileInfo &other) const;
};

View File

@ -148,6 +148,7 @@ public class PpssppActivity extends NativeActivity {
return str;
}
// TODO: Maybe add a cheaper version that doesn't extract all the file information?
public String[] listContentUriDir(String uriString) {
try {
Uri uri = Uri.parse(uriString);