summaryrefslogtreecommitdiff
path: root/libslab/bookmark-agent.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-01 10:21:17 +0100
committerraveit65 <[email protected]>2023-05-07 17:11:32 +0200
commit62385ba63409e647381c04dbd7a647d3018d777f (patch)
tree52f589dd94e7aab20ec780a8139dfd66ff9f490f /libslab/bookmark-agent.c
parent0c084c2e24fb3f281f5735862f6010917e8f5d56 (diff)
downloadmate-control-center-62385ba63409e647381c04dbd7a647d3018d777f.tar.bz2
mate-control-center-62385ba63409e647381c04dbd7a647d3018d777f.tar.xz
bookmark-agent: fix backward compatibility with glib < 2.66
Diffstat (limited to 'libslab/bookmark-agent.c')
-rw-r--r--libslab/bookmark-agent.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libslab/bookmark-agent.c b/libslab/bookmark-agent.c
index b37616ff..6258c40f 100644
--- a/libslab/bookmark-agent.c
+++ b/libslab/bookmark-agent.c
@@ -296,6 +296,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)
{
@@ -335,8 +343,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;