OSDN Git Service

・r1.263 で消し忘れのゴミが残っていたので削除。
[gikonavigoeson/gikonavi.git] / GikoSystem.pas
index a3b9498..24ac1f1 100644 (file)
@@ -126,6 +126,7 @@ type
                function GetStyleSheetDir: string;
                function GetOutBoxFileName: string;
                function GetUserAgent: string;
+        function GetSambaFileName : string;
 
                procedure ReadSubjectFile(Board: TBoard);
                procedure CreateThreadDat(Board: TBoard);
@@ -153,7 +154,7 @@ type
                function GetFileLineCount(FileName : string): longint;
                function Get2chDate(aDate: TDateTime): string;
                function IntToDateTime(val: Int64): TDateTime;
-               function DateTimeToInt(ADate: TDateTime): Integer;
+               function DateTimeToInt(ADate: TDateTime): Int64;
 
                function ReadThreadFile(FileName: string; Line: Integer): string;
 
@@ -192,7 +193,8 @@ type
                function        Get2chThreadURL2BoardURL( inURL : string ) : string;
                function        Get2chBrowsableThreadURL( inURL : string ) : string;
                function        Get2chBoard2ThreadURL( inBoard : TBoard; inKey : string ) : string;
-               procedure ReadBoardFile;
+               procedure ListBoardFile;
+               procedure ReadBoardFile( bbs : TBBS );
 
                function        GetUnknownCategory : TCategory;
                function        GetUnknownBoard( inPlugIn : TBoardPlugIn; inURL : string ) : TBoard;
@@ -204,16 +206,18 @@ type
        // \83\8c\83X\82Ì\92l\82ð\92u\8a·\82·\82é
                function SkinedRes( skin: string; Res: TResRec; No: string ): string;
 
+        //Samba24\82Ì\83t\83@\83C\83\8b\82ª\91\8dÝ\82·\82é\82©\81B\91\8dÝ\82µ\82È\82¢\8fê\8d\87\81Adefault\83t\83@\83C\83\8b\82ðrename\82·\82é
+        procedure SambaFileExists();
        end;
 
 var
        GikoSys: TGikoSys;
 const
-       LENGTH_RESTITLE                 = 40;
+       //LENGTH_RESTITLE                       = 40;
        ZERO_DATE: Integer      = 25569;
        BETA_VERSION_NAME_E = 'beta';
        BETA_VERSION_NAME_J = 'ÊÞÀ';
-       BETA_VERSION                            = 46;
+       BETA_VERSION                            = 47;
        BETA_VERSION_BUILD      = '';                           //debug\94Å\82È\82Ç
        APP_NAME                                                = 'gikoNavi';
 
@@ -248,6 +252,7 @@ begin
        FAbon.GoHome;
        FAbon.ReturnNGwordLineNum := FSetting.ShowNGLinesNum;
        FAbon.SetNGResAnchor := FSetting.AddResAnchor;
+    FAbon.DeleteSyria := FSetting.DeleteSyria;
        FAbon.Deleterlo := FSetting.AbonDeleterlo;
        FAbon.Replaceul := FSetting.AbonReplaceul;
        FAbon.AbonPopupRes := FSetting.PopUpAbon;
@@ -463,17 +468,17 @@ var
        d2: tdatetime;
 begin
        d1 := EncodeDate(1970, 1, 1);
-       d2 := (val * 1000) / (24 * 60 * 60 * 1000);
+       d2 := val / 86400.0;//(val * 1000) / (24 * 60 * 60 * 1000);
        Result := d1 + d2;
 end;
 
-function TGikoSys.DateTimeToInt(ADate: TDateTime): Integer;
+function TGikoSys.DateTimeToInt(ADate: TDateTime): Int64;
 var
        d: TDateTime;
        c: Currency;
 begin
        d := EncodeDate(1970, 1, 1);
-       c := (ADate - d) * 24 * 60 * 60;
+       c := (ADate - d) * 86400; //(ADate - d) * 24 * 60 * 60;
        Result := Trunc(c);
 end;
 
@@ -500,7 +505,10 @@ var
        RoundItem: TRoundItem;
        idx: Integer;
        usePlugIn : Boolean;
+    tmpStr: string;
 begin
+    if Board.IsThreadDatRead then
+       Exit;
        Board.Clear;
        UnRead := 0;
 //     TmpUpdate := False;
@@ -531,88 +539,94 @@ begin
 
        sl := TStringList.Create;
        try
-               if FileExists(FileName) then
+               if FileExists(FileName) then begin
                        sl.LoadFromFile(FileName);
 
-               //\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]);
-
-                       if usePlugIn then
-                               ThreadItem := TThreadItem.Create(
-                                       Board.BoardPlugIn,
-                                       Board.BoardPlugIn.FileName2ThreadURL( DWORD( Board ), Rec.FFileName ) )
-                       else
-                               ThreadItem := TThreadItem.Create(
-                                       nil,
-                                       Get2chBoard2ThreadURL( Board, ChangeFileExt( Rec.FFileName, '' ) ) );
-
-                       if FileList.Count <> 0 then
-                               if FileList.Find( ThreadItem.FileName, Index ) then
-                                       //ThreadItem.IsLogFile := True;
-                                       FileList.Delete( Index );
-
-                       ThreadItem.BeginUpdate;
-                       ThreadItem.No := Rec.FNo;
-                       ThreadItem.FileName := Rec.FFileName;
-                       ThreadItem.Title := Rec.FTitle;
-                       ThreadItem.Count := Rec.FCount;
-                       ThreadItem.Size := Rec.FSize;
-//                     ThreadItem.RoundNo := Rec.FRoundNo;
-                       ThreadItem.RoundDate := Rec.FRoundDate;
-                       ThreadItem.LastModified := Rec.FLastModified;
-                       ThreadItem.Kokomade := Rec.FKokomade;
-                       ThreadItem.NewReceive := Rec.FNewReceive;
-//                     ThreadItem.Round := Rec.FRound;
-                       ThreadItem.UnRead := Rec.FUnRead;
-                       ThreadItem.ScrollTop := Rec.FScrollTop;
-                       ThreadItem.AllResCount := Rec.FAllResCount;
-                       ThreadItem.NewResCount := Rec.FNewResCount;
-                       ThreadItem.AgeSage := Rec.FAgeSage;
-                       ThreadItem.ParentBoard := Board;
-
-                       //\8f\84\89ñ\83\8a\83X\83g\82É\91\8dÝ\82µ\82½\82ç\8f\84\89ñ\83t\83\89\83O\83Z\83b\83g
-                       if ThreadItem.IsLogFile then begin
-                               idx := RoundList.Find(ThreadItem);
-                               if idx <> -1 then begin
-                                       RoundItem := RoundList.Items[idx, grtItem];
-                                       ThreadItem.RoundName := RoundItem.RoundName;
-                                       ThreadItem.Round := True;
-                               end;
-                       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]);
+                if usePlugIn then
+                    ThreadItem := TThreadItem.Create(
+                        Board.BoardPlugIn,
+                        Board.BoardPlugIn.FileName2ThreadURL( DWORD( Board ), Rec.FFileName ) )
+                else
+                    ThreadItem := TThreadItem.Create(
+                        nil,
+                        Get2chBoard2ThreadURL( Board, ChangeFileExt( Rec.FFileName, '' ) ) );
+
+                if FileList.Count <> 0 then
+                    if FileList.Find( ThreadItem.FileName, Index ) then
+                        //ThreadItem.IsLogFile := True;
+                        FileList.Delete( Index );
+
+                ThreadItem.BeginUpdate;
+                ThreadItem.No := Rec.FNo;
+                ThreadItem.FileName := Rec.FFileName;
+                ThreadItem.Title := Rec.FTitle;
+                ThreadItem.Count := Rec.FCount;
+                ThreadItem.Size := Rec.FSize;
+    //                 ThreadItem.RoundNo := Rec.FRoundNo;
+                ThreadItem.RoundDate := Rec.FRoundDate;
+                ThreadItem.LastModified := Rec.FLastModified;
+                ThreadItem.Kokomade := Rec.FKokomade;
+                ThreadItem.NewReceive := Rec.FNewReceive;
+    //                 ThreadItem.Round := Rec.FRound;
+                ThreadItem.UnRead := Rec.FUnRead;
+                ThreadItem.ScrollTop := Rec.FScrollTop;
+                ThreadItem.AllResCount := Rec.FAllResCount;
+                ThreadItem.NewResCount := Rec.FNewResCount;
+                ThreadItem.AgeSage := Rec.FAgeSage;
+                ThreadItem.ParentBoard := Board;
+
+                //\8f\84\89ñ\83\8a\83X\83g\82É\91\8dÝ\82µ\82½\82ç\8f\84\89ñ\83t\83\89\83O\83Z\83b\83g
+                if ThreadItem.IsLogFile then begin
+                    idx := RoundList.Find(ThreadItem);
+                    if idx <> -1 then begin
+                        RoundItem := RoundList.Items[idx, grtItem];
+                        ThreadItem.RoundName := RoundItem.RoundName;
+                        ThreadItem.Round := True;
+                    end;
+                end;
 
-                       //\91O\89ñ\88Ù\8fí\8fI\97¹\8e\9e\83`\83F\83b\83N
-                       if TmpFileList.Count <> 0 then begin
-                               if TmpFileList.Find(ChangeFileExt(ThreadItem.FileName, '.tmp'), Index) then begin
-                                       ini := TMemIniFile.Create(ChangeFileExt(ThreadItem.GetThreadFileName, '.tmp'));
-                                       try
-                                               ThreadItem.RoundDate := ini.ReadDateTime('Setting', 'RoundDate', ZERO_DATE);
-                                               ThreadItem.LastModified := ini.ReadDateTime('Setting', 'LastModified', ZERO_DATE);
-                                               ThreadItem.Size := ini.ReadInteger('Setting', 'Size', 0);
-                        if ThreadItem.Size = 0 then begin
-                               ThreadItem.Size := FileSizeByName(ThreadItem.FileName) - ThreadItem.Count;
+                //\91O\89ñ\88Ù\8fí\8fI\97¹\8e\9e\83`\83F\83b\83N
+                if TmpFileList.Count <> 0 then begin
+                    if TmpFileList.Find(ChangeFileExt(ThreadItem.FileName, '.tmp'), Index) then begin
+                        ini := TMemIniFile.Create(ChangeFileExt(ThreadItem.GetThreadFileName, '.tmp'));
+                        try
+                            //ThreadItem.RoundDate := ini.ReadDateTime('Setting', 'RoundDate', ZERO_DATE);
+                            tmpStr := ini.ReadString('Setting', 'RoundDate', DateTimeToStr(ZERO_DATE));
+                            ThreadItem.RoundDate := ConvertDateTimeString(tmpStr);
+
+                            //ThreadItem.LastModified := ini.ReadDateTime('Setting', 'LastModified', ZERO_DATE);
+                            tmpStr := ini.ReadString('Setting', 'LastModified', DateTimeToStr(ZERO_DATE));
+                            ThreadItem.LastModified := ConvertDateTimeString(tmpStr);
+
+                            ThreadItem.Size := ini.ReadInteger('Setting', 'Size', 0);
+                            if ThreadItem.Size = 0 then begin
+                                ThreadItem.Size := FileSizeByName(ThreadItem.FileName) - ThreadItem.Count;
+                            end;
+                            ThreadItem.Count := ini.ReadInteger('Setting', 'Count', 0);
+                            ThreadItem.NewReceive := ini.ReadInteger('Setting', 'NewReceive', 0);
+                            ThreadItem.Round := ini.ReadBool('Setting', 'Round', False);
+                            ThreadItem.UnRead := False;//ini.ReadBool('Setting', 'UnRead', False);
+                            ThreadItem.ScrollTop := ini.ReadInteger('Setting', 'ScrollTop', 0);
+                            ThreadItem.AllResCount := ini.ReadInteger('Setting', 'AllResCount', ThreadItem.Count);
+                            ThreadItem.NewResCount := ini.ReadInteger('Setting', 'NewResCount', 0);
+                            ThreadItem.AgeSage := TGikoAgeSage(ini.ReadInteger('Setting', 'AgeSage', Ord(gasNone)));
+                        finally
+                            ini.Free;
                         end;
-                                               ThreadItem.Count := ini.ReadInteger('Setting', 'Count', 0);
-                                               ThreadItem.NewReceive := ini.ReadInteger('Setting', 'NewReceive', 0);
-                                               ThreadItem.Round := ini.ReadBool('Setting', 'Round', False);
-                                               ThreadItem.UnRead := False;//ini.ReadBool('Setting', 'UnRead', False);
-                                               ThreadItem.ScrollTop := ini.ReadInteger('Setting', 'ScrollTop', 0);
-                                               ThreadItem.AllResCount := ini.ReadInteger('Setting', 'AllResCount', ThreadItem.Count);
-                                               ThreadItem.NewResCount := ini.ReadInteger('Setting', 'NewResCount', 0);
-                                               ThreadItem.AgeSage := TGikoAgeSage(ini.ReadInteger('Setting', 'AgeSage', Ord(gasNone)));
-                                       finally
-                                               ini.Free;
-                                       end;
-                                       TmpFileList.Delete(Index);
-                               end;
-                       end;
+                        TmpFileList.Delete(Index);
+                    end;
+                end;
 
-                       ThreadItem.EndUpdate;
-                       Board.Add(ThreadItem);
+                ThreadItem.EndUpdate;
+                Board.Add(ThreadItem);
 
-//                     if (ThreadItem.IsLogFile) and (ThreadItem.Count > ThreadItem.Kokomade) then
-                       if (ThreadItem.IsLogFile) and (ThreadItem.UnRead) then
-                               Inc(UnRead);
+    //                 if (ThreadItem.IsLogFile) and (ThreadItem.Count > ThreadItem.Kokomade) then
+                if (ThreadItem.IsLogFile) and (ThreadItem.UnRead) then
+                    Inc(UnRead);
+            end;
                end;
 
                if UnRead <> Board.UnRead then
@@ -630,6 +644,7 @@ begin
                        else
                                ThreadItem := TThreadItem.Create(
                                        nil, Get2chBoard2ThreadURL( Board, ChangeFileExt( FileList[i], '' ) ) );
+
             ThreadItem.BeginUpdate;
             ThreadItem.FilePath := FileName;
                        ThreadItem.No := Board.Count + 1;
@@ -1417,7 +1432,7 @@ var
        wkIdx: array[0..9] of Integer;
        url: string;
        href: string;
-       i: Integer;
+       i, b: Integer;
        idx: Integer;
        anchorLen : Integer;
 begin
@@ -1462,11 +1477,15 @@ begin
 
                s := Copy(s, idx, length(s));
 
-               for i := 0 to Length(s) do begin
-                       idx := AnsiPos(s[i + 1], URL_CHAR);
-                       if (idx = 0) or (i = (Length(s))) then begin
+               b := Length( s ) + 1;
+               for i := 1 to b do begin
+                       if i = b then
+       idx := 0
+      else
+                               idx := AnsiPos(s[i], URL_CHAR);
+                       if idx = 0 then begin
                                //URL\82\82á\82È\82¢\95\8e\9a\94­\8c©\81I\82Æ\82©\81A\95\8e\9a\82ª\82È\82­\82È\82Á\82½\81B
-                               url := Copy(s, 0, i);
+                               url := Copy(s, 0, i - 1);
 
                                if AnsiPos('ttp://', url) = 1 then
                                        href := 'h' + url
@@ -1479,7 +1498,7 @@ begin
                                else
                                        href := url;
                                Result := Result + '<a href="' + href + '" target="_blank">' + url + '</a>';
-                               s := Copy(s, i + 1, Length(s));
+                               s := Copy(s, i, MaxInt);
                                Break;
                        end;
                end;
@@ -3190,153 +3209,154 @@ begin
 end;
 
 (*************************************************************************
+ *\8b@\94\\96¼\81@\81@\81F\83{\81[\83h\83t\83@\83C\83\8b\97ñ\8b\93
+ *\89Â\8e\8b\81@\81@\81@\81FPublic
+ *************************************************************************)
+procedure TGikoSys.ListBoardFile;
+var
+       boardFileList   : TStringList;
+       i, l                                    : Integer;
+begin
+
+  // BBS \82Ì\8aJ\95ú
+  try
+    for i := 0 to Length( BBSs ) - 1 do
+      BBSs[ i ].Free;
+  except
+  end;
+  SetLength( BBSs, 0 );
+
+  l := 0;
+  // \94Â\83\8a\83X\83g\82Ì\97ñ\8b\93
+  if FileExists( GikoSys.GetBoardFileName ) then begin
+    SetLength( BBSs, l + 1 );
+    BBSs[ l ]                          := TBBS.Create( GikoSys.GetBoardFileName );
+    BBSs[ l ].Title    := '\82Q\82¿\82á\82ñ\82Ë\82é';
+               Inc( l );
+  end;
+
+  if FileExists( GikoSys.GetCustomBoardFileName ) then begin
+    SetLength( BBSs, l + 1 );
+    BBSs[ l ]                          := TBBS.Create( GikoSys.GetCustomBoardFileName );
+    BBSs[ l ].Title    := '\82»\82Ì\91¼';
+               Inc( l );
+  end;
+
+  // Board \83t\83H\83\8b\83_
+  if DirectoryExists( GikoSys.Setting.GetBoardDir ) then begin
+    BoardFileList := TStringList.Create;
+    try
+      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 ] );
+        BBSs[ l ].Title        := ChangeFileExt( ExtractFileName( BoardFileList[ i ] ), '' );
+
+        Inc( l );
+      end;
+    finally
+      BoardFileList.Free;
+    end;
+  end;
+
+end;
+
+(*************************************************************************
  *\8b@\94\\96¼\81@\81@\81F\83{\81[\83h\83t\83@\83C\83\8b\93Ç\82Ý\8d\9e\82Ý
  *\89Â\8e\8b\81@\81@\81@\81FPublic
- *\97\9a\97ð\82P\81@\81@\81F\90V\8bK\8dì\90¬
  *************************************************************************)
-procedure TGikoSys.ReadBoardFile;
+procedure TGikoSys.ReadBoardFile( bbs : TBBS );
 var
-       idx: Integer;
-       ini: TMemIniFile;
-       CategoryList: TStringList;
-       BoardList: TStringList;
-       Category: TCategory;
-       Board: TBoard;
-       inistr: string;
-       RoundItem: TRoundItem;
+       idx                                             : Integer;
+       ini                                             : TMemIniFile;
 
-       // BBS \94z\97ñ(1 \83{\81[\83h\83t\83@\83C\83\8b\82É\82Â\82« 1 \8d\80\96Ú)
-       bbsList                         : array of TStringList;
-       boardFileList   : TStringList;
+       boardFile                       : TStringList;
+       CategoryList    : TStringList;
+       BoardList                       : TStringList;
+       Category                        : TCategory;
+       Board                                   : TBoard;
+       inistr                          : string;
+       RoundItem                       : TRoundItem;
 
        i, iBound                       : Integer;
        j, jBound                       : Integer;
        k, kBound                       : Integer;
-       l, lBound                       : Integer;
 begin
-       ini := TMemIniFile.Create('');
-       try
-               // BBS \82Ì\8aJ\95ú
-               try
-                       for i := 0 to Length( BBSs ) - 1 do
-                               BBSs[ i ].Free;
-               except
-               end;
-               SetLength( BBSs, 0 );
-
-               // \94Â\83\8a\83X\83g\82Ì\97ñ\8b\93
-               if FileExists( GikoSys.GetBoardFileName ) then begin
-                       l                                                               := Length( bbsList );
-                       SetLength( bbsList, l + 1 );
-                       bbsList[ l ]            := TStringList.Create;
-                       bbsList[ l ].LoadFromFile( GikoSys.GetBoardFileName );
-
-                       SetLength( BBSs, l + 1 );
-                       BBSs[ l ]                               := TBBS.Create( GikoSys.Setting.LogFolder );
-                       BBSs[ l ].Title := '\82Q\82¿\82á\82ñ\82Ë\82é';
-               end;
-
-               if FileExists( GikoSys.GetCustomBoardFileName ) then begin
-                       l                                                               := Length( bbsList );
-                       SetLength( bbsList, l + 1 );
-                       bbsList[ l ]            := TStringList.Create;
-                       bbsList[ l ].LoadFromFile( GikoSys.GetCustomBoardFileName );
-
-                       SetLength( BBSs, l + 1 );
-                       BBSs[ l ]                               := TBBS.Create( GikoSys.Setting.LogFolder );
-                       BBSs[ l ].Title := '\82»\82Ì\91¼';
-               end;
 
-               // Board \83t\83H\83\8b\83_
-               if DirectoryExists( GikoSys.Setting.GetBoardDir ) then begin
-                       BoardFileList := TStringList.Create;
-                       try
-                               GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True );
-                               l := Length( bbsList );
-                               for i := BoardFileList.Count - 1 downto 0 do begin
-                                       SetLength( bbsList, l + 1 );
-                                       bbsList[ l ]            := TStringList.Create;
-                                       bbsList[ l ].LoadFromFile( BoardFileList[ i ] );
-
-                                       SetLength( BBSs, l + 1 );
-                                       BBSs[ l ]                               := TBBS.Create( GikoSys.Setting.LogFolder );
-                                       BBSs[ l ].Title := ChangeFileExt( ExtractFileName( BoardFileList[ i ] ), '' );
-
-                                       Inc( l );
-                               end;
-                       finally
-                               BoardFileList.Free;
-                       end;
-               end;
-
-               lBound := Length( bbsList ) - 1;
-               for l := 0 to lBound do begin
-                       ini.SetStrings( bbsList[ l ] );
-                       CategoryList    := TStringList.Create;
-                       BoardList                       := TStringList.Create;
-                       try
-                               ini.ReadSections( CategoryList );
-
-                               iBound := CategoryList.Count - 1;
-                               for i := 0 to iBound do begin
-                                       ini.ReadSection( CategoryList[i], BoardList );
-                                       Category                                := TCategory.Create;
-                                       Category.No                     := i + 1;
-                                       Category.Title  := CategoryList[i];
-
-                                       jBound := BoardList.Count - 1;
-                                       for j := 0 to jBound do begin
-                                               Board := nil;
-                                               inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
-
-                                               //===== \83v\83\89\83O\83C\83\93
-                                               try
-                                                       kBound := Length( BoardPlugIns ) - 1;
-                                                       for k := 0 to kBound do begin
-                                                               if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin
-                                                                       if BoardPlugIns[ k ].AcceptURL( inistr ) = atBoard then begin
-                                                                               Board := TBoard.Create( BoardPlugIns[ k ], inistr );
-
-                                                                               Break;
-                                                                       end;
-                                                               end;
-                                                       end;
-                                               except
-                                                       // exception \82ª\94­\90\82µ\82½\8fê\8d\87\82Í\93à\95\94\8f\88\97\9d\82É\94C\82¹\82½\82¢\82Ì\82Å\82±\82±\82Å\82Í\89½\82à\82µ\82È\82¢
-                                               end;
+  if not FileExists( bbs.FilePath ) then
+    Exit;
+
+       bbs.Clear;
+  ini := TMemIniFile.Create('');
+  boardFile := TStringList.Create;
+  try
+    boardFile.LoadFromFile( bbs.FilePath );
+
+    ini.SetStrings( boardFile );
+    CategoryList       := TStringList.Create;
+    BoardList                  := TStringList.Create;
+    try
+      ini.ReadSections( CategoryList );
+
+      iBound := CategoryList.Count - 1;
+      for i := 0 to iBound do begin
+        ini.ReadSection( CategoryList[i], BoardList );
+        Category                               := TCategory.Create;
+        Category.No                    := i + 1;
+        Category.Title := CategoryList[i];
+
+        jBound := BoardList.Count - 1;
+        for j := 0 to jBound do begin
+          Board := nil;
+          inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
+
+          //===== \83v\83\89\83O\83C\83\93
+          try
+            kBound := Length( BoardPlugIns ) - 1;
+            for k := 0 to kBound do begin
+              if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin
+                if BoardPlugIns[ k ].AcceptURL( inistr ) = atBoard then begin
+                  Board := TBoard.Create( BoardPlugIns[ k ], inistr );
+
+                  Break;
+                end;
+              end;
+            end;
+          except
+            // exception \82ª\94­\90\82µ\82½\8fê\8d\87\82Í\93à\95\94\8f\88\97\9d\82É\94C\82¹\82½\82¢\82Ì\82Å\82±\82±\82Å\82Í\89½\82à\82µ\82È\82¢
+          end;
+
+          if Board = nil then
+            Board := TBoard.Create( nil, inistr );
+          Board.BeginUpdate;
+          Board.No := j + 1;
+          Board.Title := BoardList[j];
+          Board.RoundDate := ZERO_DATE;
+
+          idx := RoundList.Find(Board);
+          if idx <> -1 then begin
+            RoundItem                          := RoundList.Items[idx, grtBoard];
+            Board.Round                        := True;
+            Board.RoundName    := RoundItem.RoundName;
+          end;
+
+          Category.Add(Board);
+          Board.LoadSettings;
+          Board.EndUpdate;
+        end;
 
-                                               if Board = nil then
-                                                       Board := TBoard.Create( nil, inistr );
-                                               Board.BeginUpdate;
-                                               Board.No := j + 1;
-                                               Board.Title := BoardList[j];
-                                               Board.RoundDate := ZERO_DATE;
-
-                                               idx := RoundList.Find(Board);
-                                               if idx <> -1 then begin
-                                                       RoundItem                               := RoundList.Items[idx, grtBoard];
-                                                       Board.Round                     := True;
-                                                       Board.RoundName := RoundItem.RoundName;
-                                               end;
-                        
-                                               Category.Add(Board);
-                                               Board.LoadSettings;
-                                               Board.EndUpdate;
-                                       end;
+        bbs.Add( Category );
+      end;
+                       bbs.IsBoardFileRead := True;
+    finally
+      BoardList.Free;
+      CategoryList.Free;
+    end;
+  finally
+    boardFile.Free;
+    ini.Free;
+  end;
 
-                                       BBSs[ l ].Add( Category );
-                               end;
-                       finally
-                               BoardList.Free;
-                               CategoryList.Free;
-                       end;
-               end;
-       finally
-               ini.Free;
-               lBound := Length( bbsList ) - 1;
-               for l := 0 to lBound do
-                       bbsList[ l ].Free;
-       end;
 end;
 
 function       TGikoSys.GetUnknownCategory : TCategory;
@@ -3378,7 +3398,28 @@ begin
        end;
 
 end;
-
+function TGikoSys.GetSambaFileName : string;
+begin
+       Result := Setting.GetSambaFileName;
+end;
+procedure TGikoSys.SambaFileExists();
+var
+       sambaTmp: string;
+    sambaStrList: TStringList;
+begin
+    if not FileExists(GikoSys.GetSambaFileName) then begin
+       sambaTmp := ChangeFileExt(GikoSys.GetSambaFileName, '.default');
+        sambaStrList := TStringList.Create;
+        try
+            if FileExists(sambaTmp) then begin
+                       sambaStrList.LoadFromFile(sambaTmp);
+                sambaStrList.SaveToFile(GikoSys.GetSambaFileName);
+            end;
+        finally
+               sambaStrList.Free;
+        end;
+    end;
+end;
 
 initialization
        GikoSys := TGikoSys.Create;