Commit 550fcfc1 authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[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.
parent cf2c4a42
...@@ -1582,7 +1582,7 @@ void fixup_rootmenu(struct menu *menu) ...@@ -1582,7 +1582,7 @@ void fixup_rootmenu(struct menu *menu)
int main(int ac, char *av[]) int main(int ac, char *av[])
{ {
const char *name; const char *name;
gchar *cur_dir, *exe_path; char *env;
gchar *glade_file; gchar *glade_file;
#ifndef LKC_DIRECT_LINK #ifndef LKC_DIRECT_LINK
...@@ -1598,12 +1598,13 @@ int main(int ac, char *av[]) ...@@ -1598,12 +1598,13 @@ int main(int ac, char *av[])
//add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
/* Determine GUI path */ /* Determine GUI path */
cur_dir = g_get_current_dir(); env = getenv(SRCTREE);
exe_path = g_strdup(av[0]); if (env)
exe_path[0] = '/'; glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL);
glade_file = g_strconcat(cur_dir, exe_path, ".glade", NULL); else if (av[0][0] == '/')
g_free(cur_dir); glade_file = g_strconcat(av[0], ".glade", NULL);
g_free(exe_path); else
glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL);
/* Load the interface and connect signals */ /* Load the interface and connect signals */
init_main_window(glade_file); init_main_window(glade_file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment