| 44 |
procedure LoadRoundBoardFile; |
procedure LoadRoundBoardFile; |
| 45 |
procedure LoadRoundThreadFile; |
procedure LoadRoundThreadFile; |
| 46 |
procedure SaveRoundFile; |
procedure SaveRoundFile; |
| 47 |
|
|
| 48 |
|
procedure URLReplace(oldURLs: TStringList; newURLs :TStringList); |
| 49 |
end; |
end; |
| 50 |
|
|
| 51 |
TRoundItem = class(TObject) |
TRoundItem = class(TObject) |
| 632 |
end; |
end; |
| 633 |
end; |
end; |
| 634 |
end; |
end; |
| 635 |
|
procedure TRoundList.URLReplace(oldURLs: TStringList; newURLs :TStringList); |
| 636 |
|
var |
| 637 |
|
i: Integer; |
| 638 |
|
j: Integer; |
| 639 |
|
tempString: string; |
| 640 |
|
tmpURL: string; |
| 641 |
|
oldHost: string; |
| 642 |
|
oldBoardName: string; |
| 643 |
|
newHost: string; |
| 644 |
|
newBoardName: string; |
| 645 |
|
begin |
| 646 |
|
if oldURLs.Count <> newURLs.Count then |
| 647 |
|
Exit; |
| 648 |
|
//ここから、BoardのURLの変更 |
| 649 |
|
for j :=0 to oldURLs.Count - 1 do begin |
| 650 |
|
for i :=0 to FBoardList.Count - 1 do begin |
| 651 |
|
if TRoundItem(FBoardList[i]).FURL = oldURLs[i] then |
| 652 |
|
TRoundItem(FBoardList[i]).FURL := newURLs[i]; |
| 653 |
|
end; |
| 654 |
|
end; |
| 655 |
|
//ここまで、BoardのURLの変更 |
| 656 |
|
|
| 657 |
|
//ここから、ThreadのURLの変更 |
| 658 |
|
//面倒だけどthreadはそれぞれURLをチャックしながらやってかなきゃいけない。 |
| 659 |
|
for i := 0 to oldURLs.Count - 1 do begin |
| 660 |
|
tmpURL := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1); |
| 661 |
|
oldHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) ); |
| 662 |
|
oldBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/'; |
| 663 |
|
tmpURL := Copy(newURLs[i], 1, Length(newURLs[i]) -1); |
| 664 |
|
newHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) ); |
| 665 |
|
newBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/'; |
| 666 |
|
|
| 667 |
|
for j := 0 to FItemList.Count - 1 do begin |
| 668 |
|
tempString := TRoundItem(FItemList[j]).FURL; |
| 669 |
|
if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin |
| 670 |
|
tempString := StringReplace(tempString, oldHost, newHost,[]); |
| 671 |
|
TRoundItem(FItemList[j]).FURL := tempString; |
| 672 |
|
end; |
| 673 |
|
end; |
| 674 |
|
end; |
| 675 |
|
//ここまで、ThreadのURLの変更 |
| 676 |
|
|
| 677 |
|
end; |
| 678 |
|
|
| 679 |
end. |
end. |