[gnome-dvb-daemon] Make sure that Channel's GroupId is set in the constructor.



commit 45f12673bf5924d58356bfa79fe091f2e511fac7
Author: Sebastian Pölsterl <sebp k-d-w org>
Date:   Sun May 29 13:08:30 2011 +0200

    Make sure that Channel's GroupId is set in the constructor.
    
    This fixes a bug where EPG events where not restored at start time.

 src/Cable/CableChannel.vala             |    4 ++++
 src/Channel.vala                        |    5 +++--
 src/Satellite/SatelliteChannel.vala     |    4 ++++
 src/Terrestrial/TerrestrialChannel.vala |    4 ++++
 src/io/ChannelListReader.vala           |    7 +++----
 5 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/Cable/CableChannel.vala b/src/Cable/CableChannel.vala
index a3928b4..6d9a8eb 100644
--- a/src/Cable/CableChannel.vala
+++ b/src/Cable/CableChannel.vala
@@ -27,6 +27,10 @@ namespace DVB {
         public DvbSrcCodeRate CodeRate {get; set;}
         public DvbSrcModulation Modulation {get; set;}
 
+        public CableChannel (uint group_id) {
+            base (group_id);
+        }
+
         public CableChannel.without_schedule () {
             Channel.without_schedule ();
         }
diff --git a/src/Channel.vala b/src/Channel.vala
index 09cb06f..899d2ba 100644
--- a/src/Channel.vala
+++ b/src/Channel.vala
@@ -33,7 +33,7 @@ namespace DVB {
                 }
             }
         }
-        public uint GroupId {get; set;}
+        public uint GroupId {get; construct;}
         public string Name {get; set;}
         public uint TransportStreamId {get; set;}
         public string Network {get; set;}
@@ -61,7 +61,8 @@ namespace DVB {
             this.AudioPIDs = new Gee.ArrayList<uint> ();
         }
 
-        public Channel () {
+        public Channel (uint group_id) {
+            Object (GroupId: group_id);
             this.has_schedule = true;
         }
 
diff --git a/src/Satellite/SatelliteChannel.vala b/src/Satellite/SatelliteChannel.vala
index 0d4e047..cd5fd30 100644
--- a/src/Satellite/SatelliteChannel.vala
+++ b/src/Satellite/SatelliteChannel.vala
@@ -26,6 +26,10 @@ namespace DVB {
         public uint SymbolRate {get; set;}
         public int DiseqcSource {get; set;}
 
+        public SatelliteChannel (uint group_id) {
+            base (group_id);
+        }
+
         public SatelliteChannel.without_schedule () {
             Channel.without_schedule ();
         }
diff --git a/src/Terrestrial/TerrestrialChannel.vala b/src/Terrestrial/TerrestrialChannel.vala
index 016a4bd..cbec164 100644
--- a/src/Terrestrial/TerrestrialChannel.vala
+++ b/src/Terrestrial/TerrestrialChannel.vala
@@ -32,6 +32,10 @@ namespace DVB {
         public DvbSrcGuard GuardInterval {get; set;}
         public DvbSrcHierarchy Hierarchy {get; set;}
 
+        public TerrestrialChannel (uint group_id) {
+            base (group_id);
+        }
+
         public TerrestrialChannel.without_schedule () {
             Channel.without_schedule ();
         }
diff --git a/src/io/ChannelListReader.vala b/src/io/ChannelListReader.vala
index a841338..e558a3c 100644
--- a/src/io/ChannelListReader.vala
+++ b/src/io/ChannelListReader.vala
@@ -74,7 +74,6 @@ namespace DVB.io {
             }
             
             if (c != null && c.is_valid ()) {
-                c.GroupId = this.channels.GroupId;
                 return c;
             } else {
                 string val = (c == null) ? "(null)" : c.to_string ();
@@ -91,7 +90,7 @@ namespace DVB.io {
          * Das Erste:212500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:513:514:32
          */
         private TerrestrialChannel? parse_terrestrial_channel (string line) {
-            var channel = new TerrestrialChannel ();
+            var channel = new TerrestrialChannel (this.channels.GroupId);
             
             string[] fields = line.split(":");
             
@@ -201,7 +200,7 @@ namespace DVB.io {
          * Das Erste:11836:h:0:27500:101:102:28106
          */
         private SatelliteChannel? parse_satellite_channel (string line) {
-            var channel = new SatelliteChannel ();
+            var channel = new SatelliteChannel (this.channels.GroupId);
             
             string[] fields = line.split(":");
             
@@ -246,7 +245,7 @@ namespace DVB.io {
          * ProSieben:330000000:INVERSION_AUTO:6900000:FEC_NONE:QAM_64:255:256:898
          */
         private CableChannel? parse_cable_channel (string line) {
-            var channel = new CableChannel ();
+            var channel = new CableChannel (this.channels.GroupId);
             
             string[] fields = line.split(":");
             



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