Commit 33d7252dbea61cae1347cc1d965e88fd075c7e34
1 parent
14e4ac20
Exists in
v5.2
Fixing warnings when using default print settings.
Showing
2 changed files
with
18 additions
and
9 deletions
Show diff stats
src/pw3270/linux/print.c
| @@ -31,6 +31,7 @@ | @@ -31,6 +31,7 @@ | ||
| 31 | #include <v3270.h> | 31 | #include <v3270.h> |
| 32 | #include <v3270/print.h> | 32 | #include <v3270/print.h> |
| 33 | #include <lib3270/selection.h> | 33 | #include <lib3270/selection.h> |
| 34 | + #include <lib3270/log.h> | ||
| 34 | 35 | ||
| 35 | #define FONT_CONFIG "font-family" | 36 | #define FONT_CONFIG "font-family" |
| 36 | #define DEFAULT_FONT "Courier New" | 37 | #define DEFAULT_FONT "Courier New" |
| @@ -50,11 +51,15 @@ | @@ -50,11 +51,15 @@ | ||
| 50 | GKeyFile * conf = get_application_keyfile(); | 51 | GKeyFile * conf = get_application_keyfile(); |
| 51 | GError * err = NULL; | 52 | GError * err = NULL; |
| 52 | 53 | ||
| 53 | - if(g_key_file_has_group(conf,"print_settings") && !gtk_print_settings_load_key_file(settings,conf,"print_settings",&err)) | 54 | + debug("print_settings=%s",g_key_file_has_group(conf,"print_settings") ? "TRUE" : "FALSE"); |
| 55 | + if(g_key_file_has_group(conf,"print_settings")) | ||
| 54 | { | 56 | { |
| 55 | - g_warning("Error getting print settings: %s",err->message); | ||
| 56 | - g_error_free(err); | ||
| 57 | - err = NULL; | 57 | + if(!gtk_print_settings_load_key_file(settings,conf,"print_settings",&err)) |
| 58 | + { | ||
| 59 | + g_warning("Error getting print settings: %s",err->message); | ||
| 60 | + g_error_free(err); | ||
| 61 | + err = NULL; | ||
| 62 | + } | ||
| 58 | } | 63 | } |
| 59 | #ifdef DEBUG | 64 | #ifdef DEBUG |
| 60 | else | 65 | else |
| @@ -63,11 +68,14 @@ | @@ -63,11 +68,14 @@ | ||
| 63 | } | 68 | } |
| 64 | #endif // DEBUG | 69 | #endif // DEBUG |
| 65 | 70 | ||
| 66 | - if(g_key_file_has_group(conf,"page_setup") && !gtk_page_setup_load_key_file(setup,conf,"page_setup",&err)) | 71 | + if(g_key_file_has_group(conf,"page_setup")) |
| 67 | { | 72 | { |
| 68 | - g_warning("Error getting page setup: %s",err->message); | ||
| 69 | - g_error_free(err); | ||
| 70 | - err = NULL; | 73 | + if(!gtk_page_setup_load_key_file(setup,conf,"page_setup",&err)) |
| 74 | + { | ||
| 75 | + g_warning("Error getting page setup: %s",err->message); | ||
| 76 | + g_error_free(err); | ||
| 77 | + err = NULL; | ||
| 78 | + } | ||
| 71 | } | 79 | } |
| 72 | #ifdef DEBUG | 80 | #ifdef DEBUG |
| 73 | else | 81 | else |
src/pw3270/print.c
| @@ -126,7 +126,8 @@ | @@ -126,7 +126,8 @@ | ||
| 126 | 126 | ||
| 127 | { | 127 | { |
| 128 | // Setup async mode | 128 | // Setup async mode |
| 129 | - gboolean async = get_boolean_from_config("terminal","allow_async_print",TRUE); | 129 | + gboolean async = get_boolean_from_config("print","allow_async",TRUE); |
| 130 | + debug("Allow async is %s",async ? "enabled" : "disabled"); | ||
| 130 | gtk_print_operation_set_allow_async(operation,async); | 131 | gtk_print_operation_set_allow_async(operation,async); |
| 131 | } | 132 | } |
| 132 | 133 |