Ejemplo n.º 1
0
GIcon *
photos_utils_icon_from_rdf_type (const gchar *type)
{
  GIcon *ret_val = NULL;
  gint size;

  size = photos_utils_get_icon_size ();
  if (strstr (type, "nfo#DataContainer") != NULL)
    ret_val = photos_utils_create_collection_icon (size, NULL);

  return ret_val;
}
Ejemplo n.º 2
0
GIcon *
photos_utils_get_icon_from_item (PhotosBaseItem *item)
{
  GIcon *icon = NULL;
  gboolean is_remote = FALSE;
  const gchar *identifier;
  const gchar *mime_type;

  identifier = photos_base_item_get_identifier (item);
  if (identifier != NULL)
    {
      if (g_str_has_prefix (identifier, "facebook:") ||
          g_str_has_prefix (identifier, "flickr:") ||
          g_str_has_prefix (identifier, "google:"))
        is_remote = TRUE;
    }

  if (!is_remote)
    icon = photos_utils_get_thumbnail_icon (item);

  if (icon != NULL)
    goto out;

  mime_type = photos_base_item_get_mime_type (item);
  if (mime_type != NULL)
    icon = g_content_type_get_icon (mime_type);

  if (icon != NULL)
    goto out;

  if (photos_base_item_is_collection (item))
    {
      gint size;

      size = photos_utils_get_icon_size ();
      icon = photos_utils_create_collection_icon (size, NULL);
    }

  if (icon != NULL)
    goto out;

  icon = g_themed_icon_new ("image-x-generic");

 out:
  return icon;
}