OSDN Git Service

・Board ファイルごとに BBS を分けるようになった。
authoryoffy <yoffy>
Sun, 23 Nov 2003 03:27:50 +0000 (03:27 +0000)
committeryoffy <yoffy>
Sun, 23 Nov 2003 03:27:50 +0000 (03:27 +0000)
BoardGroup.pas
Favorite.pas
Giko.pas
GikoSystem.pas
gikoNavi.res

index 1edfba4..a18230a 100644 (file)
@@ -795,9 +795,8 @@ constructor TBoard.Create(
        inURL                   : string
 );
 var
-       foundPos                        : Integer;
        protocol, host, path, document, port, bookmark  : string;
-       BBSID, BBSKey   : string;
+       BBSID                   : string;
 begin
 
        Create;
@@ -808,16 +807,16 @@ begin
 
        // \83v\83\89\83O\83C\83\93\82É TBoardItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
        if inPlugIn = nil then begin
-    // subject.txt \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
-    GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
-    if GikoSys.Is2chHost( host ) then
-      FilePath :=
-        IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
-        BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
-    else
-      FilePath :=
-        IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
-        EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
+               // subject.txt \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
+               GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
+               if GikoSys.Is2chHost( host ) then
+                       FilePath :=
+                               IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                               BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
+               else
+                       FilePath :=
+                               IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                               EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
        end else begin
                inPlugIn.CreateBoardItem( DWORD( Self ) );
        end;
index e028ee4..0f31479 100644 (file)
@@ -262,6 +262,7 @@ begin
                                                        threadItem := TThreadItem.Create(
                                                                board.BoardPlugIn,
                                                                GikoSys.Get2chBoard2ThreadURL( board, ChangeFileExt( Node.Attributes[ 'thread' ], '' ) ) );
+                                                       threadItem.Title := Node.Attributes[ 'title' ];
                                                        board.Add( threadItem );
                                                end;
                                        end else begin
@@ -290,6 +291,8 @@ begin
 
                                                if threadItem = nil then
                                                        threadItem := TThreadItem.Create( nil, url );
+
+                                               threadItem.Title := Node.Attributes[ 'title' ];
                                                board.Add( threadItem );
                                        end;
                                end;
index f56d607..6a172e5 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -2351,8 +2351,6 @@ var
        URL: string;
        ATitle: Boolean;
 
-       wkThread : TThreadItem;
-
        //wkInt: Integer;
        wkIntSt: Integer;
        wkIntTo: Integer;
index 13482a4..081b075 100644 (file)
@@ -2719,8 +2719,6 @@ end;
  *************************************************************************)
 procedure TGikoSys.ReadBoardFile;
 var
-       i, j, k: integer;
-       kbound: Integer;
        idx: Integer;
        ini: TMemIniFile;
        CategoryList: TStringList;
@@ -2729,45 +2727,19 @@ var
        Board: TBoard;
        inistr: string;
        RoundItem: TRoundItem;
-       BBSList: TStringList;
-       CustomList: TStringList;
-       BoardFileList: TStringList;
-
-       plugInBBSs                              : array of TBBS;
-       agent                           : string;
-       major                           : DWORD;
-       minor                           : DWORD;
-       release                 : string;
-       revision                : DWORD;
-       plugInIndex     : Integer;
-       bbs2channel     : TBBS;
-       bbsCustom               : TBBS;
+
+  // 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;
+
+  i, iBound                    : Integer;
+  j, jBound                    : Integer;
+       k, kBound                       : Integer;
+  l, lBound                    : Integer;
 begin
        ini := TMemIniFile.Create('');
-       BBSList := TStringList.Create;
-       CustomList := TStringList.Create;
-       BoardFileList := TStringList.Create;
        try
-               // \94Â\83\8a\83X\83g\82Ì\93Ç\82Ý\8d\9e\82Ý
-
-               // \82Q\82¿\82á\82ñ\82Ë\82é
-               if FileExists(GikoSys.GetBoardFileName) then
-                       BBSList.LoadFromFile(GikoSys.GetBoardFileName);
-               // \83J\83X\83^\83\80
-               if FileExists(GikoSys.GetCustomBoardFileName) then
-                       CustomList.LoadFromFile(GikoSys.GetCustomBoardFileName);
-               BBSList.AddStrings(CustomList);
-               // Board \83t\83H\83\8b\83_
-               if DirectoryExists(GikoSys.Setting.GetBoardDir) then begin
-                       GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True );
-                       for i := BoardFileList.Count - 1 downto 0 do begin
-                               CustomList.Clear;
-                               CustomList.LoadFromFile( BoardFileList[ i ] );
-                               BBSList.AddStrings( CustomList );
-                       end;
-               end;
-               ini.SetStrings(BBSList);
-
+       // BBS \82Ì\8aJ\95ú
                try
                        for i := 0 to Length( BBSs ) - 1 do
                                BBSs[ i ].Free;
@@ -2775,114 +2747,117 @@ begin
                end;
                SetLength( BBSs, 0 );
 
-               // \82Q\82¿\82á\82ñ\82Ë\82é\82ð\90\90¬
-               bbs2channel := TBBS.Create( GikoSys.Setting.LogFolder );
-               bbs2channel.Title := '\82Q\82¿\82á\82ñ\82Ë\82é';
-               i := Length( BBSs );
-               SetLength( BBSs, i + 1 );
-               BBSs[ i ] := bbs2channel;
-
-               // \83J\83X\83^\83\80 BBS \82ð\90\90¬
-               bbsCustom := TBBS.Create( GikoSys.Setting.LogFolder );
-               bbsCustom.Title := '\82»\82Ì\91¼';
-               i := Length( BBSs );
-               SetLength( BBSs, i + 1 );
-               BBSs[ i ] := bbsCustom;
-
-               // \83v\83\89\83O\83C\83\93\97p BBS \82ð\90\90¬
-               try
-                       kbound  := Length( BoardPlugIns );
-                       SetLength( plugInBBSs, kbound );
-                       i := Length( BBSs );
-                       SetLength( BBSs, i + kbound );
-                       Dec( kbound );
-                       for k := 0 to kbound do begin
-                               if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin
-                                       // BBS \96¼\82Ì\91ã\82í\82è\82É\82Æ\82è\82 \82¦\82¸\83v\83\89\83O\83C\83\93\96¼\82ð\93ü\82ê\82Ä\82¨\82­
-                                       // \81¦\8d¡\8cã BBS \96¼\82ð\93ü\82ê\82é\82æ\82¤\82É\89ü\97Ç\82·\82é\82±\82Æ
-                                       BoardPlugIns[ k ].VersionInfo( agent, major, minor, release, revision );
-                                       plugInBBSs[ k ] := TBBS.Create( GikoSys.Setting.LogFolder );
-                                       plugInBBSs[ k ].Title   := agent;
-                                       BBSs[ i + k ] := plugInBBSs[ k ];
-                               end;
-                       end;
-               except
-               end;
+               // \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;
 
-               CategoryList := TStringList.Create;
-               BoardList := TStringList.Create;
-               try
-                       ini.ReadSections(CategoryList);
-                       for i := 0 to CategoryList.Count - 1 do begin
-
-                               ini.ReadSection(CategoryList[i], BoardList);
-                               Category := TCategory.Create;
-                               Category.No := i + 1;
-                               Category.Title := CategoryList[i];
-                               // \82¿\82å\82Á\82Æ\83g\83\8a\83b\83L\81[\82¾\82ª\81A
-                               // plugInIndex >= 0 \81c\81\83v\83\89\83O\83C\83\93\82ð\8eg\97p\81BBoardPlugIns \82Ì\93Y\82¦\8e\9a\82É\82È\82é
-                               // plugInIndex = -1 \81c\81\82Q\82¿\82á\82ñ\82Ë\82é
-                               // other \81c\81\82»\82Ì\91¼
-                               plugInIndex := -99999;
-
-                               for j := 0 to BoardList.Count - 1 do begin
-                                       Board := nil;
-                                       inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
-
-                                       //===== \83v\83\89\83O\83C\83\93
-                                       try
-                                               kbound := High( BoardPlugIns );
-                                               for k := Low( BoardPlugIns ) 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 );
-                                                                       plugInIndex := k;
-
-                                                                       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 begin
-                                               Board := TBoard.Create( nil, inistr );
-                                               if GikoSys.Is2chHost( GikoSys.UrlToServer( inistr ) ) then
-                                                       plugInIndex := -1;
-                                       end;
-                                       Board.BeginUpdate;
-                                       Board.No := j + 1;
-                                       Board.Title := BoardList[j];
-                                       Board.BBSID := GikoSys.UrlToID(inistr);
-                                       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.EndUpdate;
-                               end;
-                               if plugInIndex >= 0 then begin
-                                       plugInBBSs[ plugInIndex ].Add( Category );
-                               end else if plugInIndex = -1 then begin
-                                       bbs2channel.Add( Category );
-                               end else begin
-                                       bbsCustom.Add( Category );
-                               end;
-                       end;
-               finally
-                       BoardList.Free;
-                       CategoryList.Free;
+               // 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      := 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 Board = nil then
+              Board := TBoard.Create( nil, inistr );
+            Board.BeginUpdate;
+            Board.No := j + 1;
+            Board.Title := BoardList[j];
+            Board.BBSID := GikoSys.UrlToID(inistr);
+            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.EndUpdate;
+          end;
+
+          BBSs[ l ].Add( Category );
+        end;
+      finally
+        BoardList.Free;
+        CategoryList.Free;
+      end;
+    end;
        finally
-               BBSList.Free;
-               CustomList.Free;
-               BoardFileList.Free;
                ini.Free;
+    lBound := Length( bbsList ) - 1;
+    for l := 0 to lBound do
+       bbsList[ l ].Free;
        end;
 end;
 
index 1d79ecf..09f2287 100644 (file)
Binary files a/gikoNavi.res and b/gikoNavi.res differ