summaryrefslogtreecommitdiff
path: root/plugins/HistoryPlusPlus
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-29 18:16:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-29 18:16:23 +0000
commitde5dce707cc60ace5b92d2ac61914c590cb9680b (patch)
tree64f2ee6639edeefcc9a32425d10cd56463dab6a4 /plugins/HistoryPlusPlus
parent13952bddf4931ed75338460754860a81d3710678 (diff)
rest of unused databases services removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@5181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryPlusPlus')
-rw-r--r--plugins/HistoryPlusPlus/PassForm.pas4
-rw-r--r--plugins/HistoryPlusPlus/hpp_contacts.pas6
-rw-r--r--plugins/HistoryPlusPlus/hpp_database.pas31
-rw-r--r--plugins/HistoryPlusPlus/hpp_searchthread.pas12
4 files changed, 14 insertions, 39 deletions
diff --git a/plugins/HistoryPlusPlus/PassForm.pas b/plugins/HistoryPlusPlus/PassForm.pas
index 9de9e6ef63..6b923b3b68 100644
--- a/plugins/HistoryPlusPlus/PassForm.pas
+++ b/plugins/HistoryPlusPlus/PassForm.pas
@@ -185,11 +185,11 @@ begin
lvCList.Items.BeginUpdate;
try
lvCList.Items.Clear;
- hCont := CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hCont := db_find_first();
while hCont <> 0 do
begin
AddContact(lvCList,hCont);
- hCont := CallService(MS_DB_CONTACT_FINDNEXT, hCont, 0);
+ hCont := db_find_next(hCont);
end;
AddContact(lvCList,0);
lvCList.SortType := stNone;
diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas
index b78c4db72e..a9a4cd5e93 100644
--- a/plugins/HistoryPlusPlus/hpp_contacts.pas
+++ b/plugins/HistoryPlusPlus/hpp_contacts.pas
@@ -126,7 +126,6 @@ function GetContactID(hContact: THandle; Proto: AnsiString = ''; Contact: boolea
var
uid: PAnsiChar;
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
tmp: String;
begin
Result := '';
@@ -137,10 +136,7 @@ begin
uid := PAnsiChar(CallProtoService(PAnsiChar(Proto), PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0));
if (uid <> pAnsiChar(CALLSERVICE_NOTFOUND)) and (uid <> nil) then
begin
- cgs.szModule := PAnsiChar(Proto);
- cgs.szSetting := uid;
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, LPARAM(@cgs)) = 0 then
+ if db_get(hContact, PAnsiChar(Proto), uid, @dbv) = 0 then
begin
case dbv._type of
DBVT_BYTE:
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
diff --git a/plugins/HistoryPlusPlus/hpp_searchthread.pas b/plugins/HistoryPlusPlus/hpp_searchthread.pas
index 30effa8ae4..d3bd22d361 100644
--- a/plugins/HistoryPlusPlus/hpp_searchthread.pas
+++ b/plugins/HistoryPlusPlus/hpp_searchthread.pas
@@ -251,7 +251,7 @@ procedure TSearchThread.BuildContactsList;
var
hCont: THandle;
begin
- hCont := CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hCont := db_find_first();
while hCont <> 0 do
begin
@@ -261,7 +261,7 @@ begin
if SearchProtectedContacts or (not SearchProtectedContacts and (not IsUserProtected(hCont)))
then
AddContact(hCont);
- hCont := CallService(MS_DB_CONTACT_FINDNEXT, hCont, 0);
+ hCont := db_find_next(hCont);
end;
AddContact(hCont);
@@ -274,7 +274,7 @@ var
hCont: THandle;
begin
MaxProgress := 0;
- hCont := CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hCont := db_find_first();
while hCont <> 0 do
begin
// I hope I haven't messed this up by
@@ -282,7 +282,7 @@ begin
if SearchProtectedContacts or (not SearchProtectedContacts and (not IsUserProtected(hCont)))
then
MaxProgress := MaxProgress + GetItemsCount(hCont);
- hCont := CallService(MS_DB_CONTACT_FINDNEXT, hCont, 0);
+ hCont := db_find_next(hCont);
end;
// add sysem history
MaxProgress := MaxProgress + GetItemsCount(hCont);
@@ -338,7 +338,7 @@ begin
end;
{$IFNDEF SMARTSEARCH}
- hCont := CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hCont := db_find_first();
while (hCont <> 0) and not Terminated do
begin
Inc(AllContacts);
@@ -352,7 +352,7 @@ begin
else
SearchContact(hCont);
end;
- hCont := CallService(MS_DB_CONTACT_FINDNEXT, hCont, 0);
+ hCont := db_find_next(hCont);
end;
if BookmarksMode then
SearchBookmarks(hCont)