cpp includes in http ioslave

Rolf Eike Beer kde at opensource.sf-tec.de
Sun Jul 17 11:38:40 BST 2011


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)?

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.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110717/0805e932/attachment.sig>


More information about the kde-core-devel mailing list