Handle cancel in PreferencesDialog::on_chooseFile_clicked
If I click in the Preferences Dialog on the 3 dots to choose a default file to load and cancel the opening FileDialog an empty string is returned and set to the coresponding QLineEdit. The new behavior (and mostly expected) is to update the QLineEdit only if there is a filename returned from QFileDialog. Signed-off-by: Patrick Majewski <dive@patrick-majewski.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b839cd4cb0
commit
936ac958ed
@ -307,7 +307,10 @@ void PreferencesDialog::buttonClicked(QAbstractButton* button)
|
||||
void PreferencesDialog::on_chooseFile_clicked()
|
||||
{
|
||||
QFileInfo fi(system_default_filename());
|
||||
ui.defaultfilename->setText(QFileDialog::getOpenFileName(this, tr("Open Default Log File"), fi.absolutePath(), tr("Subsurface XML files (*.ssrf *.xml *.XML)")));
|
||||
QString choosenFileName = QFileDialog::getOpenFileName(this, tr("Open Default Log File"), fi.absolutePath(), tr("Subsurface XML files (*.ssrf *.xml *.XML)"));
|
||||
|
||||
if(!choosenFileName.isEmpty())
|
||||
ui.defaultfilename->setText(choosenFileName);
|
||||
}
|
||||
|
||||
void PreferencesDialog::emitSettingsChanged()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user