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.38 by yoffy, Tue Aug 3 17:21:51 2004 UTC revision 1.39 by yoffy, Thu Aug 5 01:21:47 2004 UTC
# Line 616  end; Line 616  end;
616    
617  procedure TFavoriteDM.URLReplace(oldURLs: TStringList; newURLs: TStringList);  procedure TFavoriteDM.URLReplace(oldURLs: TStringList; newURLs: TStringList);
618  var  var
619          i, j                    : Integer;          i                                       : Integer;
620                  tmpURL: string;                  tmpURL: string;
621      oldHost: string;      oldHost: string;
622      oldBoardName: string;      oldBoardName: string;
# Line 626  var Line 626  var
626          favBoard        : TFavoriteBoardItem;          favBoard        : TFavoriteBoardItem;
627          favThread       : TFavoriteThreadItem;          favThread       : TFavoriteThreadItem;
628          favorites       : TTreeNodes;          favorites       : TTreeNodes;
629            Node                    : TTreeNode;
630  begin  begin
631    
632          // 面倒だけどthreadはそれぞれURLをチェックしながらやってかなきゃいけない。          // 面倒だけどthreadはそれぞれURLをチェックしながらやってかなきゃいけない。
# Line 639  begin Line 640  begin
640                          newHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );                          newHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
641                          newBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';                          newBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
642    
643                          for j := favorites.Count - 1 downto 0 do begin                          Node := favorites.GetFirstNode.getFirstChild;
644                            while Node <> nil do begin
645                                  try                                  try
646                                          if TObject( favorites.Item[ j ].Data ) is TFavoriteBoardItem then begin                                          if TObject( Node.Data ) is TFavoriteBoardItem then begin
647                                                  favBoard := TFavoriteBoardItem( favorites.Item[ j ].Data );                                                  favBoard := TFavoriteBoardItem( Node.Data );
648                                                  if favBoard = nil then continue;                                                  if favBoard = nil then continue;
649                                                  tempString := favBoard.URL;                                                  tempString := favBoard.URL;
650                                                  if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin                                                  if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
651                                                          tempString              := StringReplace(tempString, oldHost, newHost,[]);                                                          tempString              := StringReplace(tempString, oldHost, newHost,[]);
652                                                          favBoard.URL    := tempString;                                                          favBoard.URL    := tempString;
653                                                  end;                                                  end;
654                                          end else if TObject( favorites.Item[ j ].Data ) is TFavoriteThreadItem then begin                                          end else if TObject( Node.Data ) is TFavoriteThreadItem then begin
655                                                  favThread := TFavoriteThreadItem( favorites.Item[ j ].Data );                                                  favThread := TFavoriteThreadItem( Node.Data );
656                                                  if favThread = nil then continue;                                                  if favThread = nil then continue;
657                                                  tempString := favThread.URL;                                                  tempString := favThread.URL;
658                                                  if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin                                                  if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
# Line 660  begin Line 662  begin
662                                          end;                                          end;
663                                  except                                  except
664                                  end;                                  end;
665                                    Node := Node.GetNext;
666                          end;                          end;
667                  except                  except
668                  end;                  end;

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

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