Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/Favorite.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3.2.2 by yoffy, Thu Sep 9 16:20:30 2004 UTC revision 1.3.2.3 by yoffy, Fri Oct 8 05:44:48 2004 UTC
# Line 117  function       TFavoriteBoardItem.GetItem : TB Line 117  function       TFavoriteBoardItem.GetItem : TB
117  var  var
118          protocol, host, path, document, port, bookmark : string;          protocol, host, path, document, port, bookmark : string;
119          BBSID{, BBSKey} : string;          BBSID{, BBSKey} : string;
120          tmpURL                          : string;          tmpURL, boardURL                : string;
121  //      category : TCategory;  //      category : TCategory;
122            i, bi: Integer;
123            tmpThread: TThreadItem;
124            tmpBoard: TBoard;
125  begin  begin
126    
127          if FItem = nil then begin          if FItem = nil then begin
128                  FItem := BBSsFindBoardFromURL( URL );                  FItem := BBSsFindBoardFromURL( URL );
129                  if FItem = nil then begin                  if FItem = nil then begin
130                            //===== プラグイン
131                            try
132                                    //作業中//
133                                    bi := High( BoardPlugIns );
134                                    for i := Low( BoardPlugIns ) to bi do begin
135                                            if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin
136                                                    case BoardPlugIns[ i ].AcceptURL( URL ) of
137                                                    atThread:
138                                                            begin
139                                                                    tmpThread               := TThreadItem.Create( BoardPlugIns[ i ], URL );
140                                                                    boardURL                := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) );
141                                                                    FItem                           := BBSsFindBoardFromURL( boardURL );
142                                                                    URL := FItem.URL;
143                                                                    tmpThread.Free;
144                                                                    break;
145                                                            end;
146                                                    atBoard:
147                                                            begin
148                                                                    tmpBoard := TBoard.Create(BoardPlugIns[ i ], URL);
149                                                                    FItem := BBSsFindBoardFromURL( tmpBoard.URL );
150                                                                    tmpBoard.Free;
151                                                                    if FItem <> nil then begin
152                                                                            URL := FItem.URL;
153                                                                    end;
154                                                                    break;
155                                                            end;
156                                                    end;
157                                            end;
158                                    end;
159                            except
160                                    // exception が発生した場合は内部処理に任せたいのでここでは何もしない
161                            end;
162                    end;
163                    if FItem = nil then begin
164                          tmpURL := URL;                          tmpURL := URL;
165                          GikoSys.ParseURI( tmpURL, protocol, host, path, document, port, bookmark );                          GikoSys.ParseURI( tmpURL, protocol, host, path, document, port, bookmark );
166                          if GikoSys.Is2chHost( host ) then begin                          if GikoSys.Is2chHost( host ) then begin
# Line 131  begin Line 168  begin
168                                  FItem := BBSs[ 0 ].FindBBSID( BBSID );                                  FItem := BBSs[ 0 ].FindBBSID( BBSID );
169                                  if FItem <> nil then                                  if FItem <> nil then
170                                          URL := FItem.URL;                                          URL := FItem.URL;
                         end else if AnsiPos('jbbs.shitaraba.com', host) <> 0 then begin  
                                 // したらばJBBSのhttp://jbbs.shitaraba.com/ → http://jbbs.livedoor.com/ 置換  
                                 URL := CustomStringReplace(URL, 'http://jbbs.shitaraba.com/', 'http://jbbs.livedoor.com/', false);  
                                 FItem := BBSsFindBoardFromURL( URL );  
                                 if FItem <> nil then  
                                         URL := FItem.URL;  
171                          end;                          end;
172                          {                          {
173                          // ※作っても、追加するカテゴリが無いので激しく保留                          // ※作っても、追加するカテゴリが無いので激しく保留
# Line 284  begin Line 315  begin
315          FileName := GikoSys.GetConfigDir + FAVORITE_FILE_NAME;          FileName := GikoSys.GetConfigDir + FAVORITE_FILE_NAME;
316    
317          FavFolder := TFavoriteFolder.Create;          FavFolder := TFavoriteFolder.Create;
318          Node := FTreeView.Items.AddChildObject(nil, FAVORITE_ROOT_NAME, FavFolder);          Node := FTreeView.Items.AddChildObjectFirst(nil, FAVORITE_ROOT_NAME, FavFolder);
319          Node.ImageIndex := 14;          Node.ImageIndex := 14;
320          Node.SelectedIndex := 14;          Node.SelectedIndex := 14;
321    
# Line 300  begin Line 331  begin
331                                  FStack.Push(Node);                                  FStack.Push(Node);
332                                  LinkExists := False;                                  LinkExists := False;
333                                  if XMLNode.NodeName = 'favorite' then begin                                  if XMLNode.NodeName = 'favorite' then begin
334                                          for i := 0 to XMLNode.ChildNodes.Count - 1 do begin                                          for i := XMLNode.ChildNodes.Count - 1 downto 0 do begin
335                                                  ReadNode(XMLNode.ChildNodes[i]);                                                  ReadNode(XMLNode.ChildNodes[i]);
336                                                  if (XMLNode.ChildNodes[i].NodeName = 'folder') and                                                  if (XMLNode.ChildNodes[i].NodeName = 'folder') and
337                                                           (XMLNode.ChildNodes[i].Attributes['title'] = FAVORITE_LINK_NAME) then begin                                                           (XMLNode.ChildNodes[i].Attributes['title'] = FAVORITE_LINK_NAME) then begin
# Line 310  begin Line 341  begin
341                                  end;                                  end;
342                                  if not LinkExists then begin                                  if not LinkExists then begin
343                                          FavFolder := TFavoriteFolder.Create;                                          FavFolder := TFavoriteFolder.Create;
344                                          Node := FTreeView.Items.AddChildObject(Node, FAVORITE_LINK_NAME, FavFolder);                                          Node := FTreeView.Items.AddChildObjectFirst(Node, FAVORITE_LINK_NAME, FavFolder);
345                                          Node.ImageIndex := 14;                                          Node.ImageIndex := 14;
346                                          Node.SelectedIndex := 14;                                          Node.SelectedIndex := 14;
347                                  end;                                  end;
# Line 324  begin Line 355  begin
355    
356  {  {
357          FavFolder := TFavoriteFolder.Create;          FavFolder := TFavoriteFolder.Create;
358          Node := FTreeView.Items.AddChildObject(nil, FAVORITE_ROOT_NAME, FavFolder);          Node := FTreeView.Items.AddChildObjectFirst(nil, FAVORITE_ROOT_NAME, FavFolder);
359          Node.ImageIndex := 12;          Node.ImageIndex := 12;
360          Node.SelectedIndex := 13;          Node.SelectedIndex := 13;
361    
# Line 360  begin Line 391  begin
391                  ParentNode := FStack.Peek;                  ParentNode := FStack.Peek;
392                  if TObject(ParentNode.Data) is TFavoriteFolder then begin                  if TObject(ParentNode.Data) is TFavoriteFolder then begin
393                          FavFolder := TFavoriteFolder.Create;                          FavFolder := TFavoriteFolder.Create;
394                          CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavFolder);                          CurrentNode := FTreeView.Items.AddChildObjectFirst(ParentNode, Node.Attributes['title'], FavFolder);
395                          CurrentNode.ImageIndex := 14;                          CurrentNode.ImageIndex := 14;
396                          CurrentNode.SelectedIndex := 14;                          CurrentNode.SelectedIndex := 14;
                         CurrentNode.Expanded := Node.Attributes[ 'expanded' ] = 'true';  
397                          FStack.Push(CurrentNode);                          FStack.Push(CurrentNode);
398                  end;                  end;
399                  for i := 0 to Node.ChildNodes.Count - 1 do begin                  for i := Node.ChildNodes.Count - 1 downto 0 do begin
400                          ReadNode(Node.ChildNodes[i]);                          ReadNode(Node.ChildNodes[i]);
401                  end;                  end;
402                    if TObject(ParentNode.Data) is TFavoriteFolder then
403                            CurrentNode.Expanded := Node.Attributes[ 'expanded' ] = 'true';
404                  if FStack.Count <> 0 then                  if FStack.Count <> 0 then
405                          FStack.Pop;                          FStack.Pop;
406          end else if Node.NodeName = 'favitem' then begin          end else if Node.NodeName = 'favitem' then begin
# Line 387  begin Line 419  begin
419                                                  FavBoard := TFavoriteBoardItem.Create(                                                  FavBoard := TFavoriteBoardItem.Create(
420                                                          Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], nil );                                                          Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], nil );
421                                          end;                                          end;
422                                          CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavBoard);                                          CurrentNode := FTreeView.Items.AddChildObjectFirst(ParentNode, Node.Attributes['title'], FavBoard);
423                                          CurrentNode.ImageIndex := 15;                                          CurrentNode.ImageIndex := 15;
424                                          CurrentNode.SelectedIndex := 15;                                          CurrentNode.SelectedIndex := 15;
425                                  end else if Node.Attributes['favtype'] = 'thread' then begin                                  end else if Node.Attributes['favtype'] = 'thread' then begin
# Line 414  begin Line 446  begin
446                                                  FavThread := TFavoriteThreadItem.Create(                                                  FavThread := TFavoriteThreadItem.Create(
447                                                          Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], nil );                                                          Node.Attributes[ 'url' ], Node.Attributes[ 'title' ], nil );
448                                          end;                                          end;
449                                          CurrentNode := FTreeView.Items.AddChildObject(ParentNode, Node.Attributes['title'], FavThread);                                          CurrentNode := FTreeView.Items.AddChildObjectFirst(ParentNode, Node.Attributes['title'], FavThread);
450                                          CurrentNode.ImageIndex := 16;                                          CurrentNode.ImageIndex := 16;
451                                          CurrentNode.SelectedIndex := 16;                                          CurrentNode.SelectedIndex := 16;
452                                  end;                                  end;

Legend:
Removed from v.1.3.2.2  
changed lines
  Added in v.1.3.2.3

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26