Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/RoundData.pas

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

revision 1.16 by h677, Tue Mar 16 15:37:55 2004 UTC revision 1.17 by h677, Tue Mar 30 12:44:57 2004 UTC
# Line 44  type Line 44  type
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)
# Line 630  begin Line 632  begin
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.

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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