Commit a6a9c37e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Don't bother with vlc_object_get() when you can keep pointers!

parent 84d0f814
...@@ -134,6 +134,7 @@ public: ...@@ -134,6 +134,7 @@ public:
PrefsPanel *panel; PrefsPanel *panel;
wxBoxSizer *sizer; wxBoxSizer *sizer;
module_t *p_module;
int i_object_id; int i_object_id;
int i_subcat_id; int i_subcat_id;
int i_type; int i_type;
...@@ -584,9 +585,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -584,9 +585,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
config_data->b_submodule = module_IsSubModule(p_module); config_data->b_submodule = module_IsSubModule(p_module);
#endif #endif
config_data->i_type = TYPE_MODULE; config_data->i_type = TYPE_MODULE;
config_data->i_object_id = config_data->b_submodule ? config_data->p_module = config_data->b_submodule ?
((vlc_object_t *)p_module)->p_parent->i_object_id : p_module->p_parent : p_module;
((vlc_object_t *)p_module)->i_object_id;
config_data->psz_help = NULL; config_data->psz_help = NULL;
/* WXMSW doesn't know image -1 ... FIXME */ /* WXMSW doesn't know image -1 ... FIXME */
...@@ -769,7 +769,7 @@ ConfigTreeData *PrefsTreeCtrl::FindModuleConfig( ConfigTreeData *config_data ) ...@@ -769,7 +769,7 @@ ConfigTreeData *PrefsTreeCtrl::FindModuleConfig( ConfigTreeData *config_data )
{ {
config_new = (ConfigTreeData *)GetItemData( module ); config_new = (ConfigTreeData *)GetItemData( module );
if( config_new && !config_new->b_submodule && if( config_new && !config_new->b_submodule &&
config_new->i_object_id == config_data->i_object_id ) config_new->p_module == config_data->p_module )
{ {
return config_new; return config_new;
} }
...@@ -899,8 +899,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -899,8 +899,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
/* Get a pointer to the module */ /* Get a pointer to the module */
if( config_data->i_type == TYPE_MODULE ) if( config_data->i_type == TYPE_MODULE )
{ {
p_module = (module_t *) p_module = config_data->p_module;
vlc_object_get( config_data->i_object_id );
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment