aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmppresetselect.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-01-11 23:26:03 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-01-11 23:26:03 +0800
commitf7f2e9039cfd6c3d07a28137e321fa96b0267084 (patch)
tree1fd53d58a388b575881dce827520b3a8d6984fbb /qmidiplayer-desktop/qmppresetselect.cpp
parent12ad6495fa332ea499485082272f796c4b08c83c (diff)
downloadQMidiPlayer-f7f2e9039cfd6c3d07a28137e321fa96b0267084.tar.xz
Code refactoring for qmpChannelEditor.
Do not crash if preset selection dialog is closed with no preset selected. More translatable strings in qmpChannelEditor.
Diffstat (limited to 'qmidiplayer-desktop/qmppresetselect.cpp')
-rw-r--r--qmidiplayer-desktop/qmppresetselect.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qmidiplayer-desktop/qmppresetselect.cpp b/qmidiplayer-desktop/qmppresetselect.cpp
index 85dc893..8286053 100644
--- a/qmidiplayer-desktop/qmppresetselect.cpp
+++ b/qmidiplayer-desktop/qmppresetselect.cpp
@@ -84,6 +84,7 @@ void qmpPresetSelector::on_pbOk_clicked()
plyr->setChannelPreset(ch,(ui->spCustomMSB->value()<<7)|ui->spCustomLSB->value(),ui->spCustomPC->value());
else
{
+ if(!ui->lwBankSelect->currentItem()||!ui->lwPresetSelect->currentItem())return (void)close();
int b=ui->lwBankSelect->currentItem()->text().split(' ').first().toInt();
int p=ui->lwPresetSelect->currentItem()->text().split(' ').first().toInt();
plyr->setChannelPreset(ch,b,p);