[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: [patch] per-domain settings gui now fully functional for java & javascript
From:       Leo Savernik <l.savernik () aon ! at>
Date:       2002-12-19 17:34:49
[Download RAW message or body]

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

["khtml_per-domain_7.diff" (text/x-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<QString,KPerDomainSettings> 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;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic