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



commit 5c691490f2beaeaedfebd7780de81e58de508f8f
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/meson.build                               |   3 +-
 src/org.gnome.SoundRecorder.src.gresource.xml |   1 -
 src/params.js                                 | 128 --------------------------
 4 files changed, 17 insertions(+), 146 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/meson.build b/src/meson.build
index e14efe6..518ebf1 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -6,7 +6,6 @@ sound_recorder_sources = files(
   'listview.js',
   'main.js',
   'mainWindow.js',
-  'params.js',
   'play.js',
   'preferences.js',
   'record.js',
@@ -36,4 +35,4 @@ gnome.compile_resources(
   gresource_bundle: true,
   install: true,
   install_dir: sound_recoder_pkgdatadir
-)
\ No newline at end of file
+)
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]