sec : TStringList;
begin
sec := TStringList.Create;
- ini := TMemIniFile.Create(GikoSys.GetBoardFileName);
- ini.ReadSections(sec);
+ try
+ ini := TMemIniFile.Create(GikoSys.GetBoardFileName);
+ try
+ ini.ReadSections(sec);
- CategoryComboBox.Clear;
- CategoryComboBox.Items.BeginUpdate;
- for i := 0 to sec.Count - 1 do begin
- CategoryComboBox.Items.Add(sec[i]);
- end;
- CategoryComboBox.Items.EndUpdate;
- CategoryComboBox.ItemIndex := 0;
+ CategoryComboBox.Clear;
+ CategoryComboBox.Items.BeginUpdate;
+ for i := 0 to sec.Count - 1 do begin
+ CategoryComboBox.Items.Add(sec[i]);
+ end;
+ CategoryComboBox.Items.EndUpdate;
+ CategoryComboBox.ItemIndex := 0;
- ResultMemo.Lines.Clear;
+ ResultMemo.Lines.Clear;
+ finally
+ if ini <> nil then begin
+ ini.Free;
+ end;
+ end;
+ finally
+ if sec <> nil then begin
+ sec.Free;
+ end;
+ end;
end;
-
+//! \8c\9f\8dõ\83{\83^\83\93\83C\83x\83\93\83g
procedure TNewBoardURLForm.SearchButtonClick(Sender: TObject);
var
i : Integer;
IdHTTP.Request.CacheControl := 'no-cache';
IdHTTP.Request.CustomHeaders.Add('Pragma: no-cache');
IdHTTP.HandleRedirects := false;
+ IdAntiFreeze.Active := true;
for i := 0 to URLs.Count - 1 do begin
- IdAntiFreeze.Active := true;
try
ResStream.Clear;
IdHTTP.Get(URLs[i], ResStream);
newURL := IdHTTP.Response.Location;
end;
if (newURL <> '') then begin
+ // \83\8a\83_\83C\83\8c\83N\83g\82·\82ê\82Î\95K\82¸\88Ú\93]\82Æ\82Í\8cÀ\82ç\82È\82¢
+ // \83e\83\8c\83r\94Ô\91g\94Â\82È\82Ç\82Ì\91Î\8dô\8dÅ\8cã\82Ì'/'\82Ü\82Å\82ðURL\82Æ\82·\82é
+ if (Length(newURL) <> LastDelimiter('/', newURL)) then begin
+ newURL := Copy(newURL, 1, LastDelimiter('/', newURL));
+ end;
oldURL := URLs[i];
- ResultMemo.Lines.Add('URL:' + oldURL + ' -> ' + newURL);
- if (newURL <> '') then begin
+ if (oldURL <> newURL) then begin
+ ResultMemo.Lines.Add('URL:' + oldURL + ' -> ' + newURL);
oldURLs.Add( oldURL );
newURLs.Add( newURL );
end;
{$ENDIF}
end;
end;
- IdAntiFreeze.Active := false;
end;
-
+ IdAntiFreeze.Active := false;
if (newURLs.Count > 0) and (oldURLs.Count > 0) then begin
ReplaceURLs(oldURLs, newURLs);
GikoForm.FavoritesURLReplace(oldURLs, newURLs);
keys := TStringList.Create;
try
ini := TMemIniFile.Create(GikoSys.GetBoardFileName);
- ini.ReadSection(sec, keys);
- for i := 0 to keys.Count - 1 do begin
- urls.Add(ini.ReadString(sec, keys[i], ''));
+ try
+ ini.ReadSection(sec, keys);
+ for i := 0 to keys.Count - 1 do begin
+ urls.Add(ini.ReadString(sec, keys[i], ''));
+ end;
+ finally
+ ini.Free;
end;
finally
keys.Free;