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

List:       kde-devel
Subject:    Re: KToggleAction and KDE 3.5
From:       David Faure <faure () kde ! org>
Date:       2006-05-31 13:10:57
Message-ID: 200605311510.57435.faure () kde ! org
[Download RAW message or body]

On Wednesday 31 May 2006 14:17, Armando Navarro-Vazquez wrote:
> Dear All:
> I have an application with some exclusive KToggleActions where the
> toggled(bool ) signals are connected to some slots. Things were fine till I
> installed KDE 3.5.1 (Suse 10.1 x86_64 ), now the toggled(bool ) signal is
> only emitted when I change from one action to another, but not when I
> check/uncheck the action.
> Is this a bug or things are different in KDE 3.5 ? Any way to circumvent
> this problem?

Yeah there was a behavior-incompatible change to kdelibs, which was discovered
too late [well, I warned early enough but the committer didn't react for a long \
time...]

The committer forgot that there are two ways to use exclusive ktoggleactions indeed:
to switch between N modes (so clicking on the current action shouldn't do anything)
and to switch between N modes plus "none checked" - like for kword's \
superscript/subscript buttons.

This is how we fixed the regression in KWord:

-laptop- dfaure 15:08 /devel/kde/src/3/koffice/kword>svnlastchange -r469530 \
KWView.cpp subversion/libsvn_fs_fs/tree.c:315: (apr_err=160013)
Index: kwview.cc
===================================================================
--- kwview.cc   (revision 469529)
+++ kwview.cc   (revision 469530)
@@ -802,11 +802,11 @@ void KWView::setupActions()
     actionFormatSuper = new KToggleAction( i18n( "Superscript" ), "super", 0,
                                               this, SLOT( textSuperScript() ),
                                               actionCollection(), "format_super" );
-    actionFormatSuper->setExclusiveGroup( "valign" );
+    //actionFormatSuper->setExclusiveGroup( "valign" );
     actionFormatSub = new KToggleAction( i18n( "Subscript" ), "sub", 0,
                                               this, SLOT( textSubScript() ),
                                               actionCollection(), "format_sub" );
-    actionFormatSub->setExclusiveGroup( "valign" );
+    //actionFormatSub->setExclusiveGroup( "valign" );

     actionFormatIncreaseIndent= new KAction( i18n( "Increase Indent" ),
                                             QApplication::reverseLayout() ? \
"format_decreaseindent" : "format_increaseindent", 0, @@ -4891,6 +4891,8 @@ void \
KWView::textSuperScript()  }
     if( macroCmd)
         m_doc->addCommand(macroCmd);
+    if (actionFormatSuper->isChecked() )
+        actionFormatSub->setChecked( false );
 }

 void KWView::textSubScript()
@@ -4911,6 +4913,8 @@ void KWView::textSubScript()
     }
     if( macroCmd )
         m_doc->addCommand(macroCmd);
+    if (actionFormatSub->isChecked() )
+        actionFormatSuper->setChecked( false );
 }

 void KWView::changeCaseOfText()


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

 
> > Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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