X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=cut-n-paste%2Frecent-files%2Fegg-recent-item.c;h=bf7fee6c636d153d55d45d64b76bd6ed3c639356;hb=848665b157185945d190a7a746d054d7f5d5e6e0;hp=c533205187159067484ad59f64f559280e88e24f;hpb=2845fb905cccd6655c294247722648d3bce97a27;p=evince.git diff --git a/cut-n-paste/recent-files/egg-recent-item.c b/cut-n-paste/recent-files/egg-recent-item.c index c5332051..bf7fee6c 100644 --- a/cut-n-paste/recent-files/egg-recent-item.c +++ b/cut-n-paste/recent-files/egg-recent-item.c @@ -128,6 +128,7 @@ egg_recent_item_copy (const EggRecentItem *item) 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); @@ -219,8 +220,6 @@ egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri) g_free (utf8_uri); } - egg_recent_item_update_mime_type (item); - return TRUE; } @@ -261,7 +260,7 @@ make_valid_utf8 (const char *name) 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)) @@ -317,6 +316,11 @@ egg_recent_item_get_short_name (const EggRecentItem *item) 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) { @@ -355,13 +359,14 @@ egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime) 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); }