Re: gnome-vfs freeze break request - executable files



tir, 07,.09.2004 kl. 15.49 +0200, skrev Alexander Larsson:
> Currently, all executable files in nautilus are launched when you open
> them. This is quite bad, because normal files are sometimes executable.
> Some filesystems such as FAT even show all files as executable.
> 
Yeah, I agree with this change.

Sorry for not being adamant when it comes to approving fixes, but this
comes from having spent way to much time in bugzilla already. Elijah
pointed out to me that I had closed > 6% of all reports in bugzilla and
I don't necessarily want that number to increase much :-)

1 of 2

Cheers
Kjartan

> This is a regression introduced by the new mimesystem. The new code
> doesn't implement the can_be_executable check, nor mime_type_is_known,
> which are both needed for nautilus to work correctly here.
> 
> This patch fixes this. Ok to commit?
> 
> Index: libgnomevfs/gnome-vfs-mime-info.c
> ===================================================================
> RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-mime-info.c,v
> retrieving revision 1.79
> diff -u -p -r1.79 gnome-vfs-mime-info.c
> --- libgnomevfs/gnome-vfs-mime-info.c	26 Jul 2004 19:31:36 -0000	1.79
> +++ libgnomevfs/gnome-vfs-mime-info.c	7 Sep 2004 13:43:49 -0000
> @@ -561,6 +561,10 @@ gnome_vfs_mime_get_value (const char *mi
>  		return entry->parent_classes;
>  	} else if (!strcmp (key, "aliases")) {
>  		return entry->aliases;
> +	} else if (!strcmp (key, "can_be_executable")) {
> +		if (gnome_vfs_mime_type_get_equivalence (mime_type, "application/x-executable") != GNOME_VFS_MIME_UNRELATED ||
> +		    gnome_vfs_mime_type_get_equivalence (mime_type, "text/plain") != GNOME_VFS_MIME_UNRELATED)
> +			return "TRUE";
>  	}
>  
>  	return NULL;
> @@ -577,6 +581,8 @@ gnome_vfs_mime_get_value (const char *mi
>  gboolean
>  gnome_vfs_mime_type_is_known (const char *mime_type)
>  {
> +	MimeEntry *entry;
> +	
>  	if (mime_type == NULL) {
>  		return FALSE;
>  	}
> @@ -589,7 +595,12 @@ gnome_vfs_mime_type_is_known (const char
>  
>  	reload_if_needed ();
>  
> -	return FALSE;
> +	entry = get_entry (mime_type);
> +	
> +	/* TODO: Should look for aliases too, which needs
> +	   a alias -> mimetype mapping */
> +
> +	return entry != NULL;
>  }
>  
>  /**
> 
> 
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander Larsson                                            Red Hat, Inc 
>                    alexl redhat com    alla lysator liu se 
> He's a genetically engineered ninja master criminal on the wrong side of the 
> law. She's a chain-smoking mutant schoolgirl with her own daytime radio talk 
> show. They fight crime! 
> 
> _______________________________________________
> release-team mailing list
> release-team gnome org
> http://mail.gnome.org/mailman/listinfo/release-team



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]