-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make browser remove the file extensions when dragging and dropping layers into the canvas #15191
Comments
Author Name: Etienne Tourigny (@etiennesky) I am probably responsible for that... I thought it was more explanatory to know what the source is (i.e. tiff vs. netcdf). |
Author Name: Giovanni Manghi (@gioman) Etienne Tourigny wrote:
Hi Etienne, it probably doesn't make much difference when adding layers to the canvas (on the contrary as you say it can be useful) but when dragging and dropping layers into DB manager it should be avoided (postgis and spatialite tables names do include ".shp" by default). |
Author Name: Giuseppe Sucameli (@brushtyler) Giovanni Manghi wrote:
... not only when dropping it to DBManager, but also dropping it to the Browser itself (e.g. to a PG connection). |
Author Name: Giovanni Manghi (@gioman) what about allowing have the extensions added as an option in qgis general properties? |
Author Name: Giovanni Manghi (@gioman) Giovanni Manghi wrote:
In general I'm in favour of having something that allows to recognise the type of datasource of the layers in the TOC. |
Author Name: Etienne Tourigny (@etiennesky) Giovanni Manghi wrote:
I guess it should be modified for that case. I had not even imagined that worked, so I didn't think about it. The problem is that a qgsdataitem has a "name" attribute, and that cannot change according to the destination. A solution would be to filter the name (and remove the extension) at the destination, or perhaps add the extension only in the canvas, instead of in the browser. |
Author Name: Etienne Tourigny (@etiennesky) Here is the It's probably better not to have an option to add the extension, but have a consistent behaviour. Which is best?
|
Author Name: Etienne Tourigny (@etiennesky) I guess for rasters it's ok to always have the extension, right? Because there are no other D&D operations. Unless I am overlooking something (like other providers such as grass, which I don't use). Then this discussion only applies to vectors, which can have various layers for a given file. The following change in src/providers/ogr/qgsogrdataitems.cpp would do the trick:
However, this brings an inconsistency between raster and vector layer display in the legend (which happens anyway when you add vectors from DBs). Also, I like to be able to see the file extension in the browser, which this change removes. It also is not possible for shapes inside zipfiles, because filenames are listed with extension. But this is not really a big deal, more like an exception than the rule. |
Author Name: Giovanni Manghi (@gioman)
I like more this because is a feature often requested by users (eventually adding the extension after the layer name as "layername (ext)" and not as "layername.ext" -> just an idea). |
Author Name: Giovanni Manghi (@gioman) Etienne Tourigny wrote:
actually there is... DB Manager (now part of qgis core) supports D&D for PostGIS rasters... :) |
Author Name: Giuseppe Sucameli (@brushtyler) Etienne Tourigny wrote:
I fully agree that displaying the extension in the browser is necessary, So I'd add a third choice: Unfortunately I already know I don't understand what the user needs... :) Having more opinions would be good but having a look at tickets is not so popular, so |
Author Name: Giuseppe Sucameli (@brushtyler) Giovanni Manghi wrote:
But not from the browser... althought I'm working on making possible the BTW I still think extensions are senseless when a layer is loaded. |
Author Name: Giovanni Manghi (@gioman) Giuseppe Sucameli wrote:
real life projects tend to be large, with many, many layers. Usually a project is made of many different datasources and data types, so in a typical project you may find, shapes, gpx, kml, gml, postgis, spatialite, tiffs, ecws. sid, GRASS vectors and rasters, etc... for example not all the layers are editable, because the provider does not allow it or because the user is missing permissions... so I guess now is more clear why IS important to have at least an option to allow see what kind of vector/raster is a layer in the TOC... :) |
Author Name: Radim Blazek (@blazek) Rasters are also going to support D&D. Rasters and vectors must be consistent. File extension must be displayed in the browser because more formats with the same base name may be present (.shp, .gml ...). I would prefer a base name without an extension in the legend by default. I believe that in most cases a layer of the same base name is added just once. I have also often the same layer in many formats, but most people don't, I think. Instead of an option for file extension to be part of a layer name in the legend, the legend could have an optional (for experts) additional column with data source format. |
Author Name: Etienne Tourigny (@etiennesky) responded to the mailing list so things are centralized |
Author Name: Etienne Tourigny (@etiennesky) prototype using 2nd column for file type
|
Author Name: Etienne Tourigny (@etiennesky) see pull request |
Author Name: Etienne Tourigny (@etiennesky) new pull request |
Author Name: Giuseppe Sucameli (@brushtyler) Etienne,
|
Author Name: Giuseppe Sucameli (@brushtyler) Summary: |
Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 5621
Affected QGIS version: master
Redmine category:browser
subject says it all
The text was updated successfully, but these errors were encountered: