Gui::FileChooser respect Qt Dialog Flag

- Gui::FileChooser was not respecting the USE_QT_FILEDIALOG
  compile flag.
This commit is contained in:
wandererfan
2018-09-23 10:28:21 -04:00
committed by wmayer
parent f24b838b57
commit f0bc36e6ff

View File

@@ -670,11 +670,19 @@ void FileChooser::chooseFile()
prechosenDirectory = FileDialog::getWorkingDirectory();
}
#if defined(USE_QT_FILEDIALOG)
QFileDialog::Options dlgOpt = QFileDialog::DontUseNativeDialog;
#else
QFileDialog::Options dlgOpt;
#endif
QString fn;
if ( mode() == File )
fn = QFileDialog::getOpenFileName( this, tr( "Select a file" ), prechosenDirectory, _filter );
else
fn = QFileDialog::getExistingDirectory( this, tr( "Select a directory" ), prechosenDirectory );
if ( mode() == File ) {
fn = QFileDialog::getOpenFileName( this, tr( "Select a file" ), prechosenDirectory, _filter,0,dlgOpt );
} else {
QFileDialog::Options option = QFileDialog::ShowDirsOnly | dlgOpt;
fn = QFileDialog::getExistingDirectory( this, tr( "Select a directory" ), prechosenDirectory,option );
}
if (!fn.isEmpty()) {
fn = QDir::fromNativeSeparators(fn);
@@ -746,6 +754,7 @@ QString FileChooser::buttonText() const
return button->text();
}
// ----------------------------------------------------------------------
/* TRANSLATOR Gui::SelectModule */