From de5dce707cc60ace5b92d2ac61914c590cb9680b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 29 Jun 2013 18:16:23 +0000 Subject: rest of unused databases services removed git-svn-id: http://svn.miranda-ng.org/main/trunk@5181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryPlusPlus/PassForm.pas | 4 ++-- plugins/HistoryPlusPlus/hpp_contacts.pas | 6 +----- plugins/HistoryPlusPlus/hpp_database.pas | 31 +++++----------------------- plugins/HistoryPlusPlus/hpp_searchthread.pas | 12 +++++------ 4 files changed, 14 insertions(+), 39 deletions(-) (limited to 'plugins/HistoryPlusPlus') 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) -- cgit v1.2.3