summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/obackendfactory.h
Unidiff
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 @@
12 * ===================================================================== 12 * =====================================================================
13 * ToDo: Use plugins 13 * ToDo: Use plugins
14 * ===================================================================== 14 * =====================================================================
@@ -18,2 +18,12 @@
18 * $Log$ 18 * $Log$
19 * Revision 1.5 2003/02/21 23:31:52 zecke
20 * Add XML datebookresource
21 * -clean up todoaccessxml header
22 * -implement some more stuff in the oeven tester
23 * -extend DefaultFactory to not crash and to use datebook
24 *
25 * -reading of OEvents is working nicely.. saving will be added
26 * tomorrow
27 * -fix spelling in ODateBookAcces
28 *
19 * Revision 1.4 2002/10/14 15:55:18 eilers 29 * Revision 1.4 2002/10/14 15:55:18 eilers
@@ -49,2 +59,3 @@
49#include "ocontactaccessbackend_xml.h" 59#include "ocontactaccessbackend_xml.h"
60#include "odatebookaccessbackend_xml.h"
50 61
@@ -66,5 +77,5 @@ class OBackendFactory
66 }; 77 };
67 78
68 static T* Default( const QString backendName, const QString& appName ){ 79 static T* Default( const QString backendName, const QString& appName ){
69 80
70 // __asm__("int3"); 81 // __asm__("int3");
@@ -80,2 +91,3 @@ class OBackendFactory
80 dict.insert( "contact", new int (CONTACT) ); 91 dict.insert( "contact", new int (CONTACT) );
92 dict.insert( "datebook", new int(DATE) );
81 93
@@ -83,10 +95,13 @@ class OBackendFactory
83 qWarning ("CONTACT is: %d", CONTACT); 95 qWarning ("CONTACT is: %d", CONTACT);
84 96
85 switch ( *dict.take( backendName ) ){ 97 int *find = dict[ backendName ];
98 if (!find ) return 0;
99
100 switch ( *find ){
86 case TODO: 101 case TODO:
87#ifdef __USE_SQL 102#ifdef __USE_SQL
88 if ( backend == "sql" ) 103 if ( backend == "sql" )
89 return (T*) new OTodoAccessBackendSQL(""); 104 return (T*) new OTodoAccessBackendSQL("");
90#else 105#else
91 if ( backend == "sql" ) 106 if ( backend == "sql" )
92 qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); 107 qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!");
@@ -96,3 +111,3 @@ class OBackendFactory
96 case CONTACT: 111 case CONTACT:
97 if ( backend == "sql" ) 112 if ( backend == "sql" )
98 qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); 113 qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!");
@@ -101,4 +116,6 @@ class OBackendFactory
101 case DATE: 116 case DATE:
102 qWarning ("OBackendFactory:: DATE-Backend not implemented!"); 117 if ( backend == "sql" )
103 return NULL; 118 qWarning("OBackendFactory:: sql Backend not implemented! Using XML instead!");
119
120 return (T*) new ODateBookAccessBackend_XML( appName );
104 default: 121 default:
@@ -106,4 +123,4 @@ class OBackendFactory
106 } 123 }
107 124
108 125
109 } 126 }