[gnome-music/wip/jfelder/emptyview-search] emptyview: Add mock {un}select_all methods



commit 97aa2bb996c32f11339d1ece7977c8fb5d3ce967
Author: Jean Felder <jfelder src gnome org>
Date:   Mon Feb 18 07:31:14 2019 +0100

    emptyview: Add mock {un}select_all methods
    
    EmptyView does not inherit from BaseView anymore. Therefore, it does
    not have any default {un}select_all methods anymore.
    This can lead to a crash when selection_mode is enabled from a view or
    a widget and then a search which returns no result is triggered.
    
    Add select_all and unselect_all methods to EmptyView to prevent this
    crash. These functions do nothing as no song, artist or album can be
    selected from an empty view.

 gnomemusic/views/emptyview.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gnomemusic/views/emptyview.py b/gnomemusic/views/emptyview.py
index e15ee658..2a72fb58 100644
--- a/gnomemusic/views/emptyview.py
+++ b/gnomemusic/views/emptyview.py
@@ -132,3 +132,13 @@ class EmptyView(Gtk.Stack):
             "Your music files cannot be indexed without Tracker running")
 
         self._icon.props.icon_name = "dialog-error-symbolic"
+
+    @log
+    def select_all(self):
+        """Cannot select songs from EmptyView."""
+        pass
+
+    @log
+    def unselect_all(self):
+        """Cannot select songs from EmptyView."""
+        pass


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