[Xfce4-commits] [apps/parole] 01/01: Fix coverity warnings

noreply at xfce.org noreply at xfce.org
Fri Jul 4 16:33:13 CEST 2014


This is an automated email from the git hooks/post-receive script.

bluesabre pushed a commit to branch master
in repository apps/parole.

commit dae574ae77dea9888121799caa5d24499d98e53f
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Jul 4 10:33:07 2014 -0400

    Fix coverity warnings
---
 src/misc/parole-stream.c |    3 ++-
 src/parole-medialist.c   |   25 ++++++++++++++-----------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/misc/parole-stream.c b/src/misc/parole-stream.c
index 74f6280..8516e19 100644
--- a/src/misc/parole-stream.c
+++ b/src/misc/parole-stream.c
@@ -836,7 +836,8 @@ void parole_stream_init_properties (ParoleStream *stream)
     /* Remove the previous image if it exists */
     if ( PAROLE_STREAM_GET_PRIVATE (stream)->previous_image )
     {
-        g_remove (PAROLE_STREAM_GET_PRIVATE (stream)->previous_image);
+        if (g_remove (PAROLE_STREAM_GET_PRIVATE (stream)->previous_image) != 0)
+            g_warning ("Failed to remove temporary artwork");
     }
     PAROLE_STREAM_GET_PRIVATE (stream)->previous_image = NULL;
 }
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index 5e3872a..7f26b3a 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -286,23 +286,25 @@ parole_media_list_add (ParoleMediaList *list, ParoleFile *file, gboolean disc, g
         filename = g_strdup(parole_file_get_file_name(file));
 
         /* Check the first row */
-        gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list_store), &iter);
-        gtk_tree_model_get(GTK_TREE_MODEL(list_store), &iter, DATA_COL, &row_file, -1);
-        if (g_strcmp0(filename, parole_file_get_file_name(row_file)) == 0)
+        if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list_store), &iter))
         {
-            gtk_list_store_remove (GTK_LIST_STORE(list_store), &iter);
-        }
-
-        /* Check subsequent rows */
-        while (gtk_tree_model_iter_next(GTK_TREE_MODEL(list_store), &iter)) {
             gtk_tree_model_get(GTK_TREE_MODEL(list_store), &iter, DATA_COL, &row_file, -1);
             if (g_strcmp0(filename, parole_file_get_file_name(row_file)) == 0)
             {
                 gtk_list_store_remove (GTK_LIST_STORE(list_store), &iter);
             }
-        }
 
-        g_object_unref(row_file);
+            /* Check subsequent rows */
+            while (gtk_tree_model_iter_next(GTK_TREE_MODEL(list_store), &iter)) {
+                gtk_tree_model_get(GTK_TREE_MODEL(list_store), &iter, DATA_COL, &row_file, -1);
+                if (g_strcmp0(filename, parole_file_get_file_name(row_file)) == 0)
+                {
+                    gtk_list_store_remove (GTK_LIST_STORE(list_store), &iter);
+                }
+            }
+
+            g_object_unref(row_file);
+        }
     }
 
     /* Add the file to the playlist */
@@ -2129,7 +2131,8 @@ void parole_media_list_save_list (ParoleMediaList *list)
         else
         {
             // If the playlist is empty, delete the list.
-            remove(history);
+            if (remove(history) != 0)
+                g_warning ("Failed to remove playlist");
             g_free(history);
         }
         g_slist_free (fileslist);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list