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

List:       koffice-devel
Subject:    Re: Thesaurus KDataTool
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-11-07 22:31:31
[Download RAW message or body]

On Mercredi 7 Novembre 2001 20:44, Daniel Naber wrote:
> On Tuesday 06 November 2001 13:44, David Faure wrote:
> 
> > Either you should provide an icon for it, or you should update the
> > code in KDataTool so that it accepts that no Icon is set.
> 
> The code goes like this:
> 
> KDataToolAction::KDataToolAction( const QString & text, const KDataToolInfo 
> & info, const QString & command, QObject * parent, const char * name )
>     : KAction( text, info.iconName(), 0, parent, name ),
>       m_command( command ),
>       m_info( info )
> {}
> 
> There's no icon if I remove "info.iconName()", but you cannot write an if() 
> there. As you can see I have no clue about C++...
Right, that's the problem I had in mind when saying that :}

Actually, passing an empty string to KAction should do the right thing IMHO.

Does this help ?

Index: kaction.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kaction.cpp,v
retrieving revision 1.196
diff -u -p -r1.196 kaction.cpp
--- kaction.cpp 2001/10/29 18:52:51     1.196
+++ kaction.cpp 2001/11/07 22:32:26
@@ -199,8 +199,8 @@ KAction::KAction( const QString& text, c
     setAccel( accel );

     d->m_iconName=pix;
-    d->m_bIconSetNotYetLoaded=true;
-    d->m_bIconSet=true;
+    d->m_bIconSetNotYetLoaded=!pix.isEmpty();
+    d->m_bIconSet=!pix.isEmpty();
 }

 KAction::KAction( const QString& text, const QIconSet& pix, int accel,
@@ -241,8 +241,8 @@ KAction::KAction( const QString& text, c
     setText( text );

     d->m_iconName=pix;
-    d->m_bIconSetNotYetLoaded=true;
-    d->m_bIconSet=true;
+    d->m_bIconSetNotYetLoaded=!pix.isEmpty();
+    d->m_bIconSet=!pix.isEmpty();

     if ( receiver )
       connect( this, SIGNAL( activated() ), receiver, slot );

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/ , http://www.konqueror.org/
KDE 3.0: Konquering the Desktops

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

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

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