-rw-r--r-- | libopie2/opiedb/osqlitedriver.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index b9a491e..92f89cf 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp | |||
@@ -141,67 +141,67 @@ bool OSQLiteDriver::open() { | |||
141 | } | 141 | } |
142 | 142 | ||
143 | 143 | ||
144 | /* close the db | 144 | /* close the db |
145 | * sqlite closes them without | 145 | * sqlite closes them without |
146 | * telling failure or success | 146 | * telling failure or success |
147 | */ | 147 | */ |
148 | bool OSQLiteDriver::close() { | 148 | bool OSQLiteDriver::close() { |
149 | if (m_sqlite ) | 149 | if (m_sqlite ) |
150 | sqlite_close( m_sqlite ), m_sqlite=0l; | 150 | sqlite_close( m_sqlite ), m_sqlite=0l; |
151 | if (sqreg.regex_raw != NULL){ | 151 | if (sqreg.regex_raw != NULL){ |
152 | odebug << "Freeing regex on close" << oendl; | 152 | odebug << "Freeing regex on close" << oendl; |
153 | free(sqreg.regex_raw); | 153 | free(sqreg.regex_raw); |
154 | sqreg.regex_raw=NULL; | 154 | sqreg.regex_raw=NULL; |
155 | regfree(&sqreg.regex_c); | 155 | regfree(&sqreg.regex_c); |
156 | } | 156 | } |
157 | return true; | 157 | return true; |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | /* Query */ | 161 | /* Query */ |
162 | OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { | 162 | OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { |
163 | if ( !m_sqlite ) { | 163 | if ( !m_sqlite ) { |
164 | // FIXME set error code | 164 | // FIXME set error code |
165 | OSQLResult result( OSQLResult::Failure ); | 165 | OSQLResult result( OSQLResult::Failure ); |
166 | return result; | 166 | return result; |
167 | } | 167 | } |
168 | Query query; | 168 | Query query; |
169 | query.driver = this; | 169 | query.driver = this; |
170 | char *err; | 170 | char *err; |
171 | /* SQLITE_OK 0 if return code > 0 == failure */ | 171 | /* SQLITE_OK 0 if return code > 0 == failure */ |
172 | if ( sqlite_exec(m_sqlite, qu->query().utf8(),&call_back, &query, &err) > 0 ) { | 172 | if ( sqlite_exec(m_sqlite, qu->query().utf8(),&call_back, &query, &err) > 0 ) { |
173 | qWarning("OSQLiteDriver::query: Error while executing %s",err); | 173 | owarn << "OSQLiteDriver::query: Error while executing " << err << "" << oendl; |
174 | free(err ); | 174 | free( err ); |
175 | // FixMe Errors | 175 | // FixMe Errors |
176 | } | 176 | } |
177 | 177 | ||
178 | OSQLResult result(OSQLResult::Success, | 178 | OSQLResult result(OSQLResult::Success, |
179 | query.items, | 179 | query.items, |
180 | query.errors ); | 180 | query.errors ); |
181 | return result; | 181 | return result; |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | OSQLTable::ValueList OSQLiteDriver::tables() const { | 185 | OSQLTable::ValueList OSQLiteDriver::tables() const { |
186 | 186 | ||
187 | } | 187 | } |
188 | 188 | ||
189 | 189 | ||
190 | OSQLError OSQLiteDriver::lastError() { | 190 | OSQLError OSQLiteDriver::lastError() { |
191 | OSQLError error; | 191 | OSQLError error; |
192 | return error; | 192 | return error; |
193 | }; | 193 | }; |
194 | 194 | ||
195 | 195 | ||
196 | /* handle a callback add the row to the global | 196 | /* handle a callback add the row to the global |
197 | * OSQLResultItem | 197 | * OSQLResultItem |
198 | */ | 198 | */ |
199 | int OSQLiteDriver::handleCallBack( int, char**, char** ) { | 199 | int OSQLiteDriver::handleCallBack( int, char**, char** ) { |
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
203 | 203 | ||
204 | /* callback_handler add the values to the list*/ | 204 | /* callback_handler add the values to the list*/ |
205 | int OSQLiteDriver::call_back( void* voi, int argc, | 205 | int OSQLiteDriver::call_back( void* voi, int argc, |
206 | char** argv, char** columns) { | 206 | char** argv, char** columns) { |
207 | Query* qu = (Query*)voi; | 207 | Query* qu = (Query*)voi; |