~ps-jenkins/bamf/latestsnapshot-0.4.0daily13.06.1913.04-0ubuntu1

« back to all changes in this revision

Viewing changes to src/bamf-application.c

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño), Brandon Schaefer
  • Date: 2013-05-30 23:32:23 UTC
  • mfrom: (534.1.12 bamf-0.4)
  • Revision ID: tarmac-20130530233223-b89ypaq36p9d0aqg
libbamf: BamfApplication: cache MimeTypes and ApplicationType on favorite and sticky apps.

Approved by Brandon Schaefer, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
static gchar **
101
101
bamf_application_default_get_supported_mime_types (BamfApplication *application)
102
102
{
103
 
  const char *desktop_file = bamf_application_get_desktop_file (application);
 
103
  const char *desktop_file;
 
104
  char** mimes;
 
105
 
 
106
  desktop_file = bamf_application_get_desktop_file (application);
104
107
 
105
108
  if (!desktop_file)
106
109
    return NULL;
107
110
 
108
111
  GKeyFile* key_file = g_key_file_new ();
109
 
  GError *error = NULL;
110
 
 
111
 
  g_key_file_load_from_file (key_file, desktop_file, (GKeyFileFlags) 0, &error);
112
 
 
113
 
  if (error)
 
112
 
 
113
  if (!g_key_file_load_from_file (key_file, desktop_file, (GKeyFileFlags) 0, NULL))
114
114
    {
115
115
      g_key_file_free (key_file);
116
 
      g_error_free (error);
117
116
      return NULL;
118
117
    }
119
118
 
120
 
  char** mimes = g_key_file_get_string_list (key_file, "Desktop Entry", "MimeType", NULL, NULL);
 
119
  mimes = g_key_file_get_string_list (key_file, G_KEY_FILE_DESKTOP_GROUP,
 
120
                                      G_KEY_FILE_DESKTOP_KEY_MIME_TYPE, NULL, NULL);
 
121
 
121
122
  g_signal_emit (application, application_signals[SUPPORTED_MIMES_CHANGED], 0, mimes);
122
123
 
123
124
  g_key_file_free (key_file);