Changeset View
Changeset View
Standalone View
Standalone View
tests/features/main.cpp
Show All 34 Lines | |||||
35 | #include <iostream> | 35 | #include <iostream> | ||
36 | 36 | | |||
37 | using namespace std; | 37 | using namespace std; | ||
38 | 38 | | |||
39 | QByteArray prgname; | 39 | QByteArray prgname; | ||
40 | QString db_name; | 40 | QString db_name; | ||
41 | QString drv_id; | 41 | QString drv_id; | ||
42 | QString test_name; | 42 | QString test_name; | ||
43 | int cursor_options = 0; | 43 | KDbCursor::Options cursor_options; | ||
44 | bool db_name_required = true; | 44 | bool db_name_required = true; | ||
45 | 45 | | |||
46 | KDbConnectionData conn_data; | 46 | KDbConnectionData conn_data; | ||
47 | 47 | | |||
48 | //! @todo IMPORTANT: replace QPointer<KDbConnection> conn; | 48 | //! @todo IMPORTANT: replace QPointer<KDbConnection> conn; | ||
49 | KDbConnection* conn = 0; | 49 | KDbConnection* conn = 0; | ||
50 | 50 | | |||
51 | //! @todo IMPORTANT: replace QPointer<KDbDriver> driver; | 51 | //! @todo IMPORTANT: replace QPointer<KDbDriver> driver; | ||
▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Line(s) | 222 | #endif | |||
283 | if (db_name_required && db_name.isEmpty()) { | 283 | if (db_name_required && db_name.isEmpty()) { | ||
284 | qDebug() << prgname << ": database name?"; | 284 | qDebug() << prgname << ": database name?"; | ||
285 | return finish(1); | 285 | return finish(1); | ||
286 | } | 286 | } | ||
287 | conn_data.setDatabaseName(db_name); | 287 | conn_data.setDatabaseName(db_name); | ||
288 | if (!db_name.isEmpty() ) { | 288 | if (!db_name.isEmpty() ) { | ||
289 | //additional switches: | 289 | //additional switches: | ||
290 | if (bufCursors) { | 290 | if (bufCursors) { | ||
291 | cursor_options |= KDbCursor::Buffered; | 291 | cursor_options |= KDbCursor::Option::Buffered; | ||
292 | } | 292 | } | ||
293 | conn = driver->createConnection(conn_data); | 293 | conn = driver->createConnection(conn_data); | ||
294 | 294 | | |||
295 | if (!conn || driver->result().isError()) { | 295 | if (!conn || driver->result().isError()) { | ||
296 | qDebug() << driver->result(); | 296 | qDebug() << driver->result(); | ||
297 | return finish(1); | 297 | return finish(1); | ||
298 | } | 298 | } | ||
299 | qDebug() << "main: KDbConnection object created."; | 299 | qDebug() << "main: KDbConnection object created."; | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |