[gnome-sound-recorder] Bug 744989



commit c0b5edd249050ee3d3be169431f2c16604144a1d
Author: Meg Ford <megford gnome org>
Date:   Mon May 18 20:57:38 2015 -0500

    Bug 744989
    
    Check for Recordings directory before file creation. Create it if it's not there.

 src/application.js |    4 ++++
 src/record.js      |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index e34d641..24da08f 100644
--- a/src/application.js
+++ b/src/application.js
@@ -85,6 +85,10 @@ const Application = new Lang.Class({
         this._initAppMenu();
         application = this;
         settings = new Gio.Settings({ schema: 'org.gnome.gnome-sound-recorder' });
+        this.ensure_directory()
+    },
+    
+    ensure_directory: function() {
         /* Translators: "Recordings" here refers to the name of the directory where the application places 
files */
         let path = GLib.build_filenamev([GLib.get_home_dir(), _("Recordings")]);
 
diff --git a/src/record.js b/src/record.js
index f58a1be..6cda67b 100644
--- a/src/record.js
+++ b/src/record.js
@@ -314,6 +314,10 @@ const BuildFileName = new Lang.Class({
     buildInitialFilename: function() {
         let fileExtensionName = MainWindow.audioProfile.fileExtensionReturner();
         let dir = Gio.Application.get_default().saveDir;
+        if (dir == null) {
+            Application.ensure_directory();
+            let dir = Gio.Application.get_default().saveDir;
+        }
         this.dateTime = GLib.DateTime.new_now_local();
         this.clipNumber = Listview.trackNumber + 1;
         this.clipNumberString = this.clipNumber.toString();


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