[gnome-music/wip/jfelder/selection-misc-cleanups: 9/20] views: Remove unused selected_items_count property



commit e50d0d648e205111dd5237e4a27db018d3fb3882
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Jan 10 13:08:00 2020 +0100

    views: Remove unused selected_items_count property
    
    Since the core rewrite, it is handled by CoreSelection.

 gnomemusic/views/albumsview.py |  1 -
 gnomemusic/views/baseview.py   |  1 -
 gnomemusic/views/searchview.py | 10 ----------
 gnomemusic/window.py           |  5 -----
 4 files changed, 17 deletions(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index 10316f45..25d3a827 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -42,7 +42,6 @@ class AlbumsView(Gtk.Stack):
     __gtype_name__ = "AlbumsView"
 
     search_mode_active = GObject.Property(type=bool, default=False)
-    selected_items_count = GObject.Property(type=int, default=0, minimum=0)
     selection_mode = GObject.Property(type=bool, default=False)
 
     _scrolled_window = Gtk.Template.Child()
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index 3aa19219..748c10c4 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -30,7 +30,6 @@ from gnomemusic import log
 class BaseView(Gtk.Stack):
     """Base Class for all view classes"""
 
-    selected_items_count = GObject.Property(type=int, default=0, minimum=0)
     selection_mode = GObject.Property(type=bool, default=False)
 
     def __repr__(self):
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index ec2940e4..3ae98992 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -46,7 +46,6 @@ class SearchView(Gtk.Stack):
     __gtype_name__ = "SearchView"
 
     search_state = GObject.Property(type=int, default=Search.State.NONE)
-    selected_items_count = GObject.Property(type=int, default=0, minimum=0)
     selection_mode = GObject.Property(type=bool, default=False)
 
     _album_header = Gtk.Template.Child()
@@ -132,7 +131,6 @@ class SearchView(Gtk.Stack):
         self._scrolled_artist_window = None
 
         self._search_mode_active = False
-        # self.connect("notify::search-state", self._on_search_state_changed)
 
     def _core_filter(self, coreitem, coremodel, nr_items):
         if coremodel.get_n_items() <= 5:
@@ -428,14 +426,6 @@ class SearchView(Gtk.Stack):
                 and self.get_parent().get_visible_child() == self):
             self.unselect_all()
 
-    @log
-    def _on_search_state_changed(self, klass, param):
-        # If a search is triggered when selection mode is activated,
-        # reset the number of selected items.
-        if (self.props.selection_mode
-                and self.props.search_state != Search.State.NONE):
-            self.props.selected_items_count = 0
-
     @GObject.Property(type=bool, default=False)
     def search_mode_active(self):
         """Get search mode status.
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 05ebab87..bd65ef2f 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -273,11 +273,6 @@ class Window(Gtk.ApplicationWindow):
         self.views[View.PLAYLIST] = PlaylistsView(self._app, self._player)
         self.views[View.SEARCH] = SearchView(self._app, self._player)
 
-        selectable_views = [View.ALBUM, View.ARTIST, View.SONG, View.SEARCH]
-        for view in selectable_views:
-            self.views[view].bind_property(
-                'selected-items-count', self, 'selected-items-count')
-
         # empty view has already been created in self._setup_view starting at
         # View.ALBUM
         # empty view state is changed once album view is visible to prevent it


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