newitem->uri = g_strdup (item->uri);
if (item->mime_type)
newitem->mime_type = g_strdup (item->mime_type);
+ newitem->mime_type_is_explicit = item->mime_type_is_explicit
newitem->timestamp = item->timestamp;
newitem->private_data = item->private_data;
newitem->groups = egg_recent_item_copy_groups (item->groups);
g_free (utf8_uri);
}
- egg_recent_item_update_mime_type (item);
-
return TRUE;
}
string = NULL;
remainder = name;
- remaining_bytes = strlen (name);
+ remaining_bytes = name ? strlen (name) : 0;
while (remaining_bytes != 0) {
if (g_utf8_validate (remainder, remaining_bytes, &invalid))
return NULL;
short_name = gnome_vfs_uri_extract_short_name (uri);
+ if (short_name == NULL) {
+ gnome_vfs_uri_unref (uri);
+ return NULL;
+ }
+
valid = FALSE;
if (strcmp (gnome_vfs_uri_get_scheme (uri), "file") == 0) {
item->mime_type = g_strdup (mime);
} else {
item->mime_type_is_explicit = FALSE;
- egg_recent_item_update_mime_type (item);
}
}
gchar *
-egg_recent_item_get_mime_type (const EggRecentItem *item)
+egg_recent_item_get_mime_type (EggRecentItem *item)
{
+ egg_recent_item_update_mime_type (item);
+
return g_strdup (item->mime_type);
}