Am I missing something in Javascript ?

David Faure david at mandrakesoft.com
Thu Nov 14 11:52:19 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 13 November 2002 23:11, Harri Porten wrote:
> On Wed, 13 Nov 2002, David Faure wrote:
> 
> > > P.S. Another strange thing is that in both IE and Moz all of
> > > the menu's and other window decoration is anabled by default
> > > but not in Konq!
> > 
> > Ouch - sounds like a bug. Unspecified argument for the settings should mean
> > default, nor none. I'll check that later.
> 
> I can't test but the following looks wrong:
> 
>     // scan feature argument
>     v = args[2];
>     QString features;
>     if (!v.isNull()) {
>       features = v.toString(exec).qstring();
>       // specifying window params means false defaults
>       winargs.menuBarVisible = false;

Indeed, that's wrong.

> The isNull() check should be replaced with isUndefined().

Much safer IMHO is:

- --- kjs_window.cpp      2002/11/12 16:37:46     1.297
+++ kjs_window.cpp      2002/11/14 11:51:45
@@ -1080,10 +1080,9 @@ Value Window::openWindow(ExecState *exec
     KParts::WindowArgs winargs;

     // scan feature argument
- -    v = args[2];
     QString features;
- -    if (!v.isNull()) {
- -      features = v.toString(exec).qstring();
+    if (args.size()>2) {
+      features = args[2].toString(exec).qstring();
       // specifying window params means false defaults
       winargs.menuBarVisible = false;
       winargs.toolBarsVisible = false;
@@ -1157,7 +1156,7 @@ Value Window::openWindow(ExecState *exec

     KParts::URLArgs uargs;
     KHTMLPart *p = m_part;
- -    uargs.frameName = !args[1].isNull() ?
+    uargs.frameName = args.size() > 1 ?
                       args[1].toString(exec).qstring()
                       : QString("_blank");
     if ( uargs.frameName == "_top" )

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9046C72KcVAmwbhARAu6RAJ9nmSps/aNZCLjAlU41of9xNqgfagCfSe/i
/qs5DKYhc0si5DgbwohgAEM=
=IsFG
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list