patches/nautilus-04-execute-shellscript.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 16013 6dfdf0aa30c8
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16013
6dfdf0aa30c8 * base-specs/nautilus.spec : Bump to 2.26.3
mattman
parents: 11383
diff changeset
     1
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-file.c nautilus-2.26.3/libnautilus-private/nautilus-file.c
6dfdf0aa30c8 * base-specs/nautilus.spec : Bump to 2.26.3
mattman
parents: 11383
diff changeset
     2
--- nautilus-2.26.3.old/libnautilus-private/nautilus-file.c	2009-05-18 20:44:26.000000000 +0100
6dfdf0aa30c8 * base-specs/nautilus.spec : Bump to 2.26.3
mattman
parents: 11383
diff changeset
     3
+++ nautilus-2.26.3/libnautilus-private/nautilus-file.c	2009-07-13 11:28:09.518901000 +0100
6dfdf0aa30c8 * base-specs/nautilus.spec : Bump to 2.26.3
mattman
parents: 11383
diff changeset
     4
@@ -6249,10 +6249,31 @@ nautilus_file_get_file_info_error (Nauti
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     5
 gboolean
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     6
 nautilus_file_contains_text (NautilusFile *file)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     7
 {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     8
+	const gchar *script_mime_types[]= {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     9
+		"application/x-shellscript",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    10
+		"application/x-perl",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    11
+		"application/x-python",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    12
+		"application/x-csh",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    13
+		"application/x-ruby",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    14
+		NULL
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    15
+	};
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    16
+	const gchar **it;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    17
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    18
 	if (file == NULL) {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    19
 		return FALSE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    20
 	}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    21
 
11383
4e0bd1ce6770 2007-01-03 Brian Cameron <[email protected]>
yippi
parents: 9060
diff changeset
    22
+	if (file->details == NULL || file->details->mime_type == NULL) {
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    23
+		return FALSE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    24
+	}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    25
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    26
+	it = script_mime_types;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    27
+	while (*it) {
11383
4e0bd1ce6770 2007-01-03 Brian Cameron <[email protected]>
yippi
parents: 9060
diff changeset
    28
+		if (! strcmp (file->details->mime_type, *it))
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    29
+			return TRUE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    30
+		it ++;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    31
+	}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    32
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    33
 	/* All text files inherit from text/plain */
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    34
 	return nautilus_file_is_mime_type (file, "text/plain");
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    35
 }