[devhelp/wip/swilmet/misc-improvements] book-tree: spring clean-up



commit 98e21e01265281fcfd99e2a03160b0762feb706d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun May 24 15:28:33 2015 +0200

    book-tree: spring clean-up

 src/dh-book-tree.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/src/dh-book-tree.c b/src/dh-book-tree.c
index 5e11469..e4528ea 100644
--- a/src/dh-book-tree.c
+++ b/src/dh-book-tree.c
@@ -36,8 +36,6 @@ typedef struct {
         DhLink        *selected_link;
 } DhBookTreePrivate;
 
-static void dh_book_tree_class_init        (DhBookTreeClass  *klass);
-static void dh_book_tree_init              (DhBookTree       *tree);
 static void book_tree_add_columns          (DhBookTree       *tree);
 static void book_tree_setup_selection      (DhBookTree       *tree);
 static void book_tree_insert_node          (DhBookTree       *tree,
@@ -182,8 +180,8 @@ book_tree_setup_selection (DhBookTree *tree)
 
 /* Tries to find:
  *  - An exact match of the language group
- *  - The language group which should be just after our given language group.
- *  - Both.
+ *  - Or the language group which should be just after our given language group.
+ *  - Or both.
  */
 static void
 book_tree_find_language_group (DhBookTree  *tree,
@@ -215,7 +213,7 @@ book_tree_find_language_group (DhBookTree  *tree,
         }
 
         do {
-                gchar  *title = NULL;
+                gchar *title = NULL;
 
                 /* Look for language titles, which are those where there
                  * is no book object associated in the row */
@@ -251,8 +249,8 @@ book_tree_find_language_group (DhBookTree  *tree,
 /* Tries to find, starting at 'first' (if given), and always in the same
  * level of the tree:
  *  - An exact match of the book
- *  - The book which should be just after our given book
- *  - Both.
+ *  - Or the book which should be just after our given book
+ *  - Or both.
  */
 static void
 book_tree_find_book (DhBookTree        *tree,
@@ -625,7 +623,6 @@ book_tree_group_by_language_cb (GObject    *object,
         book_tree_populate_tree (DH_BOOK_TREE (user_data));
 }
 
-
 static void
 book_tree_init_selection (DhBookTree *tree)
 {
@@ -645,7 +642,7 @@ book_tree_init_selection (DhBookTree *tree)
          *   https://bugzilla.gnome.org/show_bug.cgi?id=492206
          */
         selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
-        g_signal_handlers_block_by_func        (selection,
+        g_signal_handlers_block_by_func (selection,
                                          book_tree_selection_changed_cb,
                                          tree);
 
@@ -735,7 +732,7 @@ dh_book_tree_class_init (DhBookTreeClass *klass)
                                          PROP_BOOK_MANAGER,
                                          g_param_spec_object ("book-manager",
                                                               "Book Manager",
-                                                              "The book maanger",
+                                                              "The book manager",
                                                               DH_TYPE_BOOK_MANAGER,
                                                               G_PARAM_READWRITE |
                                                               G_PARAM_CONSTRUCT_ONLY));
@@ -754,7 +751,9 @@ dh_book_tree_class_init (DhBookTreeClass *klass)
 GtkWidget *
 dh_book_tree_new (DhBookManager *book_manager)
 {
-        return GTK_WIDGET (g_object_new (DH_TYPE_BOOK_TREE, "book-manager", book_manager, NULL));
+        return GTK_WIDGET (g_object_new (DH_TYPE_BOOK_TREE,
+                                         "book-manager", book_manager,
+                                         NULL));
 }
 
 static gboolean
@@ -809,7 +808,7 @@ dh_book_tree_select_uri (DhBookTree  *tree,
         if (gtk_tree_selection_iter_is_selected (selection, &data.iter))
                 return;
 
-        g_signal_handlers_block_by_func        (selection,
+        g_signal_handlers_block_by_func (selection,
                                          book_tree_selection_changed_cb,
                                          tree);
 
@@ -841,7 +840,7 @@ dh_book_tree_get_selected_book (DhBookTree *tree)
         path = gtk_tree_model_get_path (model, &iter);
 
         /* Get the book node for this link. */
-        while (1) {
+        while (TRUE) {
                 if (gtk_tree_path_get_depth (path) <= 1) {
                         break;
                 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]