[gnome-sound-recorder/wip/jtojnar/es6: 5/5] Get rid of params.js



commit 44f787ce34486968e35eb6f3f1c12e55a88d1c36
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Jan 18 06:51:07 2019 +0100

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

 src/mainWindow.js                             |  31 ++++---
 src/org.gnome.SoundRecorder.src.gresource.xml |   1 -
 src/params.js                                 | 128 --------------------------
 3 files changed, 16 insertions(+), 144 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 5d230c0..cd1bf2c 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -37,7 +37,6 @@ const AudioProfile = imports.audioProfile;
 const FileUtil = imports.fileUtil;
 const Info = imports.info;
 const Listview = imports.listview;
-const Params = imports.params;
 const Play = imports.play;
 const Preferences = imports.preferences;
 const Record = imports.record;
@@ -97,15 +96,16 @@ var MainWindow = GObject.registerClass(class MainWindow extends Gtk.ApplicationW
         view = new MainView();
         play = new Play.Play();
 
-        params = Params.fill(params, { title: GLib.get_application_name(),
-                                       default_height: 480,
-                                       default_width: 780,
-                                       height_request: 480,
-                                       width_request: 640,
-                                       hexpand: true,
-                                       vexpand: true,
-                                       icon_name: "org.gnome.SoundRecorder" });
-        super._init(params);
+        super._init(Object.assign({
+            title: GLib.get_application_name(),
+            default_height: 480,
+            default_width: 780,
+            height_request: 480,
+            width_request: 640,
+            hexpand: true,
+            vexpand: true,
+            icon_name: "org.gnome.SoundRecorder"
+        }, params));
 
         header = new Gtk.HeaderBar({ hexpand: true,
                                      show_close_button: true });
@@ -137,11 +137,12 @@ var MainWindow = GObject.registerClass(class MainWindow extends Gtk.ApplicationW
 
 const MainView = GObject.registerClass(class MainView extends Gtk.Stack {
     _init(params) {
-        params = Params.fill(params, { vexpand: true,
-                                       transition_type: Gtk.StackTransitionType.CROSSFADE,
-                                       transition_duration: 100,
-                                       visible: true });
-        super._init(params);
+        super._init(Object.assign({
+            vexpand: true,
+            transition_type: Gtk.StackTransitionType.CROSSFADE,
+            transition_duration: 100,
+            visible: true
+        }, params));
 
         this._addListviewPage('listviewPage');
         this.labelID = null;
diff --git a/src/org.gnome.SoundRecorder.src.gresource.xml b/src/org.gnome.SoundRecorder.src.gresource.xml
index 5ed3acc..c72fdd1 100644
--- a/src/org.gnome.SoundRecorder.src.gresource.xml
+++ b/src/org.gnome.SoundRecorder.src.gresource.xml
@@ -8,7 +8,6 @@
     <file>listview.js</file>
     <file>main.js</file>
     <file>mainWindow.js</file>
-    <file>params.js</file>
     <file>play.js</file>
     <file>preferences.js</file>
     <file>record.js</file>


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