Bug report #19703

Open MDAL data dialog does NOT show All files

Added by Richard Duivenvoorde over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/MDAL
Affected QGIS version:3.3(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27528

Description

In current master if I open a Mesh via the Data Source Manager by clicking on the ... button, I get an 'Open MDAL Supported Mesh Dataset(s)' dialog, with on the bottom the possibility to only show 'GRIB Files', '2DM Meshfile' or All files.

BUT even using the 'All files', I do not see all files. Only when I rename a file to something.grib I start to see it.

To test: go to: https://data.knmi.nl/datasets/harmonie_p1/0.2?q=grib

To get a current weather grib file, untar the .tgz file which will open as a long list of filenames like:
/tmp/harm36_v1_ned_surface_2018082700_048_GB (not without extension!)

But you will not be able to open those, unless you rename them to *.grib (see screenshot, where I untarred the tgz into my /tmp and only renamed 1 of the files to /tmp/harm36_v1_ned_surface_2018082700_048_GB.grib)

Also added a screenshot to show the mesh in QGIS because it is so cool :-)

openmesh.png (162 KB) Richard Duivenvoorde, 2018-08-27 08:50 AM

harmonyInQgis.png (1.03 MB) Richard Duivenvoorde, 2018-08-27 08:54 AM

Associated revisions

Revision 4fa62e9b
Added by Richard Duivenvoorde over 5 years ago

Fix #19703, make filter translatable and add NetCDF (#8245)

  • Add NetCDF into MDAL dialog's file filter

History

#1 Updated by Richard Duivenvoorde over 5 years ago

  • Assignee deleted (Peter Petrik)

Ok, I had a look into this myself, and found that the value of mFilter in qgsfilewidget.ccp

https://github.com/qgis/QGIS/blob/master/src/gui/qgsfilewidget.cpp#L254-L278

Was different for different kind of files:

For grib it was:

"All files(.*);;GRIB File(.grb .grb2 *.bin *.grib *.grib1 *.grib2);;2DM Mesh File(.2dm);;3Di Resu"

For rasters it is:

"All files ();;GDAL/OGR VSIFileHandler (.zip *.gz *.tar *.tar.gz *.tgz *.ZIP *.GZ *.TAR *.TAR.GZ *."

For csv it is:

"Text files (.txt *.csv *.dat *.wkt);;All files ( *.*)"

AND actually only the csv shows ALL files for me!

According to http://doc.qt.io/qt-5/qfiledialog.html#setNameFilters using "*.*" is not portable.
They point to dot-files, but in my case the downloaded grb files without(!) any extension is also not shown.

I'll add a patch which change All files(.*) to All files().

Grepping on "All files(*" there are still a lot of other places where this is used.

#3 Updated by Richard Duivenvoorde over 5 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF