diff options
author | zhuyaliang <[email protected]> | 2021-07-22 08:12:26 +0800 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2021-07-28 11:52:41 -0400 |
commit | 71c7563e708128f80d6d60447cdb0430c5414626 (patch) | |
tree | e8106477696f1f3c346cf80bcb26fcfbd2e50f89 /libslab/bookmark-agent.c | |
parent | f9d1c221023e76e5a84bb4f88af4b05494054dd4 (diff) | |
download | mate-control-center-71c7563e708128f80d6d60447cdb0430c5414626.tar.bz2 mate-control-center-71c7563e708128f80d6d60447cdb0430c5414626.tar.xz |
Replace the deprecated g_bookmark_file_get_modified with g_bookmark_file_get_modified_date_time
Diffstat (limited to 'libslab/bookmark-agent.c')
-rw-r--r-- | libslab/bookmark-agent.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/libslab/bookmark-agent.c b/libslab/bookmark-agent.c index 29df9247..09a4e310 100644 --- a/libslab/bookmark-agent.c +++ b/libslab/bookmark-agent.c @@ -112,8 +112,6 @@ static void store_monitor_cb (GFileMonitor *, GFile *, GFile *, GFileMonitorEvent, gpointer); static void weak_destroy_cb (gpointer, GObject *); -static gint recent_item_mru_comp_func (gconstpointer a, gconstpointer b); - static gchar *find_package_data_file (const gchar *filename); static gint BookmarkAgent_private_offset; @@ -170,7 +168,7 @@ 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) - g_bookmark_file_set_modified (priv->store, item->uri, item->mtime); + g_bookmark_file_set_modified_date_time (priv->store, item->uri, item->mtime); if (item->title) g_bookmark_file_set_title (priv->store, item->uri, item->title); @@ -323,13 +321,13 @@ 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); - item->mtime = g_bookmark_file_get_modified (store, uris [i], NULL); + item->mtime = g_bookmark_file_get_modified_date_time (store, uris [i], NULL); items_ordered = g_list_prepend (items_ordered, item); } } - items_ordered = g_list_sort (items_ordered, recent_item_mru_comp_func); + items_ordered = g_list_sort (items_ordered, g_date_time_compare); g_strfreev (uris); @@ -358,7 +356,7 @@ 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); - g_bookmark_file_set_modified (priv->store, item->uri, item->mtime); + g_bookmark_file_set_modified_date_time (priv->store, item->uri, item->mtime); bookmark_item_free (item); } @@ -720,7 +718,7 @@ 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); - priv->items [i]->mtime = g_bookmark_file_get_modified (priv->store, uris_ordered [i], NULL); + priv->items [i]->mtime = g_bookmark_file_get_modified_date_time (priv->store, uris_ordered [i], NULL); priv->items [i]->app_name = NULL; priv->items [i]->app_exec = NULL; @@ -1226,9 +1224,3 @@ weak_destroy_cb (gpointer data, GObject *g_obj) { instances [GPOINTER_TO_INT (data)] = NULL; } - -static gint -recent_item_mru_comp_func (gconstpointer a, gconstpointer b) -{ - return ((BookmarkItem *) b)->mtime - ((BookmarkItem *) a)->mtime; -} |