diff options
| author | Roman Zippel <zippel@linux-m68k.org> | 2004-01-06 03:46:03 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-06 03:46:03 -0800 |
| commit | 550fcfc195905fd3a99fa249757c678ac734acc7 (patch) | |
| tree | 3392a7cfde3310f570e18f2e69565d6595994a05 | |
| parent | cf2c4a429483a68475bbcce9a9364eb883aaf5b7 (diff) | |
[PATCH] gconf startup fixes
Let gconf find it's glade file, even it's started with an absolute path
and check srcdir so it also works if it's compiled outside of the tree.
| -rw-r--r-- | scripts/kconfig/gconf.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 792a0664c5ab..10d70e333ec9 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -1582,7 +1582,7 @@ void fixup_rootmenu(struct menu *menu) int main(int ac, char *av[]) { const char *name; - gchar *cur_dir, *exe_path; + char *env; gchar *glade_file; #ifndef LKC_DIRECT_LINK @@ -1598,12 +1598,13 @@ int main(int ac, char *av[]) //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); /* Determine GUI path */ - cur_dir = g_get_current_dir(); - exe_path = g_strdup(av[0]); - exe_path[0] = '/'; - glade_file = g_strconcat(cur_dir, exe_path, ".glade", NULL); - g_free(cur_dir); - g_free(exe_path); + env = getenv(SRCTREE); + if (env) + glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL); + else if (av[0][0] == '/') + glade_file = g_strconcat(av[0], ".glade", NULL); + else + glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); /* Load the interface and connect signals */ init_main_window(glade_file); |
