[devhelp] Use directly DhBook type in DhBookManager signals callbacks
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] Use directly DhBook type in DhBookManager signals callbacks
- Date: Fri, 5 May 2017 10:56:06 +0000 (UTC)
commit 6e2eb2a34a165b546de422389b2999a6360ef97e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri May 5 12:52:25 2017 +0200
Use directly DhBook type in DhBookManager signals callbacks
src/dh-book-tree.c | 7 ++-----
src/dh-preferences.c | 12 ++++++------
2 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/src/dh-book-tree.c b/src/dh-book-tree.c
index c705d4f..9af6971 100644
--- a/src/dh-book-tree.c
+++ b/src/dh-book-tree.c
@@ -419,11 +419,9 @@ book_tree_add_book_to_store (DhBookTree *tree,
static void
book_tree_book_created_or_enabled_cb (DhBookManager *book_manager,
- GObject *book_object,
+ DhBook *book,
DhBookTree *tree)
{
- DhBook *book = DH_BOOK (book_object);
-
if (!dh_book_get_enabled (book))
return;
@@ -432,11 +430,10 @@ book_tree_book_created_or_enabled_cb (DhBookManager *book_manager,
static void
book_tree_book_deleted_or_disabled_cb (DhBookManager *book_manager,
- GObject *book_object,
+ DhBook *book,
DhBookTree *tree)
{
DhBookTreePrivate *priv = dh_book_tree_get_instance_private (tree);
- DhBook *book = DH_BOOK (book_object);
GtkTreeIter exact_iter;
gboolean exact_iter_found = FALSE;
GtkTreeIter language_iter;
diff --git a/src/dh-preferences.c b/src/dh-preferences.c
index 083315a..91646fd 100644
--- a/src/dh-preferences.c
+++ b/src/dh-preferences.c
@@ -482,11 +482,10 @@ preferences_bookshelf_set_language_inconsistent (DhPreferences *prefs,
static void
preferences_bookshelf_book_deleted_cb (DhBookManager *book_manager,
- GObject *book_object,
+ DhBook *book,
DhPreferences *prefs)
{
DhPreferencesPrivate *priv = dh_preferences_get_instance_private (prefs);
- DhBook *book = DH_BOOK (book_object);
GtkTreeIter exact_iter;
gboolean exact_iter_found;
@@ -505,12 +504,13 @@ preferences_bookshelf_book_deleted_cb (DhBookManager *book_manager,
static void
preferences_bookshelf_book_created_cb (DhBookManager *book_manager,
- GObject *book_object,
+ DhBook *book,
DhPreferences *prefs)
{
- preferences_bookshelf_add_book_to_store (prefs,
- DH_BOOK (book_object),
- dh_book_manager_get_group_by_language (book_manager));
+ gboolean group_by_language;
+
+ group_by_language = dh_book_manager_get_group_by_language (book_manager);
+ preferences_bookshelf_add_book_to_store (prefs, book, group_by_language);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]