mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Removed JI_SIGNAL_REMOVE_CHILD and JI_SIGNAL_NEW_PARENT.
These signals do not make sense when we are removing a widget that is being destroyed.
This commit is contained in:
parent
51b0fbdc96
commit
e0ff9d5ee8
@ -148,7 +148,8 @@ jstring ase_file_selector(const jstring& message,
|
||||
JWidget goforward = jwidget_find_name(window, "goforward");
|
||||
JWidget goup = jwidget_find_name(window, "goup");
|
||||
JWidget location = jwidget_find_name(window, "location");
|
||||
filetype = (ComboBox*)jwidget_find_name(window, "filetype");
|
||||
filetype = dynamic_cast<ComboBox*>(jwidget_find_name(window, "filetype"));
|
||||
assert(filetype != NULL);
|
||||
filename_entry = jwidget_find_name(window, "filename");
|
||||
|
||||
jwidget_focusrest(goback, false);
|
||||
@ -188,7 +189,8 @@ jstring ase_file_selector(const jstring& message,
|
||||
}
|
||||
else {
|
||||
fileview = jwidget_find_name(window, "fileview");
|
||||
filetype = (ComboBox*)jwidget_find_name(window, "filetype");
|
||||
filetype = dynamic_cast<ComboBox*>(jwidget_find_name(window, "filetype"));
|
||||
assert(filetype != NULL);
|
||||
filename_entry = jwidget_find_name(window, "filename");
|
||||
|
||||
jwidget_signal_off(fileview);
|
||||
@ -360,7 +362,9 @@ again:
|
||||
static void update_location(JWidget window)
|
||||
{
|
||||
JWidget fileview = jwidget_find_name(window, "fileview");
|
||||
ComboBox* location = (ComboBox*)jwidget_find_name(window, "location");
|
||||
ComboBox* location = dynamic_cast<ComboBox*>(jwidget_find_name(window, "location"));
|
||||
assert(location != NULL);
|
||||
|
||||
FileItem* current_folder = fileview_get_current_folder(fileview);
|
||||
FileItem* fileitem = current_folder;
|
||||
JList locations = jlist_new();
|
||||
@ -490,7 +494,9 @@ static void add_in_navigation_history(FileItem *folder)
|
||||
static void select_filetype_from_filename(JWidget window)
|
||||
{
|
||||
JWidget entry = jwidget_find_name(window, "filename");
|
||||
ComboBox* filetype = (ComboBox*)jwidget_find_name(window, "filetype");
|
||||
ComboBox* filetype = dynamic_cast<ComboBox*>(jwidget_find_name(window, "filetype"));
|
||||
assert(filetype != NULL);
|
||||
|
||||
const char *filename = entry->getText();
|
||||
char *p = get_extension(filename);
|
||||
char buf[MAX_PATH];
|
||||
@ -588,7 +594,7 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* hook for the 'location' combo-box */
|
||||
// Hook for the 'location' combo-box
|
||||
static bool location_msg_proc(JWidget widget, JMessage msg)
|
||||
{
|
||||
if (msg->type == JM_SIGNAL) {
|
||||
|
@ -189,8 +189,6 @@ enum {
|
||||
JI_SIGNAL_SHOW,
|
||||
JI_SIGNAL_HIDE,
|
||||
JI_SIGNAL_ADD_CHILD,
|
||||
JI_SIGNAL_REMOVE_CHILD,
|
||||
JI_SIGNAL_NEW_PARENT,
|
||||
JI_SIGNAL_SET_TEXT,
|
||||
JI_SIGNAL_SET_FONT,
|
||||
JI_SIGNAL_INIT_THEME,
|
||||
|
@ -508,7 +508,6 @@ void jwidget_add_child(JWidget widget, JWidget child)
|
||||
jlist_append(widget->children, child);
|
||||
child->parent = widget;
|
||||
|
||||
jwidget_emit_signal(child, JI_SIGNAL_NEW_PARENT);
|
||||
jwidget_emit_signal(widget, JI_SIGNAL_ADD_CHILD);
|
||||
}
|
||||
|
||||
@ -534,9 +533,6 @@ void jwidget_remove_child(JWidget widget, JWidget child)
|
||||
|
||||
jlist_remove(widget->children, child);
|
||||
child->parent = NULL;
|
||||
|
||||
jwidget_emit_signal(child, JI_SIGNAL_NEW_PARENT);
|
||||
jwidget_emit_signal(widget, JI_SIGNAL_REMOVE_CHILD);
|
||||
}
|
||||
|
||||
void jwidget_replace_child(JWidget widget, JWidget old_child, JWidget new_child)
|
||||
@ -557,7 +553,6 @@ void jwidget_replace_child(JWidget widget, JWidget old_child, JWidget new_child)
|
||||
jlist_insert_before(widget->children, before, new_child);
|
||||
new_child->parent = widget;
|
||||
|
||||
jwidget_emit_signal(new_child, JI_SIGNAL_NEW_PARENT);
|
||||
jwidget_emit_signal(widget, JI_SIGNAL_ADD_CHILD);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user