MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / open

Method open

src/database/WizIndexBase.cpp:28–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28bool 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
56bool WizIndexBase::isOpened()
57{

Callers

nothing calls this directly

Calls 2

tableExistsMethod · 0.80
QStringClass · 0.70

Tested by

no test coverage detected