The solution used by Gentoo for installing KDE3 and
KDE4 in
parallel was to filter the
$PATH variable in startkde by using sed--if the startkde
for KDE3 was invoked, KDE4
directories would be filtered out of the path, and
vice-versa. That fixes most of the
problems you describe (invoking a KDE4 application while
running KDE3/Trinity
does require the full path to be given, but that's a minor
flaw compared to not knowing
which app you're going to be getting), although I admit it
isn't elegant.
A challenge with that solution is when KDE4 apps are installed in /usr/bin. Tough to
filter that location from the $PATH variable. :) I'm curious how that was achieved,
unless in Gentoo KDE4 executables are installed someplace unique rather than /usr/bin.
I mentioned the *.desktop files. I haven't thought of a smooth or slick way to update
those files on-the-fly when building packages. But in my proposed revised starttde script
(bug report 675), I revised everything to full paths to avoid conflicts with KDE4 because
that was exactly what was happening to me.
I'm starting to think that not using full paths in files such as the *.desktop files
is an old habit that works a significant majority of the time but probably is a bad habit
nonetheless.
Perhaps anything that gets installed in a non standard location like /opt should be built
to use full paths everywhere? :)
Darrell