[vlc-commits] Qt: sprefs, fix caching combobox behaviour
Jean-Baptiste Kempf
git at videolan.org
Sat Oct 22 03:32:12 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Oct 22 02:07:41 2011 +0200| [aa2b33928e9e0599a53033f60e95bf8dc5aadc59] | committer: Jean-Baptiste Kempf
Qt: sprefs, fix caching combobox behaviour
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa2b33928e9e0599a53033f60e95bf8dc5aadc59
---
modules/gui/qt4/components/simple_preferences.cpp | 21 +++++++++++----------
modules/gui/qt4/components/simple_preferences.hpp | 4 ++--
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index b79dcb5..faee5e2 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -490,16 +490,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
addToCachingBox( N_("Higher latency"), CachingHigher );
#undef addToCachingBox
-#define TestCaC( name ) \
+#define TestCaC( name, factor ) \
b_cache_equal = b_cache_equal && \
- ( i_cache == config_GetInt( p_intf, name ) )
+ ( i_cache * factor == config_GetInt( p_intf, name ) );
/* Select the accurate value of the ComboBox */
bool b_cache_equal = true;
- int i_cache = config_GetInt( p_intf, "file-caching");
+ int i_cache = config_GetInt( p_intf, "file-caching" );
- TestCaC( "network-caching" );
- TestCaC( "disc-caching" );
- TestCaC( "live-caching" );
+ TestCaC( "network-caching", 10/3 );
+ TestCaC( "disc-caching", 1);
+ TestCaC( "live-caching", 1 );
if( b_cache_equal == 1 )
ui.cachingCombo->setCurrentIndex(
ui.cachingCombo->findData( QVariant( i_cache ) ) );
@@ -770,15 +770,16 @@ void SPrefsPanel::apply()
config_PutPsz( p_intf, "cd-audio", devicepath );
}
-#define CaC( name ) config_PutInt( p_intf, name, i_comboValue )
+#define CaC( name, factor ) config_PutInt( p_intf, name, i_comboValue * factor )
/* Caching */
QComboBox *cachingCombo = qobject_cast<QComboBox *>(optionWidgets[cachingCoB]);
int i_comboValue = cachingCombo->itemData( cachingCombo->currentIndex() ).toInt();
if( i_comboValue )
{
- CaC( "network-caching" );
- CaC( "disc-caching" );
- CaC( "live-caching" );
+ CaC( "file-caching", 1 );
+ CaC( "network-caching", 10/3 );
+ CaC( "disc-caching", 1 );
+ CaC( "live-caching", 1 );
}
break;
#undef CaC
diff --git a/modules/gui/qt4/components/simple_preferences.hpp b/modules/gui/qt4/components/simple_preferences.hpp
index b680790..2b7ef73 100644
--- a/modules/gui/qt4/components/simple_preferences.hpp
+++ b/modules/gui/qt4/components/simple_preferences.hpp
@@ -59,8 +59,8 @@ enum {
CachingLowest = 100,
CachingLow = 200,
CachingNormal = 300,
- CachingHigh = 750,
- CachingHigher = 2500
+ CachingHigh = 500,
+ CachingHigher = 1000
};
enum {
More information about the vlc-commits
mailing list