mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
Neutrino sleeptimer: speed up timer deletion
Origin commit data
------------------
Branch: ni/coolstream
Commit: 0a195c7c48
Author: Christian Schuett <Gaucho316@hotmail.com>
Date: 2013-12-30 (Mon, 30 Dec 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
committed by
vanhofen
parent
08569d59a0
commit
f17f57eb0e
@@ -108,12 +108,15 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
printf("sleeptimer min: %d\n", shutdown_min);
|
||||
if (shutdown_min == 0) // if set to zero remove existing sleeptimer
|
||||
{
|
||||
if(g_Timerd->getSleeptimerID() > 0) {
|
||||
g_Timerd->removeTimerEvent(g_Timerd->getSleeptimerID());
|
||||
}
|
||||
int timer_id = g_Timerd->getSleeptimerID();
|
||||
if (timer_id > 0)
|
||||
g_Timerd->removeTimerEvent(timer_id);
|
||||
}
|
||||
else // set the sleeptimer to actual time + shutdown mins and announce 1 min before
|
||||
g_Timerd->setSleeptimer(time(NULL) + ((shutdown_min -1) * 60),time(NULL) + shutdown_min * 60,0);
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
g_Timerd->setSleeptimer(now + (shutdown_min - 1) * 60, now + shutdown_min * 60, 0);
|
||||
}
|
||||
}
|
||||
|
||||
is_running = false;
|
||||
|
Reference in New Issue
Block a user