diff options
author | George Hazan <george.hazan@gmail.com> | 2014-04-22 11:51:27 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-04-22 11:51:27 +0000 |
commit | 184155c8aaf1dd0c8bcd498dfd7ba9c512433e73 (patch) | |
tree | 9e6a7b029d2877aa70cddb9af228c12f9149047b /src/mir_core | |
parent | 158a825fb4ec52f492d7accd0de17ce8b601b5b6 (diff) |
db_mc_setDefault/db_mc_setDefaultNum got a flag to update database or not
git-svn-id: http://svn.miranda-ng.org/main/trunk@9047 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/mc.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mir_core/mc.cpp b/src/mir_core/mc.cpp index 90e967fa98..00431a0875 100644 --- a/src/mir_core/mc.cpp +++ b/src/mir_core/mc.cpp @@ -129,7 +129,7 @@ MIR_CORE_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum) }
//sets the default contact, using the subcontact's handle
-MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub)
+MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb)
{
DBCachedContact *cc = CheckMeta(hMetaContact);
if (cc == NULL)
@@ -140,14 +140,15 @@ MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub) return 1;
cc->nDefault = contact_number;
- currDb->MetaSetDefault(cc);
+ if (bWriteDb)
+ currDb->MetaSetDefault(cc);
NotifyEventHooks(hEventDefaultChanged, hMetaContact, hSub);
return 0;
}
//sets the default contact, using the subcontact's number
-MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum)
+MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWriteDb)
{
DBCachedContact *cc = CheckMeta(hMetaContact);
if (cc == NULL)
@@ -156,7 +157,8 @@ MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum) return 1;
cc->nDefault = iNum;
- currDb->MetaSetDefault(cc);
+ if (bWriteDb)
+ currDb->MetaSetDefault(cc);
NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum));
return 0;
|