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.5k stars 2.99k forks source link

Delete layers/files rather than remove #27656

Open qgib opened 6 years ago

qgib commented 6 years ago

Author Name: Tom na (Tom na) Original Redmine Issue: 19832

Redmine category:actions


There are some stackexchange questions about this with some code.

Rather than right clicking and removing layers, can we have the option to Delete them, so you don't have multiple duplicate/not needed files around.

I think this is more useful for commercial users, as it can be hard to determine what is still useful or junk data after the user who created the layers has finished his work.

Stackexchange tickets [[https://gis.stackexchange.com/questions/190283/deleting-shapefiles-using-qgis]] [[https://gis.stackexchange.com/questions/215673/deleting-shapefile-with-qgis?noredirect=1&lq=1]]

The stackexchange tickets list how to delete shapefile but the scripts may need be converted in QGIS 3.0 as there has been an API break ect..

qgib commented 6 years ago

Author Name: Alessandro Pasotti (@elpaso)


Right-click on a shapefile from the browser and choose "Delete ..." on a shapefile works for me in current master (and 3.x).


qgib commented 6 years ago

Author Name: Tom na (Tom na)


I can't edit the existing ticket, but I was referring to the QGIS Desktop application and not having to use browser or other programs. I am thinking of making it easier to delete files within a QGIS project whilst you are doing work. Thank you, sorry for the delay in the update. I should have made it clearer in the ticket


qgib commented 6 years ago

Author Name: Alessandro Pasotti (@elpaso)


Tom, when we say "browser" we mean the QGIS internal browser dock widget (usually show in the top left corner of the application and always shown in the data source manager dialog).

Does it work for you?

qgib commented 6 years ago

Author Name: Tom na (Tom na)


Alessandro Pasotti wrote:

Tom, when we say "browser" we mean the QGIS internal browser dock widget (usually show in the top left corner of the application and always shown in the data source manager dialog).

Does it work for you?

I see what you mean with browser, that is slightly easier than using file explorer (windows) to find the files after you have removed the layers. However using QGIS 3.2.2-1 when using browser/browser 2 dock widget, the .cpg and .qpj files are not deleted, (perhaps I should raise that as a bug.)

I was hoping to add an option into Layer dock widget, so remove/and delete, as you still need to navigate to the file in the browser dock widget.

Thanks