@@ -575,15 +575,15 @@ void PreferencesDlg::initSoundSystemTab()
575
575
void PreferencesDlg::initSoundEventsTab ()
576
576
{
577
577
ui.spackBox ->clear ();
578
- ui.spackBox ->addItem (tr (" Default" ));
578
+ ui.spackBox ->addItem (tr (" Default" ), SETTINGS_SOUNDS_PACK_DEFAULT );
579
579
QDir dir ( SOUNDSPATH, " " , QDir::Name, QDir::AllDirs|QDir::NoSymLinks|QDir::NoDotAndDotDot);
580
580
QStringList aspack = dir.entryList ();
581
581
for (int i=0 ;i<aspack.size ();i++)
582
582
{
583
583
QString packname = aspack[i].left (aspack[i].size ());
584
584
ui.spackBox ->addItem (packname, packname);
585
585
}
586
- QString pack = ttSettings->value (SETTINGS_SOUNDS_PACK, QCoreApplication::translate ( " MainWindow " , SETTINGS_SOUNDS_PACK_DEFAULT) ).toString ();
586
+ QString pack = ttSettings->value (SETTINGS_SOUNDS_PACK, SETTINGS_SOUNDS_PACK_DEFAULT).toString ();
587
587
int index = ui.spackBox ->findData (pack);
588
588
if (index >=0 )
589
589
ui.spackBox ->setCurrentIndex (index );
@@ -1889,7 +1889,7 @@ void PreferencesDlg::slotTTSRevert(bool /*checked*/)
1889
1889
1890
1890
void PreferencesDlg::slotSPackChange ()
1891
1891
{
1892
- if (ui.spackBox ->currentText () != ttSettings->value (SETTINGS_SOUNDS_PACK, QCoreApplication::translate ( " MainWindow " , SETTINGS_SOUNDS_PACK_DEFAULT) ).toString ())
1892
+ if (ui.spackBox ->currentText () != ttSettings->value (SETTINGS_SOUNDS_PACK, SETTINGS_SOUNDS_PACK_DEFAULT).toString ())
1893
1893
{
1894
1894
resetDefaultSoundsPack ();
1895
1895
@@ -1914,7 +1914,9 @@ void PreferencesDlg::slotSPackChange()
1914
1914
}
1915
1915
}
1916
1916
}
1917
- ttSettings->setValue (SETTINGS_SOUNDS_PACK, ui.spackBox ->currentText ());
1917
+ int index = ui.spackBox ->currentIndex ();
1918
+ if (index >= 0 )
1919
+ ttSettings->setValue (SETTINGS_SOUNDS_PACK, ui.spackBox ->itemData (index ).toString ());
1918
1920
}
1919
1921
updateSoundEventFileEdit ();
1920
1922
}
0 commit comments