[Digikam-devel] setButtonGuiItem() from KDE 3.3

Tom Albers tomalbers at kde.nl
Sat Nov 26 16:25:06 GMT 2005


Mike Seymour (sent by Nabble.com) wrote:
> Hello:
> 
> Actually, the change in the SVN souce will leave the forward and back
> buttons blank in the image properties dialog.  I added the code below
> which seemed to give the buttons for those of us stuck with KDE < 3.3
> cordialement

Hi,

I dont undestand this patch, it seems to remove the special handling for
KDE<3.3. Maybe the patch is the wrong way around? Anyway the current
code looks like:

    if (m_mode == MULTI)
    {
#if KDE_IS_VERSION(3,3,0)
        setButtonGuiItem(User1, KStdGuiItem::guiItem(KStdGuiItem::Forward));
        setButtonGuiItem(User2, KStdGuiItem::guiItem(KStdGuiItem::Back));
#endif
        enableButton(User1, m_currItem->nextItem() != 0);
        enableButton(User2, m_currItem->prevItem() != 0);
    }

Let me know what to change..

Toma


> Mike
> 
> *** imageproperties.cpp 2005-11-22 22:40:41.023253880 +0100
> --- imageproperties.cpp.bak     2005-11-16 15:18:32.000000000 +0100
> ***************
> *** 59,74 ****
>   {
>       if (m_mode == MULTI)
>       {
> -     #if KDE_IS_VERSION(3,3,0)
>           setButtonGuiItem(User1,
> KStdGuiItem::guiItem(KStdGuiItem::Forward));
>           setButtonGuiItem(User2, KStdGuiItem::guiItem(KStdGuiItem::Back));
> -     #else
> -       setButtonText(User1,
>  KStdGuiItem::guiItem(KStdGuiItem::Forward).plainTe
> xt() );
> -       setButtonTip( User1,
> KStdGuiItem::guiItem(KStdGuiItem::Forward).toolTip(
> ) );
> -       setButtonText(User2,
>  KStdGuiItem::guiItem(KStdGuiItem::Back).plainText(
> ) );
> -       setButtonTip( User2,
> KStdGuiItem::guiItem(KStdGuiItem::Back).toolTip() )
> ;
> 
> -     #endif
>           enableButton(User1, m_currItem->nextItem() != 0);
>           enableButton(User2, m_currItem->prevItem() != 0);
>       }
> --- 59,67 ----
> 
> 
> 
>     Gilles Caulier wrote:
>     Le Mardi 15 Novembre 2005 00:14, Uwe Reder a �crit :
>     > Hi!
>     >
>     > I run KDE 3.2.3. Compilation breaks in
>     > digikam-0.8.0-rc/digikam/digikam/imageproperties.cpp with
>     > setButtonGuiItem() undefined. It seams setButtonGuiItem() appeared
>     with
>     > KDE 3.3. There must be a way to work around setButtonGuiItem()
>     since it is
>     > the only method (as far as I can see) that is used from 3.3.
>     >
>     > I took a rather simple approach to solve the problem: I backported
>     > setButtonGuiItem() to 3.2.3's libkdeui.so. Works perfectly for me :-)
>     >
>     > Uwe.
> 
>     Fixed on svn to ignore this method if compiling under kde 3.2.x like
>     this :
> 
>     ImageProperties::ImageProperties(enum Mode mode, QWidget* parent,
>                                      AlbumIconView* view, AlbumIconItem*
>     currItem,
>                                      QRect* selectionArea, uint* imageData,
>                                      int imageWidth, int imageHeight)
>         : KDialogBase(Tabbed, QString::null,
>                       (mode == MULTI) ? Help|User1|User2|Stretch|Close :
>     Help|
>     Stretch|Close,
>                       Close, parent, 0, true, true),
>           m_view(view), m_currItem(currItem), m_mode(mode)
>     {
>         if (m_mode == MULTI)
>         {
>     #if KDE_IS_VERSION(3,3,0)
>             setButtonGuiItem(User1,
>     KStdGuiItem::guiItem(KStdGuiItem::Forward));
>             setButtonGuiItem(User2,
>     KStdGuiItem::guiItem(KStdGuiItem::Back));
>     #endif
>             enableButton(User1, m_currItem->nextItem() != 0);
>             enableButton(User2, m_currItem->prevItem() != 0);
>         }
>     ...
> 
>     Regards
> 
>     -- 
>     Gilles Caulier
> 
>     _______________________________________________
>     Digikam-devel mailing list
>     Digikam-devel at kde.org
>     https://mail.kde.org/mailman/listinfo/digikam-devel
> 
> 
> ------------------------------------------------------------------------
> Sent from the digikam-devel
> <http://www.nabble.com/setButtonGuiItem%28%29-from-KDE-3.3-t552361.html#a1607996>
> forum at Nabble.com.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3577 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20051126/63b155ca/attachment.bin>


More information about the Digikam-devel mailing list