Commit 08889eb4a7ea2e80c2927e65f0c26a46338c648e
1 parent
659f7786
Exists in
master
and in
5 other branches
Showing message on configuration update.
Showing
2 changed files
with
13 additions
and
6 deletions
Show diff stats
rpm/_service
... | ... | @@ -12,6 +12,8 @@ |
12 | 12 | <param name="url">https://github.com/PerryWerneck/pw3270.git</param> |
13 | 13 | |
14 | 14 | <param name="changesgenerate">enable</param> |
15 | + <param name="changesauthor">perry.werneck@gmail.com</param> | |
16 | + | |
15 | 17 | <param name="versionformat">@PARENT_TAG@</param> |
16 | 18 | <param name="scm">git</param> |
17 | 19 | </service> | ... | ... |
src/pw3270/common/config.c
... | ... | @@ -549,9 +549,7 @@ void set_integer_to_config(const gchar *group, const gchar *key, gint val) |
549 | 549 | |
550 | 550 | void configuration_deinit(void) |
551 | 551 | { |
552 | -#ifdef ENABLE_WINDOWS_REGISTRY | |
553 | - | |
554 | -#else | |
552 | +#if !defined(ENABLE_WINDOWS_REGISTRY) | |
555 | 553 | |
556 | 554 | gchar *text; |
557 | 555 | |
... | ... | @@ -562,13 +560,20 @@ void configuration_deinit(void) |
562 | 560 | |
563 | 561 | if(text) |
564 | 562 | { |
563 | + GError * error = NULL; | |
564 | + | |
565 | 565 | g_autofree gchar * name = g_strconcat(g_get_application_name(),".conf",NULL); |
566 | 566 | g_autofree gchar * filename = g_build_filename(g_get_user_config_dir(),name,NULL); |
567 | 567 | |
568 | - trace("Saving configuration in \"%s\"",filename); | |
569 | - | |
570 | 568 | g_mkdir_with_parents(g_get_user_config_dir(),S_IRUSR|S_IWUSR); |
571 | - g_file_set_contents(filename,text,-1,NULL); | |
569 | + g_file_set_contents(filename,text,-1,&error); | |
570 | + | |
571 | + if(error) { | |
572 | + g_message( _( "Can't save \"%s\": %s" ), filename, error->message); | |
573 | + g_error_free(error); | |
574 | + } else { | |
575 | + g_message( _("Configuration saved to %s"), filename); | |
576 | + } | |
572 | 577 | |
573 | 578 | } |
574 | 579 | ... | ... |