From fa74937337a1728e5795e9289221feefd6e3c43f Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Thu, 5 Feb 2015 16:38:04 +0100 Subject: [PATCH] only change if dialog was accepted --- src/plugins/secondary_backends/sound/soundsettings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/secondary_backends/sound/soundsettings.cpp b/src/plugins/secondary_backends/sound/soundsettings.cpp index bde5824..c990f17 100644 --- a/src/plugins/secondary_backends/sound/soundsettings.cpp +++ b/src/plugins/secondary_backends/sound/soundsettings.cpp @@ -35,8 +35,9 @@ SoundSettings::SoundSettings(SnorePlugin *snorePlugin, QWidget *parent) : dialog.setNameFilter("All Audio files (*.mp3 *.wav *.ogg)"); dialog.setFileMode(QFileDialog::ExistingFile); dialog.setDirectory(m_lineEdit->text()); - dialog.exec(); - m_lineEdit->setText(dialog.selectedFiles().first()); + if (dialog.exec()) { + m_lineEdit->setText(dialog.selectedFiles().first()); + } }); addRow("", button); }