After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 626624 - Notebook sorting not ok under notebook button
Notebook sorting not ok under notebook button
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
: 589240 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-08-11 12:48 UTC by Frank Van Geirt
Modified: 2010-09-06 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to solve the notebook sorting (340 bytes, patch)
2010-08-17 23:10 UTC, Frank Van Geirt
none Details | Review

Description Frank Van Geirt 2010-08-11 12:48:27 UTC
I created several notebooks. In the Search All Notes screen they are sorted alphabetically, so no problem. But when I open a note and want to select an existing notebook via the button the notebooks are not sorted. They seem to appear in random order as the list is not always the same.

I am using Gnote 0.7.2 on Fedora 13 x86_64.
Comment 1 Aurimas Černius 2010-08-11 17:53:34 UTC
The same bug is in current version in git.
Comment 2 Frank Van Geirt 2010-08-17 23:10:50 UTC
Created attachment 168156 [details] [review]
Patch to solve the notebook sorting
Comment 3 Frank Van Geirt 2010-08-17 23:12:11 UTC
It sounds contradictory but disabling the sort function solved the issue for me.
Comment 4 Aurimas Černius 2010-08-18 18:40:49 UTC
> It sounds contradictory but disabling the sort function solved the issue for
> me.

get_notebooks() return the sorted list of notebooks.
The call to sort() sorts pointers to notebooks, that is, notebooks are sorted by their addresses in memory :)

There are two possible solutions to this:
1) The proposed patch - removing sort(),
2) Passing sort() a predicate, which compares two notebooks by their names.

First solution is easier, second is more prone to possible future changes.
Comment 5 Aurimas Černius 2010-09-03 20:25:55 UTC
*** Bug 589240 has been marked as a duplicate of this bug. ***
Comment 6 Aurimas Černius 2010-09-06 20:33:23 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.

I removed the line, that causes the problem.