From: yoffy Date: Mon, 8 Mar 2004 05:31:43 +0000 (+0000) Subject: ・板リストファイルに対し遅延読み出しを行うようになった。 X-Git-Tag: v1_64_1_820~1384 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f6325a27933d0323ef000e39cb5e95c57d6f05c6;p=gikonavigoeson%2Fgikonavi.git ・板リストファイルに対し遅延読み出しを行うようになった。 ・TBBS.GetLogFolder は BBS 個別のログフォルダではなく  一貫して2ちゃんねるのログフォルダのみを返していたため誤使用を避けるため削除した。 ・代わりに板リストファイルを指す TBBS.FilePath を追加。 (代わりと言っても、TBBS.FilePath とログフォルダのパスは関連性は無い) --- diff --git a/BoardGroup.pas b/BoardGroup.pas index d2cf79e..14bf42e 100644 --- a/BoardGroup.pas +++ b/BoardGroup.pas @@ -70,21 +70,22 @@ type TBoard = class; TThreadItem = class; - //‚Æ‚è‚ ‚¦‚¸‚Q‚¿‚á‚ñ‚Ë‚é‚̃‹[ƒg + // BBS ‚̃‹[ƒg TBBS = class(TList) private FTitle: string; - FLogFolder: string; + FFilePath : string; // ”ƒŠƒXƒg‚̃pƒX FExpand: Boolean; FKubetsuChk: Boolean; //iž‚ÝŽž‘啶Žš¬•¶Žš‹æ•Ê FSelectText: string; //iž‚Ý•¶Žš—ñ FShortSelectText: string; + FIsBoardFileRead : Boolean; // ”ƒŠƒXƒg‚͓ǂݍž‚Ü‚ê‚Ä‚¢‚é‚©H function GetCategory(index: integer): TCategory; procedure SetCategory(index: integer; value: TCategory); procedure SetSelectText(s: string); public - constructor Create(LogFolder: string); + constructor Create( boardFilePath : string ); destructor Destroy; override; function Add(item: TCategory): integer; @@ -97,7 +98,7 @@ type function FindThreadFromURL( inURL : string ) : TThreadItem; function FindThreadItem(BBSID: string; FileName: string): TThreadItem; function FindCategoryFromTitle( inTitle : string ) : TCategory; - function GetLogFolder: string; + property FilePath : string read FFilePath write FFilePath; property Items[index: integer]: TCategory read GetCategory write SetCategory; property Title: string read FTitle write FTitle; @@ -106,6 +107,8 @@ type property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk; property SelectText: string read FSelectText write SetSelectText; property ShortSelectText: string read FShortSelectText write FShortSelectText; + + property IsBoardFileRead : Boolean read FIsBoardFileRead write FIsBoardFileRead; end; //ƒJƒeƒSƒŠ @@ -382,20 +385,18 @@ const // COLUMN_BOARD: array[0..3] of string = ('”–¼', 'Žæ“¾”', '„‰ñ—\–ñ', '‘O‰ñ„‰ñ“úŽž'); // COLUMN_THREADITEM: array[0..3] of string = ('ƒXƒŒƒbƒh–¼', 'ƒJƒEƒ“ƒg', '„‰ñ—\–ñ', '‘O‰ñ„‰ñ“úŽž'); +// BBSID ‚ð—p‚¢‚é 2 ‚¿‚á‚ñ‚Ë‚é‚Ì‚Ý’T‚µo‚µ‚Ü‚· +// BBSID ‚ÌŽg—p‚Í‹É—Í”ð‚¯‚Ä‚­‚¾‚³‚¢B +// ‰Â”\‚ȏꍇ‚Í URL ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢B function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard; -var - i : Integer; begin - for i := Length( BBSs ) - 1 downto 0 do begin - Result := BBSs[ i ].FindBBSID( inBBSID ); - if Result <> nil then - Exit; - end; + if not BBSs[ 0 ].IsBoardFileRead then + GikoSys.ReadBoardFile( BBSs[ 0 ] ); - Result := nil; + Result := BBSs[ 0 ].FindBBSID( inBBSID ); end; @@ -454,11 +455,11 @@ end; *‹@”\–¼FTBBSƒRƒ“ƒXƒgƒ‰ƒNƒ^ *Public *************************************************************************) -constructor TBBS.Create(LogFolder: string); +constructor TBBS.Create( boardFilePath : string ); begin inherited Create; Title := BBS2CH_NAME; - FLogFolder := LogFolder; + FFilePath := boardFilePath; end; (************************************************************************* @@ -599,16 +600,6 @@ begin end; -(************************************************************************* - *ƒƒOƒtƒHƒ‹ƒ_Žæ“¾ - * - *************************************************************************) -function TBBS.GetLogFolder: string; -begin - Result := IncludeTrailingPathDelimiter(FLogFolder) - + BBS2CH_LOG_FOLDER + PATH_DELIM; -end; - procedure TBBS.SetSelectText(s: string); begin FSelectText := s; @@ -992,8 +983,8 @@ begin if Length( FilePath ) > 0 then FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME else - FileName := ParentCategory.ParenTBBS.GetLogFolder - + BBSID + PATH_DELIM + FOLDER_INI_FILENAME; + FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) + + BBS2CH_LOG_FOLDER + BBSID + PATH_DELIM + FOLDER_INI_FILENAME; if not FileExists(FileName) then Exit; @@ -1050,8 +1041,8 @@ begin if Length( FilePath ) > 0 then FileName := ExtractFilePath( FilePath ) else - FileName := ParentCategory.ParenTBBS.GetLogFolder - + BBSID + PATH_DELIM; + FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) + + BBS2CH_LOG_FOLDER + BBSID + PATH_DELIM; if not GikoSys.DirectoryExistsEx(FileName) then GikoSys.ForceDirectoriesEx(FileName); FileName := FileName + FOLDER_INI_FILENAME; @@ -1107,8 +1098,8 @@ begin if Length( FilePath ) > 0 then Result := FilePath else - Result := ParentCategory.ParenTBBS.GetLogFolder - + BBSID + PATH_DELIM + SUBJECT_FILENAME; + Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) + + BBS2CH_LOG_FOLDER + BBSID + PATH_DELIM + SUBJECT_FILENAME; end; // ƒCƒ“ƒfƒbƒNƒXƒtƒ@ƒCƒ‹–¼(folder.idx)Žæ“¾iƒpƒX{ƒtƒ@ƒCƒ‹–¼j @@ -1117,8 +1108,8 @@ begin if Length( FilePath ) > 0 then Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME else - Result := ParentCategory.ParenTBBS.GetLogFolder - + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME; + Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) + + BBS2CH_LOG_FOLDER + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME; end; // ƒXƒŒ—§‚Ä‘—MURL @@ -1627,8 +1618,8 @@ begin if Length( FilePath ) > 0 then Result := FilePath else - Result := ParentBoard.ParentCategory.ParenTBBS.GetLogFolder - + ParentBoard.BBSID + PATH_DELIM + FileName; + Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) + + BBS2CH_LOG_FOLDER + ParentBoard.BBSID + PATH_DELIM + FileName; end; procedure TThreadItem.SetLastModified(d: TDateTime);