[rhythmbox] podcast: clean up parse error handling in the podcast add dialog



commit 796bca08d692d622aeb404608eb8cd73906b4370
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Mar 3 08:34:07 2021 +1000

    podcast: clean up parse error handling in the podcast add dialog
    
    We don't store the error in the parse data any more, so this was
    probably checking the wrong thing, besides being a bit hard to read.

 podcast/rb-podcast-add-dialog.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/podcast/rb-podcast-add-dialog.c b/podcast/rb-podcast-add-dialog.c
index 987500b6d..f8e8a84ce 100644
--- a/podcast/rb-podcast-add-dialog.c
+++ b/podcast/rb-podcast-add-dialog.c
@@ -283,7 +283,6 @@ typedef struct {
        RBPodcastChannel *channel;
        gboolean existing;
        gboolean single;
-       GError *error;
        int reset_count;
 } ParseData;
 
@@ -294,24 +293,19 @@ parse_cb (RBPodcastChannel *channel, GError *error, gpointer user_data)
 
        g_assert (channel == data->channel);
 
-       if (error != NULL) {
-               /* fake up a channel with just the url as the title, allowing the user
-                * to subscribe to the podcast anyway.
-                */
-               channel->title = g_strdup (channel->url);
-               g_error_free (error);
-       }
-
        if (data->reset_count != data->dialog->priv->reset_count) {
                rb_debug ("dialog reset while parsing");
                rb_podcast_parse_channel_unref (data->channel);
                g_object_unref (data->dialog);
-               g_clear_error (&data->error);
                g_free (data);
                return;
        }
 
-       if (data->error != NULL) {
+       if (error != NULL) {
+               /* fake up a channel with just the url as the title, allowing the user
+                * to subscribe to the podcast anyway.
+                */
+               channel->title = g_strdup (channel->url);
                gtk_label_set_label (GTK_LABEL (data->dialog->priv->info_bar_message),
                                     _("Unable to load the feed. Check your network connection."));
                gtk_widget_show (data->dialog->priv->info_bar);
@@ -375,7 +369,6 @@ parse_cb (RBPodcastChannel *channel, GError *error, gpointer user_data)
 
        rb_podcast_parse_channel_unref (data->channel);
        g_object_unref (data->dialog);
-       g_clear_error (&data->error);
        g_free (data);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]