[PATCH] Konqueror AdBlocK v5

Leo Savernik l.savernik at aon.at
Sun May 1 17:33:15 BST 2005


Am Sonntag, 1. Mai 2005 17:09 schrieb Ivor Hewitt:
> Removing layout removed at Leo's request. This version strips the img tags
> from the dom instead.
> Renamed variables and methods.

Looks good so far.

However, as Martijn mentioned, blocked images are blocked for good, even if 
you disable adblocking for the url in the meantime. Only a reload will bring 
them back.

For my part, I don't care (read: you can leave the behaviour your patch 
introduces), but you should keep it in mind if questions arise.

Oh, one thing:
+void KHTMLSettings::addAdFilter( const QString &url )

Directly writing into the global configuration file from within khtml is a big 
nono. You may append the regexps to the array in memory, but it must be left 
to the embedding application whether it will persist them (this is because 
more than one application may embed khtml, and they may want to maintain 
different sets of filtered urls).

And there's a last nitpick I've overlooked so far:
 void Cache::init()
 {
[...]
+    if ( !blockedPixmap )
+    {
+        blockedPixmap = new QPixmap();
+        blockedPixmap->loadFromData(blocked_icon_data, blocked_icon_len);
+    }
+    

Don't initialize blockedPixmap in Cache::init, initialize it on demand when 
it's actually used. There's no need to penalize users who don't block images.

mfg
	Leo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20050501/034fac1c/attachment.sig>


More information about the kfm-devel mailing list