From 254e5db775242ccb158342742415b700821a25df Mon Sep 17 00:00:00 2001 From: yoffy Date: Sun, 23 Nov 2003 05:45:31 +0000 Subject: [PATCH] =?utf8?q?=E3=83=BB=E5=A4=96=E9=83=A8=E6=9D=BF=E3=81=AE?= =?utf8?q?=E5=90=8D=E5=89=8D=E3=81=AB=E6=8B=A1=E5=BC=B5=E5=AD=90=E3=81=8C?= =?utf8?q?=E3=81=A4=E3=81=8B=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= =?utf8?q?=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- GikoSystem.pas | 208 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/GikoSystem.pas b/GikoSystem.pas index 081b075..201ad1e 100644 --- a/GikoSystem.pas +++ b/GikoSystem.pas @@ -2728,18 +2728,18 @@ var inistr: string; RoundItem: TRoundItem; - // BBS ”z—ñ(1 ƒ{[ƒhƒtƒ@ƒCƒ‹‚ɂ‚« 1 €–Ú) - bbsList : array of TStringList; + // BBS ”z—ñ(1 ƒ{[ƒhƒtƒ@ƒCƒ‹‚ɂ‚« 1 €–Ú) + bbsList : array of TStringList; boardFileList : TStringList; - i, iBound : Integer; - j, jBound : Integer; + i, iBound : Integer; + j, jBound : Integer; k, kBound : Integer; - l, lBound : Integer; + l, lBound : Integer; begin ini := TMemIniFile.Create(''); try - // BBS ‚ÌŠJ•ú + // BBS ‚ÌŠJ•ú try for i := 0 to Length( BBSs ) - 1 do BBSs[ i ].Free; @@ -2749,115 +2749,115 @@ begin // ”ƒŠƒXƒg‚Ì—ñ‹“ if FileExists( GikoSys.GetBoardFileName ) then begin - l := Length( bbsList ); - SetLength( bbsList, l + 1 ); - bbsList[ l ] := TStringList.Create; - bbsList[ l ].LoadFromFile( GikoSys.GetBoardFileName ); - - SetLength( BBSs, l + 1 ); - BBSs[ l ] := TBBS.Create( GikoSys.Setting.LogFolder ); - BBSs[ l ].Title := '‚Q‚¿‚á‚ñ‚Ë‚é'; - end; + l := Length( bbsList ); + SetLength( bbsList, l + 1 ); + bbsList[ l ] := TStringList.Create; + bbsList[ l ].LoadFromFile( GikoSys.GetBoardFileName ); + + SetLength( BBSs, l + 1 ); + BBSs[ l ] := TBBS.Create( GikoSys.Setting.LogFolder ); + BBSs[ l ].Title := '‚Q‚¿‚á‚ñ‚Ë‚é'; + end; if FileExists( GikoSys.GetCustomBoardFileName ) then begin - l := Length( bbsList ); - SetLength( bbsList, l + 1 ); - bbsList[ l ] := TStringList.Create; - bbsList[ l ].LoadFromFile( GikoSys.GetCustomBoardFileName ); - - SetLength( BBSs, l + 1 ); - BBSs[ l ] := TBBS.Create( GikoSys.Setting.LogFolder ); - BBSs[ l ].Title := '‚»‚Ì‘¼'; - end; + l := Length( bbsList ); + SetLength( bbsList, l + 1 ); + bbsList[ l ] := TStringList.Create; + bbsList[ l ].LoadFromFile( GikoSys.GetCustomBoardFileName ); + + SetLength( BBSs, l + 1 ); + BBSs[ l ] := TBBS.Create( GikoSys.Setting.LogFolder ); + BBSs[ l ].Title := '‚»‚Ì‘¼'; + end; // Board ƒtƒHƒ‹ƒ_ if DirectoryExists( GikoSys.Setting.GetBoardDir ) then begin BoardFileList := TStringList.Create; - try - GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True ); - l := Length( bbsList ); - for i := BoardFileList.Count - 1 downto 0 do begin - SetLength( bbsList, l + 1 ); - bbsList[ l ] := TStringList.Create; - bbsList[ l ].LoadFromFile( BoardFileList[ i ] ); - - SetLength( BBSs, l + 1 ); - BBSs[ l ] := TBBS.Create( GikoSys.Setting.LogFolder ); - BBSs[ l ].Title := ExtractFileName( BoardFileList[ i ] ); - - Inc( l ); - end; - finally - BoardFileList.Free; - end; + try + GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True ); + l := Length( bbsList ); + for i := BoardFileList.Count - 1 downto 0 do begin + SetLength( bbsList, l + 1 ); + bbsList[ l ] := TStringList.Create; + bbsList[ l ].LoadFromFile( BoardFileList[ i ] ); + + SetLength( BBSs, l + 1 ); + BBSs[ l ] := TBBS.Create( GikoSys.Setting.LogFolder ); + BBSs[ l ].Title := ChangeFileExt( ExtractFileName( BoardFileList[ i ] ), '' ); + + Inc( l ); + end; + finally + BoardFileList.Free; + end; end; - lBound := Length( bbsList ) - 1; - for l := 0 to lBound do begin + lBound := Length( bbsList ) - 1; + for l := 0 to lBound do begin ini.SetStrings( bbsList[ l ] ); - CategoryList := TStringList.Create; - BoardList := TStringList.Create; - try - ini.ReadSections( CategoryList ); - - iBound := CategoryList.Count - 1; - for i := 0 to iBound do begin - ini.ReadSection( CategoryList[i], BoardList ); - Category := TCategory.Create; - Category.No := i + 1; - Category.Title := CategoryList[i]; - - jBound := BoardList.Count - 1; - for j := 0 to jBound do begin - Board := nil; - inistr := ini.ReadString(CategoryList[i], BoardList[j], ''); - - //===== ƒvƒ‰ƒOƒCƒ“ - try - kBound := Length( BoardPlugIns ) - 1; - for k := 0 to kBound do begin - if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin - if BoardPlugIns[ k ].AcceptURL( inistr ) = atBoard then begin - Board := TBoard.Create( BoardPlugIns[ k ], inistr ); - - Break; - end; - end; - end; - except - // exception ‚ª”­¶‚µ‚½ê‡‚Í“à•”ˆ—‚É”C‚¹‚½‚¢‚Ì‚Å‚±‚±‚ł͉½‚à‚µ‚È‚¢ - end; - - if Board = nil then - Board := TBoard.Create( nil, inistr ); - Board.BeginUpdate; - Board.No := j + 1; - Board.Title := BoardList[j]; - Board.BBSID := GikoSys.UrlToID(inistr); - Board.RoundDate := ZERO_DATE; - - idx := RoundList.Find(Board); - if idx <> -1 then begin - RoundItem := RoundList.Items[idx, grtBoard]; - Board.Round := True; - Board.RoundName := RoundItem.RoundName; - end; - Category.Add(Board); - Board.EndUpdate; - end; - - BBSs[ l ].Add( Category ); - end; - finally - BoardList.Free; - CategoryList.Free; - end; - end; + CategoryList := TStringList.Create; + BoardList := TStringList.Create; + try + ini.ReadSections( CategoryList ); + + iBound := CategoryList.Count - 1; + for i := 0 to iBound do begin + ini.ReadSection( CategoryList[i], BoardList ); + Category := TCategory.Create; + Category.No := i + 1; + Category.Title := CategoryList[i]; + + jBound := BoardList.Count - 1; + for j := 0 to jBound do begin + Board := nil; + inistr := ini.ReadString(CategoryList[i], BoardList[j], ''); + + //===== ƒvƒ‰ƒOƒCƒ“ + try + kBound := Length( BoardPlugIns ) - 1; + for k := 0 to kBound do begin + if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin + if BoardPlugIns[ k ].AcceptURL( inistr ) = atBoard then begin + Board := TBoard.Create( BoardPlugIns[ k ], inistr ); + + Break; + end; + end; + end; + except + // exception ‚ª”­¶‚µ‚½ê‡‚Í“à•”ˆ—‚É”C‚¹‚½‚¢‚Ì‚Å‚±‚±‚ł͉½‚à‚µ‚È‚¢ + end; + + if Board = nil then + Board := TBoard.Create( nil, inistr ); + Board.BeginUpdate; + Board.No := j + 1; + Board.Title := BoardList[j]; + Board.BBSID := GikoSys.UrlToID(inistr); + Board.RoundDate := ZERO_DATE; + + idx := RoundList.Find(Board); + if idx <> -1 then begin + RoundItem := RoundList.Items[idx, grtBoard]; + Board.Round := True; + Board.RoundName := RoundItem.RoundName; + end; + Category.Add(Board); + Board.EndUpdate; + end; + + BBSs[ l ].Add( Category ); + end; + finally + BoardList.Free; + CategoryList.Free; + end; + end; finally ini.Free; - lBound := Length( bbsList ) - 1; - for l := 0 to lBound do - bbsList[ l ].Free; + lBound := Length( bbsList ) - 1; + for l := 0 to lBound do + bbsList[ l ].Free; end; end; -- 2.11.0