[gnome-shell/gnome-3-8] screencast: Fix return value in case of invalid file template



commit 73903400c588034387856aef4a61a391232e0d96
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed May 22 16:42:00 2013 +0200

    screencast: Fix return value in case of invalid file template
    
    If we are passed an invalid file template, ShellRecorder.record()
    will return a %NULL filename; as the Screencast DBus interface
    expects a string return value, we cannot return the value unmodified
    in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700842

 js/ui/screencast.js |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/screencast.js b/js/ui/screencast.js
index 642d40a..4a14933 100644
--- a/js/ui/screencast.js
+++ b/js/ui/screencast.js
@@ -105,7 +105,8 @@ const ScreencastService = new Lang.Class({
 
             recorder.set_file_template(fileTemplate);
             this._applyOptionalParameters(recorder, options);
-            returnValue = recorder.record();
+            let [success, fileName] = recorder.record();
+            returnValue = [success, fileName ? fileName : ''];
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));
@@ -125,7 +126,8 @@ const ScreencastService = new Lang.Class({
             recorder.set_file_template(fileTemplate);
             recorder.set_area(x, y, width, height);
             this._applyOptionalParameters(recorder, options);
-            returnValue = recorder.record();
+            let [success, fileName] = recorder.record();
+            returnValue = [success, fileName ? fileName : ''];
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));


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