diff options
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); } |