[gnome-sound-recorder] Check for delete event from Recordings directory. Re-create the directory if it's detected.
- From: Meg Ford (Margaret) <megford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder] Check for delete event from Recordings directory. Re-create the directory if it's detected.
- Date: Mon, 31 Aug 2015 00:47:25 +0000 (UTC)
commit e0d7840ee6509b912d09a364971a29d4b50acc54
Author: Meg Ford <megford gnome org>
Date: Sun Aug 30 19:44:02 2015 -0500
Check for delete event from Recordings directory.
Re-create the directory if it's detected.
src/listview.js | 12 +++++++++---
src/record.js | 5 -----
2 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/listview.js b/src/listview.js
index cc95abc..7541a3c 100644
--- a/src/listview.js
+++ b/src/listview.js
@@ -260,7 +260,7 @@ const Listview = new Lang.Class({
},
_onDirChanged: function(dirMonitor, file1, file2, eventType) {
- if (eventType == Gio.FileMonitorEvent.DELETED ||
+ if ((eventType == Gio.FileMonitorEvent.DELETED &&
!Gio.Application.get_default().saveDir.equal(file1)) ||
(eventType == Gio.FileMonitorEvent.CHANGES_DONE_HINT
&& MainWindow.recordPipeline == MainWindow.RecordPipelineStates.STOPPED)) {
stopVal = EnumeratorState.ACTIVE;
@@ -274,8 +274,14 @@ const Listview = new Lang.Class({
}
}
- if (eventType == Gio.FileMonitorEvent.CREATED)
- startRecording = true;
+ else if (eventType == Gio.FileMonitorEvent.CREATED) {
+ startRecording = true;
+ }
+
+ else if (eventType == Gio.FileMonitorEvent.DELETED &&
Gio.Application.get_default().saveDir.equal(file1)) {
+ Gio.Application.get_default().ensure_directory();
+ this._saveDir = Gio.Application.get_default().saveDir;
+ }
},
_getCapsForList: function(info) {
diff --git a/src/record.js b/src/record.js
index ed21f7c..fcb9cc9 100644
--- a/src/record.js
+++ b/src/record.js
@@ -30,7 +30,6 @@ const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
-const Application = imports.application;
const AudioProfile = imports.audioProfile;
const MainWindow = imports.mainWindow;
const Listview = imports.listview;
@@ -314,10 +313,6 @@ 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();
- 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]