| 26 | } |
| 27 | |
| 28 | bool WizIndexBase::open(const CString& strFileName) |
| 29 | { |
| 30 | m_strFileName = strFileName; |
| 31 | |
| 32 | try { |
| 33 | m_db.open(strFileName); |
| 34 | |
| 35 | for (int i = 0; i < TABLE_COUNT; i++) { |
| 36 | if (!checkTable(g_arrayTableName[i])) |
| 37 | return false; |
| 38 | } |
| 39 | |
| 40 | // upgrade table structure if table structure have been changed |
| 41 | if (m_db.tableExists(TABLE_NAME_WIZ_META)) { |
| 42 | int nVersion = getTableStructureVersion().toInt(); |
| 43 | if (nVersion < QString(WIZ_TABLE_STRUCTURE_VERSION).toInt()) { |
| 44 | updateTableStructure(nVersion); |
| 45 | setTableStructureVersion(WIZ_TABLE_STRUCTURE_VERSION); |
| 46 | } |
| 47 | } |
| 48 | } catch (const CppSQLite3Exception& e) { |
| 49 | return logSQLException(e, "open database"); |
| 50 | } |
| 51 | |
| 52 | |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | bool WizIndexBase::isOpened() |
| 57 | { |
nothing calls this directly
no test coverage detected