summaryrefslogtreecommitdiff
path: root/plugins/YahooGroups
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-07 19:47:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-07 19:47:13 +0000
commit097c52ad9a2928422084bf76cebee58958341574 (patch)
tree26d6b11e9738fc4e854f68c0ff04eaadf7d849e8 /plugins/YahooGroups
parentf096b29abb03618ec609ba4acaedaed43eec1fea (diff)
end of the old database macroses
git-svn-id: http://svn.miranda-ng.org/main/trunk@4373 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YahooGroups')
-rw-r--r--plugins/YahooGroups/src/services.cpp4
-rw-r--r--plugins/YahooGroups/src/utils.cpp46
2 files changed, 22 insertions, 28 deletions
diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp
index b896f5598f..5334e7f4a2 100644
--- a/plugins/YahooGroups/src/services.cpp
+++ b/plugins/YahooGroups/src/services.cpp
@@ -101,7 +101,7 @@ void AddNewGroup(char *newGroup)
wchar_t wide[MAX_SIZE] = {0};
*wide = 1;
MultiByteToWideChar(currentCodePage, 0, group + 1, -1, wide + 1, MAX_SIZE - 1);
- DBWriteContactSettingWString(NULL, CLIST_GROUPS, tmp, wide);
+ db_set_ws(NULL, CLIST_GROUPS, tmp, wide);
availableGroups.Add(_strdup(group + 1));
}
@@ -111,7 +111,7 @@ void AddContactToGroup(HANDLE hContact, char *group)
const int MAX_SIZE = 1024;
wchar_t wide[MAX_SIZE] = {0};
MultiByteToWideChar(currentCodePage, 0, group, -1, wide, MAX_SIZE);
- DBWriteContactSettingWString(hContact, "CList", "Group", wide);
+ db_set_ws(hContact, "CList", "Group", wide);
}
void CreateGroup(char *group)
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp
index 0a77deb1e4..4c1022fd76 100644
--- a/plugins/YahooGroups/src/utils.cpp
+++ b/plugins/YahooGroups/src/utils.cpp
@@ -169,34 +169,28 @@ int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName,
int res = 1;
int len;
dbv.type = DBVT_WCHAR;
- if (DBGetContactSettingWString(hContact, szModule, szSettingName, &dbv) == 0)
- {
- res = 0;
- if (dbv.type != DBVT_WCHAR)
- {
- MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, szResult, count);
- }
- else{
- int tmp = wcslen(dbv.pwszVal);
- len = (tmp < count - 1) ? tmp : count - 1;
- wcsncpy(szResult, dbv.pwszVal, len);
- szResult[len] = L'\0';
- }
- mir_free(dbv.pwszVal);
+ if ( db_get_s(hContact, szModule, szSettingName, &dbv, 0) == 0) {
+ res = 0;
+ if (dbv.type != DBVT_WCHAR)
+ MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, szResult, count);
+ else {
+ int tmp = wcslen(dbv.pwszVal);
+ len = (tmp < count - 1) ? tmp : count - 1;
+ wcsncpy(szResult, dbv.pwszVal, len);
+ szResult[len] = L'\0';
}
- else{
- res = 1;
- if (szError)
- {
- int tmp = wcslen(szError);
- len = (tmp < count - 1) ? tmp : count - 1;
- wcsncpy(szResult, szError, len);
- szResult[len] = L'\0';
- }
- else{
- szResult[0] = L'\0';
- }
+ mir_free(dbv.pwszVal);
+ }
+ else {
+ res = 1;
+ if (szError) {
+ int tmp = wcslen(szError);
+ len = (tmp < count - 1) ? tmp : count - 1;
+ wcsncpy(szResult, szError, len);
+ szResult[len] = L'\0';
}
+ else szResult[0] = L'\0';
+ }
return res;
}