editdialog: Don't add file filters on OS X

Due to a Qt bug (QTBUG-38427), changing filters in a QFileDialog
does not enable/disable files until the user changes directory.

See issue #230.
This commit is contained in:
Samir Aguiar
2015-03-22 18:36:37 +01:00
parent bf0517de8a
commit 7259241062

View File

@@ -78,8 +78,11 @@ void EditDialog::importData()
QString fileName = QFileDialog::getOpenFileName(
this,
tr("Choose a file"),
PreferencesDialog::getSettingsValue("db", "defaultlocation").toString(),
tr("Text files(*.txt);;Image files(%1);;All files(*)").arg(image_formats));
PreferencesDialog::getSettingsValue("db", "defaultlocation").toString()
#ifndef Q_OS_MAC // Filters on OS X are buggy
, tr("Text files(*.txt);;Image files(%1);;All files(*)").arg(image_formats)
#endif
);
if(QFile::exists(fileName))
{
QFile file(fileName);