mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
Widget and WGroup API changes:
* (widget_destroy): new API to destroy widget. * (group_del_widget): rename to group_remove_widget. Don't destroy widget after remove it from group. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
22ad70ed02
commit
74c510f4fb
@ -175,12 +175,12 @@ group_add_widget_autopos (WGroup * g, void *w, widget_pos_flags_t pos_flags, con
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Delete widget from group.
|
||||
* Remove widget from group.
|
||||
*
|
||||
* @param w Widget object
|
||||
*/
|
||||
void
|
||||
group_del_widget (void *w)
|
||||
group_remove_widget (void *w)
|
||||
{
|
||||
WGroup *g;
|
||||
GList *d;
|
||||
@ -194,7 +194,7 @@ group_del_widget (void *w)
|
||||
if (d == g->current)
|
||||
group_set_current_widget_next (g);
|
||||
|
||||
g->widgets = g_list_remove_link (g->widgets, d);
|
||||
g->widgets = g_list_delete_link (g->widgets, d);
|
||||
if (g->widgets == NULL)
|
||||
g->current = NULL;
|
||||
|
||||
@ -204,6 +204,8 @@ group_del_widget (void *w)
|
||||
dlg_draw (DIALOG (g)); /* FIXME */
|
||||
group_select_current_widget (g);
|
||||
}
|
||||
|
||||
WIDGET (w)->owner = NULL;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -40,7 +40,7 @@ struct WGroup
|
||||
|
||||
unsigned long group_add_widget_autopos (WGroup * g, void *w, widget_pos_flags_t pos_flags,
|
||||
const void *before);
|
||||
void group_del_widget (void *w);
|
||||
void group_remove_widget (void *w);
|
||||
|
||||
void group_set_current_widget_next (WGroup * g);
|
||||
void group_set_current_widget_prev (WGroup * g);
|
||||
|
@ -2268,7 +2268,7 @@ edit_close_cmd (WEdit * edit)
|
||||
if (edit->locked != 0)
|
||||
unlock_file (edit->filename_vpath);
|
||||
|
||||
group_del_widget (edit);
|
||||
group_remove_widget (edit);
|
||||
widget_destroy (WIDGET (edit));
|
||||
|
||||
if (edit_widget_is_editor (CONST_WIDGET (g->current->data)))
|
||||
|
Loading…
Reference in New Issue
Block a user