~noskcaj/ubuntu/vivid/thunar/1.6.4

« back to all changes in this revision

Viewing changes to thunar/thunar-file.c

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-12-30 13:43:31 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20121230134331-gh7yww1d4wtjpfwo
Tags: 1.6.2-0ubuntu1
New upstream stable release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
#define FLAG_UNSET(file,flag)                G_STMT_START{ ((file)->flags &= ~(flag)); }G_STMT_END
137
137
#define FLAG_IS_SET(file,flag)               (((file)->flags & (flag)) != 0)
138
138
 
 
139
#define DEFAULT_CONTENT_TYPE "application/octet-stream"
 
140
 
139
141
 
140
142
 
141
143
typedef enum
827
829
  const gchar *display_name;
828
830
  gboolean     is_secure = FALSE;
829
831
  gchar       *casefold;
 
832
  gchar       *path;
830
833
 
831
834
  _thunar_return_if_fail (THUNAR_IS_FILE (file));
832
835
  _thunar_return_if_fail (file->info == NULL || G_IS_FILE_INFO (file->info));
851
854
  file->basename = g_file_get_basename (file->gfile);
852
855
  _thunar_assert (file->basename != NULL);
853
856
 
 
857
  /* problematic files with content type reading */
 
858
  if (strcmp (file->basename, "kmsg") == 0
 
859
      && g_file_is_native (file->gfile))
 
860
    {
 
861
      path = g_file_get_path (file->gfile);
 
862
      if (g_strcmp0 (path, "/proc/kmsg") == 0)
 
863
        file->content_type = g_strdup (DEFAULT_CONTENT_TYPE);
 
864
      g_free (path);
 
865
    }
 
866
 
854
867
  /* check if this file is a desktop entry */
855
868
  if (thunar_file_is_desktop_file (file, &is_secure) && is_secure)
856
869
    {
2257
2270
        {
2258
2271
          /* async load the content-type */
2259
2272
          info = g_file_query_info (file->gfile,
2260
 
                                    thunar_file_is_readable (file) ?
2261
 
                                        G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE :
2262
 
                                        G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE,
 
2273
                                    G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
2263
2274
                                    G_FILE_QUERY_INFO_NONE,
2264
2275
                                    NULL, &err);
2265
2276
 
2281
2292
 
2282
2293
          /* always provide a fallback */
2283
2294
          if (file->content_type == NULL)
2284
 
            file->content_type = g_strdup ("application/octet-stream");
 
2295
            file->content_type = g_strdup (DEFAULT_CONTENT_TYPE);
2285
2296
        }
2286
2297
 
2287
2298
      bailout: