| 37 | #define UPDATE_SEQUENCE_NUMBER 4; |
| 38 | |
| 39 | DataStore::DataStore(DatabaseConnection *db) |
| 40 | { |
| 41 | this->db = db; |
| 42 | db->lockForRead(); |
| 43 | // Check if the table exists. If not, create it. |
| 44 | NSqlQuery sql(db); |
| 45 | sql.exec("Select * from sqlite_master where type='table' and name='DataStore';"); |
| 46 | if (!sql.next()) { |
| 47 | db->unlock(); |
| 48 | this->createTable(); |
| 49 | } |
| 50 | this->setTable("DataStore"); |
| 51 | this->select(); |
| 52 | this->setEditStrategy(QSqlTableModel::OnFieldChange); |
| 53 | sql.finish(); |
| 54 | db->unlock(); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | //* Create the NoteTable table. |
nothing calls this directly
no test coverage detected