From 82e1444c01f0ab700c385ff0f846858c7f627c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 2 Apr 2018 11:59:43 +0300 Subject: Dbx_mdbx: - unused class members removed; - added function TouchFile() to change access date & time on loading & exit --- plugins/Dbx_mdbx/src/dbcontacts.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/Dbx_mdbx/src/dbcontacts.cpp') diff --git a/plugins/Dbx_mdbx/src/dbcontacts.cpp b/plugins/Dbx_mdbx/src/dbcontacts.cpp index aa3a27f8f2..f59e57c4b3 100644 --- a/plugins/Dbx_mdbx/src/dbcontacts.cpp +++ b/plugins/Dbx_mdbx/src/dbcontacts.cpp @@ -25,7 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. STDMETHODIMP_(LONG) CDbxMDBX::GetContactCount(void) { - return m_contactCount; + MDBX_stat st; + mdbx_dbi_stat(m_txn_ro, m_dbContacts, &st, sizeof(st)); + return st.ms_entries; } STDMETHODIMP_(LONG) CDbxMDBX::GetContactSize(void) @@ -78,8 +80,6 @@ STDMETHODIMP_(LONG) CDbxMDBX::DeleteContact(MCONTACT contactID) // free cache item m_cache->FreeCachedContact(contactID); DBFlush(); - - InterlockedDecrement(&m_contactCount); return 0; } @@ -100,7 +100,7 @@ STDMETHODIMP_(MCONTACT) CDbxMDBX::AddContact() } DBFlush(); - InterlockedIncrement(&m_contactCount); + NotifyEventHooks(hContactAddedEvent, dwContactId, 0); return dwContactId; } -- cgit v1.2.3