Feature request #19832

Delete layers/files rather than remove

Added by Tom na almost 2 years ago. Updated almost 2 years ago.

Status:Reopened
Priority:Normal
Assignee:-
Category:Actions
Pull Request or Patch supplied:No Resolution:worksforme
Easy fix?:No Copied to github as #:27656

Description

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..

History

#1 Updated by Alessandro Pasotti almost 2 years ago

  • Resolution set to worksforme
  • Status changed from Open to Closed

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

#2 Updated by Tom na almost 2 years ago

  • Status changed from Closed to Reopened

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

#3 Updated by Alessandro Pasotti almost 2 years ago

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?

#4 Updated by Tom na almost 2 years ago

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

Also available in: Atom PDF