[totem/wip/hadess/mpris-can-go-next: 2/4] main: Simplify prev/next button sensitivity with new helpers



commit 71a0950ed9b88895b9bb5b8038dc258fd8615f89
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 14 03:37:21 2019 +0100

    main: Simplify prev/next button sensitivity with new helpers

 src/totem-object.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 78ca07845..42b9ff2cd 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3637,19 +3637,10 @@ update_media_menu_items (TotemObject *totem)
 static void
 update_buttons (TotemObject *totem)
 {
-       gboolean has_item;
-
-       /* Previous */
-       has_item = bacon_video_widget_has_previous_track (totem->bvw) ||
-               totem_playlist_has_previous_mrl (totem->playlist) ||
-               totem_playlist_get_repeat (totem->playlist);
-       totem_object_set_sensitivity2 ("previous-chapter", has_item);
-
-       /* Next */
-       has_item = bacon_video_widget_has_next_track (totem->bvw) ||
-               totem_playlist_has_next_mrl (totem->playlist) ||
-               totem_playlist_get_repeat (totem->playlist);
-       totem_object_set_sensitivity2 ("next-chapter", has_item);
+       totem_object_set_sensitivity2 ("previous-chapter",
+                                      totem_object_can_seek_previous (totem));
+       totem_object_set_sensitivity2 ("next-chapter",
+                                      totem_object_can_seek_next (totem));
 }
 
 void


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