--------------Boundary-00=_1IND4Y7BZSH3BJ6BSD8I Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Am Donnerstag, 19. Dezember 2002 18:10 schrieb David Faure: > One thing about this new code: can you comment out the debug output in > khtml? It clutters the other output quite a lot, and makes other things > difficult to debug. I suggest using #ifdef DEBUG_SETTINGS or something like > that, so that you can easily enable all of them again (with a simple > #define DEBUG_SETTINGS at the top of the file). > Thanks. at your command. PS: do not apply patch to cvs, i did it already --------------Boundary-00=_1IND4Y7BZSH3BJ6BSD8I Content-Type: text/x-diff; charset="iso-8859-1"; name="khtml_per-domain_7.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="khtml_per-domain_7.diff" Index: khtml_settings.cc =================================================================== RCS file: /home/kde/kdelibs/khtml/khtml_settings.cc,v retrieving revision 1.91 diff -u -p -r1.91 khtml_settings.cc --- khtml_settings.cc 17 Dec 2002 19:19:54 -0000 1.91 +++ khtml_settings.cc 19 Dec 2002 17:28:38 -0000 @@ -42,7 +42,8 @@ struct KPerDomainSettings { KHTMLSettings::KJSWindowFocusPolicy m_windowFocusPolicy : 1; KHTMLSettings::KJSWindowMovePolicy m_windowMovePolicy : 1; KHTMLSettings::KJSWindowResizePolicy m_windowResizePolicy : 1; - + +#ifdef DEBUG_SETTINGS void dump(const QString &infix = QString::null) const { kdDebug() << "KPerDomainSettings " << infix << " @" << this << ":" << endl; kdDebug() << " m_bEnableJava: " << m_bEnableJava << endl; @@ -54,6 +55,7 @@ struct KPerDomainSettings { kdDebug() << " m_windowMovePolicy: " << m_windowMovePolicy << endl; kdDebug() << " m_windowResizePolicy: " << m_windowResizePolicy << endl; } +#endif }; typedef QMap PolicyMap; @@ -383,7 +385,9 @@ void KHTMLSettings::init( KConfig * conf // Read options from the global "domain" readDomainSettings(config,reset,true,d->global); +#ifdef DEBUG_SETTINGS d->global.dump("init global"); +#endif // The domain-specific settings. @@ -416,7 +420,9 @@ void KHTMLSettings::init( KConfig * conf QString domain = it.key(); config->setGroup(domain); readDomainSettings(config,reset,false,d->domainPolicy[domain]); +#ifdef DEBUG_SETTINGS d->domainPolicy[domain].dump("init "+domain); +#endif } config->setGroup(js_group_save); @@ -435,7 +441,9 @@ void KHTMLSettings::init( KConfig * conf splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); setup_per_domain_policy(d,domain).m_bEnableJava = javaAdvice == KJavaScriptAccept; +#ifdef DEBUG_SETTINGS setup_per_domain_policy(d,domain).dump("JavaDomainSettings 4 "+domain); +#endif } } @@ -454,7 +462,9 @@ void KHTMLSettings::init( KConfig * conf splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); setup_per_domain_policy(d,domain).m_bEnableJavaScript = javaScriptAdvice == KJavaScriptAccept; +#ifdef DEBUG_SETTINGS setup_per_domain_policy(d,domain).dump("ECMADomainSettings 4 "+domain); +#endif } } @@ -476,7 +486,9 @@ void KHTMLSettings::init( KConfig * conf if( check_old_ecma ) setup_per_domain_policy(d,domain).m_bEnableJavaScript = javaScriptAdvice == KJavaScriptAccept; +#ifdef DEBUG_SETTINGS setup_per_domain_policy(d,domain).dump("JavaScriptDomainAdvice 4 "+domain); +#endif } //save all the settings into the new keywords if they don't exist @@ -523,7 +535,9 @@ static const KPerDomainSettings &lookup_ { kdDebug() << "lookup_hostname_policy(" << hostname << ")" << endl; if (hostname.isEmpty()) { +#ifdef DEBUG_SETTINGS d->global.dump("global"); +#endif return d->global; } @@ -533,7 +547,9 @@ static const KPerDomainSettings &lookup_ PolicyMap::const_iterator it = d->domainPolicy.find(hostname); if( it != notfound ) { kdDebug() << "perfect match" << endl; +#ifdef DEBUG_SETTINGS (*it).dump(hostname); +#endif // yes, use it (unless dunno) return *it; } @@ -548,7 +564,9 @@ static const KPerDomainSettings &lookup_ Q_ASSERT(notfound == d->domainPolicy.end()); if( it != notfound ) { kdDebug() << "partial match" << endl; +#ifdef DEBUG_SETTINGS (*it).dump(host_part); +#endif return *it; } // assert(host_part[0] == QChar('.')); @@ -557,7 +575,9 @@ static const KPerDomainSettings &lookup_ // No domain-specific entry: use global domain kdDebug() << "no match" << endl; +#ifdef DEBUG_SETTINGS d->global.dump("global"); +#endif return d->global; } --------------Boundary-00=_1IND4Y7BZSH3BJ6BSD8I--