diff options
author | rbuj <[email protected]> | 2021-11-01 10:21:17 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-02-09 04:47:12 +0000 |
commit | 384ce5d35897453a5dcca79c2633035dd40aeaa1 (patch) | |
tree | 2840d9f24277de09f8124845c6f5972a5cfaae5b /libslab/bookmark-agent.c | |
parent | f6bd25fdf6196dd98d36708966e13e58a22d6c85 (diff) | |
download | mate-control-center-384ce5d35897453a5dcca79c2633035dd40aeaa1.tar.bz2 mate-control-center-384ce5d35897453a5dcca79c2633035dd40aeaa1.tar.xz |
bookmark-agent: fix backward compatibility with glib < 2.66
Diffstat (limited to 'libslab/bookmark-agent.c')
-rw-r--r-- | libslab/bookmark-agent.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libslab/bookmark-agent.c b/libslab/bookmark-agent.c index 31834bd1..6d6551e0 100644 --- a/libslab/bookmark-agent.c +++ b/libslab/bookmark-agent.c @@ -294,6 +294,14 @@ bookmark_agent_reorder_items (BookmarkAgent *this, const gchar **uris) save_store (this); } +#if !GLIB_CHECK_VERSION(2,66,0) +static gint +recent_item_mru_comp_func (gconstpointer a, gconstpointer b) +{ + return ((BookmarkItem *) b)->mtime - ((BookmarkItem *) a)->mtime; +} +#endif + static GList * make_items_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store) { @@ -333,8 +341,11 @@ make_items_from_bookmark_file (BookmarkAgent *this, GBookmarkFile *store) } } +#if GLIB_CHECK_VERSION(2,66,0) items_ordered = g_list_sort (items_ordered, g_date_time_compare); - +#else + items_ordered = g_list_sort (items_ordered, recent_item_mru_comp_func); +#endif g_strfreev (uris); return items_ordered; |