[devhelp] Preferences: fix sort function when not grouping by language
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] Preferences: fix sort function when not grouping by language
- Date: Fri, 6 Apr 2018 16:10:41 +0000 (UTC)
commit 79bc61586b5bb694a04241b65e16ad708e08a8df
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Apr 6 17:34:22 2018 +0200
Preferences: fix sort function when not grouping by language
In that case we must not compare the language, just the book titles.
src/dh-preferences.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-preferences.c b/src/dh-preferences.c
index 0a31abc..9df48e1 100644
--- a/src/dh-preferences.c
+++ b/src/dh-preferences.c
@@ -341,6 +341,7 @@ bookshelf_sort_func (GtkTreeModel *model,
GtkTreeIter *iter_b,
gpointer user_data)
{
+ DhSettings *settings;
DhBook *book_a;
DhBook *book_b;
gchar *title_a;
@@ -361,6 +362,12 @@ bookshelf_sort_func (GtkTreeModel *model,
COLUMN_TITLE, &title_b,
-1);
+ settings = dh_settings_get_default ();
+ if (!dh_settings_get_group_books_by_language (settings)) {
+ ret = dh_book_cmp_by_title (book_a, book_b);
+ goto out;
+ }
+
if (book_a != NULL)
language_a = dh_book_get_language (book_a);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]