Angus Leeming wrote: > Index: src/frontends/qt2/QDocument.C > > > + string x11hexname = params.branchlist().getColor(current_branch); > > + // check that we have a valid color! > > + if (x11hexname[0] != '#') > > + x11hexname = lcolor.getX11Name(LColor::background); > > Is this safe? Can branchlist().getColor() return string()? If so, you > should have > if (x11hexname.empty() || x11hexname[0] != '#')
branchlist().getColor() can return string() (but it shouldn't as I read the code). What I want is that we fall back to the background color whenever the branch has no sensible color or color "none". Doesn't an empty string mean "no color"? Anyway, the branches background was set to black for new branches. This is the fallback color of LColor.C, but we do not want this at all here. > > + lcolor.setColor(current_branch, x11hexname); > > This doesn't belong in the frontends. This should be moved into the > controller along, into the function called in the very next line in > fact. O.K. Done. Thanks, Jürgen.