From kde-commits Fri Aug 29 01:24:40 2008 From: Harri Porten Date: Fri, 29 Aug 2008 01:24:40 +0000 To: kde-commits Subject: branches/KDE/4.1/kdelibs/khtml/ecma Message-Id: <1219973080.381461.6153.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=121997309218004 SVN commit 854183 by porten: Merged revision 854182: Event handlers were still accessing the debugger even if it was disabled. M +6 -6 kjs_events.cpp M +10 -0 kjs_proxy.cpp M +1 -0 kjs_proxy.h --- branches/KDE/4.1/kdelibs/khtml/ecma/kjs_events.cpp #854182:854183 @@ -62,18 +62,18 @@ void JSEventListener::handleEvent(DOM::Event &evt) { -#ifdef KJS_DEBUGGER - //### This is the wrong place to do this --- we need - // a more global/general stategy to prevent unwanted event loop recursion issues. - if (DebugWindow::window() && DebugWindow::window()->inSession()) - return; -#endif KHTMLPart *part = qobject_cast(static_cast(win.get())->part()); KJSProxy *proxy = 0L; if (part) proxy = part->jScript(); if (proxy && listener && listener->implementsCall()) { +#ifdef KJS_DEBUGGER + //### This is the wrong place to do this --- we need + // a more global/general stategy to prevent unwanted event loop recursion issues. + if (proxy->debugEnabled() && DebugWindow::window()->inSession()) + return; +#endif ref(); KJS::ScriptInterpreter *interpreter = static_cast(proxy->interpreter()); --- branches/KDE/4.1/kdelibs/khtml/ecma/kjs_proxy.cpp #854182:854183 @@ -60,6 +60,7 @@ virtual KJS::Interpreter *interpreter(); virtual void setDebugEnabled(bool enabled); + virtual bool debugEnabled() const; virtual void showDebugWindow(bool show=true); virtual bool paused() const; virtual void dataReceived(); @@ -279,6 +280,15 @@ #endif } +bool KJSProxyImpl::debugEnabled() const +{ +#ifdef KJS_DEBUGGER + return m_debugEnabled; +#else + return false; +#endif +} + void KJSProxyImpl::showDebugWindow(bool /*show*/) { #ifdef KJS_DEBUGGER --- branches/KDE/4.1/kdelibs/khtml/ecma/kjs_proxy.h #854182:854183 @@ -62,6 +62,7 @@ virtual KJS::Interpreter *interpreter() = 0; virtual void setDebugEnabled(bool enabled) = 0; + virtual bool debugEnabled() const = 0; virtual void showDebugWindow(bool show=true) = 0; virtual bool paused() const = 0; virtual void dataReceived() = 0;