OSDN Git Service

動作の最適化(たぶん)
authorh677 <h677>
Tue, 20 Apr 2004 12:16:06 +0000 (12:16 +0000)
committerh677 <h677>
Tue, 20 Apr 2004 12:16:06 +0000 (12:16 +0000)
BoardGroup.pas
GikoSystem.pas
gikoNavi.res

index 1a00430..99c8f72 100644 (file)
@@ -92,18 +92,18 @@ type
                procedure Delete(index: integer);
                procedure Clear; override;
                function Find(key: string): TCategory;
-               function FindBBSID(BBSID: string): TBoard;
-               function FindBoardFromTitle(Title: string): TBoard;
-               function FindBoardFromURL(inURL: string): TBoard;
-               function FindThreadFromURL( inURL : string ) : TThreadItem;
-               function FindThreadItem(BBSID: string; FileName: string): TThreadItem;
-               function FindCategoryFromTitle( inTitle : string ) : TCategory;
+               function FindBBSID(const BBSID: string): TBoard;
+               function FindBoardFromTitle(const Title: string): TBoard;
+               function FindBoardFromURL(const inURL: string): TBoard;
+               function FindThreadFromURL(const inURL : string ) : TThreadItem;
+               function FindThreadItem(const BBSID, FileName: string): TThreadItem;
+               function FindCategoryFromTitle(const inTitle : string ) : TCategory;
                property FilePath : string read FFilePath write FFilePath;
 
                property Items[index: integer]: TCategory read GetCategory write SetCategory;
                property Title: string read FTitle write FTitle;
                property NodeExpand: Boolean read FExpand write FExpand;
-                                                                                
+
                property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk;
                property SelectText: string read FSelectText write SetSelectText;
                property ShortSelectText: string read FShortSelectText write FShortSelectText;
@@ -133,11 +133,11 @@ type
                function Add(item: TBoard): integer;
                procedure Delete(index: integer);
                procedure Clear; override;
-               function FindName(key: string): TBoard;
-               function FindBBSID(BBSID: string): TBoard;
-               function FindBoardFromTitle(Title: string): TBoard;
-               function FindBoardFromURL(inURL: string): TBoard;
-               function FindThreadFromURL( inURL : string ) : TThreadItem;
+               function FindName(const key: string): TBoard;
+               function FindBBSID(const BBSID: string): TBoard;
+               function FindBoardFromTitle(const Title: string): TBoard;
+               function FindBoardFromURL(const inURL: string): TBoard;
+               function FindThreadFromURL(const inURL : string ) : TThreadItem;
                function IsMidoku: Boolean;
 
                property NodeExpand: Boolean read FExpand write FExpand;
@@ -219,10 +219,10 @@ type
                procedure Delete(index: integer);
                procedure DeleteList(index: integer);
                procedure Clear; override;
-               function FindThreadFromFileName(ItemFileName: string): TThreadItem;
-               function FindThreadFromURL( inURL : string ) : TThreadItem;
-               function GetIndexFromFileName(ItemFileName: string): Integer;
-               function GetIndexFromURL(URL: string): Integer;
+               function FindThreadFromFileName(const ItemFileName: string): TThreadItem;
+               function FindThreadFromURL(const inURL : string ) : TThreadItem;
+               function GetIndexFromFileName(const ItemFileName: string): Integer;
+               function GetIndexFromURL(const URL: string): Integer;
                procedure LoadSettings;
                procedure SaveSettings;
                function GetReadCgiURL: string;
@@ -284,12 +284,12 @@ type
 
                procedure SetLastModified(d: TDateTime);
                procedure SetRound(b: Boolean);
-               procedure SetRoundName(s: string);
+               procedure SetRoundName(const s: string);
                procedure SetKokomade(i: Integer);
                procedure SetUnRead(b: Boolean);
                procedure SetScrollTop(i: Integer);
                procedure Init;
-        function GetCreateDate: TDateTime;
+               function GetCreateDate: TDateTime;
        public
                constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
                destructor Destroy; override;
@@ -297,7 +297,7 @@ type
                function GetDatURL: string;
                function GetDatgzURL: string;
 //             function GetOldDatgzURL: string;
-               function GetOfflawCgiURL(SessionID: string): string;
+               function GetOfflawCgiURL(const SessionID: string): string;
                function GetSendURL: string;
                procedure DeleteLogFile;
                function GetThreadFileName: string;
@@ -330,7 +330,7 @@ type
                property DownloadHost: string read FDownloadHost write FDownloadHost;
                property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
 //             property SPID: string read FSPID write FSPID;
-        property CreateDate: TDateTime read GetCreateDate;
+               property CreateDate: TDateTime read GetCreateDate;
                property        URL                                     : string                                read FURL write FURL;
                property        BoardPlugIn     : TBoardPlugIn  read FBoardPlugIn;
                property        FilePath                : string                                read FFilePath write FFilePath;
@@ -359,7 +359,7 @@ type
        function        BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
        function        BBSsFindBoardFromURL( inURL : string ) : TBoard;
        function        BBSsFindBoardFromTitle( inTitle : string ) : TBoard;
-       function        BBSsFindThreadFromURL( inURL : string ) : TThreadItem;
+       function        BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
     function   ConvertDateTimeString( inDateTimeString : string) : TDateTime;
     
 var
@@ -432,7 +432,7 @@ begin
 end;
 
 function       BBSsFindThreadFromURL(
-       inURL                   : string
+       const inURL                     : string
 ) : TThreadItem;
 var
        board                   : TBoard;
@@ -511,7 +511,7 @@ begin
        Result := nil;
 end;
 
-function TBBS.FindBBSID(BBSID: string): TBoard;
+function TBBS.FindBBSID(const BBSID: string): TBoard;
 var
        i       : Integer;
 begin
@@ -528,7 +528,7 @@ end;
 //*************************************************************************
 // \83^\83C\83g\83\8b\82Ì\88ê\92v\82·\82é\94Â\82ð\92T\82·
 //*************************************************************************)
-function TBBS.FindBoardFromTitle(Title: string): TBoard;
+function TBBS.FindBoardFromTitle(const Title: string): TBoard;
 var
        i: Integer;
 begin
@@ -545,7 +545,7 @@ end;
 //*************************************************************************
 // URL \82ð\8eó\82¯\95t\82¯\82é\94Â\82ð\92T\82·
 //*************************************************************************)
-function TBBS.FindBoardFromURL(inURL: string): TBoard;
+function TBBS.FindBoardFromURL(const inURL: string): TBoard;
 var
        i                                       : Integer;
 begin
@@ -562,7 +562,7 @@ end;
 //*************************************************************************
 // URL \82ð\8eó\82¯\95t\82¯\82é\83X\83\8c\83b\83h\82ð\92T\82·
 //*************************************************************************)
-function TBBS.FindThreadFromURL(inURL: string): TThreadItem;
+function TBBS.FindThreadFromURL(const inURL: string): TThreadItem;
 var
        board                   : TBoard;
        boardURL        : string;
@@ -577,7 +577,7 @@ begin
 
 end;
 
-function TBBS.FindThreadItem(BBSID: string; FileName: string): TThreadItem;
+function TBBS.FindThreadItem(const BBSID, FileName: string): TThreadItem;
 var
        Board: TBoard;
 begin
@@ -588,7 +588,7 @@ begin
        Result := Board.FindThreadFromFileName(FileName);
 end;
 
-function TBBS.FindCategoryFromTitle( inTitle : string ) : TCategory;
+function TBBS.FindCategoryFromTitle(const inTitle : string ) : TCategory;
 var
        i : Integer;
 begin
@@ -664,15 +664,15 @@ var
 begin
        for i := Count - 1 downto 0 do
                Delete(i);
-    Capacity := Count;
+       Capacity := Count;
 end;
 
-function TCategory.FindName(key: string): TBoard;
+function TCategory.FindName(const key: string): TBoard;
 begin
        Result := nil;
 end;
 
-function TCategory.FindBBSID(BBSID: string): TBoard;
+function TCategory.FindBBSID(const BBSID: string): TBoard;
 var
        i       : integer;
 begin
@@ -688,7 +688,7 @@ end;
 //*************************************************************************
 // \83^\83C\83g\83\8b\82Ì\88ê\92v\82·\82é\94Â\82ð\92T\82·
 //*************************************************************************)
-function TCategory.FindBoardFromTitle(Title: string): TBoard;
+function TCategory.FindBoardFromTitle(const Title: string): TBoard;
 var
        i       : integer;
 begin
@@ -704,7 +704,7 @@ end;
 //*************************************************************************
 // URL \82ð\8eó\82¯\95t\82¯\82é\94Â\82ð\92T\82·
 //*************************************************************************)
-function TCategory.FindBoardFromURL(inURL: string): TBoard;
+function TCategory.FindBoardFromURL(const inURL: string): TBoard;
 var
        i       : Integer;
 begin
@@ -718,7 +718,7 @@ end;
 //*************************************************************************
 // URL \82ð\8eó\82¯\95t\82¯\82é\83X\83\8c\83b\83h\82ð\92T\82·
 //*************************************************************************)
-function TCategory.FindThreadFromURL(inURL: string): TThreadItem;
+function TCategory.FindThreadFromURL(const inURL: string): TThreadItem;
 var
        board                   : TBoard;
        boardURL        : string;
@@ -908,7 +908,7 @@ begin
         Capacity := Count;
 end;
 
-function TBoard.FindThreadFromFileName(ItemFileName: string): TThreadItem;
+function TBoard.FindThreadFromFileName(const ItemFileName: string): TThreadItem;
 var
        i: integer;
 begin
@@ -921,7 +921,7 @@ begin
        end;
 end;
 
-function TBoard.GetIndexFromFileName(ItemFileName: string): Integer;
+function TBoard.GetIndexFromFileName(const ItemFileName: string): Integer;
 var
        i: integer;
 begin
@@ -934,12 +934,12 @@ begin
        end;
 end;
 
-function TBoard.GetIndexFromURL(URL: string): Integer;
+function TBoard.GetIndexFromURL(const URL: string): Integer;
 begin
        Result := IndexOf( URL );
 end;
 
-function TBoard.FindThreadFromURL( inURL : string ) : TThreadItem;
+function TBoard.FindThreadFromURL(const inURL : string ) : TThreadItem;
 var
        i : Integer;
 begin
@@ -1591,7 +1591,7 @@ begin
        end;
 end;}
 
-function TThreadItem.GetOfflawCgiURL(SessionID: string): string;
+function TThreadItem.GetOfflawCgiURL(const SessionID: string): string;
 //var
 //     Protocol, Host, Path, Document, Port, Bookmark: string;
 begin
@@ -1686,7 +1686,7 @@ begin
                ParentBoard.FModified := True;
 end;
 
-procedure TThreadItem.SetRoundName(s: string);
+procedure TThreadItem.SetRoundName(const s: string);
 begin
        if FRoundName = s then Exit;
        FRoundName := s;
index c7a598a..9c26b06 100644 (file)
@@ -160,9 +160,8 @@ type
 
                procedure MenuFont(Font: TFont);
 
-               function RemoveToken(var s:string;delimiter:string):string;
+               function RemoveToken(var s:string; const delimiter:string):string;
                function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
-
                function DeleteLink(const s: string): string;
 
                function GetShortName(const LongName: string; ALength: integer): string;
@@ -217,7 +216,7 @@ const
        ZERO_DATE: Integer      = 25569;
        BETA_VERSION_NAME_E = 'beta';
        BETA_VERSION_NAME_J = 'ÊÞÀ';
-       BETA_VERSION                            = 47;
+       BETA_VERSION                            = 48;
        BETA_VERSION_BUILD      = '';                           //debug\94Å\82È\82Ç
        APP_NAME                                                = 'gikoNavi';
 
@@ -509,7 +508,7 @@ var
 begin
        if Board.IsThreadDatRead then
                Exit;
-       Board.Clear;
+       //Board.Clear;
        UnRead := 0;
 //     TmpUpdate := False;
 
@@ -538,8 +537,9 @@ begin
        GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, False, False);
 
        // \8fd\95¡\82ð\96h\82®
+       Board.BeginUpdate;
        Board.Sorted := True;
-       
+
        sl := TStringList.Create;
        try
                if FileExists(FileName) then begin
@@ -670,6 +670,7 @@ begin
                        ThreadItem.EndUpdate;
                        Board.Add(ThreadItem);
                end;
+               Board.EndUpdate;
        finally
                sl.Free;
                FileList.Free;
@@ -827,11 +828,11 @@ begin
 end;
 
 function TGikoSys.ParseIndexLine(Line: string): TIndexRec;
-var
-       s: string;
-       i: Integer;
+//var
+//     s: string;
+//     i: Integer;
 begin
-       for i := 0 to 14 do begin
+       {for i := 0 to 14 do begin
                s := GetTokenIndex(Line, #1, i);
                case i of
                        0: Result.FNo := StrToIntDef('$' + s, 0);
@@ -851,6 +852,23 @@ begin
                        14: Result.FAgeSage := TGikoAgeSage(StrToIntDef('$' + s, 0));
                end;
        end;
+       }
+       Result.FNo := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       Result.FFileName := RemoveToken(Line, #1);
+       Result.FTitle := RemoveToken(Line, #1);
+       Result.FCount := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       Result.FSize := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       Result.FRoundDate := IntToDateTime(StrToIntDef('$' + RemoveToken(Line, #1), ZERO_DATE));
+       Result.FLastModified := IntToDateTime(StrToIntDef('$' + RemoveToken(Line, #1), ZERO_DATE));
+       Result.FKokomade := StrToIntDef('$' + RemoveToken(Line, #1), -1);
+       Result.FNewReceive := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       RemoveToken(Line, #1);//9: ;    //\96¢\8eg\97p
+       Result.FUnRead := IntToBool(StrToIntDef('$' + RemoveToken(Line, #1), 0));
+       Result.FScrollTop := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       Result.FAllResCount := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       Result.FNewResCount := StrToIntDef('$' + RemoveToken(Line, #1), 0);
+       Result.FAgeSage := TGikoAgeSage(StrToIntDef('$' + RemoveToken(Line, #1), 0));
+
 end;
 
 //\8ew\92è\83t\83H\83\8b\83_\93à\82Ì\8ew\92è\83t\83@\83C\83\8b\88ê\97\97\82ð\8eæ\93¾\82·\82é
@@ -1526,9 +1544,12 @@ begin
                Delim := ','
        else
                Delim := '<>';
-
+       {
        Result.FFileName := GetTokenIndex(Line, Delim, 0);
        Result.FTitle := GetTokenIndex(Line, Delim, 1);
+       }
+       Result.FFileName := RemoveToken(Line, Delim);
+       Result.FTitle := RemoveToken(Line, Delim);
 
        ws := Trim(Result.FTitle);
 
@@ -1569,10 +1590,17 @@ begin
                Delim := '<>';
                Result.FType := glt2chNew;
        end;
+       {
        Result.FName := Trim(GetTokenIndex(Line, Delim, 0));
        Result.FMailTo := Trim(GetTokenIndex(Line, Delim, 1));
        Result.FDateTime := Trim(GetTokenIndex(Line, Delim, 2));
        bufBody := Trim(GetTokenIndex(Line, Delim, 3));
+       }
+       Result.FName := Trim(RemoveToken(Line, Delim));
+       Result.FMailTo := Trim(RemoveToken(Line, Delim));
+       Result.FDateTime := Trim(RemoveToken(Line, Delim));
+       bufBody := Trim(RemoveToken(Line, Delim));
+
        if bufbody = '' then begin
                Insert('&nbsp;',bufbody, 1);
        end;
@@ -1786,7 +1814,7 @@ end;
  *
  *\82Ç\82±\82©\82Ì\83T\83C\83g\82©\82ç\82Ì\83p\83N\83\8a
  *************************************************************************)
-function TGikoSys.RemoveToken(var s: string; delimiter: string): string;
+function TGikoSys.RemoveToken(var s: string;const delimiter: string): string;
 var
        p: Integer;
 begin
index 0cf9c8b..6edadd5 100644 (file)
Binary files a/gikoNavi.res and b/gikoNavi.res differ