app: port mtime code in gimp_data_save() to GIO

because it gets its stat() calls right.
This commit is contained in:
Michael Natterer 2013-08-04 16:51:31 +02:00
parent 0289eb8898
commit e72cf05ccb
1 changed files with 12 additions and 3 deletions

View File

@ -530,11 +530,20 @@ gimp_data_save (GimpData *data,
if (success)
{
struct stat filestat;
GFile *file = g_file_new_for_path (private->filename);
GFileInfo *info = g_file_query_info (file, "time::*",
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
if (info)
{
private->mtime =
g_file_info_get_attribute_uint64 (info,
G_FILE_ATTRIBUTE_TIME_MODIFIED);
g_object_unref (info);
}
g_stat (private->filename, &filestat);
g_object_unref (file);
private->mtime = filestat.st_mtime;
private->dirty = FALSE;
}