Bug report #17005

spatial bookmarks can't be sorted

Added by Steven Mizuno over 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:GUI
Affected QGIS version:master Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24904

Description

The column sort indicator shows, but clicking on column headers does not actually sort. The indicator changes direction, but that is all that occurs.

Initially, the name column header shows ascending order, but the column isn't sorted.

This is a regression from 2.14; 2.18 does not sort either.

I am using OSGeo4W nightly build on Windows 8.1 64-bit system.

Associated revisions

Revision 8233a8fb
Added by Alessandro Pasotti about 7 years ago

[bugfix] Bookmarks sorting with a proxy model

Fixes #17005 spatial bookmarks can't be sorted

I believe that this has been broken since https://github.com/qgis/QGIS/pull/2661

Revision 15ffcb43
Added by Alessandro Pasotti about 7 years ago

[bookmarks] Case insensitive sorting

Fixes #17005

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Affected QGIS version changed from master to 2.18.11

#2 Updated by Alessandro Pasotti about 7 years ago

  • Assignee set to Alessandro Pasotti

#3 Updated by Alessandro Pasotti about 7 years ago

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

An attempt to fix this messy model is in PR: https://github.com/qgis/QGIS/pull/5776
Please give it a try.

#4 Updated by Anonymous about 7 years ago

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

#5 Updated by Giovanni Manghi about 7 years ago

  • Resolution set to fixed/implemented

#6 Updated by Steven Mizuno about 7 years ago

  • Status changed from Closed to Reopened
  • Affected QGIS version changed from 2.18.11 to master

Reopened because master (010cb1567b) still does not sort bookmarks.

I used Python Console to find the bookmarks list, on which isSortingEnabled() is false. Then using setSortingEnabled(True) does allow sorting.

2.18.15 does sort.

#7 Updated by Alessandro Pasotti about 7 years ago

Thanks for the feedback, I've made a PR with the fixes, https://github.com/qgis/QGIS/pull/5852

I'd appreciate if you could test them when committed.

#8 Updated by Steven Mizuno about 7 years ago

Thanks for the attention, I will test as soon as I can.

Two minor things have occurred to me.
1. The sorting probably should be case insensitive. I believe most users would appreciate this.
2. The SRID column more properly should be CRS or possibly Projection, in keeping with usage elsewhere.

Please see #17674 export/import issues

#9 Updated by Steven Mizuno about 7 years ago

Alessandro,

I have tested the Spatial Bookmarks fixes in master (ea49c8276c latest rev. I tried) and believe they are working correctly.
  • creating bookmarks
  • moving bookmarks to/from project, including saving/loading project
  • exporting
  • importing, including starting with no bookmarks
  • sorting various columns
  • editing bookmarks (SRID can't be edited with the current implementation)

I have also tested internationalization, which hasn't been mentioned as a problem, but I did think to test -- this is OK.

I used Python Console to update a bookmark's extent, by finding the lstBookmarks object and setting the x..., y... values and the srid value, too.

I would very much appreciate the two items in my previous comment being implemented. I have tried
setSortCaseSensitivity( Qt::CaseInsensitive ) in the QgsBookmarksProxyModel constructor to get case insensitive sorting to work.

One last very minor problem: the title of the Spatial Bookmarks Panel somehow acquired an ampersand in one of the commits. It shows as "Sp&atial"... -- qgsbookmarksbase.ui is the affected file.

Thank you very much.

#10 Updated by Anonymous about 7 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF