2015-07-04 12:43 GMT+03:00 Boudhayan Gupta <m...@baloneygeek.com>: > You've gone ahead and moved all the includes from the header file to > the .cpp file? I'm going to revert that commit, since the decision to > keep all the #includes in the header is a coding style decision I > consciously made. I know this extends build times, but this keeps > things tidy - I can see exactly which components a single cpp file > depends on my looking at the headers, I don't have to look through > both the cpp and the header file. The cpp file should include one and > only one header file, and that's it's own header. > > I appreciate you fixing the build without XCB very much. However, > before making major coding style changes, please use the Review Board > or ask over e-mail. KScreenGenie does *not* use the kdelibs coding > style.
Hi Boudhayan, A good practice is to not rely on the headers pulled transitively, see [1,2]. So, the .cpp file should have all these includes anyway; and when it does, there is no reason to keep unnecessary includes in the header. Projects use different coding styles because each has its pros and cons. But regarding this #include thing the solution recommended in the links below is much more advantageous than what you decided to do. [1] http://programmers.stackexchange.com/a/262020 [2] http://stackoverflow.com/a/15420950 -- Alexander Potashev