Commit deeb2e26 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Fix includes and build

Disabled some code that does not compile or has dependency issues
parent 8a302c02
......@@ -27,6 +27,10 @@ ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX AKONADI
########### Find packages ###########
find_package(KF5 NO_MODULE REQUIRED COMPONENTS ItemViews KIO KDE4Support)
# Workaround for Akonadi server conflicting with our framework (same variable names)
# TODO: Remove once we merge both repositories into one
set(AKONADI_DBUS_INTERFACES_DIR "/usr/share/dbus-1/interfaces")
set(Boost_MINIMUM_VERSION "1.34.0")
find_package(Boost ${Boost_MINIMUM_VERSION})
set_package_properties(Boost PROPERTIES
......@@ -37,11 +41,15 @@ set_package_properties(Boost PROPERTIES
########### Targets ###########
configure_file(akonadiprivate_export.h.in "${CMAKE_CURRENT_BINARY_DIR}/akonadiprivate_export.h")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(src)
#add_subdirectory(autotests)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Akonadi")
ecm_configure_package_config_file(
......
#include "akonadi_export.h"
#include "akonadicore_export.h"
#define AKONADI_TESTS_EXPORT @AKONADI_TESTS_EXPORT@
......@@ -20,8 +20,9 @@
#ifndef AKONADI_RECURSIVEMOVER_P_H
#define AKONADI_RECURSIVEMOVER_P_H
#include <akonadi/collection.h>
#include <akonadi/item.h>
#include "item.h"
#include "collection.h"
#include "item.h"
#include "agentbase_p.h"
#include <kcompositejob.h>
......
# Turn exceptions on
kde_enable_exceptions()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/jobs
${CMAKE_CURRENT_SOURCE_DIR}/models
)
set(akonadicore_base_SRCS
agentinstance.cpp
agentmanager.cpp
......@@ -13,6 +18,7 @@ set(akonadicore_base_SRCS
changemediator_p.cpp
changenotificationdependenciesfactory.cpp
changerecorder.cpp
changerecorder_p.cpp
collection.cpp
collectionfetchscope.cpp
collectionpathresolver.cpp
......@@ -29,6 +35,7 @@ set(akonadicore_base_SRCS
entitycache.cpp
entitydeletedattribute.cpp
entitydeletedattribute.cpp
entitydisplayattribute.cpp
entityhiddenattribute.cpp
exception.cpp
firstrun.cpp
......@@ -54,6 +61,7 @@ set(akonadicore_base_SRCS
servermanager.cpp
session.cpp
specialcollectionattribute.cpp
specialcollections.cpp
tag.cpp
tagattribute.cpp
tagfetchscope.cpp
......@@ -125,19 +133,35 @@ set(akonadicore_jobs_SRCS
jobs/trashjob.cpp
jobs/trashrestorejob.cpp
jobs/unlinkjob.cpp
)
# FIXME KF5: Remove once we merge Akonadi repository in
# This is so that we find
include_directories("${CMAKE_INSTALL_PREFIX}/include")
set(akonadicore_dbus_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationManager.xml)
set_source_files_properties(${akonadicore_dbus_xml} PROPERTIES INCLUDE "akonadi/private/notificationmessagev3_p.h" )
qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationmanagerinterface )
set(akonadicore_dbus_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationSource.xml)
set_source_files_properties(${akonadicore_dbus_xml} PROPERTIES INCLUDE "akonadi/private/notificationmessagev3_p.h" )
qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationsourceinterface )
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.AgentManager.xml )
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Tracer.xml )
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml )
set(akonadicore_SRCS
${akonadicore_base_SRCS}
${akonadicore_jobs_SRCS}
${akonadicore_models_SRCS}
${akonadicore_dbus_SRCS}
)
add_library(KF5AkonadiCore ${akonadicore_SRCS})
qt5_add_dbus_interfaces(akonadicore_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.AgentManager.xml )
qt5_add_dbus_interfaces(akonadicore_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Tracer.xml )
qt5_add_dbus_interfaces(akonadicore_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml )
# qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Resource.xml resourcebase.h Akonadi::ResourceBase resourceadaptor Akonadi__ResourceAdaptor )
# qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Preprocessor.xml preprocessorbase_p.h Akonadi::PreprocessorBasePrivate preprocessoradaptor Akonadi__PreprocessorAdaptor )
# qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Status.xml agentbase.h Akonadi::AgentBase statusadaptor Akonadi__StatusAdaptor )
......@@ -156,9 +180,10 @@ target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${AkonadiCor
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${AkonadiCore_SOURCE_DIR}/src/core;${AkonadiCore_BINARY_DIR}/src/core>")
target_link_libraries(KF5AkonadiCore
KF5::ItemViews
KF5::ItemModels
KF5::KIOCore
KF5::KDE4Support
${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libakonadiprotocolinternals.so
)
set_target_properties(KF5AkonadiCore PROPERTIES
......@@ -188,5 +213,5 @@ install(FILES
${AkonadiCore_HEADERS}
DESTINATION ${INCLUDE_INSTALL_DIR}/akonadi COMPONENT Devel)
ecm_generate_pri_file(BASE_NAME AkonadiCore LIB_NAME KF5AkonadiCore DEPS "ItemViews KIOCore KDE4Support" FILENAME_VAR PRI_FILENAME)
ecm_generate_pri_file(BASE_NAME AkonadiCore LIB_NAME KF5AkonadiCore DEPS "ItemModels KIOCore KDE4Support" FILENAME_VAR PRI_FILENAME)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
......@@ -20,7 +20,7 @@
#ifndef AKONADI_AGENTINSTANCE_H
#define AKONADI_AGENTINSTANCE_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <QtCore/QList>
#include <QtCore/QMetaType>
......@@ -59,7 +59,7 @@ class AgentType;
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_EXPORT AgentInstance
class AKONADICORE_EXPORT AgentInstance
{
friend class AgentManager;
friend class AgentManagerPrivate;
......
......@@ -20,10 +20,10 @@
#ifndef AKONADI_AGENTMANAGER_H
#define AKONADI_AGENTMANAGER_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <akonadi/agenttype.h>
#include <akonadi/agentinstance.h>
#include "agenttype.h"
#include "agentinstance.h"
#include <QtCore/QObject>
......@@ -52,7 +52,7 @@ class Collection;
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_EXPORT AgentManager : public QObject
class AKONADICORE_EXPORT AgentManager : public QObject
{
friend class AgentInstance;
friend class AgentInstanceCreateJobPrivate;
......
......@@ -20,7 +20,7 @@
#ifndef AKONADI_AGENTTYPE_H
#define AKONADI_AGENTTYPE_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <QtCore/QList>
#include <QtCore/QMetaType>
......@@ -55,7 +55,7 @@ namespace Akonadi
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_EXPORT AgentType
class AKONADICORE_EXPORT AgentType
{
friend class AgentManager;
friend class AgentManagerPrivate;
......
......@@ -18,8 +18,7 @@
*/
#include "asyncselectionhandler_p.h"
#include <akonadi/entitytreemodel.h>
#include "models/entitytreemodel.h"
using namespace Akonadi;
......
......@@ -22,8 +22,8 @@
#include <QtCore/QObject>
#include <akonadi/collection.h>
#include <akonadi/item.h>
#include "collection.h"
#include "item.h"
class QAbstractItemModel;
class QModelIndex;
......
......@@ -20,7 +20,7 @@
#ifndef AKONADI_ATTRIBUTE_H
#define AKONADI_ATTRIBUTE_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <QtCore/QList>
......@@ -135,7 +135,7 @@ namespace Akonadi {
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT Attribute
class AKONADICORE_EXPORT Attribute
{
public:
/**
......
......@@ -20,11 +20,14 @@
#ifndef AKONADI_ATTRIBUTEENTITY_H
#define AKONADI_ATTRIBUTEENTITY_H
#include <akonadi/job.h>
#include <QVector>
#include <qsharedpointer.h>
#include "akonadicore_export.h"
#include "job.h"
#include "attribute.h"
#include <kdebug.h>
#include <QVector>
#include <QSharedPointer>
#include <KDebug>
namespace Akonadi {
......@@ -37,7 +40,7 @@ namespace Akonadi {
* calls etc.
* An even better solution is probably ot make AttributeEntity a private member of Entity, with all Attribute related member functions forwarding to this class.
*/
class AKONADI_EXPORT AttributeEntity {
class AKONADICORE_EXPORT AttributeEntity {
public:
AttributeEntity();
......
......@@ -20,7 +20,8 @@
#ifndef AKONADI_ATTRIBUTEFACTORY_H
#define AKONADI_ATTRIBUTEFACTORY_H
#include <akonadi/attribute.h>
#include "akonadicore_export.h"
#include "attribute.h"
namespace Akonadi {
......@@ -45,7 +46,7 @@ namespace Akonadi {
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT AttributeFactory
class AKONADICORE_EXPORT AttributeFactory
{
public:
//@cond PRIVATE
......
......@@ -20,7 +20,7 @@
#ifndef AKONADI_CACHEPOLICY_H
#define AKONADI_CACHEPOLICY_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <QtCore/QSharedDataPointer>
#include <QtCore/QStringList>
......@@ -68,7 +68,7 @@ namespace Akonadi {
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT CachePolicy
class AKONADICORE_EXPORT CachePolicy
{
public:
/**
......@@ -166,6 +166,6 @@ private:
/**
* Allows a cache policy to be output for debugging purposes.
*/
AKONADI_EXPORT QDebug operator<<(QDebug, const Akonadi::CachePolicy &);
AKONADICORE_EXPORT QDebug operator<<(QDebug, const Akonadi::CachePolicy &);
#endif
......@@ -25,7 +25,7 @@
#include <QtCore/QObject>
#include <QtCore/QSet>
#include <akonadi/item.h>
#include "item.h"
#include <akonadi/private/notificationmessagev2_p.h>
namespace Akonadi
......
......@@ -20,8 +20,7 @@
#ifndef CHANGENOTIFICATIONDEPENDENCIESFACTORY_P_H
#define CHANGENOTIFICATIONDEPENDENCIESFACTORY_P_H
#include <akonadi/session.h>
#include "session.h"
#include "entitycache_p.h"
namespace Akonadi {
......
......@@ -20,7 +20,8 @@
#ifndef AKONADI_CHANGERECORDER_H
#define AKONADI_CHANGERECORDER_H
#include <akonadi/monitor.h>
#include "akonadicore_export.h"
#include "monitor.h"
class QSettings;
......@@ -44,7 +45,7 @@ class ChangeRecorderPrivate;
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT ChangeRecorder : public Monitor
class AKONADICORE_EXPORT ChangeRecorder : public Monitor
{
Q_OBJECT
public:
......
......@@ -20,9 +20,8 @@
#ifndef AKONADI_COLLECTION_H
#define AKONADI_COLLECTION_H
#include "akonadi_export.h"
#include <akonadi/entity.h>
#include "akonadicore_export.h"
#include "entity.h"
#include <QtCore/QMetaType>
#include <QtCore/QSharedDataPointer>
......@@ -72,7 +71,7 @@ class CollectionStatistics;
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT Collection : public Entity
class AKONADICORE_EXPORT Collection : public Entity
{
public:
/**
......@@ -172,35 +171,35 @@ public:
* Returns the identifier of the parent collection.
* @deprecated Use parentCollection()
*/
AKONADI_DEPRECATED Id parent() const;
AKONADICORE_DEPRECATED Id parent() const;
/**
* Sets the identifier of the @p parent collection.
* @param parent the parent identifier to set
* @deprecated Use setParentCollection()
*/
AKONADI_DEPRECATED void setParent(Id parent);
AKONADICORE_DEPRECATED void setParent(Id parent);
/**
* Sets the parent @p collection.
* @param collection the parent collection to set
* @deprecated Use setParentCollection()
*/
AKONADI_DEPRECATED void setParent(const Collection &collection);
AKONADICORE_DEPRECATED void setParent(const Collection &collection);
/**
* Returns the parent remote identifier.
* @note This usually returns nothing for collections retrieved from the backend.
* @deprecated Use parentCollection()
*/
AKONADI_DEPRECATED QString parentRemoteId() const;
AKONADICORE_DEPRECATED QString parentRemoteId() const;
/**
* Sets the parent's remote @p identifier.
* @param identifier the parent's remote identifier to set
* @deprecated Use setParentCollection()
*/
AKONADI_DEPRECATED void setParentRemoteId(const QString &identifier);
AKONADICORE_DEPRECATED void setParentRemoteId(const QString &identifier);
/**
* Returns the root collection.
......@@ -296,11 +295,11 @@ private:
}
AKONADI_EXPORT uint qHash(const Akonadi::Collection &collection);
AKONADICORE_EXPORT uint qHash(const Akonadi::Collection &collection);
/**
* Allows to output a collection for debugging purposes.
*/
AKONADI_EXPORT QDebug operator<<(QDebug d, const Akonadi::Collection &collection);
AKONADICORE_EXPORT QDebug operator<<(QDebug d, const Akonadi::Collection &collection);
Q_DECLARE_METATYPE(Akonadi::Collection)
Q_DECLARE_METATYPE(Akonadi::Collection::List)
......
......@@ -21,7 +21,7 @@
#ifndef AKONADI_COLLECTIONFETCHSCOPE_H
#define AKONADI_COLLECTIONFETCHSCOPE_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <QtCore/QSharedDataPointer>
......@@ -65,7 +65,7 @@ class CollectionFetchScopePrivate;
* @author Volker Krause <vkrause@kde.org>
* @since 4.4
*/
class AKONADI_EXPORT CollectionFetchScope
class AKONADICORE_EXPORT CollectionFetchScope
{
public:
/**
......@@ -105,7 +105,7 @@ public:
*
* @deprecated Use includeUnsubscribed()
*/
AKONADI_DEPRECATED bool includeUnubscribed() const;
AKONADICORE_DEPRECATED bool includeUnubscribed() const;
/**
* Returns whether unsubscribed collection should be included.
......
......@@ -20,8 +20,9 @@
#ifndef AKONADI_COLLECTIONPATHRESOLVER_P_H
#define AKONADI_COLLECTIONPATHRESOLVER_P_H
#include <akonadi/collection.h>
#include <akonadi/job.h>
#include "akonadicore_export.h"
#include "collection.h"
#include "job.h"
namespace Akonadi {
......@@ -39,7 +40,7 @@ class CollectionPathResolverPrivate;
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT CollectionPathResolver : public Job
class AKONADICORE_EXPORT CollectionPathResolver : public Job
{
Q_OBJECT
......
......@@ -20,7 +20,8 @@
#ifndef AKONADI_COLLECTIONQUOTAATTRIBUTE_H
#define AKONADI_COLLECTIONQUOTAATTRIBUTE_H
#include <akonadi/attribute.h>
#include "akonadicore_export.h"
#include "attribute.h"
namespace Akonadi {
......@@ -47,7 +48,7 @@ namespace Akonadi {
* @author Kevin Ottens <ervin@kde.org>
* @since 4.4
*/
class AKONADI_EXPORT CollectionQuotaAttribute : public Akonadi::Attribute
class AKONADICORE_EXPORT CollectionQuotaAttribute : public Akonadi::Attribute
{
public:
/**
......
......@@ -20,10 +20,10 @@
#ifndef AKONADI_COLLECTIONRIGHTSATTRIBUTE_P_H
#define AKONADI_COLLECTIONRIGHTSATTRIBUTE_P_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <akonadi/collection.h>
#include <akonadi/attribute.h>
#include "collection.h"
#include "attribute.h"
namespace Akonadi {
......@@ -41,7 +41,7 @@ namespace Akonadi {
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_EXPORT CollectionRightsAttribute : public Attribute
class AKONADICORE_EXPORT CollectionRightsAttribute : public Attribute
{
public:
/**
......
......@@ -20,7 +20,8 @@
#ifndef AKONADI_COLLECTIONSTATISTICS_H
#define AKONADI_COLLECTIONSTATISTICS_H
#include "akonadi_export.h"
#include "akonadicore_export.h"
#include <QtCore/QMetaType>
#include <QtCore/QSharedDataPointer>
......@@ -66,7 +67,7 @@ namespace Akonadi {
*
* @author Volker Krause <vkrause@kde.org>
*/
class AKONADI_EXPORT CollectionStatistics
class AKONADICORE_EXPORT CollectionStatistics
{
public:
/**
......@@ -153,7 +154,7 @@ private:
/**
* Allows to output the collection statistics for debugging purposes.
*/
AKONADI_EXPORT QDebug operator<<(QDebug d, const Akonadi::CollectionStatistics &);
AKONADICORE_EXPORT QDebug operator<<(QDebug d, const Akonadi::CollectionStatistics &);
Q_DECLARE_METATYPE(Akonadi::CollectionStatistics)
......
......@@ -20,8 +20,8 @@
#ifndef AKONADI_COLLECTIONSYNC_P_H
#define AKONADI_COLLECTIONSYNC_P_H
#include <akonadi/collection.h>
#include <akonadi/transactionsequence.h>
#include "collection.h"
#include "transactionsequence.h"
namespace Akonadi {
......
......@@ -21,9 +21,10 @@
#define AKONADI_COLLECTIONUTILS_P_H
#include <QtCore/QStringList>
#include <akonadi/entitydisplayattribute.h>
#include <akonadi/collectionstatistics.h>
#include <akonadi/item.h>
#include "entitydisplayattribute.h"
#include "collectionstatistics.h"
#include "item.h"
namespace Akonadi {
......
......@@ -20,13 +20,13 @@
#include "conflicthandler_p.h"
#include "conflictresolvedialog_p.h"
//#include "conflictresolvedialog_p.h"
#include <akonadi/itemcreatejob.h>
#include <akonadi/itemfetchjob.h>
#include <akonadi/itemfetchscope.h>
#include <akonadi/itemmodifyjob.h>
#include <akonadi/session.h>