summaryrefslogtreecommitdiff
path: root/plugins/Quotes/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-30 12:16:44 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-30 12:16:44 +0000
commit25ec54ea27a7099f33573b260a620ed7273176fe (patch)
tree1810a0cb35d23deeed9ccdaf0ab276a4022f9a41 /plugins/Quotes/src
parenta546606709e6bb72e01eb38b2c8c8756608fd5d6 (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 'plugins/Quotes/src')
-rw-r--r--plugins/Quotes/src/DBUtils.cpp9
-rw-r--r--plugins/Quotes/src/ImportExport.cpp7
2 files changed, 3 insertions, 13 deletions
diff --git a/plugins/Quotes/src/DBUtils.cpp b/plugins/Quotes/src/DBUtils.cpp
index 583cedcf85..d85f85c282 100644
--- a/plugins/Quotes/src/DBUtils.cpp
+++ b/plugins/Quotes/src/DBUtils.cpp
@@ -36,14 +36,7 @@ std::wstring Quotes_DBGetStringW(HANDLE hContact,const char* szModule,const char
bool Quotes_DBWriteDouble(HANDLE hContact,const char* szModule,const char* szSetting,double dValue)
{
- DBCONTACTWRITESETTING cws = {0};
-
- cws.szModule = szModule;
- cws.szSetting = szSetting;
- cws.value.type = DBVT_BLOB;
- cws.value.cpbVal = sizeof(dValue);
- cws.value.pbVal = reinterpret_cast<BYTE*>(&dValue);
- return 0 == CallService(MS_DB_CONTACT_WRITESETTING,reinterpret_cast<WPARAM>(hContact),reinterpret_cast<LPARAM>(&cws));
+ return 0 == db_set_blob(hContact, szModule, szSetting, &dValue, sizeof(dValue));
}
bool Quotes_DBReadDouble(HANDLE hContact,const char* szModule,const char* szSetting,double& rdValue)
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp
index 00153d79dd..6c7d7fc1fa 100644
--- a/plugins/Quotes/src/ImportExport.cpp
+++ b/plugins/Quotes/src/ImportExport.cpp
@@ -309,17 +309,14 @@ INT_PTR Quotes_Export(WPARAM wp,LPARAM lp)
namespace
{
- bool set_contact_settings(HANDLE hContact,DBCONTACTWRITESETTING& dbs)
+ bool set_contact_settings(HANDLE hContact, DBCONTACTWRITESETTING& dbs)
{
assert(DBVT_DELETED != dbs.value.type);
- return (0 == CallService(MS_DB_CONTACT_WRITESETTING,reinterpret_cast<WPARAM>(hContact),
- reinterpret_cast<LPARAM>(&dbs)));
+ return (0 == db_set(hContact, dbs.szModule, dbs.szSetting, &dbs.value));
}
bool handle_module(HANDLE hContact,const IXMLNode::TXMLNodePtr& pXmlModule,UINT nFlags)
{
-// USES_CONVERSION;
-
size_t cCreatedRecords = 0;
tstring sModuleName = pXmlModule->GetText();
if(false == sModuleName.empty())