author | eilers <eilers> | 2003-09-22 14:31:15 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-09-22 14:31:15 (UTC) |
commit | 34e86ddf4f9b1045a5b730beab2d8d72e2dd4d56 (patch) (unidiff) | |
tree | cee19bfcf7c8d6a24cd4aaf578bd64b38b2d0ee4 /libopie2/opiepim/backend/obackendfactory.h | |
parent | fd500184450e37c239e573adf1c12a6ff62b65f6 (diff) | |
download | opie-34e86ddf4f9b1045a5b730beab2d8d72e2dd4d56.zip opie-34e86ddf4f9b1045a5b730beab2d8d72e2dd4d56.tar.gz opie-34e86ddf4f9b1045a5b730beab2d8d72e2dd4d56.tar.bz2 |
Added first experimental incarnation of sql-backend for addressbook.
Some modifications to be able to compile the todo sql-backend.
A lot of changes fill follow...
Diffstat (limited to 'libopie2/opiepim/backend/obackendfactory.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/obackendfactory.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h index f3c339d..3567687 100644 --- a/libopie2/opiepim/backend/obackendfactory.h +++ b/libopie2/opiepim/backend/obackendfactory.h | |||
@@ -16,6 +16,11 @@ | |||
16 | * ===================================================================== | 16 | * ===================================================================== |
17 | * History: | 17 | * History: |
18 | * $Log$ | 18 | * $Log$ |
19 | * Revision 1.8 2003/09/22 14:31:16 eilers | ||
20 | * Added first experimental incarnation of sql-backend for addressbook. | ||
21 | * Some modifications to be able to compile the todo sql-backend. | ||
22 | * A lot of changes fill follow... | ||
23 | * | ||
19 | * Revision 1.7 2003/08/01 12:30:16 eilers | 24 | * Revision 1.7 2003/08/01 12:30:16 eilers |
20 | * Merging changes from BRANCH_1_0 to HEAD | 25 | * Merging changes from BRANCH_1_0 to HEAD |
21 | * | 26 | * |
@@ -74,6 +79,7 @@ | |||
74 | 79 | ||
75 | #ifdef __USE_SQL | 80 | #ifdef __USE_SQL |
76 | #include "otodoaccesssql.h" | 81 | #include "otodoaccesssql.h" |
82 | #include "ocontactaccessbackend_sql.h" | ||
77 | #endif | 83 | #endif |
78 | 84 | ||
79 | class OBackendPrivate; | 85 | class OBackendPrivate; |
@@ -118,6 +124,8 @@ class OBackendFactory | |||
118 | config.setGroup ( backendName ); | 124 | config.setGroup ( backendName ); |
119 | QString backend = config.readEntry( "usebackend" ); | 125 | QString backend = config.readEntry( "usebackend" ); |
120 | 126 | ||
127 | qWarning("Selected backend for %s is: %s", backendName.latin1(), backend.latin1() ); | ||
128 | |||
121 | QAsciiDict<int> dict ( 3 ); | 129 | QAsciiDict<int> dict ( 3 ); |
122 | dict.setAutoDelete ( TRUE ); | 130 | dict.setAutoDelete ( TRUE ); |
123 | 131 | ||
@@ -125,9 +133,6 @@ class OBackendFactory | |||
125 | dict.insert( "contact", new int (CONTACT) ); | 133 | dict.insert( "contact", new int (CONTACT) ); |
126 | dict.insert( "datebook", new int(DATE) ); | 134 | dict.insert( "datebook", new int(DATE) ); |
127 | 135 | ||
128 | qWarning ("TODO is: %d", TODO); | ||
129 | qWarning ("CONTACT is: %d", CONTACT); | ||
130 | |||
131 | int *find = dict[ backendName ]; | 136 | int *find = dict[ backendName ]; |
132 | if (!find ) return 0; | 137 | if (!find ) return 0; |
133 | 138 | ||
@@ -143,8 +148,13 @@ class OBackendFactory | |||
143 | 148 | ||
144 | return (T*) new OTodoAccessXML( appName ); | 149 | return (T*) new OTodoAccessXML( appName ); |
145 | case CONTACT: | 150 | case CONTACT: |
151 | #ifdef __USE_SQL | ||
152 | if ( backend == "sql" ) | ||
153 | return (T*) new OContactAccessBackend_SQL(""); | ||
154 | #else | ||
146 | if ( backend == "sql" ) | 155 | if ( backend == "sql" ) |
147 | qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); | 156 | qWarning ("OBackendFactory:: sql Backend not implemented! Using XML instead!"); |
157 | #endif | ||
148 | 158 | ||
149 | return (T*) new OContactAccessBackend_XML( appName ); | 159 | return (T*) new OContactAccessBackend_XML( appName ); |
150 | case DATE: | 160 | case DATE: |