- tempStringList.LoadFromFile( FavoriteFilePath );
- if oldURLs.Count = newURLs.Count then begin
- //\82±\82ê\82Å\81ABoard\82Í\91S\82Ä\90Ø\82è\91Ö\82í\82é
- for i := 0 to oldURLs.Count - 1 do begin
- CustomStringReplace(tempStringList,oldURLs[i],newURLs[i],true);
- end;
- //\96Ê\93|\82¾\82¯\82Çthread\82Í\82»\82ê\82¼\82êURL\82ð\83`\83\83\83b\83N\82µ\82È\82ª\82ç\82â\82Á\82Ä\82©\82È\82«\82á\82¢\82¯\82È\82¢\81B
- for i := 0 to oldURLs.Count - 1 do begin
- 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) ) + '/';
-
- for j := 0 to tempStringList.Count - 1 do begin
- tempString := tempStringList[j];
- if AnsiPos('favtype="thread"',tempString ) <> 0 then begin
- tempString := Copy(tempString, AnsiPos('url="',tempString ) + 5, AnsiPos('" title="',tempString ) -AnsiPos('url="',tempString ) - 5);
- if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
- tempString := StringReplace(tempStringList[j], oldHost, newHost,[]);
- //tempString := StringReplace(tempString, oldBoardName, newBoardName,[]);
- tempStringList[j] := tempString;
- end;
-
- end;
- end;
- end;
-
- end;
-
- tempStringList.SaveToFile( FavoriteFilePath );
- finally
- tempStringList.Free;
+ 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