summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-10-07 06:03:42 -0700
committerPatrick Ohly <patrick.ohly@intel.com>2016-10-07 15:17:41 +0200
commite05817a4929873c72b8880f571b96e9ea7a4b786 (patch)
tree7f54ad1fa1d37c265bad34da198bebf856a10c88
parent160b1f5e60600f60dcb45f64cf9e8cedabe1d378 (diff)
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>
-rw-r--r--src/backends/tdepim/TDEPIMAddressBookSourceRegister.cpp6
-rw-r--r--src/backends/tdepim/TDEPIMCalendarSourceRegister.cpp5
-rw-r--r--src/backends/tdepim/TDEPIMNotesSource.h6
-rw-r--r--src/backends/tdepim/TDEPIMNotesSourceRegister.cpp3
-rw-r--r--src/backends/tdepim/TDEPIMSyncSource.h6
-rw-r--r--src/backends/tdepim/tdepim.am16
6 files changed, 32 insertions, 10 deletions
diff --git a/src/backends/tdepim/TDEPIMAddressBookSourceRegister.cpp b/src/backends/tdepim/TDEPIMAddressBookSourceRegister.cpp
index 6de97fcd..d95f6704 100644
--- a/src/backends/tdepim/TDEPIMAddressBookSourceRegister.cpp
+++ b/src/backends/tdepim/TDEPIMAddressBookSourceRegister.cpp
@@ -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);
diff --git a/src/backends/tdepim/TDEPIMCalendarSourceRegister.cpp b/src/backends/tdepim/TDEPIMCalendarSourceRegister.cpp
index ad18bb45..4056ae51 100644
--- a/src/backends/tdepim/TDEPIMCalendarSourceRegister.cpp
+++ b/src/backends/tdepim/TDEPIMCalendarSourceRegister.cpp
@@ -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
diff --git a/src/backends/tdepim/TDEPIMNotesSource.h b/src/backends/tdepim/TDEPIMNotesSource.h
index fd0d3b31..3276924f 100644
--- a/src/backends/tdepim/TDEPIMNotesSource.h
+++ b/src/backends/tdepim/TDEPIMNotesSource.h
@@ -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.
diff --git a/src/backends/tdepim/TDEPIMNotesSourceRegister.cpp b/src/backends/tdepim/TDEPIMNotesSourceRegister.cpp
index 522ae6a0..e09d6267 100644
--- a/src/backends/tdepim/TDEPIMNotesSourceRegister.cpp
+++ b/src/backends/tdepim/TDEPIMNotesSourceRegister.cpp
@@ -27,6 +27,9 @@
#include "TDEPIMSyncSource.h"
+#include <syncevo/util.h>
+#include <syncevo/SyncSource.h>
+
SE_BEGIN_CXX
static SyncSource *createSource ( const SyncSourceParams &params )
diff --git a/src/backends/tdepim/TDEPIMSyncSource.h b/src/backends/tdepim/TDEPIMSyncSource.h
index bbddd38b..f77f14f0 100644
--- a/src/backends/tdepim/TDEPIMSyncSource.h
+++ b/src/backends/tdepim/TDEPIMSyncSource.h
@@ -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
diff --git a/src/backends/tdepim/tdepim.am b/src/backends/tdepim/tdepim.am
index e26e375e..992b820b 100644
--- a/src/backends/tdepim/tdepim.am
+++ b/src/backends/tdepim/tdepim.am
@@ -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) \