+procedure TFavoriteDM.URLReplace(oldURLs: TStringList; newURLs: TStringList);
+var
+ i : Integer;
+ tmpURL: string;
+ oldHost: string;
+ oldBoardName: string;
+ newHost: string;
+ newBoardName: string;
+ tempString: string;
+ favBoard : TFavoriteBoardItem;
+ favThread : TFavoriteThreadItem;
+ favorites : TTreeNodes;
+ Node : TTreeNode;
+begin
+
+ // \96Ê\93|\82¾\82¯\82Çthread\82Í\82»\82ê\82¼\82êURL\82ð\83`\83F\83b\83N\82µ\82È\82ª\82ç\82â\82Á\82Ä\82©\82È\82«\82á\82¢\82¯\82È\82¢\81B
+ favorites := FavoriteDM.FTreeView.Items;
+ for i := 0 to oldURLs.Count - 1 do begin
+ try
+ tmpURL := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1);
+ oldHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
+ oldBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
+ tmpURL := Copy(newURLs[i], 1, Length(newURLs[i]) -1);
+ newHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
+ newBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
+
+ Node := favorites.GetFirstNode.getFirstChild;
+ while Node <> nil do begin
+ try
+ if TObject( Node.Data ) is TFavoriteBoardItem then begin
+ favBoard := TFavoriteBoardItem( Node.Data );
+ if favBoard = nil then continue;
+ tempString := favBoard.URL;
+ if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
+ tempString := StringReplace(tempString, oldHost, newHost,[]);
+ favBoard.URL := tempString;
+ end;
+ end else if TObject( Node.Data ) is TFavoriteThreadItem then begin
+ favThread := TFavoriteThreadItem( Node.Data );
+ if favThread = nil then continue;
+ tempString := favThread.URL;
+ if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
+ tempString := StringReplace(tempString, oldHost, newHost,[]);
+ favThread.URL := tempString;
+ end;
+ end;
+ except
+ end;
+ Node := Node.GetNext;
+ end;
+ except
+ end;
+ end;
+
+end;
+