shell32: Use Win32 functions instead of Unix ones to retrieve the current time.
This commit is contained in:
parent
20ed414d24
commit
1ccc170b32
@ -171,8 +171,7 @@ BOOL TRASH_CanTrashFile(LPCWSTR wszPath)
|
|||||||
static BOOL try_create_trashinfo_file(const char *info_dir, const char *file_name,
|
static BOOL try_create_trashinfo_file(const char *info_dir, const char *file_name,
|
||||||
const char *original_file_name)
|
const char *original_file_name)
|
||||||
{
|
{
|
||||||
struct tm curr_time;
|
SYSTEMTIME curr_time;
|
||||||
time_t curr_time_secs;
|
|
||||||
char datebuf[200];
|
char datebuf[200];
|
||||||
char *path = SHAlloc(strlen(info_dir)+strlen(file_name)+strlen(trashinfo_suffix)+1);
|
char *path = SHAlloc(strlen(info_dir)+strlen(file_name)+strlen(trashinfo_suffix)+1);
|
||||||
int writer = -1;
|
int writer = -1;
|
||||||
@ -187,15 +186,10 @@ static BOOL try_create_trashinfo_file(const char *info_dir, const char *file_nam
|
|||||||
if (!XDG_WriteDesktopStringEntry(writer, "Path", XDG_URLENCODE, original_file_name))
|
if (!XDG_WriteDesktopStringEntry(writer, "Path", XDG_URLENCODE, original_file_name))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
time(&curr_time_secs);
|
GetLocalTime( &curr_time );
|
||||||
localtime_r(&curr_time_secs, &curr_time);
|
|
||||||
wnsprintfA(datebuf, 200, "%04d-%02d-%02dT%02d:%02d:%02d",
|
wnsprintfA(datebuf, 200, "%04d-%02d-%02dT%02d:%02d:%02d",
|
||||||
curr_time.tm_year+1900,
|
curr_time.wYear, curr_time.wMonth, curr_time.wDay,
|
||||||
curr_time.tm_mon+1,
|
curr_time.wHour, curr_time.wMinute, curr_time.wSecond);
|
||||||
curr_time.tm_mday,
|
|
||||||
curr_time.tm_hour,
|
|
||||||
curr_time.tm_min,
|
|
||||||
curr_time.tm_sec);
|
|
||||||
if (!XDG_WriteDesktopStringEntry(writer, "DeletionDate", 0, datebuf))
|
if (!XDG_WriteDesktopStringEntry(writer, "DeletionDate", 0, datebuf))
|
||||||
goto error;
|
goto error;
|
||||||
close(writer);
|
close(writer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user