[glib: 15/26] gfileinfo: Deprecate g_file_info_{get, set}_modification_time()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 15/26] gfileinfo: Deprecate g_file_info_{get, set}_modification_time()
- Date: Mon, 29 Jul 2019 13:01:33 +0000 (UTC)
commit 4faf4fcfaa8c9ce223354f9a3332a59584751110
Author: Philip Withnall <withnall endlessm com>
Date: Fri Jun 28 19:03:04 2019 +0100
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
gio/gfileinfo.c | 10 ++++++++++
gio/gfileinfo.h | 12 ++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c
index db5ba5dd7..24ae903f5 100644
--- a/gio/gfileinfo.c
+++ b/gio/gfileinfo.c
@@ -1753,7 +1753,11 @@ g_file_info_get_size (GFileInfo *info)
*
* Gets the modification time of the current @info and sets it
* 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
g_file_info_get_modification_time (GFileInfo *info,
GTimeVal *result)
@@ -1775,6 +1779,7 @@ g_file_info_get_modification_time (GFileInfo *info,
value = g_file_info_find_value (info, attr_mtime_usec);
result->tv_usec = _g_file_attribute_value_get_uint32 (value);
}
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* 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
* 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
g_file_info_set_modification_time (GFileInfo *info,
GTimeVal *mtime)
@@ -2177,6 +2186,7 @@ g_file_info_set_modification_time (GFileInfo *info,
if (value)
_g_file_attribute_value_set_uint32 (value, mtime->tv_usec);
}
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* g_file_info_set_modification_date_time:
diff --git a/gio/gfileinfo.h b/gio/gfileinfo.h
index 01dcc4f14..1629a2edb 100644
--- a/gio/gfileinfo.h
+++ b/gio/gfileinfo.h
@@ -1046,9 +1046,11 @@ GLIB_AVAILABLE_IN_ALL
const char * g_file_info_get_content_type (GFileInfo *info);
GLIB_AVAILABLE_IN_ALL
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,
- GTimeVal *result);
+ GTimeVal *result);
+G_GNUC_END_IGNORE_DEPRECATIONS
GLIB_AVAILABLE_IN_2_62
GDateTime * g_file_info_get_modification_date_time (GFileInfo *info);
GLIB_AVAILABLE_IN_ALL
@@ -1095,9 +1097,11 @@ void g_file_info_set_content_type (GFileInfo *info,
GLIB_AVAILABLE_IN_ALL
void g_file_info_set_size (GFileInfo *info,
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,
- GTimeVal *mtime);
+ GTimeVal *mtime);
+G_GNUC_END_IGNORE_DEPRECATIONS
GLIB_AVAILABLE_IN_2_62
void g_file_info_set_modification_date_time (GFileInfo *info,
GDateTime *mtime);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]