summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--timers.cpp34
-rw-r--r--timers.h2
2 files changed, 35 insertions, 1 deletions
diff --git a/timers.cpp b/timers.cpp
index 327d239..6991e91 100644
--- a/timers.cpp
+++ b/timers.cpp
@@ -135,6 +135,40 @@ namespace vdrlive {
return info.str();
}
+ bool SortedTimers::Modified()
+ {
+ // the global(!) list of known timers
+ static vector<cTimer> knownTimers;
+
+ bool modified = false;
+
+ LOCK_TIMERS_READ;
+ for ( const cTimer* timer = Timers->First(); timer; timer = Timers->Next( timer ) ) {
+ bool known_id = false;
+ for (vector<cTimer>::iterator it = knownTimers.begin(); it != knownTimers.end(); ++it) {
+ if (timer->Id() == it->Id()) {
+ known_id = true;
+ string timer_txt = *timer->ToText (true);
+ string known_txt = *it->ToText (true);
+ modified = timer_txt != known_txt;
+ break;
+ }
+ }
+ if (!known_id) {
+ modified = true;
+ break;
+ }
+ }
+ if (modified) {
+ knownTimers.clear();
+ for (const cTimer* Timer = Timers->First(); Timer; Timer = Timers->Next (Timer)) {
+ knownTimers.push_back (*Timer);
+ }
+ }
+
+ return modified;
+ }
+
TimerManager::TimerManager()
{
}
diff --git a/timers.h b/timers.h
index 10395ef..44dec10 100644
--- a/timers.h
+++ b/timers.h
@@ -24,7 +24,7 @@ namespace vdrlive {
static std::string DecodeDomId(std::string const &timerDomId);
#if VDRVERSNUM >= 20301
- bool Modified() { return true; }
+ bool Modified();
#else
bool Modified() { return Timers.Modified(m_state); }
#endif