From 12f927ed81046de0a6b747653724e31e7e9fd66c Mon Sep 17 00:00:00 2001 From: Michael Prager Date: Thu, 24 Mar 2011 11:40:19 +0100 Subject: [PATCH] fixed homescreen widget update not always working on N8 --- Readme.txt | 3 +-- comingNext/index.html | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Readme.txt b/Readme.txt index ca50ef4..308ad8f 100644 --- a/Readme.txt +++ b/Readme.txt @@ -56,8 +56,6 @@ Known limitations: http://sourceforge.net/tracker/download.php?group_id=276816&atid=1175663&file_id=401828&aid=2956758 More info on this in the bug tracker: http://sourceforge.net/tracker/?func=detail&aid=2956758&group_id=276816&atid=1175663 -- Event refreshing/updating is broken on N8. You will have to set update - interval in settings to 0 in order to get it working on the N8. How to obtain log file for solving issues: @@ -261,3 +259,4 @@ Changelog: - fixed "About" link opening inside browser instead of widget - fixed sorting of events without date - fixed calendar indicators not showing in some cases + - fixed homescreen widget not updating properly on N8 diff --git a/comingNext/index.html b/comingNext/index.html index fa571f5..af47f3b 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -98,6 +98,7 @@ var calendarList = []; var calendarColors = []; var updateTimer = null; var screenRotationTimer = null; +var lastUpdateTime = now; // vars for daylight saving time var summertime = false; // true, if current date is in summer, false if in winter @@ -786,6 +787,8 @@ function updateData() document.getElementById('fullscreenCalendarList').innerHTML = entriesHtml; cacheEntriesHtml = entriesHtml; } + + lastUpdateTime = new Date(); } catch(e) { error('displaying list:' + e + ', line ' + e.line); return; @@ -811,6 +814,14 @@ function updateScreen() updateHomescreen(); else if (mode == 1) updateFullscreen(); + + var time = new Date(); + if (time.getTime() - lastUpdateTime.getTime() > config['updateDataInterval'].Value * 60 * 1000) { + console.info('updateScreen(): force updateData() because last update was too long ago (' + (time.getTime() - lastUpdateTime.getTime()) / 1000 + 's)'); + clearUpdateTimer(); + updateData(); + setUpdateTimer(); // reinitialize update timer + } } function launchCalendar() -- 2.39.2