Changeset View
Changeset View
Standalone View
Standalone View
dataengines/weather/ions/noaa/ion_noaa.cpp
Show First 20 Lines • Show All 728 Lines • ▼ Show 20 Line(s) | 677 | { | |||
---|---|---|---|---|---|
729 | 729 | | |||
730 | } else if (weather.contains(QLatin1String("rain"))) { | 730 | } else if (weather.contains(QLatin1String("rain"))) { | ||
731 | result = IonInterface::Rain; | 731 | result = IonInterface::Rain; | ||
732 | 732 | | |||
733 | } else if (weather.contains(QLatin1String("few clouds")) || weather.contains(QLatin1String("mostly sunny")) || | 733 | } else if (weather.contains(QLatin1String("few clouds")) || weather.contains(QLatin1String("mostly sunny")) || | ||
734 | weather.contains(QLatin1String("mostly clear")) || weather.contains(QLatin1String("increasing clouds")) || | 734 | weather.contains(QLatin1String("mostly clear")) || weather.contains(QLatin1String("increasing clouds")) || | ||
735 | weather.contains(QLatin1String("becoming cloudy")) || weather.contains(QLatin1String("clearing")) || | 735 | weather.contains(QLatin1String("becoming cloudy")) || weather.contains(QLatin1String("clearing")) || | ||
736 | weather.contains(QLatin1String("decreasing clouds")) || weather.contains(QLatin1String("becoming sunny"))) { | 736 | weather.contains(QLatin1String("decreasing clouds")) || weather.contains(QLatin1String("becoming sunny"))) { | ||
737 | if (weather.contains(QLatin1String("breezy")) || | ||||
738 | weather.contains(QLatin1String("wind")) || | ||||
739 | weather.contains (QLatin1String("gust"))) { | ||||
740 | result = isDayTime ? IonInterface::FewCloudsWindyDay : IonInterface::FewCloudsWindyNight; | ||||
741 | } else { | ||||
737 | result = isDayTime ? IonInterface::FewCloudsDay : IonInterface::FewCloudsNight; | 742 | result = isDayTime ? IonInterface::FewCloudsDay : IonInterface::FewCloudsNight; | ||
743 | } | ||||
738 | 744 | | |||
739 | } else if (weather.contains(QLatin1String("partly cloudy")) || weather.contains(QLatin1String("partly sunny")) || | 745 | } else if (weather.contains(QLatin1String("partly cloudy")) || weather.contains(QLatin1String("partly sunny")) || | ||
740 | weather.contains(QLatin1String("partly clear"))) { | 746 | weather.contains(QLatin1String("partly clear"))) { | ||
747 | if (weather.contains(QLatin1String("breezy")) || | ||||
748 | weather.contains(QLatin1String("wind")) || | ||||
749 | weather.contains (QLatin1String("gust"))) { | ||||
750 | result = isDayTime ? IonInterface::PartlyCloudyWindyDay : IonInterface::PartlyCloudyWindyNight; | ||||
751 | } else { | ||||
741 | result = isDayTime ? IonInterface::PartlyCloudyDay : IonInterface::PartlyCloudyNight; | 752 | result = isDayTime ? IonInterface::PartlyCloudyDay : IonInterface::PartlyCloudyNight; | ||
753 | } | ||||
742 | 754 | | |||
743 | } else if (weather.contains(QLatin1String("overcast")) || weather.contains(QLatin1String("cloudy"))) { | 755 | } else if (weather.contains(QLatin1String("overcast")) || weather.contains(QLatin1String("cloudy"))) { | ||
756 | if (weather.contains(QLatin1String("breezy")) || | ||||
757 | weather.contains(QLatin1String("wind")) || | ||||
758 | weather.contains (QLatin1String("gust"))) { | ||||
759 | result = IonInterface::OvercastWindy; | ||||
760 | } else { | ||||
744 | result = IonInterface::Overcast; | 761 | result = IonInterface::Overcast; | ||
762 | } | ||||
745 | 763 | | |||
746 | } else if (weather.contains(QLatin1String("haze")) || weather.contains(QLatin1String("smoke")) || | 764 | } else if (weather.contains(QLatin1String("haze")) || weather.contains(QLatin1String("smoke")) || | ||
747 | weather.contains(QLatin1String("dust")) || weather.contains(QLatin1String("sand"))) { | 765 | weather.contains(QLatin1String("dust")) || weather.contains(QLatin1String("sand"))) { | ||
748 | result = IonInterface::Haze; | 766 | result = IonInterface::Haze; | ||
749 | 767 | | |||
750 | } else if (weather.contains(QLatin1String("fair")) || weather.contains(QLatin1String("clear")) || weather.contains(QLatin1String("sunny"))) { | 768 | } else if (weather.contains(QLatin1String("fair")) || weather.contains(QLatin1String("clear")) || weather.contains(QLatin1String("sunny"))) { | ||
769 | if (weather.contains(QLatin1String("breezy")) || | ||||
770 | weather.contains(QLatin1String("wind")) || | ||||
771 | weather.contains (QLatin1String("gust"))) { | ||||
772 | result = isDayTime ? IonInterface::ClearWindyDay : IonInterface::ClearWindyNight; | ||||
773 | } else { | ||||
751 | result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; | 774 | result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; | ||
775 | } | ||||
752 | 776 | | |||
753 | } else if (weather.contains(QLatin1String("fog"))) { | 777 | } else if (weather.contains(QLatin1String("fog"))) { | ||
754 | result = IonInterface::Mist; | 778 | result = IonInterface::Mist; | ||
755 | 779 | | |||
756 | } else if (weather.contains(QLatin1String("hot"))) { | 780 | } else if (weather.contains(QLatin1String("hot"))) { | ||
757 | // temperature condition has not hint about air ingredients, so let's assume the sky is clear when it is hot | 781 | // temperature condition has not hint about air ingredients, so let's assume the sky is clear when it is hot | ||
782 | if (weather.contains(QLatin1String("breezy")) || | ||||
783 | weather.contains(QLatin1String("wind")) || | ||||
784 | weather.contains (QLatin1String("gust"))) { | ||||
785 | result = isDayTime ? IonInterface::ClearWindyDay : IonInterface::ClearWindyNight; | ||||
786 | } else { | ||||
758 | result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; | 787 | result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; | ||
788 | } | ||||
759 | 789 | | |||
790 | } else if (weather.contains (QLatin1String("breezy")) || | ||||
791 | weather.contains (QLatin1String("wind")) || | ||||
792 | weather.contains (QLatin1String("gust"))) { | ||||
793 | // Assume a clear sky when it's windy but no clouds have been mentioned | ||||
794 | result = isDayTime ? IonInterface::ClearWindyDay : IonInterface::ClearWindyNight; | ||||
760 | } else { | 795 | } else { | ||
761 | result = IonInterface::NotAvailable; | 796 | result = IonInterface::NotAvailable; | ||
762 | } | 797 | } | ||
763 | 798 | | |||
764 | return result; | 799 | return result; | ||
765 | } | 800 | } | ||
766 | 801 | | |||
767 | void NOAAIon::getForecast(const QString& source) | 802 | void NOAAIon::getForecast(const QString& source) | ||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |