Here is an f/11 ISO chart comparison:


28mm f/1.8 at f/11 vs. 17-40 at 28mm f/11


As you can see, the 17-40 is sharper and has less chromatic aberration. I think the L zoom has a little less flare and distortion, too.


At f/4 it's a different story:


28mm f/1.8 at f/4 vs 17-40 at 28mm f/4


Here, the prime is noticeably sharper.


Since most people like to stop down for deep DOF in landscapes, I'd say that the 17-40 has the edge in image quality. (In fact, it's better in just about everything except price, weight, and wide apertures.)