16013
|
1 |
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-file.c nautilus-2.26.3/libnautilus-private/nautilus-file.c
|
|
2 |
--- nautilus-2.26.3.old/libnautilus-private/nautilus-file.c 2009-05-18 20:44:26.000000000 +0100
|
|
3 |
+++ nautilus-2.26.3/libnautilus-private/nautilus-file.c 2009-07-13 11:28:09.518901000 +0100
|
|
4 |
@@ -6249,10 +6249,31 @@ nautilus_file_get_file_info_error (Nauti
|
9060
|
5 |
gboolean
|
|
6 |
nautilus_file_contains_text (NautilusFile *file)
|
|
7 |
{
|
|
8 |
+ const gchar *script_mime_types[]= {
|
|
9 |
+ "application/x-shellscript",
|
|
10 |
+ "application/x-perl",
|
|
11 |
+ "application/x-python",
|
|
12 |
+ "application/x-csh",
|
|
13 |
+ "application/x-ruby",
|
|
14 |
+ NULL
|
|
15 |
+ };
|
|
16 |
+ const gchar **it;
|
|
17 |
+
|
|
18 |
if (file == NULL) {
|
|
19 |
return FALSE;
|
|
20 |
}
|
|
21 |
|
11383
|
22 |
+ if (file->details == NULL || file->details->mime_type == NULL) {
|
9060
|
23 |
+ return FALSE;
|
|
24 |
+ }
|
|
25 |
+
|
|
26 |
+ it = script_mime_types;
|
|
27 |
+ while (*it) {
|
11383
|
28 |
+ if (! strcmp (file->details->mime_type, *it))
|
9060
|
29 |
+ return TRUE;
|
|
30 |
+ it ++;
|
|
31 |
+ }
|
|
32 |
+
|
|
33 |
/* All text files inherit from text/plain */
|
|
34 |
return nautilus_file_is_mime_type (file, "text/plain");
|
|
35 |
}
|