summaryrefslogtreecommitdiff
path: root/plugins/HistoryPlusPlus/hpp_database.pas
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HistoryPlusPlus/hpp_database.pas')
-rw-r--r--plugins/HistoryPlusPlus/hpp_database.pas31
1 files changed, 5 insertions, 26 deletions
diff --git a/plugins/HistoryPlusPlus/hpp_database.pas b/plugins/HistoryPlusPlus/hpp_database.pas
index 483e5c553d..4341fa64e2 100644
--- a/plugins/HistoryPlusPlus/hpp_database.pas
+++ b/plugins/HistoryPlusPlus/hpp_database.pas
@@ -115,12 +115,8 @@ end;
function DBExists(const hContact: THandle; const Module, Param: AnsiString): Boolean;
var
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
begin
- cgs.szModule := PAnsiChar(Module);
- cgs.szSetting := PAnsiChar(Param);
- cgs.pValue := @dbv;
- Result := (CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) = 0);
+ Result := (db_get(hContact, PAnsiChar(Module), PAnsiChar(Param), @dbv) = 0);
if Result then
DBFreeVariant(@dbv);
end;
@@ -262,15 +258,10 @@ end;
function GetDBBlob(const hContact: THandle; const Module,Param: AnsiString; var Value: Pointer; var Size: Integer): Boolean;
var
- cgs: TDBContactGetSetting;
dbv: TDBVARIANT;
begin
Result := False;
- ZeroMemory(@cgs,SizeOf(cgs));
- cgs.szModule := PAnsiChar(Module);
- cgs.szSetting := PAnsiChar(Param);
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then exit;
+ if db_get(hContact, PAnsiChar(Module), PAnsiChar(Param), @dbv) <> 0 then exit;
Size := dbv.cpbVal;
Value := nil;
if dbv.cpbVal = 0 then exit;
@@ -327,15 +318,11 @@ end;
function GetDBInt(const hContact: THandle; const Module,Param: AnsiString; Default: Integer): Integer;
var
- cws:TDBCONTACTGETSETTING;
dbv:TDBVariant;
begin
dbv._type := DBVT_DWORD;
dbv.dVal:=Default;
- cws.szModule:=PAnsiChar(Module);
- cws.szSetting:=PAnsiChar(Param);
- cws.pValue:=@dbv;
- if CallService(MS_DB_CONTACT_GETSETTING,hContact,LPARAM(@cws))<>0 then
+ if db_get(hContact,PAnsiChar(Module),PAnsiChar(Param),@dbv)<>0 then
Result:=default
else
Result:=dbv.dval;
@@ -354,13 +341,9 @@ end;
function DBGetContactSettingString(hContact: THandle; const szModule: PAnsiChar; const szSetting: PAnsiChar; ErrorValue: PAnsiChar): AnsiString;
var
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
tmp: WideString;
begin
- cgs.szModule := szModule;
- cgs.szSetting := szSetting;
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ if db_get(hContact, szModule, szSetting, @dbv) <> 0 then
Result := ErrorValue
else begin
case dbv._type of
@@ -391,12 +374,8 @@ end;
function DBGetContactSettingWideString(hContact: THandle; const szModule: PAnsiChar; const szSetting: PAnsiChar; ErrorValue: PWideChar): WideString;
var
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
begin
- cgs.szModule := szModule;
- cgs.szSetting := szSetting;
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ if db_get(hContact, szModule, szSetting, @dbv) <> 0 then
Result := ErrorValue
else begin
case dbv._type of