From b6776fcaed336b997f0eb8f5080440467280dc7c Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 15 Jul 2016 11:23:52 +0200 Subject: [PATCH] Add comments. --- src/mrmailbox.cpp | 10 ++++++++-- src/mrmailbox.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mrmailbox.cpp b/src/mrmailbox.cpp index 93a99085..6808bfd5 100644 --- a/src/mrmailbox.cpp +++ b/src/mrmailbox.cpp @@ -86,7 +86,7 @@ bool MrMailbox::Open(const char* dbfile) } - // prepare statements + // prepare statements (we do it when the tables really exists, however, I do not know if sqlite relies on this) m_stmt_SELECT_value_FROM_config_k = sqlite3_prepare_v2_("SELECT value FROM config WHERE keyname=?;"); m_stmt_INSERT_INTO_config_kv = sqlite3_prepare_v2_("INSERT INTO config (keyname, value) VALUES (?, ?);"); m_stmt_UPDATE_config_vk = sqlite3_prepare_v2_("UPDATE config SET value=? WHERE keyname=?;"); @@ -153,6 +153,11 @@ void MrMailbox::Connect() } +void MrMailbox::Disconnect() +{ +} + + /******************************************************************************* * Handle contacts ******************************************************************************/ @@ -324,7 +329,7 @@ bool MrMailbox::sqlite3_table_exists_(const char* name) sqlite3_stmt* stmt = NULL; int sqlState; - if( (querystr=sqlite3_mprintf("PRAGMA table_info(%s)", name)) == NULL ) { + if( (querystr=sqlite3_mprintf("PRAGMA table_info(%s)", name)) == NULL ) { // this statement cannot be used with binded variables goto table_exists_Error; } @@ -352,3 +357,4 @@ table_exists_Error: return ret; } + diff --git a/src/mrmailbox.h b/src/mrmailbox.h index 70c3d738..6fc2ed8b 100644 --- a/src/mrmailbox.h +++ b/src/mrmailbox.h @@ -61,6 +61,7 @@ public: // connect to the mailbox: error are be received asynchronously. void Connect (); + void Disconnect (); // iterate contacts size_t GetContactCnt ();