Bug 97796

mweilguni at kde.org mweilguni at kde.org
Tue Mar 15 10:09:51 GMT 2005


Am Dienstag, 15. März 2005 10:30 schrieb Koos Vriezen:
> Hi,
>
> OT, can you please be a bit more descriptive. Ie. better to describe the
> bug than mentioning just a number. Not many of us knows which number is
> about what bug, nor has everyone figured out what the real problem is in
> BRs (or at least add an url to the BR for convenience).
> Also send diffs in with unified context (-u switch of diff). My cvsrc
> is:

This is the bug I mean, including testcases:
http://bugs.kde.org/show_bug.cgi?id=97796

I've no idea what you mean with "BRs"? Maybe we're talking of different things 
here?

Here's the patch in unified format:

Index: ../rendering/render_form.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_form.cpp,v
retrieving revision 1.284
diff -u -3 -p -r1.284 render_form.cpp
--- ../rendering/render_form.cpp        3 Dec 2004 14:18:21 -0000       1.284
+++ ../rendering/render_form.cpp        15 Mar 2005 10:00:48 -0000
@@ -155,18 +155,21 @@ void RenderCheckBox::slotStateChanged(in
 }

 // 
-------------------------------------------------------------------------------
-
 RenderRadioButton::RenderRadioButton(HTMLInputElementImpl *element)
     : RenderButton(element)
 {
     QRadioButton* b = new QRadioButton(view()->viewport(), "__khtml");
     b->setMouseTracking(true);
     setQWidget(b);
+
+    // prevent firing toggled() signals on initialization
+    b->setChecked(element->checked());
+
     connect(b,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
 }

 void RenderRadioButton::updateFromElement()
-{
+{
     widget()->setChecked(element()->checked());

     RenderButton::updateFromElement();
@@ -185,11 +188,13 @@ void RenderRadioButton::calcMinMaxWidth(
     RenderButton::calcMinMaxWidth();
 }

-void RenderRadioButton::slotToggled(bool)
+void RenderRadioButton::slotToggled(bool activated)
 {
-    ref();
-    element()->onChange();
-    deref();
+    if(activated) {
+      ref();
+      element()->onChange();
+      deref();
+    }
 }

 // 
-------------------------------------------------------------------------------

Regards,
Mario Weilguni




More information about the kfm-devel mailing list