summaryrefslogtreecommitdiff
path: root/examples/positioning/weatherinfo/components/WeatherIcon.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/positioning/weatherinfo/components/WeatherIcon.qml')
-rw-r--r--examples/positioning/weatherinfo/components/WeatherIcon.qml52
1 files changed, 2 insertions, 50 deletions
diff --git a/examples/positioning/weatherinfo/components/WeatherIcon.qml b/examples/positioning/weatherinfo/components/WeatherIcon.qml
index 638a52fa..47832c0e 100644
--- a/examples/positioning/weatherinfo/components/WeatherIcon.qml
+++ b/examples/positioning/weatherinfo/components/WeatherIcon.qml
@@ -53,59 +53,11 @@ import QtQuick 2.0
Item {
id: container
- property string weatherIcon: "01d"
-
- //server icons are too small. we keep using the local images
- property bool useServerIcon: true
+ property string weatherIcon: "sunny"
Image {
id: img
- source: {
- if (useServerIcon)
- "http://openweathermap.org/img/w/" + container.weatherIcon + ".png"
- else {
- switch (weatherIcon) {
- case "01d":
- case "01n":
- "../icons/weather-sunny.png"
- break;
- case "02d":
- case "02n":
- "../icons/weather-sunny-very-few-clouds.png"
- break;
- case "03d":
- case "03n":
- "../icons/weather-few-clouds.png"
- break;
- case "04d":
- case "04n":
- "../icons/weather-overcast.png"
- break;
- case "09d":
- case "09n":
- "../icons/weather-showers.png"
- break;
- case "10d":
- case "10n":
- "../icons/weather-showers.png"
- break;
- case "11d":
- case "11n":
- "../icons/weather-thundershower.png"
- break;
- case "13d":
- case "13n":
- "../icons/weather-snow.png"
- break;
- case "50d":
- case "50n":
- "../icons/weather-fog.png"
- break;
- default:
- "../icons/weather-unknown.png"
- }
- }
- }
+ source: "../icons/weather-" + container.weatherIcon + ".png"
smooth: true
anchors.fill: parent
}