mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
src/gui/screensaver.cpp: avoid create clock instance if not required
Origin commit data
------------------
Commit: badb45b646
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-11-21 (Wed, 21 Nov 2018)
This commit is contained in:
@@ -298,8 +298,12 @@ void CScreenSaver::paint()
|
||||
{
|
||||
if (scr_clock)
|
||||
{
|
||||
scr_clock->Stop();
|
||||
scr_clock->kill();
|
||||
scr_clock->allowPaint(false);
|
||||
if (g_settings.screensaver_mode == SCR_MODE_IMAGE){
|
||||
delete scr_clock;
|
||||
scr_clock = NULL;
|
||||
}
|
||||
}
|
||||
if (g_settings.screensaver_mode == SCR_MODE_IMAGE && v_bg_files.empty())
|
||||
m_frameBuffer->paintBackground();
|
||||
@@ -342,6 +346,7 @@ void CScreenSaver::paint()
|
||||
int x_random = rand() % ((g_settings.screen_EndX - w_cl - g_settings.screen_StartX) + 1) + g_settings.screen_StartX;
|
||||
int y_random = rand() % ((g_settings.screen_EndY - h_cl - g_settings.screen_StartY) + 1) + g_settings.screen_StartY;
|
||||
scr_clock->setPos(x_random, y_random);
|
||||
scr_clock->allowPaint(true);
|
||||
if (!scr_clock->isRun())
|
||||
scr_clock->Start();
|
||||
|
||||
|
Reference in New Issue
Block a user