[gnome-photos] main-toolbar: Remove redundant code



commit 99ccc05287a6d1b52cf920ecb59dd285bf6c2783
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 12 13:32:35 2017 +0200

    main-toolbar: Remove redundant code
    
    The photos_main_toolbar_populate_for_* methods already set the header
    bar to NORMAL, and everything else is taken care of by the usual mode
    change mechanism. The photos_main_toolbar_col_active_changed callback
    is only useful when the active collection changes after the initial
    mode change.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786936

 src/photos-main-toolbar.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)
---
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index dc1be19..7db0914 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -434,8 +434,6 @@ photos_main_toolbar_favorite_button_update (PhotosMainToolbar *self, gboolean fa
 static void
 photos_main_toolbar_populate_for_collections (PhotosMainToolbar *self)
 {
-  PhotosBaseItem *collection;
-
   gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
   photos_header_bar_set_mode (PHOTOS_HEADER_BAR (self->header_bar), PHOTOS_HEADER_BAR_MODE_NORMAL);
   photos_main_toolbar_add_selection_button (self);
@@ -446,9 +444,6 @@ photos_main_toolbar_populate_for_collections (PhotosMainToolbar *self)
                            G_CALLBACK (photos_main_toolbar_col_active_changed),
                            self,
                            G_CONNECT_SWAPPED);
-
-  collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
-  photos_main_toolbar_col_active_changed (self, collection);
 }
 
 
@@ -476,30 +471,20 @@ photos_main_toolbar_populate_for_edit (PhotosMainToolbar *self)
 static void
 photos_main_toolbar_populate_for_favorites (PhotosMainToolbar *self)
 {
-  PhotosBaseItem *collection;
-
   gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
   photos_header_bar_set_mode (PHOTOS_HEADER_BAR (self->header_bar), PHOTOS_HEADER_BAR_MODE_NORMAL);
   photos_main_toolbar_add_selection_button (self);
   photos_main_toolbar_add_search_button (self);
-
-  collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
-  photos_main_toolbar_col_active_changed (self, collection);
 }
 
 
 static void
 photos_main_toolbar_populate_for_overview (PhotosMainToolbar *self)
 {
-  PhotosBaseItem *collection;
-
   gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
   photos_header_bar_set_mode (PHOTOS_HEADER_BAR (self->header_bar), PHOTOS_HEADER_BAR_MODE_NORMAL);
   photos_main_toolbar_add_selection_button (self);
   photos_main_toolbar_add_search_button (self);
-
-  collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
-  photos_main_toolbar_col_active_changed (self, collection);
 }
 
 
@@ -571,8 +556,6 @@ photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
 static void
 photos_main_toolbar_populate_for_search (PhotosMainToolbar *self)
 {
-  PhotosBaseItem *collection;
-
   gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
   photos_header_bar_set_mode (PHOTOS_HEADER_BAR (self->header_bar), PHOTOS_HEADER_BAR_MODE_NORMAL);
   photos_main_toolbar_add_selection_button (self);
@@ -583,9 +566,6 @@ photos_main_toolbar_populate_for_search (PhotosMainToolbar *self)
                            G_CALLBACK (photos_main_toolbar_col_active_changed),
                            self,
                            G_CONNECT_SWAPPED);
-
-  collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
-  photos_main_toolbar_col_active_changed (self, collection);
 }
 
 


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