[Pkg-wmaker-commits] [wmforecast] 04/10: Limit of number days in forecast to 7 to avoid confusion.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Mar 26 23:16:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmforecast.

commit dcf081f749fd561904a8f9d5aeec566d8886db86
Author: Doug Torrance <dtorrance at piedmont.edu>
Date:   Sat Mar 26 18:41:31 2016 -0400

    Limit of number days in forecast to 7 to avoid confusion.
    
    "Which Saturday is it talking about?"
    
    Add note in TODO about possibly making this number a configuration option
    in the future.
---
 TODO         | 2 ++
 wmforecast.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/TODO b/TODO
index 92255a6..437fbf6 100644
--- a/TODO
+++ b/TODO
@@ -5,3 +5,5 @@ Future wmforecast features:
   - WMCreateDockapp function -- submit patch to WINGs?
   - Use WMSetApplicationIconWindow?
   - Use tools like valgrind to check things out.
+* Make # of days shown in forecast configurable?
+  - Possibly include dates if > 7 to avoid confusion.
\ No newline at end of file
diff --git a/wmforecast.c b/wmforecast.c
index 29cf8cb..adba35d 100755
--- a/wmforecast.c
+++ b/wmforecast.c
@@ -335,7 +335,7 @@ char *getBalloonText(Weather *weather)
 	text = wstrappend(text, ", ");
 	text = wstrappend(text, weather->temp);
 	text = wstrappend(text, "°\n\nForecast:\n");
-	for (i = 0; i < weather->forecasts->length; i++) {
+	for (i = 0; i < weather->forecasts->length && i < 7; i++) {
 		text = wstrappend(text, weather->forecasts->forecasts[i].day);
 		text = wstrappend(text, " - ");
 		text = wstrappend(text, weather->forecasts->forecasts[i].text);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmforecast.git



More information about the Pkg-wmaker-commits mailing list