[mythtv] mythweather patch

Mike Wohlgemuth mjw at woogie.net
Sun Mar 23 16:33:04 EST 2003


For some reason, visibility always comes back blank for my locale.  This 
patch prints "???" on the first page when visibility is blank, and 
"There will be unknown visibility." on the third page.  I hope I got the 
spaces & tabs correct, I couldn't tell if emacs was doing what I wanted 
or not.

Woogie
-------------- next part --------------
Index: mythweather/weather.cpp
===================================================================
RCS file: /var/lib/cvs/mythweather/mythweather/weather.cpp,v
retrieving revision 1.25
diff -u -r1.25 weather.cpp
--- mythweather/weather.cpp	19 Mar 2003 01:13:20 -0000	1.25
+++ mythweather/weather.cpp	23 Mar 2003 21:24:08 -0000
@@ -1595,7 +1595,9 @@
 	todayDesc += " Visibility will be unlimited for today.";
     else
     {
-	if (convertData == false)
+        if (visibility == "")
+	  todayDesc += " There will be unknown visibility.";
+	else if (convertData == false)
 	   todayDesc += " There will be a visibility of " + visibility + " miles.";
 	else
            todayDesc += " There will be a visibility of " + visibility + " km.";
@@ -1648,7 +1650,9 @@
 
     if (visibility.toFloat() != 999.00)
     {
-	if (convertData == false)
+        if (visibility == "")
+            lbVisi->setText("???  ");
+        else if (convertData == false)
             lbVisi->setText(visibility + " mi  ");
 	else
 	    lbVisi->setText(visibility + " km  ");
@@ -2497,7 +2501,9 @@
        todayDesc += " Visibility will be unlimited for today.";
   else
   {
-	if (convertData == false)
+        if (visibility == "")
+          todayDesc += " There will be unknown visibility.";
+        else if (convertData == false)
        	    todayDesc += " There will be a visibility of " + visibility + " miles.";
 	else
 	    todayDesc += " There will be a visibility of " + visibility + " kilometers.";


More information about the mythtv-dev mailing list