From 25ec54ea27a7099f33573b260a620ed7273176fe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Jun 2013 12:16:44 +0000 Subject: - 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 --- plugins/Quotes/src/DBUtils.cpp | 9 +-------- plugins/Quotes/src/ImportExport.cpp | 7 ++----- 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'plugins/Quotes/src') 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(&dValue); - return 0 == CallService(MS_DB_CONTACT_WRITESETTING,reinterpret_cast(hContact),reinterpret_cast(&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(hContact), - reinterpret_cast(&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()) -- cgit v1.2.3