[patch] per-domain settings gui now fully functional for java & javascript

Leo Savernik l.savernik at aon.at
Sun Dec 15 19:08:04 GMT 2002


http://bugs.kde.org/attachment.cgi?id=621&action=view

This patch adds full support for per-domain configurability of javascript and 
java policies. It has also been tested with old keys (ECMADomainSettings and 
JavaDomainSettings are correctly imported).

To achieve that I had to do some invasive refactoring in 
kdebase/kcontrol/konqhtml. Firstly I added jspolicies.{h,cpp} and 
policies.{h,cpp}, secondly I patched the PolicyDialog class not to hardcode 
Java and JavaScript settings but to be much more generic. Last but not least 
I added per-domain policy support to jsopts.{h,cpp} as well as 
javaopts.{h,cpp} (reading, editing, writing).

Some more detailed explanations:

policies.{h,cpp}:
Contains a new generic class for policies, called Policies.
It contains only one policy, featureEnabled, as this is the least common 
denominator for Java, JavaScript and Plugins and infrastructure methods for 
loading, saving, defaults etc.

jspolicies.{h,cpp}:
Contains JSPolicies, derived from policies, adding JavaScript policies for 
window.open and the like.

Also contains a widget JSPoliciesFrame for configuring those policies. This 
widget is reused in jsopts.* and policydlg.*.

policydlg.{h,cpp}:
I totally removed the specialization on JavaScript and Java and replaced it 
with a more generic system. It still provides the input of a domain as well 
as the specification of the featureEnabled policy (which is now "java 
enabled" resp. "javascript enabled"). Additionally the PolicyDialog instance 
can be enhanced by a custom widget for configuration of further 
domain-specific policies (which is done in jsopts).


To remain compatible I had to change the RFE in the following point:
The list of domains is not saved under the key "DomainSettings" but under 
separate keys "JavaDomains" for java, "ECMADomains" for javascript and -- 
soon to come -- "PluginDomains" for plugins.
This change also requires changes to the khtml_settings.cpp configuration 
loading methods which I am going to tackle soon.

Still missing:
I did not touch plugins.{h,cpp} yet as it even misses a domain listview.

I also plan to merge the many copies of the domain listview (in java settings 
and javascript settings) in a generic class as I have done with policydlg.


Please review this patch. If nobody complains, I'll interpret that as an 
implicit approval and commit this next week. ;-)

mfg
	Leo





More information about the kfm-devel mailing list