validate: report: avoid unnecessary calls to _append_printf

Additionally: simplify %format magic used for padding
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2017-03-01 15:06:59 -08:00
parent 9588ccd02b
commit 7f5d22f616

View file

@ -886,9 +886,9 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args)
GstValidateActionType *type = GST_VALIDATE_ACTION_TYPE (source); GstValidateActionType *type = GST_VALIDATE_ACTION_TYPE (source);
g_string_assign (string, "\nAction type:"); g_string_assign (string, "\nAction type:");
g_string_append_printf (string, "\n Name: %s", type->name); g_string_append_printf (string,
g_string_append_printf (string, "\n Implementer namespace: %s", "\n Name: %s\n Implementer namespace: %s",
type->implementer_namespace); type->name, type->implementer_namespace);
if (IS_CONFIG_ACTION_TYPE (type->flags)) if (IS_CONFIG_ACTION_TYPE (type->flags))
g_string_append_printf (string, g_string_append_printf (string,
@ -918,13 +918,12 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args)
if ((type->flags & GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL)) { if ((type->flags & GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL)) {
has_parameters = TRUE; has_parameters = TRUE;
g_string_append_printf (string, "\n %-26s : %s", "optional", g_string_append_printf (string,
"Don't raise an error if this action hasn't been executed or failed"); "\n optional : "
g_string_append_printf (string, "\n %-28s %s", "", "Don't raise an error if this action hasn't been executed of failed"
"Possible types:"); "\n%-32s Possible types:"
g_string_append_printf (string, "\n %-31s %s", "", "boolean"); "\n%-32s boolean"
g_string_append_printf (string, "\n %-28s %s", "", "\n%-32s Default: false","","","");
"Default: false");
} }
if (!has_parameters) if (!has_parameters)