tdepim: fix build issues

The *Register.cpp files and everything they include must compile
without hard dependencies on header files which are TDE specific,
so add some ifdefs. Compiling with TDE backends disabled broke
because of this.

When enabled (untested!), it is unclear how some of these *Register.cpp
could have worked without including the header file that defines the
class they instantiate. Added the necessary includes.

A closing } was missing (found by cppcheck, which tests all variations
of the code, not just those currently enabled).

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
Patrick Ohly 2016-10-07 06:03:42 -07:00
parent 160b1f5e60
commit e05817a492
6 changed files with 32 additions and 10 deletions

View File

@ -20,6 +20,11 @@
*
*/
#include "TDEPIMAddressBookSource.h"
#include <syncevo/util.h>
#include <syncevo/SyncSource.h>
SE_BEGIN_CXX
static SyncSource *createSource(const SyncSourceParams &params)
@ -105,6 +110,7 @@ protected:
// source.reset((TestingSyncSource *)SyncSource::createTestingSource("contacts", "kde-contacts", true, NULL));
// CPPUNIT_ASSERT_NO_THROW(source->open());
// }
};
SYNCEVOLUTION_TEST_SUITE_REGISTRATION(TDEAddressBookTest);

View File

@ -25,7 +25,10 @@
// #include "TDEPIMNotesSource.h"
// #include "test.h"
#include "TDEPIMSyncSource.h"
#include "TDEPIMCalendarSource.h"
#include <syncevo/util.h>
#include <syncevo/SyncSource.h>
SE_BEGIN_CXX

View File

@ -26,14 +26,14 @@
#include "config.h"
#include "KNotesIface_stub.h"
#include <syncevo/TrackingSyncSource.h>
#include <syncevo/declarations.h>
SE_BEGIN_CXX
#ifdef ENABLE_TDEPIMNOTES
#include "KNotesIface_stub.h"
#include <syncevo/TrackingSyncSource.h>
/**
* Implements access to TDE memo lists (stored as knotes items),
* exporting/importing the memos in plain UTF-8 text.

View File

@ -27,6 +27,9 @@
#include "TDEPIMSyncSource.h"
#include <syncevo/util.h>
#include <syncevo/SyncSource.h>
SE_BEGIN_CXX
static SyncSource *createSource ( const SyncSourceParams &params )

View File

@ -23,9 +23,9 @@
#ifndef TDEPIMSYNCSOURCE_H
#define TDEPIMSYNCSOURCE_H
// #include "config.h"
#include "config.h"
//#ifdef ENABLE_TDEPIM
#ifdef ENABLE_TDEPIM
#include <tdeapplication.h>
#include <syncevo/util.h>
@ -52,5 +52,5 @@ private:
};
SE_END_CXX
//#endif // ENABLE_TDEPIM
#endif // ENABLE_TDEPIM
#endif // TDEPIMSYNCSOURCE_H

View File

@ -13,26 +13,36 @@ else
noinst_LTLIBRARIES += $(src_backends_tdepim_lib)
endif
src_backends_tdepim_synctdepimcal_src = \
src_backends_tdepim_synctdepimcal_src =
if ENABLE_TDEPIMCAL
src_backends_tdepim_synctdepimcal_src += \
src/backends/tdepim/TDEPIMSyncSource.h \
src/backends/tdepim/TDEPIMSyncSource.cpp \
src/backends/tdepim/TDEPIMCalendarSource.h \
src/backends/tdepim/TDEPIMCalendarSource.cpp \
$(NOP)
endif
src_backends_tdepim_synctdepimabc_src = \
src_backends_tdepim_synctdepimabc_src =
if ENABLE_TDEPIMABC
src_backends_tdepim_synctdepimabc_src += \
src/backends/tdepim/TDEPIMSyncSource.h \
src/backends/tdepim/TDEPIMSyncSource.cpp \
src/backends/tdepim/TDEPIMAddressBookSource.h \
src/backends/tdepim/TDEPIMAddressBookSource.cpp
endif
src_backends_tdepim_synctdepimnotes_src = \
src_backends_tdepim_synctdepimnotes_src =
if ENABLE_TDEPIMNOTES
src_backends_tdepim_synctdepimnotes_src += \
src/backends/tdepim/TDEPIMSyncSource.h \
src/backends/tdepim/TDEPIMSyncSource.cpp \
src/backends/tdepim/KNotesIface_stub.h \
src/backends/tdepim/KNotesIface_stub.cpp \
src/backends/tdepim/TDEPIMNotesSource.h \
src/backends/tdepim/TDEPIMNotesSource.cpp
endif
src_backends_tdepim_cppflags = \
$(SYNCEVOLUTION_CFLAGS) \