How to debug #103713?

David Faure faure at kde.org
Thu Apr 14 14:09:38 BST 2005


On Thursday 14 April 2005 14:18, Michael Brade wrote:
> On Thursday 14 April 2005 07:52, Jens Herden wrote:
> > > The slot
> > > KNoteEdit::textSuperScript() is called twice and KAction tells me that
> > > the button was clicked twice, although I really clicked only once.
> >
> > This smells like you did connect the signal twice to the same slot?
> No, then it would never work correctly. However, it does on some systems 
> sometimes, seemingly dependent on some configuration.
> 
> BTW, I create the action like this:
> 
>     m_textSuper = new KToggleAction( i18n("Superscript"), "text_super", 0,
>                                      this, SLOT(textSuperScript()),
>                                      actions, "format_super" );
>     m_textSub = new KToggleAction( i18n("Subscript"), "text_sub", 0,
>                                    this, SLOT(textSubScript()),
>                                    actions, "format_sub" );
> 
>     m_textSuper->setExclusiveGroup( "valign" );
>     m_textSub->setExclusiveGroup( "valign" );
> 
> When clicking either of them, the slot is called twice -- sometimes. Guess I 
> will have to delete every single config file one after another and see when 
> it stops working... :-((

The "exclusiveness" could be the problem; i.e. the other one gets unchecked,
which might call activate? In KWord (kwview.cc, e.g. KWView::viewPageMode)
we check if ( action->isChecked() ) from the slot. But that's also because when
switching between viewmodes always one viewmode has to be checked, which
isn't the case for you. Hmm, but we do have subscript/superscript actions too,
and exclusive too, and I haven't seen the bug you talk about there.
Anyway, backtraces will certainly tell you what's happening.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list