[gnome-weather] Delete unused code
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] Delete unused code
- Date: Sat, 7 Nov 2020 19:33:00 +0000 (UTC)
commit 4dae30e6f5bb372181ab6ddd1b7e3fc81bf91f39
Author: Vitaly Dyachkov <obyknovenius me com>
Date: Thu Oct 29 17:44:18 2020 +0100
Delete unused code
src/app/city.js | 102 --------------------------------------------------------
1 file changed, 102 deletions(-)
---
diff --git a/src/app/city.js b/src/app/city.js
index e37d656..867de42 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -34,108 +34,6 @@ const SCROLLING_ANIMATION_TIME = 400000; //us
const UPDATED_TIME_TIMEOUT = 60; //s
-/**
- * Ported from 'gweather_info_get_icon_name' in libgweather.
- * Converts the current weather conditions into the appropriate
- * resource name.
- *
- * @param {GWeather.Info} info a GWeather.Info object
- * @returns {string} the resource name associated with the current weather conditions
- */
-function get_icon_name(info) {
- const [significant, phenomenon, qualifier] = info.get_value_conditions();
- const [valid, sky] = info.get_value_sky();
-
- if (significant) {
- if (phenomenon != GWeather.ConditionPhenomenon.NONE &&
- qualifier == GWeather.ConditionQualifier.THUNDERSTORM)
- return "weather-storm";
-
- switch (phenomenon) {
- case GWeather.ConditionPhenomenon.INVALID:
- case GWeather.ConditionPhenomenon.LAST:
- case GWeather.ConditionPhenomenon.NONE:
- break;
-
- case GWeather.ConditionPhenomenon.DRIZZLE:
- case GWeather.ConditionPhenomenon.RAIN:
- case GWeather.ConditionPhenomenon.UNKNOWN_PRECIPITATION:
- case GWeather.ConditionPhenomenon.HAIL:
- case GWeather.ConditionPhenomenon.SMALL_HAIL:
- return "weather-showers";
-
- case GWeather.ConditionPhenomenon.SNOW:
- case GWeather.ConditionPhenomenon.SNOW_GRAINS:
- case GWeather.ConditionPhenomenon.ICE_PELLETS:
- case GWeather.ConditionPhenomenon.ICE_CRYSTALS:
- return "weather-snow";
-
- case GWeather.ConditionPhenomenon.TORNADO:
- return "weather-tornado";
-
- case GWeather.ConditionPhenomenon.SQUALL:
- return "weather-storm";
-
- case GWeather.ConditionPhenomenon.MIST:
- case GWeather.ConditionPhenomenon.FOG:
- case GWeather.ConditionPhenomenon.SMOKE:
- case GWeather.ConditionPhenomenon.VOLCANIC_ASH:
- case GWeather.ConditionPhenomenon.SAND:
- case GWeather.ConditionPhenomenon.HAZE:
- case GWeather.ConditionPhenomenon.SPRAY:
- case GWeather.ConditionPhenomenon.DUST:
- case GWeather.ConditionPhenomenon.SANDSTORM:
- case GWeather.ConditionPhenomenon.DUSTSTORM:
- case GWeather.ConditionPhenomenon.FUNNEL_CLOUD:
- case GWeather.ConditionPhenomenon.DUST_WHIRLS:
- return "weather-fog";
- }
- }
-
- const daytime = info.is_daytime();
-
- if (valid) {
- switch (sky) {
- case GWeather.Sky.INVALID:
- case GWeather.Sky.LAST:
- case GWeather.Sky.CLEAR:
- if (daytime)
- return "weather-clear";
- else
- return "weather-clear-night";
-
- case GWeather.Sky.BROKEN:
- case GWeather.Sky.SCATTERED:
- case GWeather.Sky.FEW:
- if (daytime)
- return "weather-few-clouds";
- else
- return "weather-few-clouds-night";
-
- case GWeather.Sky.OVERCAST:
- return "weather-overcast";
-
- default: /* unrecognized */
- log(`Unrecognized sky type: ${sky}`);
- return null;
- }
- }
-
- log(`Could not get a sky from info`);
- return null;
-}
-
-function get_icon_resources(info) {
- const name = get_icon_name(info);
-
- if (!name) {
- return null;
- }
-
- return [`/org/gnome/Weather/status/${name}.svg`,
- `/org/gnome/Weather/status/${name}-small.svg`];
-}
-
var WeatherWidget = GObject.registerClass({
Template: 'resource:///org/gnome/Weather/weather-widget.ui',
InternalChildren: ['contentFrame', 'outerGrid',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]