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



commit 5f2724e47849201401c090c8e75da93564790bb2
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 4dd5485d0..bee93c46b 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3632,19 +3632,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]