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.65k stars 3.01k forks source link

Spatial Bookmark Manager does not write out changes immediately #32533

Open Saijin-Naib opened 5 years ago

Saijin-Naib commented 5 years ago

Describe the bug The Spatial Bookmarks Manager seems to defer writing out changes to bookmarks until the session is closed (gracefully, only!) by QGIS. This leads to a number of undesirable behaviors, such as multiple windows being out of sync with bookmarks as in Issue #32531

In addition, if the session that created the changes to the bookmarks does not close gracefully (crashes, or force-quit), the changes to the bookmarks are NOT written out.

Finally, if the session that created the bookmarks is not closed LAST, the final session over-rides the bookmarks list, and as such, the newly created bookmark will NOT be saved out.

How to Reproduce

Properly Saved Scenario

  1. Open two sessions (A and B)
  2. Create a new bookmark in Session A Observe that bookmark does not exist in Session B
  3. Close Session B
  4. Close Session A
  5. Open a fresh QGIS instance, observe bookmark exists

Forced Quit Scenario

  1. Open two sessions (A and B)
  2. Create a new bookmark in Session A Observe that bookmark does not exist in Session B
  3. Force-Close Session B
  4. Close Session A
  5. Open a fresh QGIS instance, observe bookmark does not exist

Improper Close Order Scenario

  1. Open two sessions (A and B)
  2. Create a new bookmark in Session A Observe that bookmark does not exist in Session B
  3. Close Session A
  4. Close Session B
  5. Open a fresh QGIS instance, observe bookmark does not exist

QGIS and OS versions

QGIS version 3.10.0-A Coruña QGIS code revision 6c816b4204
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 2.4.1 Running against GDAL/OGR 2.4.1
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 5.2.0 Running against PROJ Rel. 5.2.0, September 15th, 2018
OS Version Windows 10 (10.0)
Active python plugins BoundaryDelineation; BufferByPercentage; CalculateGeometry; changeDataSource; DEMto3D; FeatureGridCreator; geocatbridge; GeoCoding; GeodesicDensifier; geomovetools; getools; GroupPointsWithinDistance; HCMGIS; joinmultiplelines; kmltools; kml_style_importer; LAStools; latlontools; LineDirectionHistogram; lrs; MemoryLayerSaver; minimum_spanning_tree; mmqgis; networks; openeo-qgis-plugin-master; ORStools; oscars-georaster-qgis-plugin; ParallelLineConstruction; pdaltools; photo2shape; Polygons_Pile; polystrip; processing_circuitscape; processing_fusion; processing_gnm; processing_js; processing_prepair; processing_r; processing_saga; processing_taudem; processing_whitebox; project_colors_dock; qchainage; qconsolidate; qdraw; qgiscloud; QgisModelBaker; QGISRed; QGISSortAndNumber-master; qgis_resource_sharing; qgSurf; QRectangleCreator; QuickOSM; quick_map_services; realcentroid; refFunctions; SelectWithin; sen2cor_adapter; Serval; shapetools; snail; spatial_query_with_values; SplitPolygonShowingAreas; SpreadsheetLayers; statist; ThToolBox; toggle_labels_widget; trail_elevation_stats; vector_tiles_reader; wnt; db_manager; MetaSearch; processing

Additional context Data loss.

Pedro-Murteira commented 2 years ago

I couldn't reproduce scenarios 2 and 3. But I've noticed that if I iniciate session A and the bookmark is still there and I delete it, what happens is that when I open a new session (session B), the bookmark should be gone, but it is still there. It might be related to the issue.