| 4 |
|
|
| 5 |
uses |
uses |
| 6 |
Messages, SysUtils, Classes, Contnrs, ComCtrls, {HttpApp,} YofUtils, |
Messages, SysUtils, Classes, Contnrs, ComCtrls, {HttpApp,} YofUtils, |
| 7 |
GikoSystem{, XMLIntf, XMLDoc}, GikoXMLDoc, BoardGroup; |
GikoSystem{, XMLIntf, XMLDoc}, GikoXMLDoc, BoardGroup, windows; |
| 8 |
{SAX, SAXHelpers, SAXComps, SAXKW;} |
{SAX, SAXHelpers, SAXComps, SAXKW;} |
| 9 |
|
|
| 10 |
type |
type |
| 294 |
if FStack.Count <> 0 then |
if FStack.Count <> 0 then |
| 295 |
FStack.Pop; |
FStack.Pop; |
| 296 |
end else if Node.NodeName = 'favitem' then begin |
end else if Node.NodeName = 'favitem' then begin |
| 297 |
ParentNode := FStack.Peek; |
try |
| 298 |
if TObject(ParentNode.Data) is TFavoriteFolder then begin |
ParentNode := FStack.Peek; |
| 299 |
if Node.Attributes['favtype'] = 'board' then begin |
if TObject(ParentNode.Data) is TFavoriteFolder then begin |
| 300 |
// 旧式のお気に入りとの互換性のため |
if Node.Attributes['favtype'] = 'board' then begin |
| 301 |
if Length( Node.Attributes[ 'bbs' ] ) > 0 then begin |
// 旧式のお気に入りとの互換性のため |
| 302 |
board := BBSsFindBoardFromBBSID( Node.Attributes[ 'bbs' ] ); |
if Length( Node.Attributes[ 'bbs' ] ) > 0 then begin |
| 303 |
FavBoard := TFavoriteBoardItem.Create( |
board := BBSsFindBoardFromBBSID( Node.Attributes[ 'bbs' ] ); |
| 304 |
board.URL, Node.Attributes[ 'title' ], board ); |
if board <> nil then |
| 305 |
end else begin |
FavBoard := TFavoriteBoardItem.Create( |
| 306 |
FavBoard := TFavoriteBoardItem.Create( |
board.URL, Node.Attributes[ 'title' ], board ); |
| 307 |
Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], board ); |
end else begin |
| 308 |
end; |
FavBoard := TFavoriteBoardItem.Create( |
| 309 |
CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavBoard); |
Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], board ); |
|
CurrentNode.ImageIndex := 15; |
|
|
CurrentNode.SelectedIndex := 15; |
|
|
end else if Node.Attributes['favtype'] = 'thread' then begin |
|
|
// 旧式のお気に入りとの互換性のため |
|
|
if Length( Node.Attributes[ 'bbs' ] ) > 0 then begin |
|
|
board := BBSsFindBoardFromBBSID( Node.Attributes[ 'bbs' ] ); |
|
|
if board = nil then |
|
|
Exit; |
|
|
|
|
|
if not board.IsThreadDatRead then |
|
|
GikoSys.ReadSubjectFile( board ); |
|
|
threadItem := board.Find( Node.Attributes[ 'thread' ] ); |
|
|
if threadItem = nil then begin |
|
|
threadItem := TThreadItem.Create( |
|
|
board.BoardPlugIn, |
|
|
GikoSys.Get2chBoard2ThreadURL( board, ChangeFileExt( Node.Attributes[ 'thread' ], '' ) ) ); |
|
|
threadItem.Title := Node.Attributes[ 'title' ]; |
|
|
board.Add( threadItem ); |
|
| 310 |
end; |
end; |
| 311 |
FavThread := TFavoriteThreadItem.Create( |
CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavBoard); |
| 312 |
threadItem.URL, Node.Attributes[ 'title' ], threadItem ); |
CurrentNode.ImageIndex := 15; |
| 313 |
end else begin |
CurrentNode.SelectedIndex := 15; |
| 314 |
FavThread := TFavoriteThreadItem.Create( |
end else if Node.Attributes['favtype'] = 'thread' then begin |
| 315 |
Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], threadItem ); |
// 旧式のお気に入りとの互換性のため |
| 316 |
|
if Length( Node.Attributes[ 'bbs' ] ) > 0 then begin |
| 317 |
|
board := BBSsFindBoardFromBBSID( Node.Attributes[ 'bbs' ] ); |
| 318 |
|
if board = nil then |
| 319 |
|
Exit; |
| 320 |
|
|
| 321 |
|
if not board.IsThreadDatRead then |
| 322 |
|
GikoSys.ReadSubjectFile( board ); |
| 323 |
|
threadItem := board.Find( Node.Attributes[ 'thread' ] ); |
| 324 |
|
if threadItem = nil then begin |
| 325 |
|
threadItem := TThreadItem.Create( |
| 326 |
|
board.BoardPlugIn, |
| 327 |
|
GikoSys.Get2chBoard2ThreadURL( board, ChangeFileExt( Node.Attributes[ 'thread' ], '' ) ) ); |
| 328 |
|
threadItem.Title := Node.Attributes[ 'title' ]; |
| 329 |
|
board.Add( threadItem ); |
| 330 |
|
end; |
| 331 |
|
FavThread := TFavoriteThreadItem.Create( |
| 332 |
|
threadItem.URL, Node.Attributes[ 'title' ], threadItem ); |
| 333 |
|
end else begin |
| 334 |
|
FavThread := TFavoriteThreadItem.Create( |
| 335 |
|
Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], threadItem ); |
| 336 |
|
end; |
| 337 |
|
CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavThread); |
| 338 |
|
CurrentNode.ImageIndex := 16; |
| 339 |
|
CurrentNode.SelectedIndex := 16; |
| 340 |
end; |
end; |
|
CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavThread); |
|
|
CurrentNode.ImageIndex := 16; |
|
|
CurrentNode.SelectedIndex := 16; |
|
| 341 |
end; |
end; |
| 342 |
|
except |
| 343 |
|
// このアイテムで問題が起きても他のアイテムに影響を与えたくないので |
| 344 |
end; |
end; |
| 345 |
end; |
end; |
| 346 |
end; |
end; |