change time handling, remove DI_Close()

This commit is contained in:
dborth 2009-03-26 06:49:50 +00:00
parent c7aa8f2bd8
commit 9d3f522588
4 changed files with 5 additions and 7 deletions

View File

@ -32,7 +32,7 @@ typedef struct
{
u64 offset; // DVD offset
unsigned int length; // file length
tm mtime; // file modified time
time_t mtime; // file modified time
char isdir; // 0 - file, 1 - directory
char filename[MAXJOLIET + 1]; // full filename
char displayname[MAXDISPLAY + 1]; // name for browser display

View File

@ -277,7 +277,6 @@ ParseDirectory(int method)
char filename[MAXPATHLEN];
char tmpname[MAXPATHLEN];
struct stat filestat;
struct tm * timeinfo;
char msg[128];
int retry = 1;
bool mounted = false;
@ -352,8 +351,7 @@ ParseDirectory(int method)
}
browserList[entryNum].length = filestat.st_size;
timeinfo = localtime (&filestat.st_mtime);
memcpy(&browserList[entryNum].mtime, timeinfo, sizeof(tm));
browserList[entryNum].mtime = filestat.st_mtime;
browserList[entryNum].isdir = (filestat.st_mode & _IFDIR) == 0 ? 0 : 1; // flag this as a dir
entryNum++;

View File

@ -1489,8 +1489,9 @@ static int MenuGameSaves(int action)
saves.previewImg[j] = new GuiImageData(savebuffer);
FreeSaveBuffer();
}
strftime(saves.date[j], 20, "%a %b %d", &browserList[j].mtime);
strftime(saves.time[j], 10, "%I:%M %p", &browserList[j].mtime);
struct tm * timeinfo = localtime(&browserList[j].mtime);
strftime(saves.date[j], 20, "%a %b %d", timeinfo);
strftime(saves.time[j], 10, "%I:%M %p", timeinfo);
}
j++;
}

View File

@ -352,7 +352,6 @@ main(int argc, char *argv[])
#endif
#ifdef HW_RVL
DI_Close();
DI_Init(); // first
#endif