From 8a99b045bc48e0c5eb89129ea8ee034c72b955de Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 15 Mar 2015 00:00:45 +0000 Subject: Remove url from content thumbnailers API The content thumbnailers for each frontend were being provided the contents url. This was only ever used to call the urldb thumbnail setting API. This changes it so the single callsite that passed a valid url adds the bitmap to that url itself in desktop_history.c instead of forcing every frontend to require the urldb API. Additionally the old API could pass the url as NULL which was causing asserts where this was not an expected parameter value. Because of this this fixes bug #2286 which was also present in the monkey frontend as both called nsurl_access() on the url without the NULL check and caused an assertion. --- riscos/save.c | 2 +- riscos/thumbnail.c | 7 +------ riscos/window.c | 5 +++-- 3 files changed, 5 insertions(+), 9 deletions(-) (limited to 'riscos') diff --git a/riscos/save.c b/riscos/save.c index b5d96c460..ee8bfc598 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -1370,7 +1370,7 @@ bool ro_gui_save_create_thumbnail(hlcache_handle *h, const char *name) LOG(("Thumbnail initialisation failed.")); return false; } - thumbnail_create(h, bitmap, NULL); + thumbnail_create(h, bitmap); area = thumbnail_convert_8bpp(bitmap); bitmap_destroy(bitmap); if (!area) { diff --git a/riscos/thumbnail.c b/riscos/thumbnail.c index e259686f8..603c328b8 100644 --- a/riscos/thumbnail.c +++ b/riscos/thumbnail.c @@ -36,7 +36,6 @@ #include "utils/log.h" #include "content/content.h" #include "content/hlcache.h" -#include "content/urldb.h" #include "desktop/plotters.h" #include "desktop/thumbnail.h" #include "image/bitmap.h" @@ -79,8 +78,7 @@ static void thumbnail_restore_output(struct thumbnail_save_area *save_area); * \param bitmap the bitmap to draw to * \param url the URL the thumbnail belongs to, or NULL */ -bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, - nsurl *url) +bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap) { struct thumbnail_save_area *save_area; osspriteop_area *sprite_area = NULL; @@ -150,9 +148,6 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, return false; } - /* register the thumbnail with the URL */ - if (url) - urldb_set_thumbnail(url, bitmap); bitmap_modified(bitmap); return true; } diff --git a/riscos/window.c b/riscos/window.c index 6a2ae4467..759c0c281 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -3417,9 +3417,10 @@ void ro_gui_window_iconise(struct gui_window *g, LOG(("Thumbnail initialisation failed.")); return; } - thumbnail_create(h, bitmap, NULL); - if (overlay) + thumbnail_create(h, bitmap); + if (overlay) { bitmap_overlay_sprite(bitmap, overlay); + } area = thumbnail_convert_8bpp(bitmap); bitmap_destroy(bitmap); if (!area) { -- cgit v1.2.3