From cdee9e985ee4d29d624539e47aa515b5201a18e3 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 12 Apr 2012 13:43:57 +0000 Subject: More work on about:imagecache entry listing table. svn path=/trunk/netsurf/; revision=13855 --- image/image_cache.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'image/image_cache.c') diff --git a/image/image_cache.c b/image/image_cache.c index 8124763e5..5e62fe0aa 100644 --- a/image/image_cache.c +++ b/image/image_cache.c @@ -637,6 +637,7 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn, struct image_cache_entry_s *centry; size_t slen = 0; /* current output string length */ int fmtc = 0; /* current index into format string */ + lwc_string *origin; /* current entry's origin */ centry = image_cache__findn(entryn); if (centry == NULL) @@ -681,6 +682,29 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn, slen += snprintf(string + slen, size - slen, "%s", nsurl_access(llcache_handle_get_url(centry->content->llcache))); break; + + case 'o': + if (nsurl_has_component(llcache_handle_get_url( + centry->content->llcache), + NSURL_HOST)) { + origin = nsurl_get_component( + llcache_handle_get_url( + centry->content-> + llcache), + NSURL_HOST); + + slen += snprintf(string + slen, + size - slen, "%s", + lwc_string_data( + origin)); + + lwc_string_unref(origin); + } else { + slen += snprintf(string + slen, + size - slen, "%s", + "localhost"); + } + break; case 's': if (centry->bitmap != NULL) { -- cgit v1.2.3