qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.68k stars 3.02k forks source link

Can't open several files with long path, or hundreds of short paths (textbox limit chars) #51294

Open latot opened 1 year ago

latot commented 1 year ago

What is the bug or the crash?

I'm working with..., hundred of raster files, so..., I need to open all of them, I went to layers, add rasters, select all of them, and then add.

I notice not all the files was loaded, then I found this: Captura desde 2022-12-23 10-35-14

The text is truncated!, due to this QGIS is not able to load all the files.

Actually, I can load all the files if I load from 500 to 500. So QGIS is able to work with all of them, I was able to load 1600 files.

The limit seems to be in the textbox, probably a char limit, so, we really don't need hundred of files to simulate this, just a few of them with very long paths to reach the textbox limit.

Seems the limit is close to 32744 characters. (copy the textbox content to python and apply len)

Maybe instead a textbox a listbox would do the trick? Maybe not..., the point is the limit of characters, if every element of the list has a limit too... the limit should be more than the longer path that every filesystem can handle. Or something that just does not has a limit of characters.

Linux, Gentoo 64.

Thx!

Steps to reproduce the issue

  1. Put two files where the length of path of every one is 17000 characters, or get hundred of files with a short path.
  2. Go to layers
  3. Add raster
  4. Select both rasters
  5. You will see in the textbox the second raster has an incomplete path

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

Versión de QGIS | 3.28.2-Firenze | Rama del código de QGIS | Release 3.28 -- | -- | -- | -- Versión Qt | 5.15.7 Versión de Python | 3.9.9 Versión de GDAL/OGR | 3.6.0 Versión de PROJ | 9.1.0 Versión del registro de base de datos EPSG | v10.074 (2022-08-01) Versión de GEOS | 3.11.1-CAPI-1.17.1 Versión de SQLite | 3.36.0 Versión de PDAL | 2.4.3 Versión del cliente de PostgreSQL | unknown Versión de SpatiaLite | 5.0.1 Versión de QWT | 6.1.5 Versión de QScintilla2 | 2.11.6 Versión del SO | KDE Flatpak runtime   |   |   |   Complementos activos de Python grassprovider | 2.12.99 processing | 2.12.99 MetaSearch | 0.3.6 sagaprovider | 2.12.99 db_manager | 0.1.20 Versión de QGIS 3.28.2-Firenze Rama del código de QGIS [Release 3.28](https://github.com/qgis/QGIS/tree/release-3_28) Versión Qt 5.15.7 Versión de Python 3.9.9 Versión de GDAL/OGR 3.6.0 Versión de PROJ 9.1.0 Versión del registro de base de datos EPSG v10.074 (2022-08-01) Versión de GEOS 3.11.1-CAPI-1.17.1 Versión de SQLite 3.36.0 Versión de PDAL 2.4.3 Versión del cliente de PostgreSQL unknown Versión de SpatiaLite 5.0.1 Versión de QWT 6.1.5 Versión de QScintilla2 2.11.6 Versión del SO KDE Flatpak runtime Complementos activos de Python grassprovider 2.12.99 processing 2.12.99 MetaSearch 0.3.6 sagaprovider 2.12.99 db_manager 0.1.20 ### Supported QGIS version - [ ] I'm running a supported QGIS version according to the roadmap. ### New profile - [ ] I tried with a new QGIS profile ### Additional context _No response_
roya0045 commented 1 year ago

Does drag & drop work fine for so many layers? Just curios.

agiudiceandrea commented 1 year ago

It seems the character limit (32767) is due to the QLineEdit Qt class the QGIS widget is based on.

latot commented 1 year ago

Does drag & drop work fine for so many layers? Just curios.

Yes, from Nautilus to QGIS, seems all the files was loaded.

alexbruy commented 1 year ago

Looks like an upstream issue in Qt.