diff options
Diffstat (limited to 'plugins/Quotes/src')
-rw-r--r-- | plugins/Quotes/src/DBUtils.cpp | 10 | ||||
-rw-r--r-- | plugins/Quotes/src/ImportExport.cpp | 10 | ||||
-rw-r--r-- | plugins/Quotes/src/QuoteInfoDlg.cpp | 10 | ||||
-rw-r--r-- | plugins/Quotes/src/QuotesProviderVisitorFormater.cpp | 10 |
4 files changed, 4 insertions, 36 deletions
diff --git a/plugins/Quotes/src/DBUtils.cpp b/plugins/Quotes/src/DBUtils.cpp index 4ef1f1dd3a..583cedcf85 100644 --- a/plugins/Quotes/src/DBUtils.cpp +++ b/plugins/Quotes/src/DBUtils.cpp @@ -49,19 +49,11 @@ bool Quotes_DBWriteDouble(HANDLE hContact,const char* szModule,const char* szSet bool Quotes_DBReadDouble(HANDLE hContact,const char* szModule,const char* szSetting,double& rdValue)
{
DBVARIANT dbv = {0};
- DBCONTACTGETSETTING cgs;
- cgs.szModule=szModule;
- cgs.szSetting=szSetting;
- cgs.pValue = &dbv;
dbv.type = DBVT_BLOB;
- bool bResult = ((0 == CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
- && (DBVT_BLOB == dbv.type));
-
+ bool bResult = ((0 == db_get(hContact, szModule, szSetting, &dbv)) && (DBVT_BLOB == dbv.type));
if(bResult)
- {
rdValue = *reinterpret_cast<double*>(dbv.pbVal);
- }
db_free(&dbv);
return bResult;
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index 6ffaef1594..00153d79dd 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -34,18 +34,10 @@ namespace static int enum_contact_settings(const char* szSetting,LPARAM lp)
{
-// USES_CONVERSION;
CEnumContext* ctx = reinterpret_cast<CEnumContext*>(lp);
DBVARIANT dbv;
- DBCONTACTGETSETTING cgs;
-
- cgs.szModule = ctx->m_pszModule;
- cgs.szSetting = szSetting;
- cgs.pValue = &dbv;
- if(0 == CallService(MS_DB_CONTACT_GETSETTING,
- reinterpret_cast<WPARAM>(ctx->m_hContact),
- reinterpret_cast<LPARAM>(&cgs)))
+ if(0 == db_get(ctx->m_hContact, ctx->m_pszModule, szSetting, &dbv))
{
mir_safety_dbvar sdbvar(&dbv);
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index c04f6d8ec9..756a17ad8f 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -31,16 +31,8 @@ namespace bool get_fetch_time(time_t& rTime,HANDLE hContact)
{
DBVARIANT dbv;
- DBCONTACTGETSETTING cgs;
-
- cgs.szModule=QUOTES_PROTOCOL_NAME;
- cgs.szSetting=DB_STR_QUOTE_FETCH_TIME;
- cgs.pValue=&dbv;
- if(CallService(MS_DB_CONTACT_GETSETTING,reinterpret_cast<WPARAM>(hContact),reinterpret_cast<LPARAM>(&cgs))
- || (DBVT_DWORD != dbv.type))
- {
+ if (db_get(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FETCH_TIME, &dbv) || (DBVT_DWORD != dbv.type))
return false;
- }
rTime = dbv.dVal;
return true;
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp index d95b4ed342..0c95f3846f 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp +++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp @@ -48,16 +48,8 @@ namespace bool get_fetch_time(HANDLE hContact,time_t& rTime)
{
DBVARIANT dbv;
- DBCONTACTGETSETTING cgs;
-
- cgs.szModule=QUOTES_MODULE_NAME;
- cgs.szSetting=DB_STR_QUOTE_FETCH_TIME;
- cgs.pValue=&dbv;
- if(CallService(MS_DB_CONTACT_GETSETTING,reinterpret_cast<WPARAM>(hContact),reinterpret_cast<LPARAM>(&cgs))
- || (DBVT_DWORD != dbv.type))
- {
+ if (db_get(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_FETCH_TIME, &dbv) || (DBVT_DWORD != dbv.type))
return false;
- }
rTime = dbv.dVal;
return true;
|