Problem with KAction::updateIcon{,Set} ?

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


-----BEGIN PGP SIGNED MESSAGE-----
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 mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9+KQJ72KcVAmwbhARAstQAJ4358vrs7BaCq3Cqhc4JtCvqzllPgCfSDkb
b9AQXbdHmCKRvyhA2fWV+OM=
=4wDZ
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list