Prepare for 3.12 compatibility.

Works only on 3.11.5, to make it work on other 3.11 versions, metadata.json.in has to be fixed, because development versions must be secified exactly with major.minor.point .
multiprovider
Jens Lody 11 years ago
parent a4c57e4b10
commit 68867c49a3
  1. 2
      data/metadata.json.in
  2. 17
      src/extension.js
  3. 2
      src/prefs.js

@ -2,7 +2,7 @@
"uuid": "@uuid@", "uuid": "@uuid@",
"name": "OpenWeather", "name": "OpenWeather",
"description": "Weather extension to display weather information from http://openweathermap.org/ for many cities in GNOME Shell", "description": "Weather extension to display weather information from http://openweathermap.org/ for many cities in GNOME Shell",
"shell-version": [ "3.6", "3.8", "3.10" ], "shell-version": [ "3.6", "3.8", "3.10", "3.11.5", "3.12" ],
"localedir": "@LOCALEDIR@", "localedir": "@LOCALEDIR@",
"url": "@url@" "url": "@url@"
} }

@ -220,12 +220,13 @@ const WeatherMenuButton = new Lang.Class({
reactive: false reactive: false
}); });
if (ExtensionUtils.versionCheck(['3.9', '3.10'], Config.PACKAGE_VERSION)) { log("gnome-shell-version: "+Config.PACKAGE_VERSION);
_itemCurrent.actor.add_actor(this._currentWeather); if (ExtensionUtils.versionCheck(['3.6', '3.8'], Config.PACKAGE_VERSION)) {
_itemFuture.actor.add_actor(this._futureWeather);
} else {
_itemCurrent.addActor(this._currentWeather); _itemCurrent.addActor(this._currentWeather);
_itemFuture.addActor(this._futureWeather); _itemFuture.addActor(this._futureWeather);
} else {
_itemCurrent.actor.add_actor(this._currentWeather);
_itemFuture.actor.add_actor(this._futureWeather);
} }
this.menu.addMenuItem(_itemCurrent); this.menu.addMenuItem(_itemCurrent);
@ -662,10 +663,10 @@ const WeatherMenuButton = new Lang.Class({
item = new PopupMenu.PopupMenuItem(this.extractLocation(cities[i])); item = new PopupMenu.PopupMenuItem(this.extractLocation(cities[i]));
item.location = i; item.location = i;
if (i == this._actual_city) { if (i == this._actual_city) {
if (ExtensionUtils.versionCheck(['3.9', '3.10'], Config.PACKAGE_VERSION)) if (ExtensionUtils.versionCheck(['3.6', '3.8'], Config.PACKAGE_VERSION))
item.setOrnament(PopupMenu.Ornament.DOT);
else
item.setShowDot(true); item.setShowDot(true);
else
item.setOrnament(PopupMenu.Ornament.DOT);
} }
this._selectCity.menu.addMenuItem(item); this._selectCity.menu.addMenuItem(item);
@ -1138,7 +1139,7 @@ weather-storm.png = weather-storm-symbolic.svg
load_json_async: function(url, params, fun) { load_json_async: function(url, params, fun) {
if (_httpSession == undefined) { if (_httpSession == undefined) {
if (ExtensionUtils.versionCheck(['3.6', '3.7'], Config.PACKAGE_VERSION)) { if (ExtensionUtils.versionCheck(['3.6'], Config.PACKAGE_VERSION)) {
// Soup session (see https://bugzilla.gnome.org/show_bug.cgi?id=661323#c64) (Simon Legner) // Soup session (see https://bugzilla.gnome.org/show_bug.cgi?id=661323#c64) (Simon Legner)
_httpSession = new Soup.SessionAsync(); _httpSession = new Soup.SessionAsync();
Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault()); Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault());

@ -541,7 +541,7 @@ const WeatherPrefsWidget = new GObject.Class({
loadJsonAsync: function(url, params, fun, id) { loadJsonAsync: function(url, params, fun, id) {
if (_httpSession == undefined) { if (_httpSession == undefined) {
if (ExtensionUtils.versionCheck(['3.6', '3.7'], Config.PACKAGE_VERSION)) { if (ExtensionUtils.versionCheck(['3.6'], Config.PACKAGE_VERSION)) {
// Soup session (see https://bugzilla.gnome.org/show_bug.cgi?id=661323#c64) (Simon Legner) // Soup session (see https://bugzilla.gnome.org/show_bug.cgi?id=661323#c64) (Simon Legner)
_httpSession = new Soup.SessionAsync(); _httpSession = new Soup.SessionAsync();
Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault()); Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault());

Loading…
Cancel
Save