On Sep 19, 2010, at 12:02 AM, Pavel Sanda wrote:

> Jens Nöckel wrote:
>> Another version of the patch is attached, this time hopefully readable by 
>> everyone... 
> 
> no its octet-stream now. next guess is .txt :)
> 
Or using a different mailer, sigh.

> cant be this code:
> 
> +// GUI_DONTSWAPCB_VISIBLE reveals checkbox for switching Ctrl and Meta on 
> Mac:                                                                          
>                                               
> +#ifdef Q_WS_MACX                                        
> +#if QT_VERSION > 0x040600                               
> +       connect(dontswapCB, SIGNAL(toggled(bool)),       
> +               this, SIGNAL(changed()));                
> +#define GUI_DONTSWAPCB_VISIBLE true                     
> +#endif                                                 
> +#endif                                                  
> +#ifndef GUI_DONTSWAPCB_VISIBLE                          
> +       dontswapCB->setVisible(false);                   
> +#endif                            
> 
> 
> written as:
> 
> +       connect(dontswapCB, SIGNAL(toggled(bool)),       
> +               this, SIGNAL(changed()));                
> +#ifdef Q_WS_MACX                                        
> +#if QT_VERSION > 0x040600                               
> +       dontswapCB->setVisible(false);                   
> +#endif                                                  
> 

No, this would be the wrong way around. If you really want even fewer #ifdef, 
one could say this:

+       connect(dontswapCB, SIGNAL(toggled(bool)),       
+               this, SIGNAL(changed()));                
+       dontswapCB->setVisible(false);                   
+#ifdef Q_WS_MACX                                        
+#if QT_VERSION > 0x040600                               
+       dontswapCB->setVisible(true);                   
+#endif                                                  

But then the actual code on Mac would execute two calls to setVisible instead 
of one, which just seems slightly more  inelegant. 

Jens


Reply via email to