[Xfce4-commits] <parole:bluesabre/gtk3> Fix remaining Coverity defects
Sean Davis
noreply at xfce.org
Fri Sep 13 03:58:01 CEST 2013
Updating branch refs/heads/bluesabre/gtk3
to a03409ba80661e2d513f21e94f00f22adcfe6d04 (commit)
from b78593c7f23934f9aefcc5fce126b0302cb715cb (commit)
commit a03409ba80661e2d513f21e94f00f22adcfe6d04
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Thu Sep 12 21:57:45 2013 -0400
Fix remaining Coverity defects
src/parole-medialist.c | 58 ++++++++++++++++++++++--------------------
src/parole-plugins-manager.c | 2 +-
2 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index 523a3ab..28ca38b 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -1014,25 +1014,26 @@ parole_media_list_move_up_clicked_cb (GtkButton *button, ParoleMediaList *list)
/* Get first item */
path = g_list_nth_data (path_list, 0);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path);
-
- /* copy it as we don't mess with the list*/
- prev = gtk_tree_path_copy (path);
-
- if ( gtk_tree_path_prev (prev) )
+ if (gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path))
{
- if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, prev))
+ /* copy it as we don't mess with the list*/
+ prev = gtk_tree_path_copy (path);
+
+ if ( gtk_tree_path_prev (prev) )
{
- /* Move each item about the previous path */
- for (i=0; i<g_list_length(path_list); i++)
+ if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, prev))
{
- path = g_list_nth_data (path_list, i);
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path))
- gtk_list_store_move_before(GTK_LIST_STORE(model), ¤t, &iter);
+ /* Move each item about the previous path */
+ for (i=0; i<g_list_length(path_list); i++)
+ {
+ path = g_list_nth_data (path_list, i);
+ if (gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path))
+ gtk_list_store_move_before(GTK_LIST_STORE(model), ¤t, &iter);
+ }
}
}
+ gtk_tree_path_free (prev);
}
- gtk_tree_path_free (prev);
}
g_list_foreach (path_list, (GFunc) gtk_tree_path_free, NULL);
@@ -1062,25 +1063,26 @@ parole_media_list_move_down_clicked_cb (GtkButton *button, ParoleMediaList *list
/* Get first item */
path = g_list_nth_data (path_list, 0);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path);
-
- /* copy it as we don't mess with the list*/
- next = gtk_tree_path_copy (path);
-
- gtk_tree_path_next (next);
-
- if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, next))
+ if (gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path))
{
- /* Move each item about the previous path */
- for (i=0; i<g_list_length(path_list); i++)
+ /* copy it as we don't mess with the list*/
+ next = gtk_tree_path_copy (path);
+
+ gtk_tree_path_next (next);
+
+ if ( gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), &iter, next))
{
- path = g_list_nth_data (path_list, i);
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path))
- gtk_list_store_move_after(GTK_LIST_STORE(model), ¤t, &iter);
+ /* Move each item about the previous path */
+ for (i=0; i<g_list_length(path_list); i++)
+ {
+ path = g_list_nth_data (path_list, i);
+ if (gtk_tree_model_get_iter (GTK_TREE_MODEL (list->priv->store), ¤t, path))
+ gtk_list_store_move_after(GTK_LIST_STORE(model), ¤t, &iter);
+ }
}
- }
- gtk_tree_path_free (next);
+ gtk_tree_path_free (next);
+ }
}
g_list_foreach (path_list, (GFunc) gtk_tree_path_free, NULL);
diff --git a/src/parole-plugins-manager.c b/src/parole-plugins-manager.c
index 1f03249..ee4a6c0 100644
--- a/src/parole-plugins-manager.c
+++ b/src/parole-plugins-manager.c
@@ -249,7 +249,7 @@ parole_plugins_manager_cell_toggled_cb (GtkCellRendererToggle *cell_renderer,
gchar *path_str,
PrefData *pref)
{
- ParoleProviderModule *module;
+ ParoleProviderModule *module = NULL;
GtkTreeIter iter;
GtkTreePath *path;
gboolean active = FALSE;
More information about the Xfce4-commits
mailing list