Commit bf280bff authored by Andreas Pakulat's avatar Andreas Pakulat

Uff. Unify #include's across libs and plugins.

The #include's now follow these rules:

For libraries
 - #include <foo.h> / #include <Foo> for anything outside kdevplatform - i.e.
   other libraries
 - #include "foo.h" or #include "../foo.h" or #include "bar/foo.h" or #include
   "../bar/foo.h" for headers that are inside the same library
 - #include <bar/foo.h> for any library bar in kdevplatform

For plugins
 - #include "foo.h" only for files inside the plugin
 - #include <bar/foo.h> for any kdevplatform library bar
 - #include <foo.h> / #include <Foo> for any other libs

This allows us to remove all include_directories() calls, so we're only have -I
switches for "external" libs (like KDE/Qt) and the top-level source/binary dir
as well as the "current" source/binary dir.

This is also supposed to make our header safer against include-problems, like
using #include <icore.h> and that picks up a header of similar name from some
other lib. 

We've had a discussion about this quite a while back. Still if anybody feels
like this still has problem please speak up.

CCMAIL:kdevelop-devel@kdevelop.org
parent 53402e6b
......@@ -15,7 +15,7 @@ include (MacroLogFeature)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR}/threadweaver )
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} )
# create config.h
configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
......
add_subdirectory(tests)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/interfaces
)
add_definitions( -DKDE_DEFAULT_DEBUG_AREA=9502 )
set(kdevplatforminterfaces_LIB_SRCS
context.cpp
......
......@@ -23,10 +23,10 @@
#include <kurl.h>
#include <kmimetype.h>
#include "interfacesexport.h"
#include <KTextEditor/Cursor>
#include <KTextEditor/Range>
#include "interfacesexport.h"
namespace KParts { class Part; class MainWindow; }
namespace KTextEditor { class Document; }
namespace Sublime{ class View; }
......
......@@ -30,9 +30,10 @@
#include <QtCore/QObject>
#include <kurl.h>
#include <ksharedconfig.h>
#include "interfacesexport.h"
#include <ksharedconfig.h>
template<typename T> class QList;
......
......@@ -17,10 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "idocument.h"
#include <QtCore/QObject>
#include "../idocument.h"
#include "scripttools.h"
#include "qobject.h"
namespace KDevelop
{
......
......@@ -20,7 +20,7 @@
#include "scriptingmanager.h"
#include "scripttools.h"
#include "icore.h"
#include "../icore.h"
#include <kross/core/manager.h>
......
......@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "interfacesexport.h"
#include "../interfacesexport.h"
namespace KDevelop
{
......
......@@ -18,8 +18,6 @@
***************************************************************************/
#include "scripttools.h"
#include "idocument.h"
#include "idocumentcontroller.h"
namespace KDevelop
{
......
......@@ -21,8 +21,8 @@
#define SCRIPTTOOLS_H
#include <QtCore/qobject.h>
#include "idocument.h"
#include "idocumentcontroller.h"
#include "../idocument.h"
#include "../idocumentcontroller.h"
Q_DECLARE_METATYPE(KDevelop::IDocument*)
Q_DECLARE_METATYPE(KDevelop::IDocumentController*)
......
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/sublime
${CMAKE_SOURCE_DIR}/shell
${CMAKE_SOURCE_DIR}/interfaces
)
set( scriptingtest_SRCS scriptingtest.cpp )
kde4_add_unit_test( scriptingtest TESTNAME scriptingtest ${scriptingtest_SRCS} )
......
......@@ -23,10 +23,10 @@
#include <kross/core/action.h>
#include <kross/core/manager.h>
#include "../../tests/common/autotestshell.h"
#include <tests/common/autotestshell.h>
#include "idocumentcontroller.h"
#include "idocument.h"
#include "../idocumentcontroller.h"
#include "../idocument.h"
class Script_Document: public QObject
{
......
......@@ -23,9 +23,9 @@
#include <kross/core/action.h>
#include <kross/core/manager.h>
#include "../../tests/common/autotestshell.h"
#include <tests/common/autotestshell.h>
#include "idocumentcontroller.h"
#include "../idocumentcontroller.h"
class Script_DocumentController: public QObject
{
......
......@@ -23,7 +23,7 @@
#include <kross/core/action.h>
#include <kross/core/manager.h>
#include "../../tests/common/autotestshell.h"
#include <tests/common/autotestshell.h>
/*
This is a very basic test to check the global objects
......
......@@ -22,7 +22,7 @@
#define DVCSADAPTORS_H
#include <QObject>
#include <vcsrevision.h>
#include <vcs/vcsrevision.h>
namespace KDevelop
{
......@@ -50,4 +50,4 @@ namespace KDevelop
};
}
#endif
\ No newline at end of file
#endif
......@@ -21,11 +21,11 @@
#include "krossbuildsystemmanager.h"
#include <KDebug>
#include <projectmodel.h>
#include <iproject.h>
#include <project/projectmodel.h>
#include <interfaces/iproject.h>
#include <kross/core/action.h>
#include <kross/core/manager.h>
#include "krossprojectmodel.h"
#include "wrappers/krossprojectmodel.h"
class ProjectManagerCallbacks : public QObject
{
......
......@@ -24,9 +24,9 @@
#include <QObject>
#include <QList>
#include <iprojectfilemanager.h>
#include <ibuildsystemmanager.h>
#include <iplugin.h>
#include <project/interfaces/iprojectfilemanager.h>
#include <project/interfaces/ibuildsystemmanager.h>
#include <interfaces/iplugin.h>
namespace Kross { class Action; }
......
......@@ -24,13 +24,13 @@
#include <KLocale>
#include <QMenu>
#include <iplugin.h>
#include <krossvcsjob.h>
#include <interfaces/iplugin.h>
#include <kross/core/action.h>
#include <context.h>
#include <projectmodel.h>
#include "krossvcsrevision.h"
#include "krossvcslocation.h"
#include <interfaces/context.h>
#include <project/projectmodel.h>
#include "krossvcsjob.h"
#include "wrappers/krossvcsrevision.h"
#include "wrappers/krossvcslocation.h"
using namespace KDevelop;
......
......@@ -24,8 +24,8 @@
#include <QObject>
#include <QList>
#include <vcsjob.h>
#include <idistributedversioncontrol.h>
#include <vcs/vcsjob.h>
#include <vcs/interfaces/idistributedversioncontrol.h>
namespace Kross { class Action; }
namespace KDevelop { class Context; }
......
......@@ -22,8 +22,8 @@
#include "krossbuildsystemmanager.h"
#include "krosstoolviewfactory.h"
#include "krosscontext.h"
#include "krosscontextmenuextension.h"
#include "wrappers/krosscontext.h"
#include "wrappers/krosscontextmenuextension.h"
#include <kross/core/manager.h>
#include <KUrl>
......@@ -31,15 +31,15 @@
#include <KDebug>
#include <KStandardDirs>
#include <icore.h>
#include <iproject.h>
#include <iplugincontroller.h>
#include <interfaces/icore.h>
#include <interfaces/iproject.h>
#include <interfaces/iplugincontroller.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <projectmodel.h>
#include <project/projectmodel.h>
#include <context.h>
#include <contextmenuextension.h>
#include <interfaces/context.h>
#include <interfaces/contextmenuextension.h>
K_PLUGIN_FACTORY(KrossSupportFactory, registerPlugin<KrossPlugin>(); )
K_EXPORT_PLUGIN(KrossSupportFactory("kdevkrossmanager"))
......
......@@ -21,7 +21,7 @@
#ifndef KROSSPROJECTMANAGER_H
#define KROSSPROJECTMANAGER_H
#include <iplugin.h>
#include <interfaces/iplugin.h>
#include <kross/core/action.h>
......
......@@ -22,7 +22,7 @@
#define KROSSTOOLVIEWFACTORY_H
#include <kross/core/action.h>
#include "iuicontroller.h"
#include <interfaces/iuicontroller.h>
class KrossToolViewFactory: public KDevelop::IToolViewFactory, public QObject
{
......@@ -43,4 +43,4 @@ private:
Qt::DockWidgetArea m_pos;
};
#endif
\ No newline at end of file
#endif
......@@ -24,8 +24,8 @@
#include <QObject>
#include <QList>
#include <vcsjob.h>
#include <idistributedversioncontrol.h>
#include <vcs/vcsjob.h>
#include <vcs/interfaces/idistributedversioncontrol.h>
namespace Kross { class Action; }
......
......@@ -22,7 +22,7 @@
#define PROJECTITEMADAPTORS_H
#include <KUrl>
#include "projectmodel.h"
#include <project/projectmodel.h>
class IProject;
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <context.h>
#include <interfaces/context.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <context.h>
#include <interfaces/context.h>
namespace Handlers
{
QVariant _fileContextHandler(void* type);
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <contextmenuextension.h>
#include <interfaces/contextmenuextension.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <contextmenuextension.h>
#include <interfaces/contextmenuextension.h>
namespace Handlers
{
QVariant _contextMenuExtensionHandler(void* type);
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <idocument.h>
#include <interfaces/idocument.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <idocument.h>
#include <interfaces/idocument.h>
namespace Handlers
{
QVariant _iDocumentHandler(void* type);
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <iuicontroller.h>
#include <interfaces/iuicontroller.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <iuicontroller.h>
#include <interfaces/iuicontroller.h>
namespace Handlers
{
QVariant _iToolViewFactoryHandler(void* type);
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <projectmodel.h>
#include <project/projectmodel.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <projectmodel.h>
#include <project/projectmodel.h>
namespace Handlers
{
QVariant _projectExecutableTargetItemHandler(void* type);
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <vcslocation.h>
#include <vcs/vcslocation.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <vcslocation.h>
#include <vcs/vcslocation.h>
namespace Handlers
{
QVariant _vcsLocationHandler(void* type);
......
......@@ -4,7 +4,7 @@
#include <QtCore/QVariant>
#include <kross/core/manager.h>
#include <kross/core/wrapperinterface.h>
#include <vcsrevision.h>
#include <vcs/vcsrevision.h>
using namespace KDevelop;
......
......@@ -5,7 +5,7 @@
//This is file has been generated by xmltokross, you should not edit this file but the files used to generate it.
#include <vcsrevision.h>
#include <vcs/vcsrevision.h>
namespace Handlers
{
QVariant _vcsRevisionHandler(void* type);
......
add_definitions( -DKDE_DEFAULT_DEBUG_AREA=9505 )
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/interfaces