summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/obackendfactory.h
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/obackendfactory.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/obackendfactory.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h
index b796fb8..3a73210 100644
--- a/libopie2/opiepim/backend/obackendfactory.h
+++ b/libopie2/opiepim/backend/obackendfactory.h
@@ -13,12 +13,22 @@
* ToDo: Use plugins
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.5 2003/02/21 23:31:52 zecke
+ * Add XML datebookresource
+ * -clean up todoaccessxml header
+ * -implement some more stuff in the oeven tester
+ * -extend DefaultFactory to not crash and to use datebook
+ *
+ * -reading of OEvents is working nicely.. saving will be added
+ * tomorrow
+ * -fix spelling in ODateBookAcces
+ *
* Revision 1.4 2002/10/14 15:55:18 eilers
* Redeactivate SQL.. ;)
*
* Revision 1.3 2002/10/10 17:08:58 zecke
* The Cache is finally in place
* I tested it with my todolist and it 'works' for 10.000 todos the hits are awesome ;)
@@ -44,12 +54,13 @@
#include <qstring.h>
#include <qasciidict.h>
#include <qpe/config.h>
#include "otodoaccessxml.h"
#include "ocontactaccessbackend_xml.h"
+#include "odatebookaccessbackend_xml.h"
#ifdef __USE_SQL
#include "otodoaccesssql.h"
#endif
@@ -75,17 +86,21 @@ class OBackendFactory
QAsciiDict<int> dict ( 3 );
dict.setAutoDelete ( TRUE );
dict.insert( "todo", new int (TODO) );
dict.insert( "contact", new int (CONTACT) );
+ dict.insert( "datebook", new int(DATE) );
qWarning ("TODO is: %d", TODO);
qWarning ("CONTACT is: %d", CONTACT);
- switch ( *dict.take( backendName ) ){
+ int *find = dict[ backendName ];
+ if (!find ) return 0;
+
+ switch ( *find ){
case TODO:
#ifdef __USE_SQL
if ( backend == "sql" )
return (T*) new OTodoAccessBackendSQL("");
#else
if ( backend == "sql" )
@@ -96,14 +111,16 @@ class OBackendFactory
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;
+ if ( backend == "sql" )
+ qWarning("OBackendFactory:: sql Backend not implemented! Using XML instead!");
+
+ return (T*) new ODateBookAccessBackend_XML( appName );
default:
return NULL;
}
}