From: André Weber Date: Thu, 20 Mar 2008 20:17:48 +0000 (+0100) Subject: Fix the handling of string variable - store them as UTF-8 into the config variables... X-Git-Tag: 0.9.0-test0~1967 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=61a056a7eb4b1190384432f31ba63d102e8d0230;p=vlc 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 --- diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c index 8ec36364be..c415835ff9 100644 --- a/modules/audio_output/waveout.c +++ b/modules/audio_output/waveout.c @@ -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 ); } } diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index e346fd0e1f..0ae3b2500e 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -184,7 +184,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf ) VStringConfigControl *vscc = qobject_cast(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 );