OSDN Git Service

datファイルのD&Dで、ファイル名チェックで、ファイルパスまで送っていたので、
authorh677 <h677>
Sun, 3 Aug 2008 02:14:04 +0000 (02:14 +0000)
committerh677 <h677>
Sun, 3 Aug 2008 02:14:04 +0000 (02:14 +0000)
エラーになる不具合の修正

Giko.pas

index 5008755..838d263 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -692,6 +692,9 @@ type
         function isValidFile(FileName: String) : boolean;
         //! ListView\82ÌD&D\8eó\82¯\8eæ\82è
         procedure AcceptDropFiles(var Msg: TMsg);
+        //! \83X\83\8c\83b\83h\88ê\97\97\8dX\90V\8f\88\97\9d
+        procedure UpdateListView();
+
        protected
                procedure CreateParams(var Params: TCreateParams); override;
                procedure WndProc(var Message: TMessage); override;
@@ -2581,20 +2584,7 @@ begin
                                end;
                                TreeView.Refresh;
                                //ListView\82Å\82±\82Ì\83X\83\8c\82ª\8aÜ\82Ü\82ê\82é\94Â\82ð\95\\8e¦\82µ\82Ä\82¢\82é\82Æ\82«\82Ì\8dX\90V\8f\88\97\9d
-                               if (ActiveList <> nil) and (ActiveList is TBoard) then begin
-                                       TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
-                                       TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
-                                       TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
-                    //ListView\82Ì\83A\83C\83e\83\80\82Ì\8cÂ\90\94\82à\8dX\90V
-                                       case GikoForm.ViewType of
-                                               gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
-                                               gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
-                                               gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
-                                               gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount;
-                                               gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount;
-                                               gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
-                                       end;
-                               end;
+                UpdateListView();
                                RefreshListView(Item.ThreadItem);
                        end;
 
@@ -6794,8 +6784,6 @@ var
     FOleInPlaceActiveObject: IOleInPlaceActiveObject;
        p : TPoint;
        AID: string;
-       stlist : TStringList;
-    i : Integer;
 begin
        result := true;
     if not Assigned(FActiveContent) then
@@ -7853,7 +7841,6 @@ var
     Board: TBoard;
     LogFolder: String;
     datList: TStringList;
-    p: TPoint;
 begin
     // \95\\8e¦\82µ\82Ä\82¢\82é\82Ì\94Â\82Ì\82Æ\82«\88È\8aO\82Í\8b\91\94Û
     if GetActiveList is TBoard then begin
@@ -7890,10 +7877,12 @@ begin
                 if (datList.Count > 0) then begin
                     GikoSys.AddOutofIndexDat(Board, datList, False);
                     ShowMessage(IntToStr(datList.Count) + '\8cÂ\82Ìdat\83t\83@\83C\83\8b\82ª\83R\83s\81[\82³\82ê\82Ü\82µ\82½\81B' );
-                       if GikoForm.TreeView.Visible then
+                       if GikoForm.TreeView.Visible then begin
                                GikoForm.TreeView.Refresh;
-                           if GikoForm.ListView.Visible then
-                               GikoForm.ListView.Refresh;
+                    end;
+                           if GikoForm.ListView.Visible then begin
+                               UpdateListView();
+                    end;
                 end else begin
                     ShowMessage('\88ê\82Â\82à\83R\83s\81[\82³\82ê\82Ü\82¹\82ñ\82Å\82µ\82½\81B' );
                 end;
@@ -7906,7 +7895,25 @@ begin
         ShowMessage('\94Â\82ð\95\\8e¦\82µ\82Ä\82­\82¾\82³\82¢\81B');
     end;
 end;
-
+procedure TGikoForm.UpdateListView();
+begin
+    //ListView\82Å\82±\82Ì\83X\83\8c\82ª\8aÜ\82Ü\82ê\82é\94Â\82ð\95\\8e¦\82µ\82Ä\82¢\82é\82Æ\82«\82Ì\8dX\90V\8f\88\97\9d
+    if (ActiveList <> nil) and (ActiveList is TBoard) then begin
+        TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
+        TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
+        TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
+        //ListView\82Ì\83A\83C\83e\83\80\82Ì\8cÂ\90\94\82à\8dX\90V
+        case GikoForm.ViewType of
+            gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
+            gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
+            gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
+            gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount;
+            gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount;
+            gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
+        end;
+    end;
+    ListView.Refresh;
+end;
 //! \83t\83@\83C\83\8b\83`\83F\83b\83N
 function TGikoForm.isValidFile(FileName: String) : boolean;
 var
@@ -7923,7 +7930,7 @@ begin
     end 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
         try
-            dt := GikoSys.GetCreateDateFromName(FileName);
+            dt := GikoSys.GetCreateDateFromName(ExtractFileName(FileName));
             if ((UnixToDateTime(ZERO_DATE) + OffsetFromUTC) = dt) then begin
                 Result := False;
                 GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '\82Ì\83t\83@\83C\83\8b\96¼\82ª\95s\90³\82Å\82·\81B', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);