1
1

1998-12-10 Miguel de Icaza <miguel@nuclecu.unam.mx>

* gcmd.c (gnome_close_panel): When a panel is destroyed, chdir to
	root directory, as the process will be holding the inode for the
	directory that was selected until an operation is performed in
	another panel.

	* gicon.c (gicon_get_icon_for_file): Invert the way the testing
	for icons is done to handle directories properly.
Этот коммит содержится в:
Miguel de Icaza 1998-12-11 02:58:48 +00:00
родитель 940cdf53c3
Коммит 51d2d5aff1
3 изменённых файлов: 59 добавлений и 42 удалений

Просмотреть файл

@ -1,3 +1,13 @@
1998-12-10 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gcmd.c (gnome_close_panel): When a panel is destroyed, chdir to
root directory, as the process will be holding the inode for the
directory that was selected until an operation is performed in
another panel.
* gicon.c (gicon_get_icon_for_file): Invert the way the testing
for icons is done to handle directories properly.
1998-12-10 Jonathan Blandford <jrb@redhat.com>
* gscreen.c (x_create_panel): made some small stylistic changes.
@ -45,6 +55,7 @@ Thu Dec 10 21:38:55 1998 Owen Taylor <otaylor@redhat.com>
* gscreen.c (panel_icon_list_select_icon): Middle button opens a
new panel on a directory.
>>>>>>> 1.184
1998-12-08 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c: Moved the old DnD cruft to olddnd.c to keep it there

Просмотреть файл

@ -120,5 +120,7 @@ gnome_close_panel (GtkWidget *widget, WPanel *panel)
destroy_widget ((void *)panel);
layout_panel_gone (panel);
mc_chdir ("/");
return TRUE;
}

Просмотреть файл

@ -140,8 +140,50 @@ gnome_file_entry_color (file_entry *fe)
{
mode_t mode = fe->buf.st_mode;
if (S_ISSOCK (mode))
return icon_view_sock;
if (S_ISCHR (mode))
return icon_view_char_dev;
if (S_ISBLK (mode))
return icon_view_block_dev;
if (S_ISFIFO (mode))
return icon_view_sock;
if (is_exe (mode))
return icon_view_executable;
if (fe->fname && (!strcmp (fe->fname, "core") || !strcmp (extension (fe->fname), "core")))
return icon_view_core;
return icon_view_regular;
}
/**
* gicon_get_icon_for_file:
*
* Given a filename and its stat information, we return the optimal
* icon for it. Including a lookup in the metadata.
*/
GdkImlibImage *
gicon_get_icon_for_file (file_entry *fe)
{
GdkImlibImage *image;
int size;
char *buf;
mode_t mode;
g_return_val_if_fail (fe != NULL, NULL);
if (!gicon_inited)
gicon_init ();
mode = fe->buf.st_mode;
/*
* If a directory, choose the best icon that reprensents it
* 1. First test for it being a directory or a link to a directory.
*/
if (S_ISDIR (mode)){
if (fe->buf.st_uid != our_uid){
@ -179,47 +221,9 @@ gnome_file_entry_color (file_entry *fe)
return icon_view_symlink;
}
if (S_ISSOCK (mode))
return icon_view_sock;
if (S_ISCHR (mode))
return icon_view_char_dev;
if (S_ISBLK (mode))
return icon_view_block_dev;
if (S_ISFIFO (mode))
return icon_view_sock;
if (is_exe (mode))
return icon_view_executable;
if (fe->fname && (!strcmp (fe->fname, "core") || !strcmp (extension (fe->fname), "core")))
return icon_view_core;
return icon_view_regular;
}
/**
* gicon_get_icon_for_file:
*
* Given a filename and its stat information, we return the optimal
* icon for it. Including a lookup in the metadata.
*/
GdkImlibImage *
gicon_get_icon_for_file (file_entry *fe)
{
GdkImlibImage *image;
int size;
char *buf;
g_return_val_if_fail (fe != NULL, NULL);
if (!gicon_inited)
gicon_init ();
/*
* 1. Try to fetch the icon from the metadata.
* 2. Try to fetch the icon from the metadata.
*/
if (gnome_metadata_get (fe->fname, "icon-filename", &size, &buf) == 0){
image = gicon_get_by_filename (buf);
@ -229,7 +233,7 @@ gicon_get_icon_for_file (file_entry *fe)
}
/*
* 2. Try to fetch the icon as an inline png from the metadata.
* 3. Try to fetch the icon as an inline png from the metadata.
*/
if (gnome_metadata_get (fe->fname, "icon-inline-png", &size, &buf) == 0){
image = gdk_imlib_inlined_png_to_image (buf, size);
@ -241,7 +245,7 @@ gicon_get_icon_for_file (file_entry *fe)
}
/*
* 3. Try to find an appropiate icon from the stat information or
* 4. Try to find an appropiate icon from the stat information or
* the hard coded filename.
*/
image = gnome_file_entry_color (fe);