summaryrefslogtreecommitdiff
path: root/libopie/pim/obackendfactory.h
Side-by-side diff
Diffstat (limited to 'libopie/pim/obackendfactory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/obackendfactory.h17
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
@@ -7,41 +7,49 @@
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation;
* either version 2 of the License, or (at your option) any later
* 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 {
TODO,
CONTACT,
DATE
};
@@ -55,27 +63,32 @@ class OBackendFactory
QAsciiDict<int> dict ( 3 );
dict.setAutoDelete ( TRUE );
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!");
return NULL;
default:
return NULL;
}