baseurl: what is this code supposed to do?

Leo Savernik l.savernik at aon.at
Wed Jul 21 23:50:19 BST 2004


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

Hello,

I just stumbled across this piece of code in khtml_part.cpp at line 1683 in 
KHTMLPart::begin()

  KURL baseurl;

  if ( !m_url.isEmpty() )
  {
    KURL title( baseurl );
    title.setRef( QString::null );
    title.setQuery( QString::null );
    emit setWindowCaption( title.prettyURL() );
  }

baseurl is defined, thus being initialized to an empty url. Then, without ever 
assigning anything to baseurl, it is assigned to title in the if clause.

Lateron, baseurl is set as the document's base url, but hasn't been assigned 
to inbetween either.

In KDE 3.0.4, baseurl is initialized in the if clause as follows:

    KURL::List lst = KURL::split( m_url );
    if ( !lst.isEmpty() )
      baseurl = *lst.begin();

Was the initialization removed intentionally? And where is it actually set 
(and if it isn't, why does KHTML still work)?

mfg
	Leo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD4DBQFA/vMrj5jssenUYTsRAt88AJjQGqfAZbq2Sw77knYXf/xdY0ySAKCKfRcz
t2CMTJYquG906DtkIqZTxg==
=ufQn
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list