I am trying to set the icon used by a button on the taskbar without success. I created a link to an application on the desktop and the icon looks right. But then when I drag it onto the taskbar the icon reverts to a KDE cog.

It's a KDE desktop. I know how to set the icon or at least how it should work but it simply isn't working. If I create the link on the desktop first and set its icon everything is great. But as soon as I drag it on to the taskbar the icon reverts to the default KDE cog icon. It doesn't matter what I do after that I cannot get it to accept the right icon (which is a PNG file) unless I drag it back on to the desktop (at which point it changes back to the correct icon).