diff options
author | rbuj <[email protected]> | 2020-03-16 11:30:32 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-03-27 14:49:19 +0100 |
commit | c9405c2d24224513212e539ff146a32246db6f51 (patch) | |
tree | e734c6ebcb3d0b56be4258f442415d329d16da76 /libslab/bookmark-agent.c | |
parent | 1b2b3fe68d8457cb718cf4aa72c2bd69a8c99bbf (diff) | |
download | mate-control-center-c9405c2d24224513212e539ff146a32246db6f51.tar.bz2 mate-control-center-c9405c2d24224513212e539ff146a32246db6f51.tar.xz |
Port libslab_handle_g_error to the built-in GLib logging framework
Diffstat (limited to 'libslab/bookmark-agent.c')
-rw-r--r-- | libslab/bookmark-agent.c | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/libslab/bookmark-agent.c b/libslab/bookmark-agent.c index fac010e1..478fd54a 100644 --- a/libslab/bookmark-agent.c +++ b/libslab/bookmark-agent.c @@ -208,13 +208,12 @@ bookmark_agent_move_item (BookmarkAgent *this, const gchar *uri, const gchar *ur if (! TYPE_IS_RECENT (priv->type)) return; - gtk_recent_manager_move_item ( - gtk_recent_manager_get_default (), uri, uri_new, & error); - - if (error) - libslab_handle_g_error ( - & error, "%s: unable to update %s with renamed file, [%s] -> [%s].", - G_STRFUNC, priv->store_path, uri, uri_new); + gtk_recent_manager_move_item (gtk_recent_manager_get_default (), uri, uri_new, &error); + if (error) { + g_warning ("Unable to update %s with renamed file, [%s] -> [%s]: %s", + priv->store_path, uri, uri_new, error->message); + g_error_free (error); + } } void @@ -232,12 +231,12 @@ bookmark_agent_purge_items (BookmarkAgent *this) uris = g_bookmark_file_get_uris (priv->store, &uris_len); if (TYPE_IS_RECENT (priv->type)) { for (i = 0; i < uris_len; i++) { - gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uris [i], & error); - - if (error) - libslab_handle_g_error ( - & error, "%s: unable to remove [%s] from %s.", - G_STRFUNC, priv->store_path, uris [i]); + gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uris [i], &error); + if (error) { + g_warning ("Unable to remove [%s] from %s: %s", + priv->store_path, uris [i], error->message); + g_error_free (error); + } } } else { for (i = 0; i < uris_len; i++) { @@ -267,13 +266,11 @@ bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri) return; if (TYPE_IS_RECENT (priv->type)) { - gtk_recent_manager_remove_item ( - gtk_recent_manager_get_default (), uri, & error); - - if (error) - libslab_handle_g_error ( - & error, "%s: unable to remove [%s] from %s.", - G_STRFUNC, priv->store_path, uri); + gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uri, &error); + if (error) { + g_warning ("Unable to remove [%s] from %s: %s", priv->store_path, uri, error->message); + g_error_free (error); + } } else { rank = get_rank (this, uri); @@ -847,10 +844,12 @@ load_xbel_store (BookmarkAgent *this) g_bookmark_file_free (priv->store); priv->store = g_bookmark_file_new (); - libslab_handle_g_error ( - & error, "%s: couldn't load bookmark file [%s]\n", - G_STRFUNC, priv->store_path ? priv->store_path : "NULL"); - + if (error) { + g_debug ("Couldn't load bookmark file [%s]: %s", priv->store_path, error->message); + g_error_free (error); + } else { + g_debug ("Couldn't load bookmark file [NULL]"); + } return; } @@ -1032,10 +1031,15 @@ save_xbel_store (BookmarkAgent *this) GError *error = NULL; + if (g_bookmark_file_to_file (priv->store, priv->store_path, &error)) + return; - if (! g_bookmark_file_to_file (priv->store, priv->store_path, & error)) - libslab_handle_g_error ( - & error, "%s: couldn't save bookmark file [%s]\n", G_STRFUNC, priv->store_path); + if (error) { + g_warning ("Couldn't save bookmark file [%s]: %s", priv->store_path, error->message); + g_error_free (error); + } else { + g_warning ("Couldn't save bookmark file [%s]", priv->store_path); + } } static void |