| 175 |
var |
var |
| 176 |
i: Integer; |
i: Integer; |
| 177 |
begin |
begin |
| 178 |
for i := 0 to FBoardList.Count - 1 do begin |
for i := FBoardList.Count - 1 downto 0 do begin |
| 179 |
if FBoardList[i] <> nil then |
if FBoardList[i] <> nil then |
| 180 |
TRoundItem(FBoardList[i]).Free; |
TRoundItem(FBoardList[i]).Free; |
| 181 |
FBoardList.Delete(i); |
FBoardList.Delete(i); |
| 182 |
end; |
end; |
| 183 |
for i := 0 to FItemList.Count - 1 do begin |
for i := FItemList.Count - 1 downto 0 do begin |
| 184 |
if FItemList[i] <> nil then |
if FItemList[i] <> nil then |
| 185 |
TRoundItem(FItemList[i]).Free; |
TRoundItem(FItemList[i]).Free; |
| 186 |
FItemList.Delete(i); |
FItemList.Delete(i); |
| 224 |
Item: TRoundItem; |
Item: TRoundItem; |
| 225 |
begin |
begin |
| 226 |
Result := -1; |
Result := -1; |
| 227 |
for i := 0 to FItemList.Count - 1 do begin |
if RoundType = grtItem then begin |
| 228 |
Item := TRoundItem(FItemList[i]); |
for i := 0 to FItemList.Count - 1 do begin |
| 229 |
if Item.FRoundType <> RoundType then Continue; |
Item := TRoundItem(FItemList[i]); |
| 230 |
if Item.FURL = URL then begin |
if Item.FRoundType <> RoundType then Continue; |
| 231 |
Result := i; |
if Item.FURL = URL then begin |
| 232 |
Exit; |
Result := i; |
| 233 |
|
Exit; |
| 234 |
|
end; |
| 235 |
end; |
end; |
| 236 |
end; |
end else begin |
| 237 |
|
for i := 0 to FBoardList.Count - 1 do begin |
| 238 |
|
Item := TRoundItem(FBoardList[i]); |
| 239 |
|
if Item.FRoundType <> RoundType then Continue; |
| 240 |
|
if Item.FURL = URL then begin |
| 241 |
|
Result := i; |
| 242 |
|
Exit; |
| 243 |
|
end; |
| 244 |
|
end; |
| 245 |
|
end; |
| 246 |
end; |
end; |
| 247 |
procedure TRoundList.Delete(URL: string; RoundType: TGikoRoundType); |
procedure TRoundList.Delete(URL: string; RoundType: TGikoRoundType); |
| 248 |
var |
var |
| 253 |
begin |
begin |
| 254 |
idx := Find(URL, RoundType); |
idx := Find(URL, RoundType); |
| 255 |
if idx <> -1 then begin |
if idx <> -1 then begin |
| 256 |
Item := TRoundItem(FItemList[idx]); |
|
|
Item.Free; |
|
|
FItemList.Delete(idx); |
|
| 257 |
if RoundType = grtBoard then begin |
if RoundType = grtBoard then begin |
| 258 |
|
Item := TRoundItem(FBoardList[idx]); |
| 259 |
|
Item.Free; |
| 260 |
|
FBoardList.Delete(idx); |
| 261 |
board := BBSsFindBoardFromURL(URL); |
board := BBSsFindBoardFromURL(URL); |
| 262 |
board.Round := False; |
if board <> nil then begin |
| 263 |
board.RoundName := ''; |
board.Round := False; |
| 264 |
|
board.RoundName := ''; |
| 265 |
|
end; |
| 266 |
end else begin |
end else begin |
| 267 |
|
Item := TRoundItem(FItemList[idx]); |
| 268 |
|
Item.Free; |
| 269 |
|
FItemList.Delete(idx); |
| 270 |
|
|
| 271 |
threadItem := BBSsFindThreadFromURL(URL); |
threadItem := BBSsFindThreadFromURL(URL); |
| 272 |
threadItem.Round := false; |
if threadItem <> nil then begin |
| 273 |
threadItem.RoundName := ''; |
threadItem.Round := false; |
| 274 |
|
threadItem.RoundName := ''; |
| 275 |
|
end; |
| 276 |
end; |
end; |
| 277 |
end; |
end; |
| 278 |
end; |
end; |