summaryrefslogtreecommitdiffstats
path: root/src/gui-gtk
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-05-04 14:39:37 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-05-04 14:39:37 +0200
commit58e7efce3d5ac71e308e7e44176473cd66e8ad26 (patch)
treed4822587940487f2910e925990a55377e60e05bd /src/gui-gtk
parent27e7d86db7c6c96e8da75e8e8dda6359b9e73c41 (diff)
downloadabrt-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-gtk')
-rw-r--r--src/gui-gtk/main.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index ee19ac8c..e9b175aa 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -25,8 +25,6 @@
# include <locale.h>
#endif
-#define PROGNAME "abrt-gui"
-
static int inotify_fd = -1;
static GIOChannel *channel_inotify;
static int channel_inotify_event_id = -1;
@@ -193,6 +191,8 @@ void scan_dirs_and_add_to_dirlist(void)
int main(int argc, char **argv)
{
+ abrt_init(argv);
+
/* I18n */
setlocale(LC_ALL, "");
#if ENABLE_NLS
@@ -204,16 +204,11 @@ int main(int argc, char **argv)
* desktops which uses the name to find the corresponding .desktop file
* trac#180
*/
- 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] [DIR]...\n"
+ "\b [-vp] [DIR]...\n"
"\n"
"Shows list of ABRT dump directories in specified DIR(s)\n"
"(default DIRs: "DEBUG_DUMPS_DIR" $HOME/.abrt/spool)"
@@ -230,15 +225,7 @@ int main(int argc, char **argv)
};
unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
- putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose));
- char *pfx = getenv("ABRT_PROG_PREFIX");
- if (pfx && string_to_bool(pfx))
- msg_prefix = PROGNAME;
- if (opts & OPT_p)
- {
- msg_prefix = PROGNAME;
- putenv((char*)"ABRT_PROG_PREFIX=1");
- }
+ export_abrt_envvars(opts & OPT_p);
GtkWidget *main_window = create_main_window();