[SCM] kodi-pvr-hts/master: make Schedule::events private and provide a read-write getter for it

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Wed Mar 2 23:01:44 UTC 2016


The following commit has been merged in the master branch:
commit f8c04fef07f1d712da9022766a6c6ded2daf660b
Author: Sam Stenvall <neggelandia at gmail.com>
Date:   Sun Jul 26 20:25:16 2015 +0300

    make Schedule::events private and provide a read-write getter for it

diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
index b8b51ce..df88efc 100644
--- a/src/Tvheadend.cpp
+++ b/src/Tvheadend.cpp
@@ -1430,7 +1430,7 @@ void CTvheadend::SyncEpgCompleted ( void )
   /* Events */
   for (auto &entry : m_schedules)
   {
-    utilities::erase_if(entry.second.events, [](const EventMapEntry &entry)
+    utilities::erase_if(entry.second.GetEvents(), [](const EventMapEntry &entry)
     {
       return entry.second.IsDirty();
     });
@@ -1891,7 +1891,8 @@ void CTvheadend::ParseEventAddOrUpdate ( htsmsg_t *msg, bool bAdd )
 
   /* Get event handle */
   Schedule &sched  = m_schedules[tmp.GetChannel()];
-  Event    &evt    = sched.events[tmp.GetId()];
+  Events   &events = sched.GetEvents();
+  Event    &evt    = events[tmp.GetId()];
   Event comparison = evt;
   sched.SetId(tmp.GetChannel());
   evt.SetId(tmp.GetId());
@@ -1928,7 +1929,7 @@ void CTvheadend::ParseEventDelete ( htsmsg_t *msg )
   for (auto &entry : m_schedules)
   {
     Schedule &schedule = entry.second;
-    Events &events = schedule.events;
+    Events &events = schedule.GetEvents();
 
     // Find the event so we can get the channel number
     auto eit = events.find(u32);
diff --git a/src/tvheadend/entity/Schedule.cpp b/src/tvheadend/entity/Schedule.cpp
index f8be45c..b43d469 100644
--- a/src/tvheadend/entity/Schedule.cpp
+++ b/src/tvheadend/entity/Schedule.cpp
@@ -46,3 +46,8 @@ Segment Schedule::GetSegment(time_t startTime, time_t endTime) const
 
   return segment;
 }
+
+Events& Schedule::GetEvents()
+{
+  return events;
+}
diff --git a/src/tvheadend/entity/Schedule.h b/src/tvheadend/entity/Schedule.h
index 298f55c..46d5997 100644
--- a/src/tvheadend/entity/Schedule.h
+++ b/src/tvheadend/entity/Schedule.h
@@ -49,6 +49,12 @@ namespace tvheadend
        */
       Segment GetSegment(time_t startTime, time_t endTime) const;
 
+      /**
+       * @return read-write reference to the events in this schedule
+       */
+      Events& GetEvents();
+
+    private:
       Events events;
     };
   }

-- 
kodi-pvr-hts packaging



More information about the pkg-multimedia-commits mailing list