[gvfs/wip/oholy/gtimeval-gdatetime: 6/10] smb: Remove usage of deprecated GTimeVal
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/oholy/gtimeval-gdatetime: 6/10] smb: Remove usage of deprecated GTimeVal
- Date: Wed, 18 Sep 2019 13:03:28 +0000 (UTC)
commit 0199fcf7c9404d7a100d829ccc75cbb19b8f214c
Author: Ondrej Holy <oholy redhat com>
Date: Mon Sep 16 17:05:23 2019 +0200
smb: Remove usage of deprecated GTimeVal
GTimeVal is deprecated. Let's remove it in order to prevent the
deprecation warnings.
daemon/gvfsbackendsmb.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 0af0529c..08a0a2ae 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1361,7 +1361,6 @@ set_info_from_stat (GVfsBackendSmb *backend,
GFileAttributeMatcher *matcher)
{
GFileType file_type;
- GTimeVal t;
char *content_type;
char *display_name;
@@ -1425,16 +1424,12 @@ set_info_from_stat (GVfsBackendSmb *backend,
G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE,
statbuf->st_blocks * G_GUINT64_CONSTANT (512));
- t.tv_sec = statbuf->st_mtime;
+ g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, statbuf->st_mtime);
#if defined (HAVE_STRUCT_STAT_ST_MTIMENSEC)
- t.tv_usec = statbuf->st_mtimensec / 1000;
+ g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, statbuf->st_mtimensec / 1000);
#elif defined (HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
- t.tv_usec = statbuf->st_mtim.tv_nsec / 1000;
-#else
- t.tv_usec = 0;
+ g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, statbuf->st_mtim.tv_nsec /
1000);
#endif
- g_file_info_set_modification_time (info, &t);
-
if (g_file_attribute_matcher_matches (matcher,
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]