fix branch acquisition
only set gcc/qt env variables if paths actually exist
use unicode safe classes for switching between upper/lower