diff options
author | jstebbins <[email protected]> | 2009-06-26 17:55:39 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-26 17:55:39 +0000 |
commit | b045e7801534b4e2549fdae22d90491ee2ec60d7 (patch) | |
tree | 7b98a867868946dc9efed429b3e6f79ec6a66020 /gtk/src/callbacks.c | |
parent | af876ffaa55ba8c063703a18c4e0329349362144 (diff) |
LinGui: add individual activity log longevity preference option
- options are week, month, year, immortal. default is immortal.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2630 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/callbacks.c')
-rw-r--r-- | gtk/src/callbacks.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index cc6ab7643..0b3e0cc12 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1792,7 +1792,7 @@ suspend_cb(countdown_t *cd) cd->timeout--; if (cd->timeout == 0) { - gtk_widget_destroy (cd->dlg); + gtk_widget_destroy (GTK_WIDGET(cd->dlg)); ghb_suspend_gpm(); return FALSE; } @@ -1919,13 +1919,19 @@ static void prune_logs(signal_user_data_t *ud) { gchar *dest_dir; + gint days; // Only prune logs stored in the default config dir location + days = ghb_settings_combo_int(ud->settings, "LogLongevity"); + if (days > 365) + return; + dest_dir = ghb_get_user_config_dir("EncodeLogs"); if (g_file_test(dest_dir, G_FILE_TEST_IS_DIR)) { const gchar *file; - int week = 7*24*60*60; + gint duration = days * 24 * 60 * 60; + GDir *gdir = g_dir_open(dest_dir, 0, NULL); time_t now; @@ -1938,7 +1944,7 @@ prune_logs(signal_user_data_t *ud) path = g_strdup_printf("%s/%s", dest_dir, file); g_stat(path, &stbuf); - if (now - stbuf.st_mtime > week) + if (now - stbuf.st_mtime > duration) { g_unlink(path); } |