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

Undo misuse of module_config_t.b_dirty

This fixes a bug whereby the configuration would not be saved because
Qt4 cleared the b_dirty flag instead of minding its own business.

The core determines whether the value of a configuration item as changed
using b_dirty. b_dirty is _not_ meant to signal changes in choices list.
Configuration callbacks blindly set b_dirty, so the UI can assume that
choices changed. Besides those callbacks should be removed as they do
not follow the locking model of the configuration and can cause crashes.
parent 0041fd5c
......@@ -2074,9 +2074,6 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
p_item->ppsz_list[i] = NULL;
p_item->ppsz_list_text[i] = NULL;
/* Signal change to the interface */
p_item->b_dirty = true;
return VLC_SUCCESS;
}
......
......@@ -759,9 +759,6 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
GetDevices (p_this, p_item, "default");
/* Signal change to the interface */
p_item->b_dirty = true;
return VLC_SUCCESS;
}
......
......@@ -1162,9 +1162,6 @@ static int ReloadDirectXDevices( vlc_object_t *p_this, char const *psz_name,
p_item->i_list = 0;
OurDirectSoundEnumerate(CallBackConfigEnum, p_item);
/* Signal change to the interface */
p_item->b_dirty = true;
error:
FreeLibrary(hdsound_dll);
......
......@@ -1076,9 +1076,6 @@ static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
p_item->ppsz_list[j] = NULL;
p_item->ppsz_list_text[j] = NULL;
/* Signal change to the interface */
p_item->b_dirty = true;
return VLC_SUCCESS;
}
......
......@@ -446,12 +446,8 @@ void StringListConfigControl::actionRequested( int i_action )
p_module_config->ppf_action[i_action]( p_this, getName(), val, val, 0 );
if( p_module_config->b_dirty )
{
combo->clear();
finish( p_module_config );
p_module_config->b_dirty = false;
}
combo->clear();
finish( p_module_config );
}
StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
......@@ -479,12 +475,6 @@ void StringListConfigControl::finish(module_config_t *p_module_config )
val.psz_string = strdup(p_module_config->value.psz);
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = false;
free( val.psz_string );
}
......@@ -543,10 +533,6 @@ void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
vlc_value_t val;
val.i_int = p_config->value.i;
p_config->pf_update_list(VLC_OBJECT(p_intf), configname, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_config->b_dirty = false;
}
for ( int i_index = 0; i_index < p_config->i_list; i_index++ )
......@@ -991,11 +977,6 @@ void IntegerListConfigControl::finish(module_config_t *p_module_config )
val.i_int = p_module_config->value.i;
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in any case that dirty was set to true
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = false;
}
for( int i_index = 0; i_index < p_module_config->i_list; i_index++ )
......@@ -1030,12 +1011,8 @@ void IntegerListConfigControl::actionRequested( int i_action )
p_module_config->ppf_action[i_action]( p_this, getName(), val, val, 0 );
if( p_module_config->b_dirty )
{
combo->clear();
finish( p_module_config );
p_module_config->b_dirty = false;
}
combo->clear();
finish( p_module_config );
}
int IntegerListConfigControl::getValue() const
......
......@@ -1471,9 +1471,6 @@ static int FindDevicesCallback(vlc_object_t *object, char const *name,
FreeLibrary(hddraw_dll);
/* Signal change to the interface */
item->b_dirty = true;
return VLC_SUCCESS;
}
......
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