Bug report #17584
Spatial Bookmarks checkbox is not synced with project status
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Alessandro Pasotti | ||
Category: | GUI | ||
Affected QGIS version: | master | Regression?: | Yes |
Operating System: | Easy fix?: | Yes | |
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 25481 |
Description
[EDIT: links to issues are #ticket]
After fixing this issue by Alessandro: #17539
I think the current implementation in which a user is able to move a bookmark from the global bookmark db to the project file (and thereby deleting it from the global one) is complex and buggy.
By using: https://issues.qgis.org/projects/qgis/search?utf8=%E2%9C%93&issues=1&q=bookmark you get:
#17472
#17005
#17004
#16991
#16990
#16986
I create a new issue here instead of reopening #17539 where I stated:
Things that go wrong with me here:
1) checkbox is not checkable unless you restart QGIS. To reproduce:
- make sure you do not have any profile info (I removed .qgis2, ~/.local/share/QGIS AND .config/QGIS)
- open QGIS, add a layer to the fresh project
- create a bookmark
- checkbox is (rightfully) uncheckable/inactive because the project is not named/saved yet
- now save the project by giving it a name
- the checkbox does not become checkable
- not even if you start a new project, and then reopen the first project
- it becomes checkable when you close QGIS and open the project again
2) as soon as you have opened one project, you can use the checkboxes, BUT if you create a new project and select one of the earlier bookmarks (which should not be checkable, as there is NOT a saved project), and you check some bookmarks, AND close QGIS without saving the project to disk. Then open QGIS and the bookmarks are gone (and nowhere saved....)
As said earlier, I think there has not been enough thought one how this could/should be used and all the implications of checking/deleting bookmarks.
Not sure if above issues are fixable easily (I doubt), but current model-merging is not optimal (to be positive).
I would think that there should actually 2 tables in the Spatial Bookmarks Panel: one for global bookmarks (saved in qgis.sqlite) and one saved in the project/project file. Then you can ONLY copy a bookmark from one table to the other, and ONLY delete it in one of the two tables (being the qgis-model and the project-model). Opening a fresh project opens (off course) the qgis-model and a fresh project-model. Opening an excisting project opens both.
No need for merging or synchronizing (which is always hell)...
Associated revisions
[bugfix] Bookmark project sync
Fixes #17584 Spatial Bookmarks checkbox is not synced with project status
History
#1 Updated by Alessandro Pasotti almost 7 years ago
- Subject changed from Spatial Bookmarks in master branch severly crippled to Spatial Bookmarks checkbox is not synced with project status
Except for one (#17005), all the tickets listed above are either duplicated or already fixed with my latest commits.
Summarizing: the only remaining issues are:
- "in project" checkbox sync with project load/unload/open/close etc.
- table sorting (that is probably a won't fix unless we rewrite the whole classes) #17005
Any other?
#2 Updated by Richard Duivenvoorde almost 7 years ago
#3 Updated by Alessandro Pasotti almost 7 years ago
- Assignee set to Alessandro Pasotti
#4 Updated by Jürgen Fischer almost 7 years ago
- Description updated (diff)
#5 Updated by Alessandro Pasotti almost 7 years ago
- Status changed from Open to In Progress
- Easy fix? changed from No to Yes
- Pull Request or Patch supplied changed from No to Yes
- Description updated (diff)
The project sync was not hard to fix, btw with my patch, if a bookmark is added to a new (but empty) project the user will not be prompted to save, this happens because the routine that checks for changes only prompts if there is at least one layer in the project.
I guess this is quite a corner case and I'm hesitant to introduce a check right for bookmarks in QgisApp.
#6 Updated by Jürgen Fischer almost 7 years ago
- Description updated (diff)
#7 Updated by Anonymous almost 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|042fd33db790dd1cbe9ac1eaa69c812b1bf42967.
#8 Updated by Giovanni Manghi almost 7 years ago
- Resolution set to fixed/implemented