diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-10-07 00:19:16 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-10-07 00:19:16 +0800 |
commit | dfdd98ae185a46949b668d01fcce3f5f2646970a (patch) | |
tree | e929b6d9281fc941fdf344652630973e57e73109 /qmidiplayer-desktop/qmpmainwindow.cpp | |
parent | 9f41b32536ef24519d8ea6bb958b80a903690f57 (diff) | |
download | QMidiPlayer-dfdd98ae185a46949b668d01fcce3f5f2646970a.tar.xz |
A less stupid way to save the soundfont list.
Old soundfont list will be ignored.
Stop using widgets in the soundfont table.
The soundfont table is no longer exposed.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 0bcf070..78230be 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -325,15 +325,17 @@ void qmpMainWindow::playerSetup(IFluidSettings* fs) } void qmpMainWindow::loadSoundFont(IFluidSettings *fs) { - for(int i=settingsw->getSFWidget()->rowCount()-1;i>=0;--i) + QList<QVariant> sflist=settingsw->getSettingsIntf()->value("Audio/SoundFonts",QList<QVariant>{}).toList(); + for(auto i=sflist.rbegin();i!=sflist.rend();++i) { - if(!((QCheckBox*)settingsw->getSFWidget()->cellWidget(i,0))->isChecked())continue; + if(i->toString().startsWith('#'))continue; + QString sf=i->toString(); #ifdef _WIN32 - char* c=wcsto8bit(settingsw->getSFWidget()->item(i,1)->text().toStdWString().c_str()); + char* c=wcsto8bit(sf.toStdWString().c_str()); fs->loadSFont(c); free(c); #else - fs->loadSFont(settingsw->getSFWidget()->item(i,1)->text().toStdString().c_str()); + fs->loadSFont(sf.toStdString().c_str()); #endif } } |