[gnome-shell] recorder: Add support for %t in filename pattern
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] recorder: Add support for %t in filename pattern
- Date: Fri, 24 Feb 2012 23:19:12 +0000 (UTC)
commit 60557f4e0f2bc306c77a689513785319db847005
Author: Florian MÃllner <fmuellner gnome org>
Date: Fri Feb 24 18:07:02 2012 +0100
recorder: Add support for %t in filename pattern
Similar to the %d format for the current date, the new %t format
can be used to use the current time in screencast filenames.
https://bugzilla.gnome.org/show_bug.cgi?id=670753
src/shell-recorder.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-recorder.c b/src/shell-recorder.c
index 7a8e27e..3737df8 100644
--- a/src/shell-recorder.c
+++ b/src/shell-recorder.c
@@ -1228,6 +1228,21 @@ recorder_open_outfile (ShellRecorder *recorder)
g_date_time_unref (datetime);
}
break;
+ case 't':
+ {
+ /* Appends time according to locale */
+ GDateTime *datetime = g_date_time_new_now_local ();
+ char *time_str = g_date_time_format (datetime, "%0X");
+ char *s;
+
+ for (s = time_str; *s; s++)
+ if (G_IS_DIR_SEPARATOR (*s))
+ *s = ':';
+
+ g_string_append (filename, time_str);
+ g_free (time_str);
+ g_date_time_unref (datetime);
+ }
case 'u':
if (recorder->unique)
g_string_append (filename, recorder->unique);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]