[PATCH] Konqueror AdBlocK v5
Leo Savernik
l.savernik at aon.at
Sun May 1 19:18:33 BST 2005
Am Sonntag, 1. Mai 2005 19:42 schrieb Ivor Hewitt:
[...]
> > 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?
You don't. It's the responsibility of the embedding app to provide and manage
the settings.
Imagine it like this:
EmbeddingApp::loadConfig(KConfig *c) {
...
embeddedKhtml->addAdFilter(c->readString("MyFilter"));
...
}
The embedding app will read the configuration, and call the appropriate
methods on the KHTMLSettings object. The same way, the embedding app will
store the filters, and it will provide a means for the user to configure the
filters (or not, depending on the app).
The KHTMLSettings methods are just means to make settings from the outside
take effect.
>
[...]
> 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.
In the respective destructors, I assume.
>
[...]
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/75239f02/attachment.sig>
More information about the kfm-devel
mailing list