[gnome-sound-recorder] Fix crashes when selecting a recording



commit 4dba2aa417829f4ccb465598707c8a5c43900fc3
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Jan 18 00:48:25 2019 +0100

    Fix crashes when selecting a recording
    
    bdaf42fb228f41d6920a28fee1fa9211c8d5ced4 removed widget property of MainWindow
    class, causing crashes for some users.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-sound-recorder/issues/39

 src/mainWindow.js | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 3ac5cc2..dca8038 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -192,8 +192,8 @@ var MainView = new Lang.Class({
         if (play.getPipeStates() == PipelineStates.PLAYING) {
             play.stopPlaying();
             var listRow = this.listBox.get_selected_row();
-            var rowWidget = listRow.get_child(this.widget);
-            rowWidget.foreach(Lang.bind(this,
+            var rowGrid = listRow.get_child();
+            rowGrid.foreach(Lang.bind(this,
                 function(child) {
 
                     if (child.name == "PauseButton") {
@@ -591,8 +591,8 @@ var MainView = new Lang.Class({
     hasPreviousSelRow: function() {
        this.destroyLoadMoreButton();
            if (previousSelRow != null) {
-              var rowWidget = previousSelRow.get_child(this.widget);
-              rowWidget.foreach(Lang.bind(this,
+              var rowGrid = previousSelRow.get_child();
+              rowGrid.foreach(Lang.bind(this,
                 function(child) {
                     var alwaysShow = child.get_no_show_all();
 
@@ -641,9 +641,9 @@ var MainView = new Lang.Class({
             }
 
             previousSelRow = selectedRow;
-            var selectedRowWidget = previousSelRow.get_child(this.widget);
-            selectedRowWidget.show_all();
-            selectedRowWidget.foreach(Lang.bind(this,
+            var selectedRowGrid = previousSelRow.get_child();
+            selectedRowGrid.show_all();
+            selectedRowGrid.foreach(Lang.bind(this,
                 function(child) {
                     var alwaysShow = child.get_no_show_all();
 
@@ -663,8 +663,8 @@ var MainView = new Lang.Class({
 
     _getFileFromRow: function(selected) {
         var fileForAction = null;
-        var rowWidget = selected.get_child(this.fileName);
-        rowWidget.foreach(Lang.bind(this,
+        var rowGrid = selected.get_child();
+        rowGrid.foreach(Lang.bind(this,
             function(child) {
 
                 if (child.name == "FileNameLabel") {
@@ -712,8 +712,8 @@ var MainView = new Lang.Class({
 
     setNameLabel: function(newName, oldName, index) {
         var selected = this.listBox.get_row_at_index(index);
-        var rowWidget = selected.get_child(oldName);
-        rowWidget.foreach(Lang.bind(this,
+        var rowGrid = selected.get_child();
+        rowGrid.foreach(Lang.bind(this,
             function(child) {
 
                 if (child.name == "FileNameLabel") {
@@ -722,7 +722,7 @@ var MainView = new Lang.Class({
                     child.label = markup;
                 }
              }));
-        rowWidget.set_name(newName);
+        rowGrid.set_name(newName);
     },
 
     onPause: function(listRow) {
@@ -730,8 +730,8 @@ var MainView = new Lang.Class({
 
         if (activeState == PipelineStates.PLAYING) {
             play.pausePlaying();
-            var rowWidget = listRow.get_child(this.widget);
-            rowWidget.foreach(Lang.bind(this,
+            var rowGrid = listRow.get_child();
+            rowGrid.foreach(Lang.bind(this,
                 function(child) {
 
                     if (child.name == "PauseButton") {
@@ -754,8 +754,8 @@ var MainView = new Lang.Class({
         if (activeState != PipelineStates.PLAYING) {
             play.startPlaying();
 
-            var rowWidget = listRow.get_child(this.widget);
-            rowWidget.foreach(Lang.bind(this,
+            var rowGrid = listRow.get_child();
+            rowGrid.foreach(Lang.bind(this,
                 function(child) {
 
                     if (child.name == "InfoButton" || child.name == "DeleteButton" ||


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