summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/obackendfactory.h
authorzecke <zecke>2003-02-21 23:31:52 (UTC)
committer zecke <zecke>2003-02-21 23:31:52 (UTC)
commit46f47c0a1e542a8b4222f3ced8f3304534c7509d (patch) (side-by-side diff)
tree82dc97a07bae77387987711c0c21697691955937 /libopie2/opiepim/backend/obackendfactory.h
parenta7448ec87d97a0128618e83ad7526bd884ef8853 (diff)
downloadopie-46f47c0a1e542a8b4222f3ced8f3304534c7509d.zip
opie-46f47c0a1e542a8b4222f3ced8f3304534c7509d.tar.gz
opie-46f47c0a1e542a8b4222f3ced8f3304534c7509d.tar.bz2
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
Diffstat (limited to 'libopie2/opiepim/backend/obackendfactory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/obackendfactory.h41
1 files changed, 29 insertions, 12 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
@@ -12,3 +12,3 @@
* =====================================================================
- * ToDo: Use plugins
+ * ToDo: Use plugins
* =====================================================================
@@ -18,2 +18,12 @@
* $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
@@ -49,2 +59,3 @@
#include "ocontactaccessbackend_xml.h"
+#include "odatebookaccessbackend_xml.h"
@@ -66,5 +77,5 @@ class OBackendFactory
};
-
+
static T* Default( const QString backendName, const QString& appName ){
-
+
// __asm__("int3");
@@ -80,2 +91,3 @@ class OBackendFactory
dict.insert( "contact", new int (CONTACT) );
+ dict.insert( "datebook", new int(DATE) );
@@ -83,10 +95,13 @@ class OBackendFactory
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" )
+ if ( backend == "sql" )
return (T*) new OTodoAccessBackendSQL("");
#else
- if ( backend == "sql" )
+ if ( backend == "sql" )
qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!");
@@ -96,3 +111,3 @@ class OBackendFactory
case CONTACT:
- if ( backend == "sql" )
+ if ( backend == "sql" )
qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!");
@@ -101,4 +116,6 @@ class OBackendFactory
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:
@@ -106,4 +123,4 @@ class OBackendFactory
}
-
-
+
+
}