From 914e0b89c4aa13461d4f36fdfcb1b49bb3f00456 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 3 Mar 2014 15:44:40 +0000 Subject: - META_PROTO/Default went to cache; - MIDatabase::MetaSetDefault method added to store the default sub in a database; - Meta_SettingChanged fixed git-svn-id: http://svn.miranda-ng.org/main/trunk@8380 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcontacts.cpp | 9 +++++++-- plugins/Db3x_mmap/src/dbintf.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins/Db3x_mmap/src') diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index ebdc9c6cfd..d05dac5555 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -208,6 +208,11 @@ BOOL CDb3Mmap::MetaDetouchSub(DBCachedContact *cc, int nSub) return 0; } +BOOL CDb3Mmap::MetaSetDefault(DBCachedContact *cc) +{ + return db_set_dw(cc->contactID, META_PROTO, "Default", cc->nDefault); +} + ///////////////////////////////////////////////////////////////////////////////////////// // contacts convertor @@ -279,8 +284,8 @@ void CDb3Mmap::FillContacts() cc->pSubs[i] = hSub; } } - cc->activeID = (0 != GetContactSetting(dwContactID, META_PROTO, "Default", &dbv)) ? NULL : dbv.dVal; - cc->parentID = (0 != GetContactSetting(dwContactID, META_PROTO, "Handle", &dbv)) ? NULL : dbv.dVal; + cc->nDefault = (0 != GetContactSetting(dwContactID, META_PROTO, "Default", &dbv)) ? -1 : dbv.dVal; + cc->parentID = (0 != GetContactSetting(dwContactID, META_PROTO, "ParentMeta", &dbv)) ? NULL : dbv.dVal; // whether we need conversion or not if (!GetContactSetting(dwContactID, META_PROTO, "MetaID", &dbv)) diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 986ac700d0..50821b6204 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -235,6 +235,7 @@ public: STDMETHODIMP_(BOOL) IsSettingEncrypted(LPCSTR szModule, LPCSTR szSetting); STDMETHODIMP_(BOOL) MetaDetouchSub(DBCachedContact *cc, int nSub); + STDMETHODIMP_(BOOL) MetaSetDefault(DBCachedContact *cc); protected: STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback); -- cgit v1.2.3