From da3ea1c1b9f65f9138f3aaa027058a3bf1b72516 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 31 Jul 2010 10:22:57 +0000 Subject: fix for #867 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4717 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/options/optw_sound.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/options/optw_sound.cpp b/src/modules/options/optw_sound.cpp index f47179a88..e23ad4b51 100644 --- a/src/modules/options/optw_sound.cpp +++ b/src/modules/options/optw_sound.cpp @@ -149,9 +149,10 @@ KviSoundGeneralOptionsWidget::~KviSoundGeneralOptionsWidget() void KviSoundGeneralOptionsWidget::showEvent(QShowEvent *) { +qDebug("showEvent"); if(!m_bFirstShow) return; - +qDebug("m_bFirstShow"); // We fill these boxes only before the first show since the soundFillBox() // is likely to trigger sound system-detection which may take time... @@ -222,6 +223,7 @@ void KviSoundGeneralOptionsWidget::mediaAutoDetect() void KviSoundGeneralOptionsWidget::soundFillBox() { + qDebug("soundFillBox"); QStringList l; QStringList::Iterator it; int cnt; @@ -235,10 +237,11 @@ void KviSoundGeneralOptionsWidget::soundFillBox() goto disable; m_pSoundSystemBox->clear(); - +qDebug("soundFillBox clear"); for ( it = l.begin(); it != l.end(); ++it ) { m_pSoundSystemBox->addItem(*it); + qDebug("soundFillBox add %s",it->toUtf8().data()); } cnt = m_pSoundSystemBox->count(); @@ -246,9 +249,11 @@ void KviSoundGeneralOptionsWidget::soundFillBox() for(i=0;iitemText(i); + qDebug("soundFillBox check %s==%s",t.toUtf8().data(),KVI_OPTION_STRING(KviOption_stringSoundSystem).toUtf8().data()); if(KviQString::equalCI(t,KVI_OPTION_STRING(KviOption_stringSoundSystem))) { m_pSoundSystemBox->setCurrentIndex(i); +qDebug("soundFillBox check ok setCurrentIndex %i",i); break; } } @@ -298,6 +303,10 @@ disable: void KviSoundGeneralOptionsWidget::commit() { + // avoid to commit if we've never been shown (and initialized) + if(m_bFirstShow) + return; + KviOptionsWidget::commit(); KVI_OPTION_STRING(KviOption_stringSoundSystem) = m_pSoundSystemBox->currentText(); KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer) = m_pMediaPlayerBox->currentText(); -- cgit v1.3.1-10-gc9f91