=== modified file 'lib/launchpad-integration.c' --- lib/launchpad-integration.c 2010-02-05 02:41:07 +0000 +++ lib/launchpad-integration.c 2010-02-06 19:57:48 +0000 @@ -13,6 +13,21 @@ static char *sourcepackagename = NULL; +int +have_program_in_path (const char *name) +{ + gchar *path = g_find_program_in_path(name); + if(path) + { + //g_find_program_in_path: If program is already an absolute path, returns a copy + // of program if program exists and is executable, and NULL otherwise. + if(!g_path_is_absolute(name)) + g_free(path); + return 1; + } + return 0; +} + void launchpad_integration_set_sourcepackagename (const char *name) { @@ -180,7 +195,7 @@ void launchpad_integration_add_ui (GtkUIManager *ui, const char *path) { - if (!g_find_program_in_path ("launchpad-integration")) { + if (!have_program_in_path ("launchpad-integration")) { return; } @@ -231,7 +246,7 @@ gboolean separator_before, gboolean separator_after) { - if (!g_find_program_in_path ("launchpad-integration")) { + if (!have_program_in_path ("launchpad-integration")) { return; } @@ -296,7 +311,7 @@ gboolean separator_before, gboolean separator_after) { - if (!g_find_program_in_path ("launchpad-integration")) { + if (!have_program_in_path ("launchpad-integration")) { return; }