[evince] shell: Sort bookmarks by page number instead of title
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] shell: Sort bookmarks by page number instead of title
- Date: Mon, 3 Oct 2016 15:45:00 +0000 (UTC)
commit fa19890508162c78a23de5d7c43e7456696549b9
Author: Felipe Borges <felipeborges gnome org>
Date: Sat Oct 1 12:58:16 2016 +0200
shell: Sort bookmarks by page number instead of title
Bookmarks shouldn't be sorted by their titles but their page
numbers. Often titles don't have any sorting text, causing
strcmp to wrongly sort them alphanumerically, just like in the
bug referenced below.
https://bugzilla.gnome.org/show_bug.cgi?id=772277
shell/ev-window.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 7205e11..e384915 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4632,7 +4632,11 @@ static gint
compare_bookmarks (EvBookmark *a,
EvBookmark *b)
{
- return strcmp (a->title, b->title);
+ if (a->page < b->page)
+ return -1;
+ if (a->page > b->page)
+ return 1;
+ return 0;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]