Bug report #19893

It's not possible to delete raster layers in geopackages on Windows

Added by Andrea Giudiceandrea over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:Browser
Affected QGIS version:3.3(master) Regression?:No
Operating System:Windows 7 Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27717

Description

It seems not possible to delete raster layers stored in geopackages on Windows from the "Browser" panel with QGIS 3.3.0-master (d99d506e75): a warning message box pops up with the text "Layer URI is malformed: layer [layer URI] cannot be deleted!".

I guess the problem is in https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsgeopackagedataitems.cpp#L360-L364

QStringList pieces( uri.split( ':' ) );
if ( pieces.size() != 3 ) {
errCause = QStringLiteral( "Layer URI is malformed: layer <b>%1</b> cannot be deleted!" ).arg( uri );
}

In fact a typical geopackage Layer URI on Windows is GPKG:C:/some/path/geopackage_name.gpkg:layer_name so pieces.size() is always 4 on Windows.


Related issues

Related to QGIS Application - Bug report #17967: Browser: deleting raster in GeoPackage doesn't work Closed 2018-01-26

Associated revisions

Revision e62c4eb9
Added by Alessandro Pasotti over 5 years ago

Fix cannot deletete GPKG from raster on windows

Fixes #17967 #19893

History

#1 Updated by Jérôme Guélat over 5 years ago

See also #17967

#2 Updated by Alessandro Pasotti over 5 years ago

  • Assignee set to Alessandro Pasotti

#3 Updated by Jürgen Fischer over 5 years ago

  • Related to Bug report #17967: Browser: deleting raster in GeoPackage doesn't work added

#4 Updated by Alessandro Pasotti over 5 years ago

  • Status changed from Open to In Progress
  • Pull Request or Patch supplied changed from No to Yes

#5 Updated by Anonymous over 5 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#6 Updated by Alessandro Pasotti over 5 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF