[gnome-weather/wip/christopherdavis/es6: 4/4] Get rid of params.js



commit 61c097ce2399b48333eb0b8fc31664c1e24c9c11
Author: Christopher Davis <brainblasted disroot org>
Date:   Sun Feb 24 03:42:00 2019 -0500

    Get rid of params.js
    
    Object.assign does basically the same thing as Params.fill.

 src/app/city.js                                    |   8 +-
 src/app/forecast.js                                |   6 +-
 src/app/weeklyForecast.js                          |  10 +-
 src/app/window.js                                  |   1 -
 src/app/world.js                                   |   7 +-
 src/misc/params.js                                 | 124 ---------------------
 src/misc/util.js                                   |   2 -
 ...ome.Weather.BackgroundService.src.gresource.xml |   1 -
 src/org.gnome.Weather.src.gresource.xml            |   1 -
 src/shared/world.js                                |   1 -
 10 files changed, 16 insertions(+), 145 deletions(-)
---
diff --git a/src/app/city.js b/src/app/city.js
index b95233d..f152ea8 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -24,7 +24,6 @@ const Gtk = imports.gi.Gtk;
 
 const Forecast = imports.app.forecast;
 const WForecast = imports.app.weeklyForecast;
-const Params = imports.misc.params;
 const Util = imports.misc.util;
 
 const SPINNER_SIZE = 128;
@@ -42,9 +41,10 @@ var WeatherWidget = GObject.registerClass({
 }, class WeatherWidget extends Gtk.Frame {
 
     _init(params) {
-        params = Params.fill(params, { shadow_type: Gtk.ShadowType.NONE,
-                                       name: 'weather-page' });
-        super._init(params);
+        super._init(Object.assign({
+            shadow_type: Gtk.ShadowType.NONE,
+            name: 'weather-page'
+        }, params));
 
         this._currentStyle = null;
         this._info = null;
diff --git a/src/app/forecast.js b/src/app/forecast.js
index 6263c89..e14bbe0 100644
--- a/src/app/forecast.js
+++ b/src/app/forecast.js
@@ -21,7 +21,6 @@ const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const Gtk = imports.gi.Gtk;
 
-const Params = imports.misc.params;
 const Util = imports.misc.util;
 
 // In microseconds
@@ -30,8 +29,9 @@ const ONE_HOUR = 3600*1000*1000;
 var ForecastBox = GObject.registerClass(class ForecastBox extends Gtk.Frame {
 
     _init(params) {
-        params = Params.fill(params, { shadow_type: Gtk.ShadowType.NONE });
-        super._init(params);
+        super._init(Object.assign({
+            shadow_type: Gtk.ShadowType.NONE
+        }, params));
         this.get_accessible().accessible_name = _("Forecast");
 
         this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
diff --git a/src/app/weeklyForecast.js b/src/app/weeklyForecast.js
index c2929bd..d15a175 100644
--- a/src/app/weeklyForecast.js
+++ b/src/app/weeklyForecast.js
@@ -21,17 +21,17 @@ const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const Gtk = imports.gi.Gtk;
 
-const Params = imports.misc.params;
 const Util = imports.misc.util;
 
 var WeeklyForecastFrame = GObject.registerClass(
     class WeeklyForecastFrame extends Gtk.Frame {
 
     _init(params) {
-        params = Params.fill(params, { shadow_type: Gtk.ShadowType.NONE,
-                                       name: 'weekly-forecast-frame',
-                                       width_request: 150 });
-        super._init(params);
+        super._init(Object.assign({
+            shadow_type: Gtk.ShadowType.NONE,
+            name: 'weekly-forecast-frame',
+            width_request: 150
+        }, params));
         this.get_accessible().accessible_name = _("Weekly Forecast");
 
         this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
diff --git a/src/app/window.js b/src/app/window.js
index 0338124..3757dc6 100644
--- a/src/app/window.js
+++ b/src/app/window.js
@@ -23,7 +23,6 @@ const GWeather = imports.gi.GWeather;
 
 const City = imports.app.city;
 const CurrentLocationController = imports.app.currentLocationController;
-const Params = imports.misc.params;
 const World = imports.shared.world;
 const WorldView = imports.app.world;
 const Util = imports.misc.util;
diff --git a/src/app/world.js b/src/app/world.js
index f0b3dae..8e1d5ce 100644
--- a/src/app/world.js
+++ b/src/app/world.js
@@ -23,7 +23,6 @@ const Gtk = imports.gi.Gtk;
 const GWeather = imports.gi.GWeather;
 
 const CurrentLocationController = imports.app.currentLocationController;
-const Params = imports.misc.params;
 const Util = imports.misc.util;
 
 
@@ -31,8 +30,10 @@ var WorldContentView = GObject.registerClass(
     class WorldContentView extends Gtk.Popover {
 
     _init(application, window, params) {
-        params = Params.fill(params, { hexpand: false, vexpand: false });
-        super._init(params);
+        super._init(Object.assign({
+            hexpand: false,
+            vexpand: false
+        }, params));
 
         this.get_accessible().accessible_name = _("World view");
 
diff --git a/src/misc/util.js b/src/misc/util.js
index 2dc3974..f63cbd8 100644
--- a/src/misc/util.js
+++ b/src/misc/util.js
@@ -31,8 +31,6 @@ const Gtk = imports.gi.Gtk;
 const System = imports.system;
 const GWeather = imports.gi.GWeather;
 
-const Params = imports.misc.params;
-
 function loadUI(resourcePath, objects) {
     let ui = new Gtk.Builder();
 
diff --git a/src/org.gnome.Weather.BackgroundService.src.gresource.xml 
b/src/org.gnome.Weather.BackgroundService.src.gresource.xml
index 130070e..d4dcd96 100644
--- a/src/org.gnome.Weather.BackgroundService.src.gresource.xml
+++ b/src/org.gnome.Weather.BackgroundService.src.gresource.xml
@@ -3,7 +3,6 @@
   <gresource prefix="/org/gnome/Weather/BackgroundService/js">
     <file>service/main.js</file>
     <file>service/searchProvider.js</file>
-    <file>misc/params.js</file>
     <file>misc/util.js</file>
     <file>shared/world.js</file>
   </gresource>
diff --git a/src/org.gnome.Weather.src.gresource.xml b/src/org.gnome.Weather.src.gresource.xml
index 703006c..da8b0aa 100644
--- a/src/org.gnome.Weather.src.gresource.xml
+++ b/src/org.gnome.Weather.src.gresource.xml
@@ -8,7 +8,6 @@
     <file>app/main.js</file>
     <file>app/window.js</file>
     <file>app/world.js</file>
-    <file>misc/params.js</file>
     <file>misc/util.js</file>
     <file>shared/world.js</file>
   </gresource>
diff --git a/src/shared/world.js b/src/shared/world.js
index 95400b7..07feade 100644
--- a/src/shared/world.js
+++ b/src/shared/world.js
@@ -20,7 +20,6 @@ const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const GWeather = imports.gi.GWeather;
 
-const Params = imports.misc.params;
 const Util = imports.misc.util;
 
 var WorldModel = GObject.registerClass({


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]