Bug report #19555

DWG import overwrites existing Geopackage without warning

Added by Micha Silver over 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:DWG/DXF import
Affected QGIS version:3.2.1 Regression?:No
Operating System:all Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27382

Description

The DWG import function to reads a DWG/DXF file and imports into a Geopackage file. If an existing gpkg file is chosen, it is silently overwritten. A warning should be issued.

Furthermore, when opening the "DWG Import" dialog, the previously used gpkg file persists in the Geopackage textbox, so the danger of accidentally overwriting is increased. That dialog should be initialized with all textboxes empty by default.

Associated revisions

Revision b74292aa
Added by Loïc Bartoletti about 1 year ago

Fixes #19555

Adds a QMessageBox if file exists
Remove lastDatabase setting to lastDirDatabase. It's dangerous to reuse
the last database.
Adds a .gpkg extension to filename if not presents.

History

#1 Updated by Jürgen Fischer about 1 year ago

Why is that dangerous? You can always reimport the original DWG.

#2 Updated by Micha Silver about 1 year ago

For two reasons:
  1. In QGIS (and most applications) a user never expects her files to be overwritten without a warning, and a chance to OK/Cancel.
  2. If I import a second DWG file, it's very easy to overlook the file name from the first DWG that persists in the "Geopackage" text box, and then overwrite that earlier gpkg by accident.

I think that the expected behavior should be: the Geopackage text box should be empty with each invocation of the DWG/DXF Import dialogue, and always issue a warning when overwriting.

THanks

#3 Updated by Anonymous about 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF