Fix issue 401: Seconds not updating in second line of clock

git-svn-id: http://tint2.googlecode.com/svn/trunk@683 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000 2015-02-04 22:09:20 +00:00 committed by mrovi9000@gmail.com
parent 1272ce4bb9
commit 3f42584fbd

View file

@ -127,14 +127,24 @@ const char* clock_get_tooltip(void* obj)
return buf_tooltip;
}
int time_format_needs_sec_ticks(char *time_format)
{
if (!time_format)
return 0;
if (strchr(time_format, 'S') || strchr(time_format, 'T') || strchr(time_format, 'r'))
return 1;
return 0;
}
void init_clock()
{
if(time1_format && clock_timeout==0) {
if (strchr(time1_format, 'S') || strchr(time1_format, 'T') || strchr(time1_format, 'r'))
if (clock_timeout == 0) {
if (time_format_needs_sec_ticks(time1_format) ||
time_format_needs_sec_ticks(time2_format)) {
clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0);
else
} else {
clock_timeout = add_timeout(10, 1000, update_clocks_min, 0);
}
}
}