Problem with KAction::updateIcon{,Set} ?

David Faure david at
Thu Dec 12 14:58:17 GMT 2002

Hash: SHA1

On Thursday 12 December 2002 14:54, Ben Burton wrote:
> Hi.  The problem I'm experiencing is as follows.
> Create a KPart that provides actions with their own icons, i.e., icons in 
> .../apps/foopart/icons/, not in the global icon dirs.
> Look at the menu item for an action, and then configure the toolbars (with a 
> standard KEditToolbar dialog).  Everything is peachy.
> Restart the application.  Configure the toolbars *without* first looking at 
> the menu item.  Then the actions in question for the part have blank icons in 
> the KEditToolbar dialog.  But furthermore, if you look at the menu item 
> *after* that, the icons are still blank, i.e., the correct icons seem to 
> never get loaded.
> I had a rummage through the kdelibs sources to see why this might be 
> happening; my best guess is that KAction::updateIcon() and 
> KAction::updateIconSet() call KGUIItem::iconSet() without providing an 
> instance (thus defaulting to KGlobal::instance() which won't work for the 
> KPart AFAICT).  I'm guessing that these routines need extra code to pass the 
> correct instance, as is done in KAction::plug(), though it's entirely 
> possible I have no idea what I'm talking about.

But the actions _are_ plugged into the menus, even if the user doens't open the menus.
Unless you use slotAboutToShow like we do for bookmarks in konqueror, but
I don't think this is the case here.

What this does look like, though, is a bug in the delayed icon loading.
Can you check if commenting out the (only) line in KIconLoader::enableDelayedIconSetLoading()
fixes it?

- -- 
David FAURE, david at, faure at
Contributing to:,
Get the latest KOffice -
Version: GnuPG v1.0.7 (GNU/Linux)


More information about the kde-core-devel mailing list