cpp includes in http ioslave

Dawit A adawit at kde.org
Sun Jul 17 18:14:39 BST 2011

On Sun, Jul 17, 2011 at 6:38 AM, Rolf Eike Beer
<kde at opensource.sf-tec.de> wrote:
> When one looks at kioslave/http/http.cpp it finds things like this:
> //string parsing helpers and HeaderTokenizer implementation
> #include "parsinghelpers.cpp"
> //authentication handlers
> #include "httpauthentication.cpp"
> Which happens because e.g. parsinghelpers.cpp only consist of static
> functions. httpauthentication.cpp on the other hand consists of normal class
> implementations. I don't really see a point in keeping at least this file
> included as it's currently is. I wanted to write some testcases for this and
> found out it's hard to use at all as several headers are missing because it
> relies on http.cpp including them. In httpauthentication.h you can also find
> things like this:

> #ifndef HTTP_H_ // if we're included from http.cpp all necessary headers are
> already included
> #include <QtCore/QByteArray>
> #include <QtCore/QString>
> #include <QtCore/QList>
> #include <kio/authinfo.h>
> #endif
> Would anyone object if I clean this up so the cpp files are all compiled on
> their own and the parsinghelper stuff is put into a namespace (to avoid
> pollution the global one) so these files can be just added in the
> CMakeLists.txt to some project (like the testcases)?

No objection to the cleanup, but please do not do it until I commit my
changes. I haved added a new unit test for http authentication after
fixing the test cases that were failing at
http://greenbytes.de/tech/tc/httpauth/. The unit test is actually more
through than that and exercises many parts of http authentication
including calculation of digest and basic authentications. I hope you
did not also do the same thing.

> I also would like to move the kioslave/tests/ directory to
> kioslave/http/tests. Currently all tests in there are http tests anyway. The
> rationale behind this is that the authentication test would need to duplicate
> all that gss include/link stuff from the http/CMakeLists.txt. I don't want to
> duplicate this as it would also needed to kept in sync if anyone goes and
> touches this. So putting the tests into the http directory would allow the
> tests to simply use the same settings that kio_http uses.

This makes sense to me too, but please wait until I commit my changes.

Dawit A.

More information about the kde-core-devel mailing list