[gimp/metadata-browser] Review the last few commits and apply some style fanaticism
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] Review the last few commits and apply some style fanaticism
- Date: Wed, 12 Sep 2012 22:47:55 +0000 (UTC)
commit 13774b74c44ac348dc97b6300e3be5e6dd8349b9
Author: Michael Natterer <mitch gimp org>
Date: Tue Feb 7 20:36:55 2012 +0100
Review the last few commits and apply some style fanaticism
some completely unrelated,
app/actions/plug-in-actions.c | 4 ++--
app/core/gimpimage-convert.c | 1 +
app/gui/gimpuiconfigurer.c | 1 +
app/pdb/gimpprocedure.c | 1 +
app/tools/gimpvectortool.c | 30 +++++++++++++++---------------
app/vectors/gimpvectors.c | 7 +++----
app/widgets/gimpcontrollerlist.c | 4 ++--
app/widgets/gimpdeviceinfoeditor.c | 1 +
app/widgets/gimptagentry.c | 1 +
app/widgets/gimptextbuffer-serialize.c | 1 +
app/widgets/gimptextstyleeditor.c | 7 ++++++-
libgimpwidgets/gimpnumberpairentry.c | 7 ++++++-
12 files changed, 40 insertions(+), 25 deletions(-)
---
diff --git a/app/actions/plug-in-actions.c b/app/actions/plug-in-actions.c
index 64a31a2..9921ce7 100644
--- a/app/actions/plug-in-actions.c
+++ b/app/actions/plug-in-actions.c
@@ -503,8 +503,8 @@ plug_in_actions_add_proc (GimpActionGroup *group,
! proc->file_proc &&
proc->image_types_val)
{
- GimpContext *context = gimp_get_user_context (group->gimp);
- GimpImage *image = context ? gimp_context_get_image (context) : NULL;
+ GimpContext *context = gimp_get_user_context (group->gimp);
+ GimpImage *image = gimp_context_get_image (context);
GimpDrawable *drawable = NULL;
gboolean sensitive;
diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c
index b3cfae2..85b2790 100644
--- a/app/core/gimpimage-convert.c
+++ b/app/core/gimpimage-convert.c
@@ -2285,6 +2285,7 @@ select_colors_rgb (QuantizeObj *quantobj,
{
compute_color_rgb (quantobj, histogram, &boxlist[i], i);
}
+
g_free (boxlist);
}
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 6b3bafa..1f67224 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -265,6 +265,7 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer *ui_configurer,
g_list_free (docks);
}
}
+
g_list_free (dialogs);
}
diff --git a/app/pdb/gimpprocedure.c b/app/pdb/gimpprocedure.c
index aa6e4c1..adb1438 100644
--- a/app/pdb/gimpprocedure.c
+++ b/app/pdb/gimpprocedure.c
@@ -765,6 +765,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
}
g_value_unset (&string_value);
+
return FALSE;
}
diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c
index 77d58de..e18d07f 100644
--- a/app/tools/gimpvectortool.c
+++ b/app/tools/gimpvectortool.c
@@ -611,6 +611,7 @@ gimp_vector_tool_button_press (GimpTool *tool,
/* deleting a segment (opening up a stroke) */
+
if (vector_tool->function == VECTORS_DELETE_SEGMENT &&
gimp_vector_tool_check_writable (vector_tool))
{
@@ -1558,8 +1559,9 @@ static void
gimp_vector_tool_vectors_thaw (GimpVectors *vectors,
GimpVectorTool *vector_tool)
{
- /* Ok, the vector might have changed externally (e.g. Undo)
- * we need to validate our internal state. */
+ /* Ok, the vector might have changed externally (e.g. Undo) we need
+ * to validate our internal state.
+ */
gimp_vector_tool_verify_state (vector_tool);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (vector_tool));
@@ -1639,8 +1641,8 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
}
}
- vector_tool->vectors = vectors;
- vector_tool->function = VECTORS_FINISHED;
+ vector_tool->vectors = vectors;
+ vector_tool->function = VECTORS_FINISHED;
gimp_vector_tool_verify_state (vector_tool);
if (! vector_tool->vectors)
@@ -1829,15 +1831,9 @@ gimp_vector_tool_delete_selected_anchors (GimpVectorTool *vector_tool)
static void
gimp_vector_tool_verify_state (GimpVectorTool *vector_tool)
{
- GimpStroke *cur_stroke = NULL;
- GimpAnchor *cur_anchor;
- GList *anchors;
- GList *list;
- gboolean cur_anchor_valid;
- gboolean cur_stroke_valid;
-
- cur_anchor_valid = FALSE;
- cur_stroke_valid = FALSE;
+ GimpStroke *cur_stroke = NULL;
+ gboolean cur_anchor_valid = FALSE;
+ gboolean cur_stroke_valid = FALSE;
vector_tool->sel_count = 0;
vector_tool->sel_anchor = NULL;
@@ -1854,6 +1850,9 @@ gimp_vector_tool_verify_state (GimpVectorTool *vector_tool)
while ((cur_stroke = gimp_vectors_stroke_get_next (vector_tool->vectors,
cur_stroke)))
{
+ GList *anchors;
+ GList *list;
+
/* anchor handles */
anchors = gimp_stroke_get_draw_anchors (cur_stroke);
@@ -1862,7 +1861,7 @@ gimp_vector_tool_verify_state (GimpVectorTool *vector_tool)
for (list = anchors; list; list = g_list_next (list))
{
- cur_anchor = GIMP_ANCHOR (list->data);
+ GimpAnchor *cur_anchor = list->data;
if (cur_anchor == vector_tool->cur_anchor)
cur_anchor_valid = TRUE;
@@ -1885,11 +1884,12 @@ gimp_vector_tool_verify_state (GimpVectorTool *vector_tool)
}
g_list_free (anchors);
+
anchors = gimp_stroke_get_draw_controls (cur_stroke);
for (list = anchors; list; list = g_list_next (list))
{
- cur_anchor = GIMP_ANCHOR (list->data);
+ GimpAnchor *cur_anchor = list->data;
if (cur_anchor == vector_tool->cur_anchor)
cur_anchor_valid = TRUE;
diff --git a/app/vectors/gimpvectors.c b/app/vectors/gimpvectors.c
index 26f2c23..688ecf8 100644
--- a/app/vectors/gimpvectors.c
+++ b/app/vectors/gimpvectors.c
@@ -1167,10 +1167,9 @@ gimp_vectors_real_make_bezier (const GimpVectors *vectors)
}
if (cmd_array->len > 0)
- {
- ret_bezdesc = gimp_bezier_desc_new ((cairo_path_data_t *) cmd_array->data,
- cmd_array->len);
- }
+ ret_bezdesc = gimp_bezier_desc_new ((cairo_path_data_t *) cmd_array->data,
+ cmd_array->len);
+
g_array_free (cmd_array, FALSE);
return ret_bezdesc;
diff --git a/app/widgets/gimpcontrollerlist.c b/app/widgets/gimpcontrollerlist.c
index 67deed7..d4896ac 100644
--- a/app/widgets/gimpcontrollerlist.c
+++ b/app/widgets/gimpcontrollerlist.c
@@ -230,6 +230,8 @@ gimp_controller_list_init (GimpControllerList *list)
g_type_class_unref (controller_class);
}
+ g_free (controller_types);
+
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_set_homogeneous (GTK_BOX (vbox), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
@@ -313,8 +315,6 @@ gimp_controller_list_init (GimpControllerList *list)
gtk_widget_set_sensitive (list->edit_button, FALSE);
gtk_widget_set_sensitive (list->up_button, FALSE);
gtk_widget_set_sensitive (list->down_button, FALSE);
-
- g_free (controller_types);
}
static void
diff --git a/app/widgets/gimpdeviceinfoeditor.c b/app/widgets/gimpdeviceinfoeditor.c
index 391994c..d13dfda 100644
--- a/app/widgets/gimpdeviceinfoeditor.c
+++ b/app/widgets/gimpdeviceinfoeditor.c
@@ -487,6 +487,7 @@ gimp_device_info_editor_constructed (GObject *object)
label = gtk_label_new (string);
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_show (label);
+
g_free (string);
}
}
diff --git a/app/widgets/gimptagentry.c b/app/widgets/gimptagentry.c
index e98e5b3..e70fb6b 100644
--- a/app/widgets/gimptagentry.c
+++ b/app/widgets/gimptagentry.c
@@ -876,6 +876,7 @@ gimp_tag_entry_parse_tags (GimpTagEntry *entry)
parsed_tags[length] = NULL;
g_list_free (tag_list);
+
return parsed_tags;
}
diff --git a/app/widgets/gimptextbuffer-serialize.c b/app/widgets/gimptextbuffer-serialize.c
index fd83002..8db37f5 100644
--- a/app/widgets/gimptextbuffer-serialize.c
+++ b/app/widgets/gimptextbuffer-serialize.c
@@ -237,6 +237,7 @@ gimp_text_buffer_serialize (GtkTextBuffer *register_buffer,
while (! gtk_text_iter_equal (&iter, end));
g_slist_free (tag_list);
+
/* Close any open tags */
for (tag_list = active_tags; tag_list; tag_list = tag_list->next)
close_tag (GIMP_TEXT_BUFFER (register_buffer), string, tag_list->data);
diff --git a/app/widgets/gimptextstyleeditor.c b/app/widgets/gimptextstyleeditor.c
index c76aefc..f99c99a 100644
--- a/app/widgets/gimptextstyleeditor.c
+++ b/app/widgets/gimptextstyleeditor.c
@@ -424,7 +424,12 @@ gimp_text_style_editor_finalize (GObject *object)
editor->fonts = NULL;
}
- g_list_free (editor->toggles);
+ if (editor->toggles)
+ {
+ g_list_free (editor->toggles);
+ editor->toggles = NULL;
+ }
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/libgimpwidgets/gimpnumberpairentry.c b/libgimpwidgets/gimpnumberpairentry.c
index 7bed2da..66f1c0b 100644
--- a/libgimpwidgets/gimpnumberpairentry.c
+++ b/libgimpwidgets/gimpnumberpairentry.c
@@ -333,7 +333,12 @@ gimp_number_pair_entry_finalize (GObject *object)
priv->num_separators = 0;
}
- g_free (priv->default_text);
+ if (priv->default_text)
+ {
+ g_free (priv->default_text);
+ priv->default_text = NULL;
+ }
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]