From 1fd23e52a638daa182a9cf813f5ba44f133811b2 Mon Sep 17 00:00:00 2001 From: yoffy Date: Sun, 23 Nov 2003 15:45:11 +0000 Subject: [PATCH] =?utf8?q?=E3=83=BBURL=20=E3=81=8B=E3=82=89=20TThreadItem?= =?utf8?q?=20=E3=82=92=E6=A4=9C=E7=B4=A2=E3=81=99=E3=82=8B=E3=82=B9?= =?utf8?q?=E3=83=94=E3=83=BC=E3=83=89=E3=82=92=E5=A4=A7=E5=B9=85=E3=81=AB?= =?utf8?q?=E9=AB=98=E9=80=9F=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- BoardGroup.pas | 52 ++++++++++++++++++++++++++++------------------------ Favorite.pas | 28 +++------------------------- GikoSystem.pas | 34 ++++++++++++++++++++++++++++++++++ gikoNavi.res | Bin 4288 -> 4288 bytes 4 files changed, 65 insertions(+), 49 deletions(-) diff --git a/BoardGroup.pas b/BoardGroup.pas index 1db76d2..e8f4227 100644 --- a/BoardGroup.pas +++ b/BoardGroup.pas @@ -431,19 +431,19 @@ begin end; function BBSsFindThreadFromURL( - inURL : string + inURL : string ) : TThreadItem; var - i : Integer; + board : TBoard; + boardURL : string; begin - for i := Length( BBSs ) - 1 downto 0 do begin - Result := BBSs[ i ].FindThreadFromURL( inURL ); - if Result <> nil then - Exit; - end; - - Result := nil; + boardURL := GikoSys.GetThreadURL2BoardURL( inURL ); + board := BBSsFindBoardFromURL( boardURL ); + if board = nil then + Result := nil + else + Result := board.FindThreadFromURL( inURL ); end; @@ -555,14 +555,17 @@ end; //*************************************************************************) function TBBS.FindThreadFromURL(inURL: string): TThreadItem; var - i : Integer; + board : TBoard; + boardURL : string; begin - for i := Count - 1 downto 0 do begin - Result := Items[ i ].FindThreadFromURL( inURL ); - if Result <> nil then - Exit; - end; - Result := nil; + + boardURL := GikoSys.GetThreadURL2BoardURL( inURL ); + board := FindBoardFromURL( boardURL ); + if board = nil then + Result := nil + else + Result := board.FindThreadFromURL( inURL ); + end; function TBBS.FindThreadItem(BBSID: string; FileName: string): TThreadItem; @@ -702,15 +705,16 @@ end; //*************************************************************************) function TCategory.FindThreadFromURL(inURL: string): TThreadItem; var - i : Integer; + board : TBoard; + boardURL : string; begin - for i := Count - 1 downto 0 do begin - Result := Items[ i ].FindThreadFromURL( inURL ); - if Result <> nil then - Exit; - end; - Result := nil; + boardURL := GikoSys.GetThreadURL2BoardURL( inURL ); + board := FindBoardFromURL( boardURL ); + if board = nil then + Result := nil + else + Result := board.FindThreadFromURL( inURL ); end; @@ -1375,7 +1379,7 @@ begin IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) + EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'; FileName := BBSKey + '.dat'; - IsLogFile := FileExists( FilePath ); + IsLogFile := FileExists( FilePath ); end; end else begin // ƒvƒ‰ƒOƒCƒ“‚É TThreadItem ‚ªì¬‚³‚ꂽ‚±‚Æ‚ð“`‚¦‚é diff --git a/Favorite.pas b/Favorite.pas index 7bbe895..1cad441 100644 --- a/Favorite.pas +++ b/Favorite.pas @@ -126,36 +126,14 @@ end; function TFavoriteThreadItem.GetItem : TThreadItem; var threadItem : TThreadItem; - boardPlugIn : TBoardPlugIn; board : TBoard; boardURL : string; i : Integer; begin if FItem = nil then begin - //===== ƒvƒ‰ƒOƒCƒ“ - boardPlugIn := nil; - try - for i := Length( BoardPlugIns ) - 1 downto 0 do begin - if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin - if BoardPlugIns[ i ].AcceptURL( url ) = atThread then begin - boardPlugIn := BoardPlugIns[ i ]; - threadItem := TThreadItem.Create(boardPlugIn, URL ); - boardURL := BoardPlugIns[ i ].GetBoardURL( Longword( threadItem ) ); - threadItem.Free; - - Break; - end; - end; - end; - except - // exception ‚ª”­¶‚µ‚½ê‡‚Í“à•”ˆ—‚É”C‚¹‚½‚¢‚Ì‚Å‚±‚±‚ł͉½‚à‚µ‚È‚¢ - end; - - if Length( boardURL ) = 0 then - boardURL := GikoSys.Get2chThreadURL2BoardURL( URL ); - - board := BBSsFindBoardFromURL( boardURL ); + boardURL := GikoSys.GetThreadURL2BoardURL( URL ); + board := BBSsFindBoardFromURL( boardURL ); if board = nil then // ¦ì‚Á‚Ä‚àA’ljÁ‚·‚éƒJƒeƒSƒŠ‚ª–³‚¢‚Ì‚ÅŒƒ‚µ‚­•Û—¯ @@ -164,7 +142,7 @@ begin FItem := board.FindThreadFromURL( URL ); if FItem = nil then begin - FItem := TThreadItem.Create( boardPlugIn, URL ); + FItem := TThreadItem.Create( board.BoardPlugIn, URL ); FItem.Title := Title; board.Add( FItem ); diff --git a/GikoSystem.pas b/GikoSystem.pas index 7af7a4d..a15fdf6 100644 --- a/GikoSystem.pas +++ b/GikoSystem.pas @@ -183,6 +183,7 @@ type function Parse2chURL2(URL: string): TPathRec; procedure ParseURI(var URL, Protocol, Host, Path, Document, Port, Bookmark: string); function GetVersionBuild: Integer; + function GetThreadURL2BoardURL( inURL : string ) : string; function Get2chThreadURL2BoardURL( inURL : string ) : string; function Get2chBrowsableThreadURL( inURL : string ) : string; function Get2chBoard2ThreadURL( inBoard : TBoard; inKey : string ) : string; @@ -2656,6 +2657,39 @@ begin end; end; +function TGikoSys.GetThreadURL2BoardURL( + inURL : string +) : string; +var + threadItem : TThreadItem; + boardPlugIn : TBoardPlugIn; + i : Integer; +begin + + //===== ƒvƒ‰ƒOƒCƒ“ + boardPlugIn := nil; + try + for i := Length( BoardPlugIns ) - 1 downto 0 do begin + if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin + if BoardPlugIns[ i ].AcceptURL( inURL ) = atThread then begin + boardPlugIn := BoardPlugIns[ i ]; + threadItem := TThreadItem.Create( boardPlugIn, inURL ); + Result := BoardPlugIns[ i ].GetBoardURL( Longword( threadItem ) ); + threadItem.Free; + + Break; + end; + end; + end; + except + // exception ‚ª”­¶‚µ‚½ê‡‚Í“à•”ˆ—‚É”C‚¹‚½‚¢‚Ì‚Å‚±‚±‚ł͉½‚à‚µ‚È‚¢ + end; + + if Length( Result ) = 0 then + Result := GikoSys.Get2chThreadURL2BoardURL( inURL ); + +end; + function TGikoSys.Get2chThreadURL2BoardURL( inURL : string ) : string; diff --git a/gikoNavi.res b/gikoNavi.res index 592fb8284063be3c15af8ef5672bca1fd17f24ce..1398b79183d2cd9fe23aaf73f943a3d64e610172 100644 GIT binary patch delta 28 jcmX@0ctCN(8(z+1j0`})$Z%}(SKi-@CYwLSKi-@#+yI#oo569k`)R^ -- 2.11.0