aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpmainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-10-07 00:19:16 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-10-07 00:19:16 +0800
commitdfdd98ae185a46949b668d01fcce3f5f2646970a (patch)
treee929b6d9281fc941fdf344652630973e57e73109 /qmidiplayer-desktop/qmpmainwindow.cpp
parent9f41b32536ef24519d8ea6bb958b80a903690f57 (diff)
downloadQMidiPlayer-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.cpp10
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
}
}