OSDN Git Service

フォルダ内のファイル一覧を取得するのに、サブフォルダを検索しないときは、全てのファイルを
authorh677 <h677>
Sat, 24 Apr 2004 13:27:25 +0000 (13:27 +0000)
committerh677 <h677>
Sat, 24 Apr 2004 13:27:25 +0000 (13:27 +0000)
検索するのではなく、あらかじめ拡張子でフィルタリングしたのを検索するようにした。

ExternalBoardManager.pas
Giko.pas
GikoSystem.pas

index 186989d..2351aa7 100644 (file)
@@ -135,7 +135,8 @@ begin
 
        pluginNames := TStringList.Create;
        try
-               GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*', pluginNames, False, False );
+               //GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*', pluginNames, False, False );
+               GikoSys.GetFileList( GikoSys.Setting.GetBoardPlugInDir, '*', pluginNames, False );
                SetLength( BoardPlugIns, pluginNames.Count );
 
                bound := pluginNames.Count - 1;
index 0e1e982..baeb88b 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -9594,7 +9594,10 @@ begin
        {end else if Key in [VK_ESCAPE..VK_HELP] then begin
                // \8f\\8e\9a\81APage Up\81APage Down \93\99\82Í Browser \82ª\8f\9f\8eè\82É\8eó\82¯\8eæ\82é\82Ì\82Å\83C\83x\83\93\83g\82ð\83J\83b\83g
                Result := True;
-    }
+       }
+       end else if(Key in [VK_SPACE..VK_HELP]) and
+               not(ssCtrl in State) and not(ssAlt in State) and not (ssShift in State) then begin
+               Result := True;
        end else begin
                // \82»\82ê\88È\8aO\82Ì\83C\83x\83\93\83g\82Í Browser \82É\97¬\82·
                Dispatch := Browser.Application;
index ff5415f..c43a491 100644 (file)
@@ -132,7 +132,8 @@ type
                procedure CreateThreadDat(Board: TBoard);
                procedure WriteThreadDat(Board: TBoard);
                function ParseIndexLine(Line: string): TIndexRec;
-               procedure GetFileList(Path: string; Mask: string; var List: TStringList; SubDir: Boolean; IsPathAdd: Boolean);
+               procedure GetFileList(Path: string; Mask: string; var List: TStringList; SubDir: Boolean; IsPathAdd: Boolean); overload;
+               procedure GetFileList(Path: string; Mask: string; var List: TStringList; IsPathAdd: Boolean); overload;//\83T\83u\83t\83H\83\8b\83_\82Í\8c\9f\8dõ\82µ\82È\82¢
                procedure GetDirectoryList(Path: string; Mask: string; List: TStringList; SubDir: Boolean);
 
                procedure CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string);
@@ -457,7 +458,8 @@ var
 begin
        d1 := EncodeDate(1970, 1, 1);
        d2 := aDate - EncodeTime(9, 0, 0, 0);
-       Result := FloatToStr(Trunc((d2 - d1) * 24 * 60 * 60));
+       //Result := FloatToStr(Trunc((d2 - d1) * 24 * 60 * 60));
+       Result := FloatToStr(Trunc((d2 - d1) * 86400));
 end;
 
 
@@ -504,7 +506,7 @@ var
        RoundItem: TRoundItem;
        idx: Integer;
        usePlugIn : Boolean;
-    tmpStr: string;
+       tmpStr: string;
 begin
        if Board.IsThreadDatRead then
                Exit;
@@ -532,10 +534,12 @@ begin
        TmpFileList.Sorted := True;
 
        //IsLogFile\97pDAT\83t\83@\83C\83\8b\83\8a\83X\83g
-       GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.dat', FileList, False, False);
+       //GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.dat', FileList, False, False);
+       GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.dat', FileList, False);
 
        //\91O\89ñ\88Ù\8fí\8fI\97¹\8e\9e\97pTmp\83t\83@\83C\83\8b\83\8a\83X\83g
-       GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, False, False);
+       //GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, False, False);
+       GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, False);
 
        // \8fd\95¡\82ð\96h\82®
        Board.BeginUpdate;
@@ -766,7 +770,8 @@ begin
        sl := TStringList.Create;
         TmpFileList := TStringList.Create;
        try
-               GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, False, true);
+               //GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, False, true);
+               GetFileList(ExtractFileDir(Board.GetFolderIndexFileName), '*.tmp', TmpFileList, true);
 
                sl.BeginUpdate;
                sl.Add(FOLDER_INDEX_VERSION);
@@ -882,7 +887,10 @@ var
        rc: Integer;
        SearchRec : TSearchRec;
        s: string;
+       maskExt: string;
 begin
+       maskExt := Copy(Mask, 1, Length(Mask) - 1);
+
        Path := IncludeTrailingPathDelimiter(Path);
        rc := FindFirst(Path + '*.*', faAnyfile, SearchRec);
        try
@@ -893,10 +901,12 @@ begin
                                //      s := IncludeTrailingPathDelimiter(s)
 
                                if (SearchRec.Attr and faDirectory = 0) and (MatchesMask(s, Mask)) then
-                                       if IsPathAdd then
-                                               List.Add(s)
-                                       else
-                                               List.Add(SearchRec.Name);
+                               //if (SearchRec.Attr and faDirectory = 0) then
+                               //      if (maskExt = '') or (ChangeFileExt(s, maskExt) = s )then
+                                               if IsPathAdd then
+                                                       List.Add(s)
+                                               else
+                                                       List.Add(SearchRec.Name);
                                if SubDir and (SearchRec.Attr and faDirectory > 0) then
                                        GetFileList(s, Mask, List, True, IsPathAdd);
                        end;
@@ -905,9 +915,37 @@ begin
        finally
                SysUtils.FindClose(SearchRec);
        end;
-    List.Sort;
+       List.Sort;
 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é
+//\83T\83u\83t\83H\83\8b\83_\82Í\8c\9f\8dõ\82µ\82È\82¢
+// ListFiles('c:\', '*.txt', list, True);
+procedure TGikoSys.GetFileList(Path: string; Mask: string; var List: TStringList; IsPathAdd: Boolean);
+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);
+                       end;
+                       rc := FindNext(SearchRec);
+               end;
+       finally
+               SysUtils.FindClose(SearchRec);
+       end;
+       List.Sort;
+end;
 //\8ew\92è\83t\83H\83\8b\83_\93à\82Ì\83f\83B\83\8c\83N\83g\83\8a\88ê\97\97\82ð\8eæ\93¾\82·\82é
 procedure TGikoSys.GetDirectoryList(Path: string; Mask: string; List: TStringList; SubDir: Boolean);
 var
@@ -3292,7 +3330,7 @@ begin
   if DirectoryExists( GikoSys.Setting.GetBoardDir ) then begin
     BoardFileList := TStringList.Create;
     try
-      GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True );
+         GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True );
                        SetLength( BBSs, l + BoardFileList.Count );
       for i := BoardFileList.Count - 1 downto 0 do begin
         BBSs[ l ]                              := TBBS.Create( BoardFileList[ i ] );