gfileinfo: Deprecate g_file_info_{get,set}_modification_time()

They use the deprecated GTimeVal type, which is not year 2038 safe, so
have to be deprecated.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
This commit is contained in:
Philip Withnall 2019-06-28 19:03:04 +01:00
parent d166a55c64
commit 4faf4fcfaa
2 changed files with 18 additions and 4 deletions

View File

@ -1753,7 +1753,11 @@ g_file_info_get_size (GFileInfo *info)
* *
* Gets the modification time of the current @info and sets it * Gets the modification time of the current @info and sets it
* in @result. * in @result.
*
* Deprecated: 2.62: Use g_file_info_get_modification_date_time() instead, as
* #GTimeVal is deprecated due to the year 2038 problem.
**/ **/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void void
g_file_info_get_modification_time (GFileInfo *info, g_file_info_get_modification_time (GFileInfo *info,
GTimeVal *result) GTimeVal *result)
@ -1775,6 +1779,7 @@ g_file_info_get_modification_time (GFileInfo *info,
value = g_file_info_find_value (info, attr_mtime_usec); value = g_file_info_find_value (info, attr_mtime_usec);
result->tv_usec = _g_file_attribute_value_get_uint32 (value); result->tv_usec = _g_file_attribute_value_get_uint32 (value);
} }
G_GNUC_END_IGNORE_DEPRECATIONS
/** /**
* g_file_info_get_modification_date_time: * g_file_info_get_modification_date_time:
@ -2153,7 +2158,11 @@ g_file_info_set_size (GFileInfo *info,
* *
* Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
* info to the given time value. * info to the given time value.
*
* Deprecated: 2.62: Use g_file_info_set_modification_date_time() instead, as
* #GTimeVal is deprecated due to the year 2038 problem.
**/ **/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void void
g_file_info_set_modification_time (GFileInfo *info, g_file_info_set_modification_time (GFileInfo *info,
GTimeVal *mtime) GTimeVal *mtime)
@ -2177,6 +2186,7 @@ g_file_info_set_modification_time (GFileInfo *info,
if (value) if (value)
_g_file_attribute_value_set_uint32 (value, mtime->tv_usec); _g_file_attribute_value_set_uint32 (value, mtime->tv_usec);
} }
G_GNUC_END_IGNORE_DEPRECATIONS
/** /**
* g_file_info_set_modification_date_time: * g_file_info_set_modification_date_time:

View File

@ -1046,9 +1046,11 @@ GLIB_AVAILABLE_IN_ALL
const char * g_file_info_get_content_type (GFileInfo *info); const char * g_file_info_get_content_type (GFileInfo *info);
GLIB_AVAILABLE_IN_ALL GLIB_AVAILABLE_IN_ALL
goffset g_file_info_get_size (GFileInfo *info); goffset g_file_info_get_size (GFileInfo *info);
GLIB_AVAILABLE_IN_ALL G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GLIB_DEPRECATED_IN_2_62_FOR(g_file_info_get_modification_date_time)
void g_file_info_get_modification_time (GFileInfo *info, void g_file_info_get_modification_time (GFileInfo *info,
GTimeVal *result); GTimeVal *result);
G_GNUC_END_IGNORE_DEPRECATIONS
GLIB_AVAILABLE_IN_2_62 GLIB_AVAILABLE_IN_2_62
GDateTime * g_file_info_get_modification_date_time (GFileInfo *info); GDateTime * g_file_info_get_modification_date_time (GFileInfo *info);
GLIB_AVAILABLE_IN_ALL GLIB_AVAILABLE_IN_ALL
@ -1095,9 +1097,11 @@ void g_file_info_set_content_type (GFileInfo *info,
GLIB_AVAILABLE_IN_ALL GLIB_AVAILABLE_IN_ALL
void g_file_info_set_size (GFileInfo *info, void g_file_info_set_size (GFileInfo *info,
goffset size); goffset size);
GLIB_AVAILABLE_IN_ALL G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GLIB_DEPRECATED_IN_2_62_FOR(g_file_info_set_modification_date_time)
void g_file_info_set_modification_time (GFileInfo *info, void g_file_info_set_modification_time (GFileInfo *info,
GTimeVal *mtime); GTimeVal *mtime);
G_GNUC_END_IGNORE_DEPRECATIONS
GLIB_AVAILABLE_IN_2_62 GLIB_AVAILABLE_IN_2_62
void g_file_info_set_modification_date_time (GFileInfo *info, void g_file_info_set_modification_date_time (GFileInfo *info,
GDateTime *mtime); GDateTime *mtime);