kjs_window.cpp usage of konquerorrc
Luciano Montanaro
mikelima at virgilio.it
Wed Jun 4 18:06:40 BST 2003
12:21, martedì 27 maggio 2003, skrev Luciano Montanaro:
> Hi,
>
> I have found that kjs_window opens konquerorrc (in the openWindow function)
> to load the WindowOpenPolicy setting. Shouldn't it use the
> KGlobal::config() instead?
> My problem is that since I am using/developing konqueror embedded, I'd like
> to use konq-embedrc instead. Is there any reason konquerorrc is used
> instead?
I mean like in this patch...
--- /home/lmonta/fwsrc/kdelibs/khtml/ecma/kjs_window.cpp 2003-05-29
12:37:52.000000000 +0200
+++ ./kjs_window.cpp 2003-06-04 18:03:39.000000000 +0200
@@ -1065,10 +1065,9 @@ Value Window::openWindow(ExecState *exec
UString s = v.toString(exec);
QString str = s.qstring();
- KConfig *config = new KConfig( "konquerorrc" );
+ KConfig *config = KGlobal::config();
config->setGroup( "Java/JavaScript Settings" );
int policy = config->readUnsignedNumEntry( "WindowOpenPolicy", 0 ); //
0=allow, 1=ask, 2=deny, 3=smart
- delete config;
if ( policy == 1 ) {
if ( KMessageBox::questionYesNo(widget,
i18n( "This site is trying to open up a
new browser "
@@ -1288,6 +1287,7 @@ Value WindowFunc::tryCall(ExecState *exe
if(args.size() == 2 && widget)
widget->setContentsPos(args[0].toInt32(exec), args[1].toInt32(exec));
return Undefined();
+#ifndef KONQ_EMBEDDED // No window manipulations in the embedded browser
case Window::MoveBy: {
if(args.size() == 2 && widget)
{
@@ -1332,6 +1332,7 @@ Value WindowFunc::tryCall(ExecState *exe
}
return Undefined();
}
+#endif // KONQ_EMBEDDED
case Window::SetTimeout:
if (args.size() == 2 && v.isA(StringType)) {
int i = args[1].toInt32(exec);
--
Luciano Montanaro// My public GPG key can be /"\ ASCII RIBBON
\X/ found at wwwkeys.pgp.net \ / CAMPAIGN
X AGAINST HTML
/ \ MAIL
More information about the kfm-devel
mailing list