From 099b443dc88339a0c971d709235980f8bc4f7faf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Jul 2022 00:58:15 +0200 Subject: [PATCH 1/3] Tell user where the downloaded file is stored Signed-off-by: Steffen Jaeckel --- src/tools/http_download.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/http_download.c b/src/tools/http_download.c index bbbccce1..9920caa1 100644 --- a/src/tools/http_download.c +++ b/src/tools/http_download.c @@ -190,8 +190,8 @@ http_file_get(void* userdata) } else { if (!download->cancel) { http_print_transfer_update(download->window, download->url, - "Downloading '%s': done", - download->url); + "Downloading '%s': done\nSaved to '%s'", + download->url, download->filename); win_mark_received(download->window, download->url); } } From 095d40d3bd70c4058ad13c0e7956b90a14c5b3f7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 19 Aug 2022 10:24:26 +0200 Subject: [PATCH 2/3] tell the user to which file we're logging Signed-off-by: Steffen Jaeckel --- src/profanity.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/profanity.c b/src/profanity.c index 1bf734b8..2480dfef 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -203,6 +203,11 @@ _init(char* log_level, char* config_file, char* log_file, char* theme_name) } ui_init(); + if (prof_log_level == PROF_LEVEL_DEBUG) { + ProfWin* console = wins_get_console(); + win_println(console, THEME_DEFAULT, "-", "Debug mode enabled! Logging to: "); + win_println(console, THEME_DEFAULT, "-", get_log_file_location()); + } session_init(); cmd_init(); log_info("Initialising contact list"); From 25e56fb494232ce061de2590a8734a29b7169e3f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 19 Aug 2022 10:30:16 +0200 Subject: [PATCH 3/3] less strdup()+free() Improvement of f8ff93234eb118de2e69d0c4667a6cbbe90e8f8c Signed-off-by: Steffen Jaeckel --- src/log.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/log.c b/src/log.c index b85f1005..df93dd15 100644 --- a/src/log.c +++ b/src/log.c @@ -180,13 +180,10 @@ log_init(log_level_t filter, char* log_file) user_provided_log = TRUE; } - gchar* lf = files_get_log_file(log_file); + mainlogfile = files_get_log_file(log_file); - logp = fopen(lf, "a"); - g_chmod(lf, S_IRUSR | S_IWUSR); - mainlogfile = g_strdup(lf); - - g_free(lf); + logp = fopen(mainlogfile, "a"); + g_chmod(mainlogfile, S_IRUSR | S_IWUSR); } const char*