diff --git a/src/dialogs/filesel.cpp b/src/dialogs/filesel.cpp index 2a96c5e83..e48f25fef 100644 --- a/src/dialogs/filesel.cpp +++ b/src/dialogs/filesel.cpp @@ -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(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(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(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(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) { diff --git a/src/jinete/jbase.h b/src/jinete/jbase.h index f297b6371..b40f19dba 100644 --- a/src/jinete/jbase.h +++ b/src/jinete/jbase.h @@ -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, diff --git a/src/jinete/jwidget.cpp b/src/jinete/jwidget.cpp index c9a200b5c..cfcdfeb5a 100644 --- a/src/jinete/jwidget.cpp +++ b/src/jinete/jwidget.cpp @@ -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); }