OSDN Git Service

最適化
authorh677 <h677>
Thu, 6 Jul 2006 15:22:41 +0000 (15:22 +0000)
committerh677 <h677>
Thu, 6 Jul 2006 15:22:41 +0000 (15:22 +0000)
ExternalBoardManager.pas
GikoSystem.pas

index cbd4429..a298e4b 100644 (file)
@@ -140,7 +140,7 @@ begin
        try
                //GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*', pluginNames, False, False );
         pluginNames.BeginUpdate;
-               GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*', pluginNames, False );
+               GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*.dll', pluginNames, False );
         pluginNames.EndUpdate;
                SetLength( BoardPlugIns, pluginNames.Count );
         //
index 01357fe..87ec3ba 100644 (file)
@@ -569,6 +569,7 @@ var
        BoardPath : String;
        server : String;
        islog : Boolean;
+    urlHead: String;
        //protocol, host, path, document, port, bookmark        : string;
        //is2ch : Boolean;
        {*
@@ -608,7 +609,12 @@ begin
        try
                if FileExists(FileName) then begin
                        sl.LoadFromFile(FileName);
-
+            // \83X\83\8c\83b\83h\82Å\8b¤\92Ê\82ÌURL\95\94
+            if Board.is2ch then begin
+                urlHead := server + 'test/read.cgi/' + Board.BBSID + '/';
+            end else begin
+                urlHead := server + 'test/read.cgi?bbs=' + Board.BBSID + '&key=';
+            end;
                        //\82Q\8ds\96Ú\82©\82ç\81i\82P\8ds\96Ú\82Í\83o\81[\83W\83\87\83\93\81j
                        for i := sl.Count - 1 downto 1 do begin
                                Rec := ParseIndexLine(sl[i]);
@@ -623,7 +629,7 @@ begin
                                                ThreadItem := TThreadItem.Create(
                                                        nil,
                                                        Board,
-                                                       server + 'test/read.cgi/' + Board.BBSID + '/' + ChangeFileExt( Rec.FFileName, '' ) + '/l50',
+                                                       urlHead + ChangeFileExt( Rec.FFileName, '' ) + '/l50',
                                                        islog,
                                                        Rec.FFileName
                                                        );
@@ -631,7 +637,7 @@ begin
                                                ThreadItem := TThreadItem.Create(
                                                        nil,
                                                        Board,
-                                                       server + 'test/read.cgi?bbs=' + Board.BBSID + '&key=' + ChangeFileExt( Rec.FFileName, '' ) + '&ls=50',
+                                                       urlHead + ChangeFileExt( Rec.FFileName, '' ) + '&ls=50',
                                                        islog,
                                                        Rec.FFileName
                                                        );
@@ -964,18 +970,13 @@ var
        rc: Integer;
        SearchRec : TSearchRec;
        s: string;
-       maskExt: string;
 begin
-       //maskExt := Copy(Mask, 1, Length(Mask) - 1);
-               maskExt := Mask;
        Path := IncludeTrailingPathDelimiter(Path);
        rc := FindFirst(Path + '*.*', faAnyfile, SearchRec);
        try
                while rc = 0 do begin
                        if (SearchRec.Name <> '..') and (SearchRec.Name <> '.') then begin
                                s := Path + SearchRec.Name;
-                               //if (SearchRec.Attr and faDirectory > 0) then
-                               //      s := IncludeTrailingPathDelimiter(s)
 
                                if (SearchRec.Attr and faDirectory = 0) and (MatchesMask(s, Mask)) then
                                                if IsPathAdd then
@@ -1010,20 +1011,19 @@ procedure TGikoSys.GetFileList(Path: string; Mask: string; var List: TStringList
 var
        rc: Integer;
        SearchRec : TSearchRec;
-       s: string;
 begin
        Path := IncludeTrailingPathDelimiter(Path);
        rc := FindFirst(Path + Mask, faAnyfile, SearchRec);
        try
                while rc = 0 do begin
                        if (SearchRec.Name <> '..') and (SearchRec.Name <> '.') then begin
-                               s := Path + SearchRec.Name;
-
-                               if (SearchRec.Attr and faDirectory = 0) then
-                                               if IsPathAdd then
-                                                       List.Add(s)
-                                               else
-                                                       List.Add(SearchRec.Name);
+                               if (SearchRec.Attr and faDirectory = 0) then begin
+                    if IsPathAdd then begin
+                        List.Add(Path + SearchRec.Name)
+                    end else begin
+                        List.Add(SearchRec.Name);
+                    end;
+                end;
                        end;
                        rc := FindNext(SearchRec);
                end;
@@ -2500,7 +2500,7 @@ end;
 procedure TGikoSys.ListBoardFile;
 var
        boardFileList   : TStringList;
-       i, l, k                                 : Integer;
+       i, l                    : Integer;
 begin
        // BBS \82Ì\8aJ\95ú
        try
@@ -2531,13 +2531,9 @@ begin
          BoardFileList := TStringList.Create;
          try
         BoardFileList.BeginUpdate;
-               GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True );
+               GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*.txt', BoardFileList, True, True );
         BoardFileList.EndUpdate;
-               for k := BoardFileList.Count - 1 downto 0 do begin
-                 if AnsiCompareText(ExtractFileExt(BoardFileList[ k ]), '.bak') = 0 then
-                         BoardFileList.Delete(k);
-               end;
-                         SetLength( BBSs, l + BoardFileList.Count );
+        SetLength( BBSs, l + BoardFileList.Count );
                for i := BoardFileList.Count - 1 downto 0 do begin
                  BBSs[ l ]                             := TBBS.Create( BoardFileList[ i ] );
                  BBSs[ l ].Title       := ChangeFileExt( ExtractFileName( BoardFileList[ i ] ), '' );