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

List:       kde-devel
Subject:    Re: Abnormal behavior with Icons
From:       fenix <fenix () club-internet ! fr>
Date:       2002-04-15 21:13:32
[Download RAW message or body]

Le lun 15/04/2002 à 20:19, David Faure a écrit :
> On Tuesday 16 April 2002 00:01, fenix wrote:
> > [kde3@DarKBlue ~/kde/CVSHEAD/kdelibs]$ grep about_kde `find . -name
> > "*.cpp" -o -name "*.h" -o -name "*.ui"`
> > ./kdeui/khelpmenu.cpp:    if (kapp->authorizeKAction("help_about_kde"))
> > ./kdeui/kstdaction.cpp: { AboutKDE,      KStdAccel::AccelNone,
> > "help_about_kde", I18N_NOOP("About &KDE"), 0,"about_kde" },
> > [kde3@DarKBlue ~/kde/CVSHEAD/kdelibs]$ 
> > 
> > who use "about_kde" icon ???
> 
> The standard action defined above, in the kstdaction.cpp match - i.e.
> all applications with a standard help menu.

ok i have understand ...

in kstdaction.cpp we have

...
KAction *aboutKDE( const QObject *recvr, const char *slot,
KActionCollection* parent, const char *name )
{ return KStdAction::create( AboutKDE, name, recvr, slot, parent ); }
...

who create a KAction with "about_kde.png" icon
but in khelpmenu.cpp we have:

...
KStdAction::aboutKDE(this, SLOT(aboutKDE()), actions);
...
if (kapp->authorizeKAction("help_about_kde"))
{
  mMenu->insertItem( SmallIcon("go"), i18n( "About &KDE" ), menuAboutKDE
);
  mMenu->connectItem( menuAboutKDE, this, SLOT( aboutKDE() ) );
}
...


the possibly correct code can be
...
mActions = actions; // store the KActionCollection in KHelpMenu member
if (mActions)
{
    StdAction::helpContents(this, SLOT(appHelpActivated()), actions);
    if (showWhatsThis)
      KStdAction::whatsThis(this, SLOT(contextHelpActivated()),
actions);
    KStdAction::reportBug(this, SLOT(reportBug()), actions);
    KStdAction::aboutApp(this, SLOT(aboutApplication()), actions);
    KStdAction::aboutKDE(this, SLOT(aboutKDE()), actions);
}
...
if (kapp->authorizeKAction("help_about_kde"))
{
   KAction* help_about_kde_action = (mActions) ?
mActions->action("help_about_kde") : KStdAction::aboutKDE(this,
SLOT(aboutKDE()), actions); // ;( how to get it without
KActionCollection

   if (help_about_kde_action) { // assertion ??
     help_about_kde_action->plug(mMenu, menuAboutKDE);
   }
}
...

the same idea can be applied to others actions

> -- 
> David FAURE, david@mandrakesoft.com, faure@kde.org
> http://people.mandrakesoft.com/~david/, http://www.konqueror.org/
> KDE, Making The Future of Computing Available Today

FeniX


>> 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