Commit 61a056a7 authored by André Weber's avatar André Weber

Fix the handling of string variable - store them as UTF-8 into the config...

Fix the handling of string variable - store them as UTF-8 into the config variables, also convert the StringList values to an UTF8 string before putting them into a QVariant - which seems not to work if created from a "char *" - because later converterd QVariant->toString() isn't UTF8 like expected.
waveout.c forgott to convert string to UTF8 before storing in choice list
parent bd2b3483
......@@ -1193,11 +1193,11 @@ static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
if(waveOutGetDevCaps(i, &caps, sizeof(WAVEOUTCAPS))
== MMSYSERR_NOERROR)
{
sprintf(sz_dev_name,psz_device_name_fmt,caps.szPname,
sprintf( sz_dev_name, psz_device_name_fmt, caps.szPname,
caps.wMid,
caps.wPid
);
p_item->ppsz_list[j] = strdup( sz_dev_name );
p_item->ppsz_list[j] = FromLocaleDup( sz_dev_name );
p_item->ppsz_list_text[j] = FromLocaleDup( sz_dev_name );
p_item->i_list++;
j++;
......@@ -1232,12 +1232,18 @@ static uint32_t findDeviceID(char *psz_device_name)
if(waveOutGetDevCaps(i, &caps, sizeof(WAVEOUTCAPS))
== MMSYSERR_NOERROR)
{
sprintf(sz_dev_name,psz_device_name_fmt,caps.szPname,
sprintf(sz_dev_name, psz_device_name_fmt, caps.szPname,
caps.wMid,
caps.wPid
);
if(!stricmp(sz_dev_name,psz_device_name))
return i;
char *psz_temp = FromLocaleDup(sz_dev_name);
if( !stricmp(psz_temp, psz_device_name) )
{
LocaleFree( psz_temp );
return i;
}
LocaleFree( psz_temp );
}
}
......
......@@ -184,7 +184,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
VStringConfigControl *vscc =
qobject_cast<VStringConfigControl *>(this);
assert( vscc );
config_PutPsz( p_intf, vscc->getName(), qta( vscc->getValue() ) );
config_PutPsz( p_intf, vscc->getName(), qtu( vscc->getValue() ) );
break;
}
case CONFIG_ITEM_KEY:
......@@ -381,7 +381,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
// assume in a×y case that dirty was set to VLC_TRUE
// assume in any case that dirty was set to VLC_TRUE
// because lazy programmes will use the same callback for
// this, like the one behind the refresh push button?
p_module_config->b_dirty = VLC_FALSE;
......@@ -466,7 +466,7 @@ void StringListConfigControl::finish(module_config_t *p_module_config, bool byca
p_module_config->ppsz_list_text[i_index])?
p_module_config->ppsz_list_text[i_index] :
p_module_config->ppsz_list[i_index] ),
QVariant( p_module_config->ppsz_list[i_index] ) );
QVariant( qfu(p_module_config->ppsz_list[i_index] )) );
if( p_item->value.psz && !strcmp( p_module_config->value.psz,
p_module_config->ppsz_list[i_index] ) )
combo->setCurrentIndex( combo->count() - 1 );
......
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