OSDN Git Service

This commit was manufactured by cvs2svn to create branch 'Bb62'.
[gikonavigoeson/gikonavi.git] / BoardGroup.pas
index 095f7f6..752daa0 100644 (file)
@@ -104,7 +104,6 @@ type
                FURL: string;                                                                   //\83{\81[\83hURL
                FRound: Boolean;                                                        //\83X\83\8c\83b\83h\88ê\97\97\8f\84\89ñ\97\\96ñ
                FRoundName: string;                                             //\8f\84\89ñ\96¼
-               //FRoundName: PChar;                                            //\8f\84\89ñ\96¼
                FRoundDate: TDateTime;                          //\83X\83\8c\83b\83h\88ê\97\97\82ð\8eæ\93¾\82µ\82½\93ú\8e\9e\81i\8f\84\89ñ\93ú\8e\9e\81j
                FLastModified: TDateTime;                       //\83X\83\8c\83b\83h\88ê\97\97\82ª\8dX\90V\82³\82ê\82Ä\82¢\82é\93ú\8e\9e\81i\83T\81[\83o\91¤\93ú\8e\9e\81j
                FLastGetTime: TDateTime;                        //\83X\83\8c\83b\83h\82Ü\82½\82Í\83X\83\8c\83b\83h\88ê\97\97\82ð\8dÅ\8cã\82É\8dX\90V\82µ\82½\93ú\8e\9e\81i\83T\81[\83o\91¤\93ú\8e\9e\81E\8f\91\82«\8d\9e\82Ý\8e\9e\82É\8eg\97p\82·\82é\81j
@@ -280,7 +279,7 @@ type
        public
                constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; inURL : string ); overload;
                constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard;
-                                        inURL : string; inExist: Boolean; const inFilename: string ); overload;
+                                        const inURL : string; inExist: Boolean; const inFilename: string ); overload;
 
                destructor Destroy; override;
 
@@ -335,6 +334,12 @@ type
         property       BoardPlugIn     : TBoardPlugIn  read FBoardPlugIn write FBoardPlugIn;
     end;
 
+    // \93Á\8eê\97p\93r\97pTBoard
+    TSpecialBoard = class(TBoard)
+    public
+        function Add(item: TThreadItem): integer; overload;
+        procedure Clear; overload;
+    end;
 
        function        BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
        function        BBSsFindBoardFromURL( inURL : string ) : TBoard;
@@ -342,9 +347,13 @@ type
        function        BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
        function        ConvertDateTimeString( inDateTimeString : string) : TDateTime;
 
+    procedure    DestorySpecialBBS( inBBS : TBBS );
+
 var
        BBSs            : array of TBBS;
     BoardGroups : array of TBoardGroup;
+    SpecialBBS  : TBBS;
+    SpecialBoard: TSpecialBoard;
 
 implementation
 
@@ -530,6 +539,28 @@ begin
        end;
 
 end;
+{!
+\brief \93Á\8eê\97p\93rBBS\8dí\8f\9c
+\param bbs \8dí\8f\9c\82·\82é\93Á\8eê\97p\93rBBS
+}
+procedure DestorySpecialBBS( inBBS : TBBS );
+var
+    sCategory : TCategory;
+    sBoard    : TSpecialBoard;
+begin
+    if inBBS <> nil then begin
+        sCategory := inBBS.Items[0];
+        if sCategory <> nil then begin
+            sBoard := TSpecialBoard(sCategory.Items[0]);
+            if sBoard <> nil then begin
+                sBoard.Modified := False;
+                sBoard.Clear;
+                FreeAndNil(sBoard);
+            end;
+        end;
+        FreeAndNil(inBBS);
+    end;
+end;
 
 (*************************************************************************
  *\8b@\94\\96¼\81FTBBS\83R\83\93\83X\83g\83\89\83N\83^
@@ -1543,7 +1574,7 @@ end;
 constructor TThreadItem.Create(
        const inPlugIn : TBoardPlugIn;
        const inBoard : TBoard;
-       inURL : string;
+       const inURL : string;
        inExist: Boolean;
        const inFilename: string
 );
@@ -1558,7 +1589,7 @@ begin
                // dat \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
                FileName        := inFilename;
                IsLogFile       := inExist;
-               URL                             := GikoSys.Get2chBrowsableThreadURL( inURL );
+        URL                            := inURL;
        end else begin
                // \83v\83\89\83O\83C\83\93\82É TThreadItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
                inPlugIn.CreateThreadItem( DWORD( Self ) );
@@ -1778,9 +1809,6 @@ begin
 end;
 
 function TThreadItem.GetCreateDate: TDateTime;
-var
-       unixtime: Int64;
-    tmp: string;
 begin
        // \83t\83@\83C\83\8b\96¼\82©\82ç\83X\83\8c\8dì\90¬\93ú\8e\9e\82ð\8b\81\82ß\82é
        try
@@ -1788,18 +1816,7 @@ begin
             Result := ZERO_DATE
         else begin
             // \83\8d\83O\83t\83@\83C\83\8b\82Ì\8ag\92£\8eq\82ð\82Í\82¸\82µ\82½\82à\82Ì\82ª\83X\83\8c\8dì\90¬\93ú\8e\9e
-                       tmp := ChangeFileExt(FFileName, '');
-                       if AnsiPos('_', tmp) <> 0 then
-                               if AnsiPos('_', tmp) > 9 then
-                                       tmp := Copy(tmp, 1, AnsiPos('_', tmp)-1)
-                               else
-                                       Delete(tmp, AnsiPos('_', tmp), 1);
-
-                       if ( Length(tmp) = 9) and ( tmp[1] = '0' ) then
-                               Insert('1', tmp, 1);
-
-                       unixtime := StrToInt64Def(tmp, ZERO_DATE);
-                       Result := UnixToDateTime(unixtime) + OffsetFromUTC;
+            Result := GikoSys.GetCreateDateFromName(FFileName);
                        if GikoSys.Setting.FutureThread then begin
                        if CompareDateTime(Result, Now) = 1 then
                        Result := ZERO_DATE;
@@ -1845,6 +1862,19 @@ begin
 
 end;
 
+function TSpecialBoard.Add(item: TThreadItem): integer;
+begin
+    Result := inherited AddObject(Item.URL, Item);
+end;
+
+procedure TSpecialBoard.Clear;
+var
+       i: integer;
+begin
+    for i := Count - 1 downto 0 do
+               DeleteList(i);
+    Capacity := 0;
+end;
 
 end.