diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-04 14:39:37 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-04 14:39:37 +0200 |
commit | 58e7efce3d5ac71e308e7e44176473cd66e8ad26 (patch) | |
tree | d4822587940487f2910e925990a55377e60e05bd /src/gui-wizard-gtk/main.c | |
parent | 27e7d86db7c6c96e8da75e8e8dda6359b9e73c41 (diff) | |
download | abrt-58e7efce3d5ac71e308e7e44176473cd66e8ad26.tar.gz abrt-58e7efce3d5ac71e308e7e44176473cd66e8ad26.tar.xz abrt-58e7efce3d5ac71e308e7e44176473cd66e8ad26.zip |
move $ABRT_foo checking and setting into helper routines.
I'm sick of fixing incorrect PROGNAME defines.
Now g_progname is a variable and it is set from argv[0].
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/gui-wizard-gtk/main.c')
-rw-r--r-- | src/gui-wizard-gtk/main.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c index 2d036085..d1341b4b 100644 --- a/src/gui-wizard-gtk/main.c +++ b/src/gui-wizard-gtk/main.c @@ -25,8 +25,6 @@ # include <locale.h> #endif -#define PROGNAME "bug-reporting-wizard" - char *g_glade_file = NULL; char *g_dump_dir_name = NULL; char *g_analyze_events = NULL; @@ -62,6 +60,8 @@ void reload_problem_data_from_dump_dir(void) int main(int argc, char **argv) { + abrt_init(argv); + /* I18n */ setlocale(LC_ALL, ""); #if ENABLE_NLS @@ -69,16 +69,11 @@ int main(int argc, char **argv) textdomain(PACKAGE); #endif - g_set_prgname("abrt"); gtk_init(&argc, &argv); - char *env_verbose = getenv("ABRT_VERBOSE"); - if (env_verbose) - g_verbose = atoi(env_verbose); - /* Can't keep these strings/structs static: _() doesn't support that */ const char *program_usage_string = _( - PROGNAME" [-vp] [-g GUI_FILE] DIR\n" + "\b [-vp] [-g GUI_FILE] DIR\n" "\n" "GUI tool to analyze and report problem saved in specified DIR" ); @@ -94,20 +89,13 @@ int main(int argc, char **argv) OPT_BOOL( 'p', NULL, NULL , _("Add program names to log")), OPT_END() }; - unsigned opts = parse_opts(argc, argv, program_options, program_usage_string); - - putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); - if (opts & OPT_p) - { - msg_prefix = PROGNAME; - putenv((char*)"ABRT_PROG_PREFIX=1"); - } - argv += optind; if (!argv[0] || argv[1]) /* zero or >1 arguments */ show_usage_and_die(program_usage_string, program_options); + export_abrt_envvars(opts & OPT_p); + g_dump_dir_name = xstrdup(argv[0]); /* load /etc/abrt/events/foo.{conf,xml} stuff |