https://bugzilla.gnome.org/show_bug.cgi?id=687520
Original commit message from CVS: merging autodetect from 0.8 branch