summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/contact.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-27 09:46:24 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-27 09:46:24 +0000
commitfdcee968da01c384608ea948d90a6a0ccf2d1771 (patch)
tree8acd5d1832ed83d0f279e605820e4aeaa762cd9f /plugins/Clist_nicer/src/contact.cpp
parentf77b70a84c4609b9fef4a5e4a497f5845541c2de (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16771 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/contact.cpp')
-rw-r--r--plugins/Clist_nicer/src/contact.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp
index 382ae75e70..ad46597c14 100644
--- a/plugins/Clist_nicer/src/contact.cpp
+++ b/plugins/Clist_nicer/src/contact.cpp
@@ -49,7 +49,7 @@ static int GetContactStatus(MCONTACT hContact)
szProto = GetContactProto(hContact);
if (szProto == NULL)
return ID_STATUS_OFFLINE;
- return cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
int __forceinline GetStatusModeOrdering(int statusMode)
@@ -90,15 +90,15 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep)
if (eventCount == 0) {
frequency = 0x7fffffff;
- cfg::writeDword(hContact, "CList", "mf_firstEvent", curTime - (dwCutoffDays * 86400));
+ db_set_dw(hContact, "CList", "mf_firstEvent", curTime - (dwCutoffDays * 86400));
}
else {
frequency = (curTime - dbei.timestamp) / eventCount;
- cfg::writeDword(hContact, "CList", "mf_firstEvent", dbei.timestamp);
+ db_set_dw(hContact, "CList", "mf_firstEvent", dbei.timestamp);
}
- cfg::writeDword(hContact, "CList", "mf_freq", frequency);
- cfg::writeDword(hContact, "CList", "mf_count", eventCount);
+ db_set_dw(hContact, "CList", "mf_freq", frequency);
+ db_set_dw(hContact, "CList", "mf_count", eventCount);
}
extern TCHAR g_ptszEventName[];
@@ -126,11 +126,11 @@ void MF_UpdateThread(LPVOID)
void MF_InitCheck(void)
{
- BYTE bMsgFrequency = cfg::getByte("CList", "fhistdata", 0);
+ BYTE bMsgFrequency = db_get_b(NULL, "CList", "fhistdata", 0);
if (!bMsgFrequency) {
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
MF_CalcFrequency(hContact, 100, 0);
- cfg::writeByte("CList", "fhistdata", 1);
+ db_set_b(NULL, "CList", "fhistdata", 1);
}
}
@@ -249,21 +249,11 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2)
#undef SAFESTRING
-int SetHideOffline(WPARAM wParam, LPARAM)
+int SetHideOffline(int iValue)
{
- int newVal = (int)wParam;
- switch ((int)wParam) {
- case 0:
- cfg::writeByte("CList", "HideOffline", 0); break;
- case 1:
- cfg::writeByte("CList", "HideOffline", 1); break;
- case -1:
- newVal = !cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- cfg::writeByte("CList", "HideOffline", (BYTE)newVal);
- break;
- }
+ int newVal = coreCli.pfnSetHideOffline(iValue);
+
SetButtonStates();
ClcSetButtonState(IDC_TBHIDEOFFLINE, newVal);
- pcli->pfnLoadContactTree();
- return 0;
+ return newVal;
}