A very frustrating issue for KDE users with firefox are the file associations. And manually setting the program for each file type is just too tedious.
What we have to do is provide a $HOME/.mailcap file which associates all file types with the xdg-open script, which will honor the file associations set in KDE (and other DE's too). Firefox uses that file to read the associations. If you want this to be system-wide (all users), copy it over /etc/mailcap (as root - backup is always a good idea) .
The easier way is to run the following command:
wget http://luisfpg.uuuq.com/blog/mailcap -O ~/.mailcap
This script was generated with update-user-mailcap, a ruby script that reads /etc/mime.types and generates the $HOME/.mailcap file. To run it, execute the following commands:
chmod +x update-user-mailcap
If you don't trust me, examine the file first. It's always a good idea to do this when downloading scripts from the Internet, by the way.
If you had previously customized some file associations in firefox, you might want to rename the $HOME/.mozilla/firefox/profile/mimeTypes.rdf to other name (or just remove it) and restart firefox to have the associations reset.
A (minor) drawback is that on the file download dialog, you will always see xdg-open as the program, and not the real program which will be used to open the file, but it will work. Trust me ;)