diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-29 18:16:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-29 18:16:23 +0000 |
commit | de5dce707cc60ace5b92d2ac61914c590cb9680b (patch) | |
tree | 64f2ee6639edeefcc9a32425d10cd56463dab6a4 /plugins/Popup | |
parent | 13952bddf4931ed75338460754860a81d3710678 (diff) |
rest of unused databases services removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@5181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup')
-rw-r--r-- | plugins/Popup/src/common.h | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 8b587b6559..5700f7f55f 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -54,57 +54,38 @@ inline int Percentile2Byte(int vPerc) { return (vPerc*255)/100; } inline char *db_get_s(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default)
{
DBVARIANT dbv;
- DBCONTACTGETSETTING dbcgs;
- dbcgs.szModule = ModuleName;
- dbcgs.pValue = &dbv;
- dbcgs.szSetting = SettingName;
-
- CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&dbcgs);
+ db_get(hContact, ModuleName, SettingName, &dbv);
char *result = 0;
if (dbv.type == DBVT_ASCIIZ)
- {
result = mir_strdup(dbv.pszVal);
- }
else if (Default)
- {
result = mir_strdup(Default);
- }
- CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)&dbv);
+ db_free(&dbv);
return result;
}
inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default, const int retType)
{
INT_PTR ret = NULL;
- BOOL result = 0;
- DBVARIANT dbv;
- DBCONTACTGETSETTING dbcgs;
- dbcgs.szModule = ModuleName;
- dbcgs.szSetting = SettingName;
- dbcgs.pValue = &dbv;
- dbv.type=(BYTE)retType;
- result = CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&dbcgs);
+ DBVARIANT dbv;
+ BOOL result = db_get_s(hContact, ModuleName, SettingName, &dbv, retType);
switch(retType) {
- case DBVT_ASCIIZ:
- ret = (INT_PTR)mir_strdup(result ? Default : dbv.pszVal);
- break;
- case DBVT_WCHAR:
- if (!result) {
- ret = (INT_PTR)mir_wstrdup(dbv.pwszVal);
- }
- else {
- ret = (INT_PTR)mir_a2u(Default);
- }
- break;
- default:
- break;
+ case DBVT_ASCIIZ:
+ ret = (INT_PTR)mir_strdup(result ? Default : dbv.pszVal);
+ break;
+ case DBVT_WCHAR:
+ if (!result)
+ ret = (INT_PTR)mir_wstrdup(dbv.pwszVal);
+ else
+ ret = (INT_PTR)mir_a2u(Default);
+ break;
}
if (!result)
- CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)&dbv);
+ db_free(&dbv);
return ret;
}
|