Nope. The length of the firearm at the barrel end, ends at the rifling. Adding flash hiders, fake suppressors, bayonets, vacuum cleaner nozzles, novelty clown noses, etc, to extend the length, permanent or otherwise does not add to the legal length of the firearm.
So the collapsed/ folded length to the end of the rifling is what you need to measure.
Yes, I read it in the firearms act, no I can't find it in that convoluted pile of a dogs breakfast at the moment.
BB.