summaryrefslogtreecommitdiff
path: root/libslab
diff options
context:
space:
mode:
authorMartin Wimpress <[email protected]>2021-08-28 07:52:41 +0100
committerGitHub <[email protected]>2021-08-28 07:52:41 +0100
commitd938ffc62902e36bfde84594873d4a3b8eaf0934 (patch)
treec85bc773809cafd862dd5235a15acc8a83bfef4e /libslab
parentb30a29be43d80734d05246d6240f64a18e4a5cc0 (diff)
downloadmate-control-center-d938ffc62902e36bfde84594873d4a3b8eaf0934.tar.bz2
mate-control-center-d938ffc62902e36bfde84594873d4a3b8eaf0934.tar.xz
Maintain compatibility with Glibc versions older than 2.66. Fixes #655 (#659)
g_bookmark_file_set_modified_date_time is used in libslab/bookmark-agent.c which sets the last time the bookmark for uri was last modified. g_bookmark_file_set_modified_date_time is only available in glibc 2.66 and newer.
Diffstat (limited to 'libslab')
-rw-r--r--libslab/bookmark-agent.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libslab/bookmark-agent.c b/libslab/bookmark-agent.c
index 09a4e310..b37616ff 100644
--- a/libslab/bookmark-agent.c
+++ b/libslab/bookmark-agent.c
@@ -168,7 +168,11 @@ bookmark_agent_add_item (BookmarkAgent *this, const BookmarkItem *item)
g_bookmark_file_set_mime_type (priv->store, item->uri, item->mime_type);
if (item->mtime)
+ #if GLIB_CHECK_VERSION(2,66,0)
g_bookmark_file_set_modified_date_time (priv->store, item->uri, item->mtime);
+ #else
+ g_bookmark_file_set_modified (priv->store, item->uri, item->mtime);
+ #endif
if (item->title)
g_bookmark_file_set_title (priv->store, item->uri, item->title);
@@ -321,7 +325,11 @@ make_items_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store)
item->uri = g_strdup (uris [i]);
item->mime_type = g_bookmark_file_get_mime_type (store, uris [i], NULL);
+ #if GLIB_CHECK_VERSION(2,66,0)
item->mtime = g_bookmark_file_get_modified_date_time (store, uris [i], NULL);
+ #else
+ item->mtime = g_bookmark_file_get_modified (store, uris [i], NULL);
+ #endif
items_ordered = g_list_prepend (items_ordered, item);
}
@@ -356,7 +364,11 @@ bookmark_agent_update_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *st
item = (BookmarkItem *) node->data;
g_bookmark_file_set_mime_type (priv->store, item->uri, item->mime_type);
+ #if GLIB_CHECK_VERSION(2,66,0)
g_bookmark_file_set_modified_date_time (priv->store, item->uri, item->mtime);
+ #else
+ g_bookmark_file_set_modified (priv->store, item->uri, item->mtime);
+ #endif
bookmark_item_free (item);
}
@@ -718,7 +730,11 @@ update_items (BookmarkAgent *this)
priv->items [i]->uri = g_strdup (uris_ordered [i]);
priv->items [i]->title = g_bookmark_file_get_title (priv->store, uris_ordered [i], NULL);
priv->items [i]->mime_type = g_bookmark_file_get_mime_type (priv->store, uris_ordered [i], NULL);
+ #if GLIB_CHECK_VERSION(2,66,0)
priv->items [i]->mtime = g_bookmark_file_get_modified_date_time (priv->store, uris_ordered [i], NULL);
+ #else
+ priv->items [i]->mtime = g_bookmark_file_get_modified (priv->store, uris_ordered [i], NULL);
+ #endif
priv->items [i]->app_name = NULL;
priv->items [i]->app_exec = NULL;