[PATCH] Konqueror AdBlocK v5

Ivor Hewitt ivor at ivor.org
Sun May 1 18:42:30 BST 2005


On Sunday 01 May 2005 17:33, Leo Savernik wrote:
> 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.
>
Magic.

> 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.
>
I wouldn't think users of adblock would want to be able to toggle ads off and 
on on demand. It would be nice to zap them immediately when a filter is set 
as a bit of positive feedback, but I'll look into that later.

> 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).
>
Ok, how do I tell the embedding app (eg konq) that the settings have changed 
and need persisting?

> And there's a last nitpick I've overlooked so far:
>
Nitpick away. This is my first kde dev so I've simply tried to copy the style 
and idioms I've seen in the code as I've gone along.

> 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.
>
Fair enough, will do.

Oh one other kde thing I wondered about looking at the code....
In kcontrol/konqhtml/main.cpp the KConfig's are new'ed and passed into the 
new'ed KCModule object but I couldn't see where they get deleted.

Regards,


-- 
Ivor Hewitt.
http://www.ivor.it - tech | http://www.ivor.org - hedge




More information about the kfm-devel mailing list