diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-30 12:16:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-30 12:16:44 +0000 |
commit | 25ec54ea27a7099f33573b260a620ed7273176fe (patch) | |
tree | 1810a0cb35d23deeed9ccdaf0ab276a4022f9a41 /src | |
parent | a546606709e6bb72e01eb38b2c8c8756608fd5d6 (diff) |
- db_set_blob used everywhere for writing blobs
- DBCONTACTWRITESETTING left only in the event handlers
git-svn-id: http://svn.miranda-ng.org/main/trunk@5191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/clist/contacts.cpp | 11 | ||||
-rw-r--r-- | src/modules/database/dbini.cpp | 14 | ||||
-rw-r--r-- | src/modules/database/dbintf.cpp | 6 |
3 files changed, 6 insertions, 25 deletions
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index d15bbd5e6c..ff2763964c 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -395,23 +395,16 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY)
{
- DBCONTACTWRITESETTING cws;
TVITEM tvi;
- int i;
- cws.szModule = "Contact";
- cws.szSetting = "NameOrder";
- cws.value.type = DBVT_BLOB;
- cws.value.cpbVal = SIZEOF(nameOrderDescr);
- cws.value.pbVal = nameOrder;
tvi.hItem = TreeView_GetRoot( GetDlgItem(hwndDlg, IDC_NAMEORDER));
- i=0;
+ int i=0;
while (tvi.hItem != NULL) {
tvi.mask = TVIF_PARAM | TVIF_HANDLE;
TreeView_GetItem( GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvi);
nameOrder[i++] = (BYTE)tvi.lParam;
tvi.hItem = TreeView_GetNextSibling( GetDlgItem(hwndDlg, IDC_NAMEORDER), tvi.hItem);
}
- CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cws);
+ db_set_blob(NULL, "Contact", "NameOrder", nameOrder, SIZEOF(nameOrderDescr));
CallService(MS_CLIST_INVALIDATEDISPLAYNAME, (WPARAM)INVALID_HANDLE_VALUE, 0);
}
break;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index 6b56ad2f9a..8c5aa31fce 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -362,23 +362,17 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf case 'N':
case 'H':
{
- PBYTE buf;
int len;
char *pszValue, *pszEnd;
- DBCONTACTWRITESETTING cws;
- buf = (PBYTE)mir_alloc(lstrlenA(szValue+1));
+ PBYTE buf = (PBYTE)mir_alloc(lstrlenA(szValue+1));
for (len = 0, pszValue = szValue+1;;len++) {
buf[len] = (BYTE)strtol(pszValue, &pszEnd, 0x10);
- if (pszValue == pszEnd) break;
+ if (pszValue == pszEnd)
+ break;
pszValue = pszEnd;
}
- cws.szModule = szSection;
- cws.szSetting = szName;
- cws.value.type = DBVT_BLOB;
- cws.value.pbVal = buf;
- cws.value.cpbVal = len;
- CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cws);
+ db_set_blob(NULL, szSection, szName, buf, len);
mir_free(buf);
}
break;
diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp index 78102a8e80..4c37e0884a 100644 --- a/src/modules/database/dbintf.cpp +++ b/src/modules/database/dbintf.cpp @@ -76,11 +76,6 @@ static INT_PTR srvGetContactSettingStatic(WPARAM wParam,LPARAM lParam) return (currDb) ? (INT_PTR)currDb->GetContactSettingStatic((HANDLE)wParam, (DBCONTACTGETSETTING*)lParam) : 0;
}
-static INT_PTR srvWriteContactSetting(WPARAM wParam,LPARAM lParam)
-{
- return (currDb) ? (INT_PTR)currDb->WriteContactSetting((HANDLE)wParam, (DBCONTACTWRITESETTING*)lParam) : 0;
-}
-
static INT_PTR srvEnumContactSettings(WPARAM wParam,LPARAM lParam)
{
return (currDb) ? (INT_PTR)currDb->EnumContactSettings((HANDLE)wParam, (DBCONTACTENUMSETTINGS*)lParam) : 0;
@@ -155,7 +150,6 @@ int LoadDbintfModule() CreateServiceFunction(MS_DB_MODULES_ENUM, srvEnumModuleNames);
CreateServiceFunction(MS_DB_CONTACT_GETSETTINGSTATIC, srvGetContactSettingStatic);
- CreateServiceFunction(MS_DB_CONTACT_WRITESETTING, srvWriteContactSetting);
CreateServiceFunction(MS_DB_CONTACT_ENUMSETTINGS, srvEnumContactSettings);
CreateServiceFunction("DB/ResidentSettings/Enum", srvEnumResidentSettings);
|