/* Returns: a new #GDesktopAppInfo, or NULL if no desktop file with that id  */
GDesktopAppInfo* g_desktop_app_info_new(const char *desktop_id)
/* Returns: a new #GDesktopAppInfo, or NULL if no desktop file with that id  */
GDesktopAppInfo* g_desktop_app_info_new(const char *desktop_id)
{
  GDesktopAppInfo *appinfo = NULL;
  guint i;
  desktop_file_dirs_lock ();
  for (i = 0; i < n_desktop_file_dirs; i++)
    {
      appinfo = desktop_file_dir_get_app (&desktop_file_dirs[i], desktop_id);
      if (appinfo)
        break;
    }
  desktop_file_dirs_unlock ();
  if (appinfo == NULL)
    return NULL;
  g_free (appinfo->desktop_id);
  appinfo->desktop_id = g_strdup (desktop_id);
  if (g_desktop_app_info_get_is_hidden (appinfo))
    {
      g_object_unref (appinfo);
      appinfo = NULL;
    }
  return appinfo;
}