[gnome-shell] recorder: Use XDG video directory rather then home
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] recorder: Use XDG video directory rather then home
- Date: Fri, 24 Feb 2012 22:39:04 +0000 (UTC)
commit e322d98886302db2422a017c23664889fa793bb7
Author: Adel Gadllah <adel gadllah gmail com>
Date: Fri Feb 24 23:16:51 2012 +0100
recorder: Use XDG video directory rather then home
Save the recorded videos in the XDG user directory rather then in the home directory.
https://bugzilla.gnome.org/show_bug.cgi?id=670749
src/shell-recorder.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/shell-recorder.c b/src/shell-recorder.c
index 2e1f3ae..5b7b54f 100644
--- a/src/shell-recorder.c
+++ b/src/shell-recorder.c
@@ -1163,9 +1163,8 @@ get_absolute_path (char *maybe_relative)
path = g_strdup (maybe_relative);
else
{
- char *cwd = g_get_current_dir ();
- path = g_build_filename (cwd, maybe_relative, NULL);
- g_free (cwd);
+ char *video_dir = g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS);
+ path = g_build_filename (video_dir, maybe_relative, NULL);
}
return path;
@@ -1183,6 +1182,7 @@ recorder_open_outfile (ShellRecorder *recorder)
const char *pattern;
int flags;
int outfile = -1;
+ char *path;
recorder->count++;
@@ -1251,12 +1251,11 @@ recorder_open_outfile (ShellRecorder *recorder)
if (recorder->filename_has_count)
flags |= O_EXCL;
- outfile = open (filename->str, flags, 0666);
+ path = get_absolute_path (filename->str);
+ outfile = open (path, flags, 0666);
if (outfile != -1)
{
- char *path = get_absolute_path (filename->str);
g_printerr ("Recording to %s\n", path);
- g_free (path);
g_string_free (filename, TRUE);
goto out;
@@ -1286,6 +1285,8 @@ recorder_open_outfile (ShellRecorder *recorder)
}
out:
+ g_free (path);
+
if (outfile != -1)
recorder->unique = g_string_free (unique, FALSE);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]