From 91eb23f044911477f615e7e25e1425b667c3f1fa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 12 Apr 2013 21:28:12 +0000 Subject: pascal sources sync git-svn-id: http://svn.miranda-ng.org/main/trunk@4435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/mRadio/i_tray.inc | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'plugins/mRadio/i_tray.inc') diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index fa63acc720..f0a463c5de 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -49,32 +49,28 @@ begin // Fill list FillChar(srch,SizeOf(srch),0); - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),cPluginName)=0 then + p:=DBReadUnicode(hContact,strCList,'MyHandle',nil); + if p<>nil then begin - p:=DBReadUnicode(hContact,strCList,'MyHandle',nil); - if p<>nil then + srch.name:=p; + // search in list + if List_GetIndex(@trayStations,@srch,@idx)<>0 then + // found - set mark + pTrayRadioStation(trayStations.Items[idx]).presents:=1 + else // add if not found begin - srch.name:=p; - // search in list - if List_GetIndex(@trayStations,@srch,@idx)<>0 then - // found - set mark - pTrayRadioStation(trayStations.Items[idx]).presents:=1 - else // add if not found - begin - mGetMem(tmp,SizeOf(tTrayRadioStation)); - tmp.name :=p; - tmp.presents:=2; - tmp.hContact:=hContact; - List_InsertPtr(@trayStations,tmp); - end; + mGetMem(tmp,SizeOf(tTrayRadioStation)); + tmp.name :=p; + tmp.presents:=2; + tmp.hContact:=hContact; + List_InsertPtr(@trayStations,tmp); end; end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact,PluginName); end; - // delete obsolete elements for i:=trayStations.realCount-1 downto 0 do begin -- cgit v1.2.3