aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-07 23:05:46 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-07 23:05:46 +0800
commit870ea8243da43be5386e699d2ba59135f8716e24 (patch)
tree9350dda599b6f4ca98fa0da6a5f8980902e799ca /src
parent7906aeb81fc96b59fc3cb3b137dfdf50a87af099 (diff)
downloadgsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.tar
gsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.tar.gz
gsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.tar.bz2
gsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.tar.lz
gsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.tar.xz
gsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.tar.zst
gsoc2013-empathy-870ea8243da43be5386e699d2ba59135f8716e24.zip
add the current date as suffix the the log name
Diffstat (limited to 'src')
-rw-r--r--src/empathy-debug-window.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index ffe3fa0b6..2cdf9967c 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -1070,7 +1070,10 @@ debug_window_save_clicked_cb (GtkToolButton *tool_button,
EmpathyDebugWindow *debug_window)
{
GtkWidget *file_chooser;
- gchar *name, *tmp;
+ gchar *name, *tmp = NULL;
+ char time_str[32];
+ time_t t;
+ struct tm *tm_s;
file_chooser = gtk_file_chooser_dialog_new (_("Save"),
GTK_WINDOW (debug_window), GTK_FILE_CHOOSER_ACTION_SAVE,
@@ -1086,7 +1089,17 @@ debug_window_save_clicked_cb (GtkToolButton *tool_button,
g_get_tmp_dir ());
name = get_active_cm_name (debug_window);
- tmp = g_strdup_printf ("%s.log", name);
+
+ t = time (NULL);
+ tm_s = localtime (&t);
+ if (tm_s != NULL)
+ {
+ if (strftime(time_str, sizeof (time_str), "%d-%m-%y_%H-%M-%S", tm_s))
+ tmp = g_strdup_printf ("%s-%s.log", name, time_str);
+ }
+
+ if (tmp == NULL)
+ tmp = g_strdup_printf ("%s.log", name);
g_free (name);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_chooser), tmp);