| 126 |
function TFavoriteThreadItem.GetItem : TThreadItem; |
function TFavoriteThreadItem.GetItem : TThreadItem; |
| 127 |
var |
var |
| 128 |
threadItem : TThreadItem; |
threadItem : TThreadItem; |
|
boardPlugIn : TBoardPlugIn; |
|
| 129 |
board : TBoard; |
board : TBoard; |
| 130 |
boardURL : string; |
boardURL : string; |
| 131 |
i : Integer; |
i : Integer; |
| 132 |
begin |
begin |
| 133 |
|
|
| 134 |
if FItem = nil then begin |
if FItem = nil then begin |
| 135 |
//===== プラグイン |
boardURL := GikoSys.GetThreadURL2BoardURL( URL ); |
| 136 |
boardPlugIn := nil; |
board := BBSsFindBoardFromURL( boardURL ); |
|
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 が発生した場合は内部処理に任せたいのでここでは何もしない |
|
|
end; |
|
|
|
|
|
if Length( boardURL ) = 0 then |
|
|
boardURL := GikoSys.Get2chThreadURL2BoardURL( URL ); |
|
|
|
|
|
board := BBSsFindBoardFromURL( boardURL ); |
|
| 137 |
|
|
| 138 |
if board = nil then |
if board = nil then |
| 139 |
// ※作っても、追加するカテゴリが無いので激しく保留 |
// ※作っても、追加するカテゴリが無いので激しく保留 |
| 142 |
FItem := board.FindThreadFromURL( URL ); |
FItem := board.FindThreadFromURL( URL ); |
| 143 |
|
|
| 144 |
if FItem = nil then begin |
if FItem = nil then begin |
| 145 |
FItem := TThreadItem.Create( boardPlugIn, URL ); |
FItem := TThreadItem.Create( board.BoardPlugIn, URL ); |
| 146 |
|
|
| 147 |
FItem.Title := Title; |
FItem.Title := Title; |
| 148 |
board.Add( FItem ); |
board.Add( FItem ); |