[PATCH - hwmixvolume 6/9] hwmixvolume: fix deprecation warnings given by G_ENABLE_DIAGNOSTIC=1

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

 



Signed-off-by: Emmanuel Gil Peyrot <linkmauve@xxxxxxxxxxxx>

diff --git a/hwmixvolume/hwmixvolume b/hwmixvolume/hwmixvolume
index af0c1e0..ec2d05d 100755
--- a/hwmixvolume/hwmixvolume
+++ b/hwmixvolume/hwmixvolume
@@ -60,7 +60,7 @@ class Stream:
         value = alsahcontrol.Value(self.element)
         value.read()
         values = value.get_tuple(TYPE_INTEGER, info.count)
-        self.label = Gtk.Label(self.get_label(info))
+        self.label = Gtk.Label.new(self.get_label(info))
         self.label.set_single_line_mode(True)
         self.parent.scales_vbox.add(self.label)
         for i in range(info.count):
@@ -201,15 +201,15 @@ class MixerWindow(Gtk.Window):
 
         self.scales_vbox = Gtk.Grid()
         self.scales_vbox.set_orientation(Gtk.Orientation.VERTICAL)
-        scrollwin.add_with_viewport(self.scales_vbox)
+        scrollwin.add(self.scales_vbox)
 
         label = Gtk.Label()
         label.set_single_line_mode(True)
-        line_height = label.size_request().height
+        line_height = max(label.get_size_request().height, 0)
         label.destroy()
         scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL)
         scale.set_draw_value(False)
-        line_height += scale.size_request().height
+        line_height += max(scale.get_size_request().height, 0)
         scale.destroy()
         # always have space for at least four sliders
         scrollwin.set_size_request(width=-1, height=line_height*4+4)
@@ -267,7 +267,7 @@ class MixerWindow(Gtk.Window):
             else:
                 msg = "This card does not have stream controls."
             if not has_msg:
-                self.msg_label = Gtk.Label(msg)
+                self.msg_label = Gtk.Label.new(msg)
                 self.msg_label.set_vexpand(True)
                 self.scales_vbox.add(self.msg_label)
                 self.scales_vbox.show_all()
-- 
2.18.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux