Commit 1e3749d3 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Do some DesktopItem porting, remove some FIXMEs

Thu Sep 20 15:17:33 2001  George Lebl <jirka@5z.com>

	* launcher.c, swallow.c: Do some DesktopItem porting, remove some
	  FIXMEs

	* *.[ch], panel-util.[ch]: whack panel_file_exists and
	  panel_is_program_in_path, since those are now nice and working
	  in the libs.
parent efb96a0e
Thu Sep 20 15:17:33 2001 George Lebl <jirka@5z.com>
* launcher.c, swallow.c: Do some DesktopItem porting, remove some
FIXMEs
* *.[ch], panel-util.[ch]: whack panel_file_exists and
panel_is_program_in_path, since those are now nice and working
in the libs.
2001-09-10 Frank Belew <frb@ximian.com>
* panel/launcher.c: changed references to removed functions to use
gnome_desktop_item_get_string instead
......
......@@ -15,9 +15,11 @@ EXTRA_SUBDIRS = config help
INCLUDES = \
-I. \
-I$(srcdir) \
-I$(top_srcdir)/gnome-desktop \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(top_builddir)/panel \
-DGNOME_CORE_INTERNAL \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGNOME_DATADIR=\""$(datadir)"\" \
-DGLADEDIR=\""$(datadir)/gnome/panel"\" \
......
......@@ -159,7 +159,7 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
menu_properties(menu->info->data);
else if(strcmp(menu->name,"edit_menus")==0) {
char *tmp;
if((tmp = panel_is_program_in_path("gmenu"))) {
if((tmp = gnome_is_program_in_path("gmenu"))) {
gnome_execute_async (g_get_home_dir (), 1, &tmp);
g_free(tmp);
}
......
......@@ -22,7 +22,7 @@ linux_battery_exists (void)
char buf[200] = "";
int foo;
if ( ! panel_file_exists("/proc/apm"))
if ( ! g_file_test ("/proc/apm", G_FILE_TEST_EXISTS))
return FALSE;
fp = fopen ("/proc/apm", "r");
......@@ -357,7 +357,7 @@ conditional_parse (const char *conditional, int len)
}
cond = FALSE;
if (panel_file_exists (file)) {
if (g_file_test (file, G_FILE_TEST_EXISTS)) {
cond = TRUE;
} else {
char *full = gnome_datadir_file (file);
......
......@@ -45,7 +45,7 @@ internal_get_distribution_type (void)
DistributionInfo *ptr;
for (ptr = distribution_info; ptr->type != DISTRIBUTION_UNKNOWN; ptr++)
if (panel_file_exists (ptr->version_file))
if (g_file_test (ptr->version_file, G_FILE_TEST_EXISTS))
return ptr->type;
return DISTRIBUTION_UNKNOWN;
......
......@@ -296,7 +296,7 @@ display_gmc_menu (void)
if ( ! checked_path) {
char *gmc_client;
gmc_client = panel_is_program_in_path ("gmc-client");
gmc_client = gnome_is_program_in_path ("gmc-client");
if (gmc_client == NULL)
got_gmc = FALSE;
......@@ -378,7 +378,7 @@ append_desktop_menu (GtkWidget *menu_bar)
item = add_menu_separator (menu);
gmc_menu_items = g_list_prepend (gmc_menu_items, item);
char_tmp = panel_is_program_in_path ("xscreensaver");
char_tmp = gnome_is_program_in_path ("xscreensaver");
if (char_tmp) {
item = pixmap_menu_item_new (_("Lock Screen"),
"gnome-lockscreen.png");
......
......@@ -304,7 +304,7 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
} else {
char *check;
int i;
check = panel_is_program_in_path("gnome-terminal");
check = gnome_is_program_in_path("gnome-terminal");
argv = g_new(char *, 2 + temp_argc + 1);
tofree = g_slist_prepend(tofree, argv);
argc = 2 + temp_argc;
......
......@@ -18,8 +18,10 @@
#include <string.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gnome-desktop/gnome-desktop-item.h>
#include "gnome-desktop-item.h"
#include "gnome-ditem-edit.h"
#include "panel-include.h"
......@@ -46,60 +48,60 @@ enum {
CLOSE_BUTTON
};
static void
launch (Launcher *launcher, int argc, char *argv[])
launch_url (Launcher *launcher)
{
#ifdef FIXME
GnomeDesktopItem *item;
GNOME_DesktopEntryType type;
gchar *command;
const char *url;
GError *error = NULL;
g_return_if_fail(launcher != NULL);
g_return_if_fail(launcher->ditem != NULL);
g_return_if_fail (launcher != NULL);
g_return_if_fail (launcher->ditem != NULL);
item = launcher->ditem;
type = gnome_desktop_item_get_type(item);
command = gnome_desktop_item_get_command(item);
if(!command) {
GtkWidget *dlg;
dlg = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("This launch icon does not "
"specify a program to run"));
gtk_window_set_wmclass(GTK_WINDOW(dlg),
"no_exec_dialog","Panel");
gtk_widget_show_all(dlg);
panel_set_dialog_layer(dlg);
url = gnome_desktop_item_get_string (item,
GNOME_DESKTOP_ITEM_URL);
if (url == NULL) {
panel_error_dialog ("no_url_dialog",
_("This launch icon does not "
"specify a url to show"));
return;
}
if (type == GNOME_DESKTOP_ENTRY_TYPE_URL) {
gnome_url_show (command);
} else if (type == GNOME_DESKTOP_ENTRY_TYPE_PANEL_APPLET) {
char *goad_id;
goad_id = get_applet_goad_id_from_dentry (item);
gnome_url_show (url, &error);
if (error != NULL) {
panel_error_dialog ("cant_show_url_dialog",
_("Cannot show %s\n%s"),
url, error->message);
g_error_clear (&error);
}
}
if (goad_id != NULL) {
load_extern_applet (goad_id, NULL,
NULL, -1,
FALSE, FALSE);
} else {
g_warning (_("Can't get goad_id from desktop entry!"));
}
g_free (goad_id);
} else {
char *curdir = g_get_current_dir ();
chdir (g_get_home_dir ());
static void
launch (Launcher *launcher, int argc, char *argv[])
{
GnomeDesktopItem *item;
GnomeDesktopItemType type;
gnome_desktop_entry_launch_with_args (item, argc, argv);
g_return_if_fail(launcher != NULL);
g_return_if_fail(launcher->ditem != NULL);
item = launcher->ditem;
type = gnome_desktop_item_get_entry_type (item);
chdir (curdir);
g_free (curdir);
if (type == GNOME_DESKTOP_ITEM_TYPE_URL) {
launch_url (launcher);
} else {
GError *error = NULL;
gnome_desktop_item_launch (item, argc, argv, &error);
if (error != NULL) {
panel_error_dialog ("cannot_launch_icon",
_("Cannot launch icon\n%s"),
error->message);
g_error_clear (&error);
}
}
if(global_config.drawer_auto_close) {
......@@ -117,13 +119,12 @@ launch (Launcher *launcher, int argc, char *argv[])
}
g_free (command);
#endif
}
static void
launch_cb (GtkWidget *widget, gpointer data)
{
launch(data,0,NULL);
launch (data, 0, NULL);
}
static void
......@@ -136,32 +137,26 @@ drag_data_received_cb (GtkWidget *widget,
guint time,
Launcher *launcher)
{
#ifdef FIXME
GList *li, *files;
int argc;
char **argv;
int i;
GList *list;
GError *error = NULL;
g_return_if_fail(launcher!=NULL);
list = gnome_vfs_uri_list_parse ((char *)selection_data->data);
files = gnome_uri_list_extract_filenames((char *)selection_data->data);
argc = g_list_length(files);
argv = g_new(char *,argc+1);
argv[argc] = NULL;
gnome_desktop_item_drop_uri_list (item, list &error);
if (error != NULL) {
panel_error_dialog ("cannot_launch_icon",
_("Cannot launch icon\n%s"),
error->message);
g_error_clear (&error);
}
for(i=0,li = files; li; i++,li = g_list_next(li))
argv[i]=li->data;
launch(launcher,argc,argv);
gnome_uri_list_free_strings (files);
g_free(argv);
#endif
gnome_vfs_uri_list_free (list);
gtk_drag_finish(context,TRUE,FALSE,time);
gtk_drag_finish (context, TRUE, FALSE, time);
}
static void
destroy_launcher(GtkWidget *widget, gpointer data)
destroy_launcher (GtkWidget *widget, gpointer data)
{
Launcher *launcher = data;
GtkWidget *prop_dialog = launcher->prop_dialog;
......@@ -177,18 +172,14 @@ free_launcher(gpointer data)
{
Launcher *launcher = data;
#ifdef FIXME
gnome_desktop_item_free(launcher->ditem);
#endif
gnome_desktop_item_unref (launcher->ditem);
launcher->ditem = NULL;
#ifdef FIXME
if (launcher->revert_ditem != NULL)
gnome_desktop_item_free(launcher->revert_ditem);
#endif
gnome_desktop_item_unref (launcher->revert_ditem);
launcher->revert_ditem = NULL;
g_free(launcher);
g_free (launcher);
}
static gboolean
......@@ -324,12 +315,11 @@ create_launcher (const char *parameters, GnomeDesktopItem *ditem)
if (default_app_pixmap == NULL)
default_app_pixmap = gnome_pixmap_file ("gnome-unknown.png");
if(ditem == NULL) {
#ifdef FIXME
if (ditem == NULL) {
if (parameters == NULL) {
return NULL;
} else if (*parameters == '/') {
dentry = gnome_desktop_entry_load_unconditional (parameters);
ditem = gnome_desktop_item_new_from_file (parameters);
} else {
char *apps_par, *entry, *extension;
......@@ -353,7 +343,7 @@ create_launcher (const char *parameters, GnomeDesktopItem *ditem)
entry = g_strconcat (merge_merge_dir, "/",
parameters,
extension, NULL);
if ( ! panel_file_exists (entry)) {
if ( ! g_file_test (entry, G_FILE_TEST_EXISTS)) {
g_free (entry);
entry = NULL;
}
......@@ -979,7 +969,7 @@ launcher_get_unique_file (void)
full = launcher_file_name (fname);
g_free (fname);
if ( ! panel_file_exists (full))
if ( ! g_file_test (full, G_FILE_TEST_EXISTS))
return full;
}
......
......@@ -12,7 +12,7 @@
#define LAUNCHER_H
#include <panel-widget.h>
#include <gnome-desktop/gnome-desktop-item.h>
#include "gnome-desktop-item.h"
G_BEGIN_DECLS
......
......@@ -539,7 +539,7 @@ main(int argc, char **argv)
#ifndef PER_SESSION_CONFIGURATION
real_global_path = gnome_config_get_real_path (old_panel_cfg_path);
real_global_path = "";
if ( ! panel_file_exists (real_global_path)) {
if ( ! g_file_test (real_global_path, G_FILE_TEST_EXISTS)) {
g_free (old_panel_cfg_path);
old_panel_cfg_path = g_strdup ("/panel.d/default/");
}
......
......@@ -428,7 +428,7 @@ fr_fill_dir(FileRec *fr, int sublevels)
ditem = gnome_desktop_item_load_unconditional (name);
if (ditem != NULL &&
ditem->tryexec != NULL) {
tryexec_path = panel_is_program_in_path (ditem->tryexec);
tryexec_path = gnome_is_program_in_path (ditem->tryexec);
if (tryexec_path == NULL) {
dr->tryexecs = g_slist_prepend (dr->tryexecs, ditem->tryexec);
ditem->tryexec = NULL;
......@@ -632,7 +632,7 @@ fr_check_and_reread (FileRec *fr)
/* recheck tryexecs */
for (li = dr->tryexecs; ! reread && li != NULL; li = li->next) {
char *tryexec = li->data;
char *p = panel_is_program_in_path (tryexec);
char *p = gnome_is_program_in_path (tryexec);
if (p != NULL) {
reread = TRUE;
......@@ -680,7 +680,8 @@ fr_check_and_reread (FileRec *fr)
dr->ditemlast_stat = curtime;
if(stat(p,&s)==-1) {
/* perhaps the directory is gone */
if ( ! panel_file_exists (ffr->name)) {
if ( ! g_file_test (ffr->name,
G_FILE_TEST_EXISTS)) {
reread = TRUE;
break;
}
......@@ -762,7 +763,8 @@ fr_check_and_reread (FileRec *fr)
any_change = TRUE;
}
if (ffr->tryexec_path != NULL &&
! panel_file_exists (ffr->tryexec_path)) {
! g_file_test (ffr->tryexec_path,
G_FILE_TEST_EXISTS)) {
reread = TRUE;
}
break;
......
......@@ -3,7 +3,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <gnome-desktop/gnome-desktop-item.h>
#include "gnome-desktop-item.h"
G_BEGIN_DECLS
......
......@@ -74,7 +74,7 @@ get_real_menu_path(const char *arguments)
else
this_menu = gnome_unconditional_datadir_file (arguments);
if (!panel_file_exists (this_menu)) {
if ( ! g_file_test (this_menu, G_FILE_TEST_EXISTS)) {
g_warning("menu %s does not exist "
"(arguments are %s)",
this_menu, arguments);
......@@ -124,7 +124,7 @@ got_gmenu (void)
if (checked)
return got_it;
tmp = panel_is_program_in_path ("gmenu");
tmp = gnome_is_program_in_path ("gmenu");
if (tmp != NULL)
got_it = TRUE;
else
......@@ -290,7 +290,7 @@ properties_apply_callback (Menu *menu)
if (menu->custom_icon &&
menu->custom_icon_file != NULL &&
panel_file_exists (menu->custom_icon_file))
g_file_test (menu->custom_icon_file, G_FILE_TEST_EXISTS))
pixmap_name = g_strdup (menu->custom_icon_file);
else
pixmap_name = get_pixmap(this_menu, (strcmp (menu->path, ".") == 0));
......
......@@ -34,7 +34,7 @@ rh_submenu_to_display(GtkWidget *menuw, GtkMenuItem *menuitem)
int r;
int do_read = FALSE;
char *userrh;
if(!panel_file_exists(REDHAT_MENUDIR))
if ( ! g_file_test (REDHAT_MENUDIR, G_FILE_TEST_IS_DIR))
return;
userrh = gnome_util_prepend_user_home(".wmconfig/");
......@@ -207,7 +207,7 @@ add_redhat_entry(GSList *list, char *file)
char *s = read_word(&p);
g_free(rh->u.item.icon);
if(*s == '/') {
if(panel_file_exists(s))
if (g_file_test (s, G_FILE_TEST_EXISTS))
rh->u.item.icon = s;
else {
g_free(s);
......@@ -215,7 +215,8 @@ add_redhat_entry(GSList *list, char *file)
}
} else {
rh->u.item.icon = g_concat_dir_and_file("/usr/share/icons", s);
if(!panel_file_exists(rh->u.item.icon)) {
if ( ! g_file_test (rh->u.item.icon,
G_FILE_TEST_EXISTS)) {
g_free(rh->u.item.icon);
rh->u.item.icon = gnome_pixmap_file(s);
}
......@@ -225,15 +226,16 @@ add_redhat_entry(GSList *list, char *file)
char *s = read_word(&p);
g_free(rh->u.item.mini_icon);
if(*s == '/') {
if(panel_file_exists(s))
if (g_file_test (s, G_FILE_TEST_EXISTS)) {
rh->u.item.mini_icon = s;
else {
} else {
g_free(s);
rh->u.item.mini_icon = NULL;
}
} else {
rh->u.item.mini_icon = g_concat_dir_and_file("/usr/share/icons/mini", s);
if(!panel_file_exists(rh->u.item.mini_icon)) {
if ( ! g_file_test (rh->u.item.mini_icon,
G_FILE_TEST_EXISTS)) {
g_free(rh->u.item.mini_icon);
rh->u.item.mini_icon = gnome_pixmap_file(s);
}
......
......@@ -157,21 +157,17 @@ get_default_menu_flags (void)
{
DistributionType distribution = get_distribution_type();
#ifdef FIXME
int flags = MAIN_MENU_SYSTEM_SUB | MAIN_MENU_USER_SUB |
MAIN_MENU_APPLETS_SUB | MAIN_MENU_PANEL_SUB |
MAIN_MENU_DESKTOP;
/*guess distribution menus*/
if(distribution != DISTRIBUTION_UNKNOWN)
if (distribution != DISTRIBUTION_UNKNOWN)
flags |= MAIN_MENU_DISTRIBUTION_SUB;
/*guess KDE menus*/
if (panel_file_exists (kde_menudir))
if (g_file_test (kde_menudir, G_FILE_TEST_IS_DIR))
flags |= MAIN_MENU_KDE_SUB;
return flags;
#else
return MAIN_MENU_SYSTEM_SUB | MAIN_MENU_USER_SUB;
#endif
}
......@@ -352,7 +352,7 @@ copy_fr_dir (DirRec *dr, const char *to)
copy_file_to_dir (fr->name, to, 0600);
} else if (fr->type == FILE_REC_DIR) {
char *newdir = g_concat_dir_and_file (to, g_basename (fr->name));
if (panel_file_exists (newdir) ||
if (g_file_test (newdir, G_FILE_TEST_IS_DIR) ||
mkdir (newdir, 0700) == 0)
copy_fr_dir ((DirRec *)fr, newdir);
g_free (newdir);
......@@ -384,7 +384,7 @@ add_app_to_personal (GtkWidget *widget, const char *item_loc)
FileRec *fr = fr_get_dir (item_loc);
if (fr != NULL) {
char *newdir = g_concat_dir_and_file (to, g_basename (fr->name));
if (panel_file_exists (newdir) ||
if (g_file_test (newdir, G_FILE_TEST_IS_DIR) ||
mkdir (newdir, 0700) == 0)
copy_fr_dir ((DirRec *)fr, newdir);
g_free(newdir);
......@@ -745,7 +745,7 @@ fake_pixmap_at_size (const char *file, int size)
{
FakeIcon *fake;
if ( ! panel_file_exists(file))
if ( ! g_file_test (file, G_FILE_TEST_EXISTS))
return NULL;
fake = g_new0 (FakeIcon, 1);
......@@ -817,7 +817,7 @@ really_add_new_menu_item (GtkWidget *d, int button, gpointer data)
dentry->location = g_strdup_printf ("%s/%s.desktop",
dir, name);
while (panel_file_exists (dentry->location)) {
while (g_file_test (dentry->location, G_FILE_TEST_EXISTS)) {
g_free (dentry->location);
dentry->location = g_strdup_printf ("%s/%s%d.desktop",
dir, name,
......@@ -1094,7 +1094,7 @@ add_drawers_from_dir (const char *dirname, const char *name,
char *mergedir;
GSList *list, *li;
if(!panel_file_exists(dirname))
if ( ! g_file_test (dirname, G_FILE_TEST_IS_DIR))
return;
dentry_name = g_concat_dir_and_file (dirname,
......@@ -5305,9 +5305,9 @@ create_panel_submenu(GtkWidget *menu, gboolean fake_submenus, gboolean tearoff,
GTK_SIGNAL_FUNC(about_cb),
NULL);
char_tmp = panel_is_program_in_path("gnome-about");
char_tmp = gnome_is_program_in_path("gnome-about");
if(!char_tmp)
char_tmp = panel_is_program_in_path ("guname");
char_tmp = gnome_is_program_in_path ("guname");
if (char_tmp) {
menuitem = gtk_menu_item_new ();
......@@ -5353,7 +5353,7 @@ create_desktop_menu (GtkWidget *menu, gboolean fake_submenus, gboolean tearoff)
NULL);
}
char_tmp = panel_is_program_in_path ("xscreensaver");
char_tmp = gnome_is_program_in_path ("xscreensaver");
if (char_tmp) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
......@@ -5950,7 +5950,7 @@ load_menu_applet(const char *params, int main_menu_flags, gboolean global_main,
GTK_STOCK_PROPERTIES,
_("Properties..."));
if(params && strcmp(params, ".")==0 &&
(tmp = panel_is_program_in_path("gmenu"))) {
(tmp = gnome_is_program_in_path("gmenu"))) {
g_free(tmp);
applet_add_callback(menu->info, "edit_menus",
NULL, _("Edit menus..."));
......
......@@ -58,7 +58,7 @@ panel_gnome_help_path (const char *docpath)
g_free (app);
if ( ! panel_file_exists (fullpath)) {
if ( ! g_file_test (fullpath, G_FILE_TEST_EXISTS)) {
g_free (fullpath);
fullpath = NULL;
}
......@@ -75,10 +75,9 @@ panel_gnome_help_path (const char *docpath)
static char *
panel_kde_help_path (const char *docpath)
{
#ifdef FIXME
GList *li;
if ( ! panel_file_exists (KDE_DOCDIR))
if ( ! g_file_text (KDE_DOCDIR, G_FILE_TEST_EXISTS))
return NULL;
for (li = gnome_i18n_get_language_list ("LC_MESSAGES");
......@@ -88,14 +87,14 @@ panel_kde_help_path (const char *docpath)
KDE_DOCDIR,
(char *)li->data,
docpath);
if (panel_file_exists (fullpath)) {
if (g_file_test (fullpath, G_FILE_TEST_EXISTS)) {
char *uri = g_strconcat ("ghelp:", fullpath, NULL);
g_free (fullpath);
return uri;
}
g_free (fullpath);
}
#endif
return NULL;
}
......@@ -844,7 +843,9 @@ panel_reset_dialog_layers (void)
}
GtkWidget *
panel_error_dialog (const char *format, ...)
panel_error_dialog (const char *class,
const char *format,
...)
{
GtkWidget *w;
char *s;
......@@ -861,8 +862,11 @@ panel_error_dialog (const char *format, ...)
w = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, s);
gtk_window_set_wmclass (GTK_WINDOW (dlg),
class, "Panel");
g_free (s);
gtk_widget_show_all (w);
panel_set_dialog_layer (w);
return w;
......@@ -924,33 +928,6 @@ strcasecmp_no_locale (const char *s1, const char *s2)
return 0; /* equal */
}
/* stolen from gnome-libs head as they are faster and don't use "stat" */
gboolean
panel_file_exists (const char *filename)
{
g_return_val_if_fail (filename != NULL, FALSE);
return (access (filename, F_OK) == 0);
}
char *
panel_is_program_in_path (const char *program)
{
static char **paths = NULL;
char **p;
if (paths == NULL)
paths = g_strsplit(g_getenv("PATH"), ":", -1);
for (p = paths; *p != NULL; p++){
char *f = g_strconcat (*p, "/", program, NULL);
if (access (f, X_OK) == 0)
return f;
g_free (f);
}
return 0;
}
int
find_applet (GtkWidget *widget)
{
......
......@@ -72,17 +72,15 @@ char * convert_keysym_state_to_string (guint keysym,
void panel_set_dialog_layer (GtkWidget *dialog);
void panel_reset_dialog_layers (void);
GtkWidget * panel_error_dialog (const char *format, ...) G_GNUC_PRINTF (1, 2);
GtkWidget * panel_error_dialog (const char *class,
const char *format,
...) G_GNUC_PRINTF (2, 3);
gboolean is_ext (const char *file,
const char *ext);
int strcasecmp_no_locale (const char *s1,
const char *s2);
/* stolen from gnome-libs head as they are faster and don't use "stat" */
gboolean panel_file_exists (const char *filename);
char * panel_is_program_in_path (const char *program);
int find_applet (GtkWidget *widget);
int get_requisition_width (GtkWidget *widget);
......
......@@ -1581,7 +1581,7 @@ panel_try_to_set_pixmap (PanelWidget *panel, char *pixmap)
return TRUE;
}
if ( ! panel_file_exists (pixmap))
if ( ! g_file_test (pixmap, G_FILE_TEST_EXISTS))
return FALSE;
panel->backpix = gdk_pixbuf_new_from_file (pixmap, NULL);
......
......@@ -969,7 +969,7 @@ drop_menu (PanelWidget *panel, int pos, const char *dir)
if(distribution != DISTRIBUTION_UNKNOWN)
flags |= MAIN_MENU_DISTRIBUTION_SUB;
/* Guess KDE menus */
if(panel_file_exists(kde_menudir))
if (g_file_test (kde_menudir, G_FILE_TEST_IS_DIR))
flags |= MAIN_MENU_KDE_SUB;
load_menu_applet (dir, flags, TRUE, FALSE, NULL, panel, pos, TRUE);
}
......@@ -980,7 +980,7 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
char *tmp;
tmp = g_concat_dir_and_file (dir, ".directory");
if (panel_file_exists (tmp)) {
if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
g_free (tmp);
drop_menu (panel, pos, dir);
return;
......@@ -988,14 +988,14 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
g_free (tmp);
tmp = g_concat_dir_and_file (dir, ".order");
if (panel_file_exists (tmp)) {
if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
g_free (tmp);
drop_menu (panel, pos, dir);
return;
}
g_free (tmp);
tmp = panel_is_program_in_path ("nautilus");
tmp = gnome_is_program_in_path ("nautilus");
if (tmp != NULL) {
/* nautilus */
char *exec[] = { "nautilus", (char *)dir, NULL };
......@@ -1011,7 +1011,7 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
pos,
TRUE);
} else {
tmp = panel_is_program_in_path ("gmc-client");
tmp = gnome_is_program_in_path ("gmc-client");
if (tmp != NULL) {
/* gmc */
char *exec[] = {
......
......@@ -13,7 +13,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <gnome-desktop/gnome-desktop-item.h>
#include "gnome-desktop-item.h"
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-init.h>
#include <libgnome/gnome-config.h>
......@@ -913,7 +913,7 @@ try_evil_config_hacks (const char *goad_id, PanelWidget *panel, int pos)