aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2008-12-19 16:36:16 -0300
committerJorge Arellano Cid <jcid@dillo.org>2008-12-19 16:36:16 -0300
commit3322961a176a1c0933cf4d525a9ed8e03b7f2d5a (patch)
tree8885f58bb9f9e5b06204a324776356acd5437388
parentbb050288d289693117c208db6233c2c25d426805 (diff)
Cleanup in Menu_load_images_cb()
-rw-r--r--src/menu.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/menu.cc b/src/menu.cc
index a86763c4..ac23117d 100644
--- a/src/menu.cc
+++ b/src/menu.cc
@@ -175,7 +175,7 @@ static void Menu_save_page_cb(Widget* )
}
/*
- * Save current page
+ * View current page source
*/
static void Menu_view_page_source_cb(Widget* )
{
@@ -192,18 +192,22 @@ static void Menu_view_page_bugs_cb(Widget* )
/*
* Load images on current page that match URL pattern
- *
- * BUG: assumes that the document is a DilloHtml.
*/
static void Menu_load_images_cb(Widget*, void *user_data)
{
DilloUrl *pattern = (DilloUrl *) user_data ;
if (popup_bw && popup_bw->Docs) {
- int i, n;
- n = dList_length(popup_bw->Docs);
- for (i = 0; i < n; i++) {
- a_Html_load_images(dList_nth_data(popup_bw->Docs, i), pattern);
+ if (dList_find_custom(popup_bw->PageUrls, popup_url,
+ (dCompareFunc)a_Url_cmp)){
+ /* HTML page is still there */
+ int n = dList_length(popup_bw->Docs);
+ if (n == 1) {
+ a_Html_load_images(dList_nth_data(popup_bw->Docs, 0), pattern);
+ } else if (n > 1) {
+ /* e.g. frames implemented and not all containing html */
+ MSG("Menu_load_images_cb multiple Docs not handled\n");
+ }
}
}
}