I wonder what the purpose of the following lines in xdg-mime would be: KMIMETYPEFINDER=`which kmimetypefinder 2>/dev/null` $KMIMETYPEFINDER "$1" 2>/dev/null | head -n 1 Since the variable KMIMETYPEFINDER is not used anywhere else, the following equivalent form would be more efficient: kmimetypefinder "$1" 2>/dev/null | head -n 1 Of course, there is a subtle difference when kmimetypefinder cannot be found (that means, of course, that the PATH is set to a weird value or the system is damaged). In this case, the error message is forcibly silenced and the argument $1 gets SILENTLY EXECUTED, which is why I set severity to Major.
This seems odd to me at first glance too. Unless I hear any cries to keep or justify this code in the next few days, I'll amend it as suggested.
I guess it's a copy/paste from the KDE3 support code, adapted for KDE4 support: if [ x"$KDE_SESSION_VERSION" = x"4" ]; then DEBUG 1 "Running kmimetypefinder \"$1\"" KMIMETYPEFINDER=`which kmimetypefinder 2>/dev/null` $KMIMETYPEFINDER "$1" 2>/dev/null | head -n 1 else DEBUG 1 "Running kfile \"$1\"" KFILE=`which kfile 2>/dev/null` $KFILE "$1" 2> /dev/null | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1 fi
Thanks. http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=2c7ff0948d7db32042aa29c5b1213746d78ce852
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.