Diffstat (limited to 'libopie/pim/obackendfactory.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/obackendfactory.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libopie/pim/obackendfactory.h b/libopie/pim/obackendfactory.h index 599fbf2..f11f029 100644 --- a/libopie/pim/obackendfactory.h +++ b/libopie/pim/obackendfactory.h @@ -11,33 +11,41 @@ * version. * ===================================================================== * ToDo: Use plugins * ===================================================================== * Version: $Id$ * ===================================================================== * History: * $Log$ + * Revision 1.2 2002/10/08 09:27:36 eilers + * Fixed libopie.pro to include the new pim-API. + * The SQL-Stuff is currently deactivated. Otherwise everyone who wants to + * compile itself would need to install libsqlite, libopiesql... + * Therefore, the backend currently uses XML only.. + * * Revision 1.1 2002/10/07 17:35:01 eilers * added OBackendFactory for advanced backend access * * * ===================================================================== */ #ifndef __OPIE_BACKENDFACTORY_H_ #define __OPIE_BACKENDFACTORY_H_ #include <qstring.h> #include <qasciidict.h> #include <qpe/config.h> #include "otodoaccessxml.h" #include "ocontactaccessbackend_xml.h" -#include "otodoaccesssql.h" +#ifdef __USE_SQL +#include "otodoaccesssql.h" +#endif template<class T> class OBackendFactory { public: OBackendFactory() {}; enum BACKENDS { @@ -59,19 +67,24 @@ class OBackendFactory dict.insert( "todo", new int (TODO) ); dict.insert( "contact", new int (CONTACT) ); qWarning ("TODO is: %d", TODO); qWarning ("CONTACT is: %d", CONTACT); switch ( *dict.take( backendName ) ){ case TODO: +#ifdef __USE_SQL if ( backend == "sql" ) return (T*) new OTodoAccessBackendSQL(""); - +#else + if ( backend == "sql" ) + qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); +#endif + return (T*) new OTodoAccessXML( appName ); case CONTACT: if ( backend == "sql" ) qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); return (T*) new OContactAccessBackend_XML( appName ); case DATE: qWarning ("OBackendFactory:: DATE-Backend not implemented!"); |