mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 21:10:25 +01:00
libnmt-newt: use cleanup macro in nmt_newt_button_build_component()
This commit is contained in:
parent
853f411567
commit
61029d4064
1 changed files with 3 additions and 4 deletions
|
|
@ -108,18 +108,17 @@ nmt_newt_button_build_component(NmtNewtComponent *component, gboolean sensitive)
|
|||
{
|
||||
NmtNewtButtonPrivate *priv = NMT_NEWT_BUTTON_GET_PRIVATE(component);
|
||||
newtComponent co;
|
||||
gs_free char * label = NULL;
|
||||
char * label_lc;
|
||||
gs_free char * label_lc = NULL;
|
||||
|
||||
if (sensitive) {
|
||||
label_lc = nmt_newt_locale_from_utf8(priv->label);
|
||||
co = newtCompactButton(-1, -1, label_lc);
|
||||
g_free(label_lc);
|
||||
} else {
|
||||
gs_free char *label = NULL;
|
||||
|
||||
label = g_strdup_printf(" <%s>", priv->label);
|
||||
label_lc = nmt_newt_locale_from_utf8(label);
|
||||
co = newtLabel(-1, -1, label_lc);
|
||||
g_free(label_lc);
|
||||
newtLabelSetColors(co, NMT_NEWT_COLORSET_DISABLED_BUTTON);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue