Commit 24143017 authored by Michael Natterer's avatar Michael Natterer 😴

Review the last few commits and apply some style fanaticism

some completely unrelated,
parent 052bce73
......@@ -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;
......
......@@ -2285,6 +2285,7 @@ select_colors_rgb (QuantizeObj *quantobj,
{
compute_color_rgb (quantobj, histogram, &boxlist[i], i);
}
g_free (boxlist);
}
......
......@@ -265,6 +265,7 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer *ui_configurer,
g_list_free (docks);
}
}
g_list_free (dialogs);
}
......
......@@ -765,6 +765,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
}
g_value_unset (&string_value);
return FALSE;
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
}
}
......
......@@ -876,6 +876,7 @@ gimp_tag_entry_parse_tags (GimpTagEntry *entry)
parsed_tags[length] = NULL;
g_list_free (tag_list);
return parsed_tags;
}
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment