only change if dialog was accepted

This commit is contained in:
Patrick von Reth 2015-02-05 16:38:04 +01:00
parent d4ef70f6c4
commit fa74937337
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}