Re: bug in gnome-desktop or nautilus ?
- From: Bastien Nocera <hadess hadess net>
- To: Frank Worsley <fworsley shaw ca>
- Cc: Nautilus List <nautilus-list gnome org>
- Subject: Re: bug in gnome-desktop or nautilus ?
- Date: 12 Mar 2003 15:42:17 +0000
On Tue, 2003-03-11 at 20:05, Frank Worsley wrote:
> > Yes, it was Andrew (who also created the patch). That's why I wanted us
> > to get the mime-type checks in Nautilus now.
>
> Oh, I didn't read your whole mail, sorry. Yeah, checking in Nautilus
> sounds good to me. I remember adding that check back in the day to fix
> the problem you describe now. So checking in Nautilus instead of in
> GnomeDesktopItem should be fine. I doubt anything else got broken by
> removing the check.
Can I commit that ? (With the appropriate ChangeLog entry of course)
Cheers
--
/Bastien Nocera
http://hadess.net
#2 0x4205a2cc in printf ("Oh my %s\n", preferred_deity) from
/lib/i686/libc.so.6 printf ("Oh my %s\n", preferred_deity);
Segmentation fault
? foo
Index: fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.275
diff -u -r1.275 fm-icon-view.c
--- fm-icon-view.c 10 Mar 2003 16:46:05 -0000 1.275
+++ fm-icon-view.c 12 Mar 2003 15:29:25 -0000
@@ -51,6 +51,7 @@
#include <libgnome/gnome-macros.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-async-ops.h>
+#include <libgnomevfs/gnome-vfs-mime-utils.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomevfs/gnome-vfs-xfer.h>
@@ -2303,6 +2304,7 @@
char *path;
char *stripped_uri;
char *container_uri;
+ char *mime_type;
const char *last_slash, *link_name;
int n_uris;
gboolean all_local;
@@ -2393,12 +2395,21 @@
/* Make a link using the desktop file contents? */
uri = node->data;
path = gnome_vfs_get_local_path_from_uri (uri);
-
+
if (path != NULL) {
- entry = gnome_desktop_item_new_from_file (path,
- GNOME_DESKTOP_ITEM_LOAD_ONLY_IF_EXISTS,
- NULL);
- g_free (path);
+ mime_type = gnome_vfs_get_mime_type (path);
+
+ if (mime_type != NULL
+ && strcmp (mime_type, "application/x-gnome-app-info") == 0) {
+ entry = gnome_desktop_item_new_from_file (path,
+ GNOME_DESKTOP_ITEM_LOAD_ONLY_IF_EXISTS,
+ NULL);
+ g_free (path);
+ } else {
+ entry = NULL;
+ }
+
+ g_free (mime_type);
} else {
entry = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]