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.7 by h677, Thu Dec 11 11:49:09 2003 UTC revision 1.8 by h677, Thu Dec 11 19:41:13 2003 UTC
# Line 18  type Line 18  type
18                  function GetCount(RoundType: TGikoRoundType): Integer;                  function GetCount(RoundType: TGikoRoundType): Integer;
19                  function GetRoundItem(Index: Integer; RoundType: TGikoRoundType): TRoundItem;                  function GetRoundItem(Index: Integer; RoundType: TGikoRoundType): TRoundItem;
20                  function ParseRoundBoardLine(Line: string): TRoundItem;                  function ParseRoundBoardLine(Line: string): TRoundItem;
21          function ParseRoundThreadLine(Line: string; var BoardList : TStringList): TRoundItem;          function ParseRoundThreadLine(Line: string): TRoundItem;
22          function ParseOldRoundBoardLine(Line: string): TRoundItem;          function ParseOldRoundBoardLine(Line: string): TRoundItem;
23          function ParseOldRoundThreadLine(Line: string; var BoardList : TStringList): TRoundItem;          function ParseOldRoundThreadLine(Line: string): TRoundItem;
24          public          public
25                  RoundNameList: TStringList;                  RoundNameList: TStringList;
26    
# Line 154  var Line 154  var
154  begin  begin
155          idx := Find(Board);          idx := Find(Board);
156          if idx <> -1 then begin          if idx <> -1 then begin
157                  Item := TRoundItem(FBoardList[idx]);                  TRoundItem(FBoardList[idx]).Free;
                 Item.Free;  
158                  FBoardList.Delete(idx);                  FBoardList.Delete(idx);
159          end;          end;
160  end;  end;
# Line 167  var Line 166  var
166  begin  begin
167          idx := Find(ThreadItem);          idx := Find(ThreadItem);
168          if idx <> -1 then begin          if idx <> -1 then begin
169                  Item := TRoundItem(FItemList[idx]);                  TRoundItem(FItemList[idx]).Free;
                 Item.Free;  
170                  FItemList.Delete(idx);                  FItemList.Delete(idx);
171          end;          end;
172  end;  end;
# Line 178  var Line 176  var
176          i: Integer;          i: Integer;
177  begin  begin
178          for i := FBoardList.Count - 1 downto 0 do begin          for i := FBoardList.Count - 1 downto 0 do begin
179                  TRoundItem(FBoardList[i]).Free;          if FBoardList[i] <> nil then
180                            TRoundItem(FBoardList[i]).Free;
181                  FBoardList.Delete(i);                  FBoardList.Delete(i);
182          end;          end;
183          for i := FItemList.Count - 1 downto 0 do begin          for i := FItemList.Count - 1 downto 0 do begin
184                  TRoundItem(FItemList[i]).Free;          if FItemList[i] <> nil then
185                            TRoundItem(FItemList[i]).Free;
186                  FItemList.Delete(i);                  FItemList.Delete(i);
187          end;          end;
188  end;  end;
# Line 371  var Line 371  var
371      errorSl: TStringList;      errorSl: TStringList;
372      errorFileName: string;      errorFileName: string;
373          Item: TRoundItem;          Item: TRoundItem;
374      boardList : TStringList;  //    boardList : TStringList;
375  begin  begin
376      boardList := TStringList.Create;  //    boardList := TStringList.Create;
377      boardList.Duplicates := dupIgnore;  //    boardList.Duplicates := dupIgnore;
378      errorSl := TStringList.Create;      errorSl := TStringList.Create;
379          errorSl.Duplicates := dupIgnore;          errorSl.Duplicates := dupIgnore;
380          sl := TStringList.Create;          sl := TStringList.Create;
# Line 395  begin Line 395  begin
395                          //1行目はバージョン                          //1行目はバージョン
396              if sl[0] = ROUND_INDEX_VERSION then begin              if sl[0] = ROUND_INDEX_VERSION then begin
397                                  for i := sl.Count - 1 downto 1 do begin                                  for i := sl.Count - 1 downto 1 do begin
398                                          Item := ParseRoundThreadLine(sl[i], boardList);                                          Item := ParseRoundThreadLine(sl[i]);
399                      if Item <> nil then begin                      if Item <> nil then begin
400                                                  FItemList.Add(Item);                                                  FItemList.Add(Item);
401                                                  RoundNameList.Add(Item.RoundName);                                                  RoundNameList.Add(Item.RoundName);
# Line 407  begin Line 407  begin
407              end else begin              end else begin
408                  LoadRoundBoardFile;                  LoadRoundBoardFile;
409                  for i := sl.Count - 1 downto 1 do begin                  for i := sl.Count - 1 downto 1 do begin
410                                          Item := ParseOldRoundThreadLine(sl[i], boardList);                                          Item := ParseOldRoundThreadLine(sl[i]);
411                      if Item <> nil then begin                      if Item <> nil then begin
412                                                  FItemList.Add(Item);                                                  FItemList.Add(Item);
413                                                  RoundNameList.Add(Item.RoundName);                                                  RoundNameList.Add(Item.RoundName);
# Line 417  begin Line 417  begin
417                      end;                      end;
418                                  end;                                  end;
419              end;              end;
420                  j := boardList.Count - 1;  //              j := boardList.Count - 1;
421              while j >= 0 do begin  //          while j >= 0 do begin
422                          GikoSys.ReadSubjectFile( BBSsFindBoardFromURL( boardList[j] ) );  //                      GikoSys.ReadSubjectFile( BBSsFindBoardFromURL( boardList[j] ) );
423                      boardList.Delete(j);  //                  boardList.Delete(j);
424                  Dec(j);  //              Dec(j);
425                  end;  //              end;
426              if errorSl.Count > 0 then              if errorSl.Count > 0 then
427                  errorSl.SaveToFile(errorFileName);                  errorSl.SaveToFile(errorFileName);
428                  end;                  end;
429          finally          finally
430                  sl.Free;                  sl.Free;
431          boardList.Free;  //        boardList.Free;
432          end;          end;
433  end;  end;
434  procedure TRoundList.SaveRoundFile;  procedure TRoundList.SaveRoundFile;
# Line 497  begin Line 497  begin
497      end;      end;
498  end;  end;
499    
500  function TRoundList.ParseRoundThreadLine(Line: string; var BoardList : TStringList): TRoundItem;  function TRoundList.ParseRoundThreadLine(Line: string): TRoundItem;
501  var  var
502          s: string;          s: string;
503          i: Integer;          i: Integer;
# Line 512  begin Line 512  begin
512                  0:                  0:
513                  begin                  begin
514                      Result.URL := s;                      Result.URL := s;
515                      threadItem := BBSsFindThreadFromURL( s );                      //threadItem := BBSsFindThreadFromURL( s );
516                      if threadItem <> nil then begin                      //if threadItem <> nil then begin
517                          BoardList.Add( threadItem.ParentBoard.URL );                      //    BoardList.Add( threadItem.ParentBoard.URL );
518                      end;                      //end;
519                  end;                  end;
520                  1: Result.BoardTitle := s;                  1: Result.BoardTitle := s;
521                  2: Result.FileName := s;                  2: Result.FileName := s;
# Line 562  begin Line 562  begin
562      end;      end;
563  end;  end;
564    
565  function TRoundList.ParseOldRoundThreadLine(Line: string; var BoardList : TStringList): TRoundItem;  function TRoundList.ParseOldRoundThreadLine(Line: string): TRoundItem;
566      var      var
567      i: Integer;      i: Integer;
568          s: string;          s: string;
# Line 584  begin Line 584  begin
584                          Result.FileName := s;                          Result.FileName := s;
585                          board := BBSs[ 0 ].FindBoardFromTitle(Result.BoardTitle);                          board := BBSs[ 0 ].FindBoardFromTitle(Result.BoardTitle);
586                      if board <> nil then begin                      if board <> nil then begin
587                              BoardList.Add(board.URL);                              //BoardList.Add(board.URL);
588                          buf := Copy(board.GetSendURL,1,LastDelimiter('/', board.GetSendURL)-1);                          buf := Copy(board.GetSendURL,1,LastDelimiter('/', board.GetSendURL)-1);
589                                                  Result.URL := buf + '/read.cgi/'+ board.BBSID+ '/' +ChangeFileExt(s,'') + '/l50';                                                  Result.URL := buf + '/read.cgi/'+ board.BBSID+ '/' +ChangeFileExt(s,'') + '/l50';
590                      end else begin                      end else begin

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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