Haha, I was greatly puzzled by "date.month() == 10 && date.daysInMonth() == 31" :D
authorunc0rr
Thu, 26 Jan 2012 16:04:08 +0400
changeset 6600 5810e42d8375
parent 6599 1d3746138113
child 6601 5965e2927b3d
Haha, I was greatly puzzled by "date.month() == 10 && date.daysInMonth() == 31" :D
QTfrontend/main.cpp
--- a/QTfrontend/main.cpp	Thu Jan 26 02:06:57 2012 +0100
+++ b/QTfrontend/main.cpp	Thu Jan 26 16:04:08 2012 +0400
@@ -68,11 +68,11 @@
    QDate date = QDate::currentDate();
    
    //Christmas?
-   if (date.month() == 12 && date.daysInMonth() >= 24 
-	&& date.daysInMonth() <= 26)
+   if (date.month() == 12 && date.day() >= 24
+        && date.day() <= 26)
 	season = SEASON_CHRISTMAS;
    //Hedgewars birthday?
-   else if (date.month() == 10 && date.daysInMonth() == 31)
+   else if (date.month() == 10 && date.day() == 31)
    {
    	season = SEASON_HWBDAY;
 	years_since_foundation = date.year() - 2004;