updated filedate, after file on disk check

git-svn-id: trunk@8662 -
This commit is contained in:
mattias 2006-01-30 10:38:28 +00:00
parent 7091bb7446
commit 395c164a81
4 changed files with 54 additions and 52 deletions

View File

@ -64,7 +64,6 @@ type
procedure SetFilename(Value: string); procedure SetFilename(Value: string);
procedure SetScanner(const Value: TLinkScanner); procedure SetScanner(const Value: TLinkScanner);
procedure SetIsDeleted(const NewValue: boolean); procedure SetIsDeleted(const NewValue: boolean);
procedure MakeFileDateValid;
public public
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
@ -85,6 +84,7 @@ type
procedure UnlockAutoDiskRevert; procedure UnlockAutoDiskRevert;
procedure IncrementRefCount; procedure IncrementRefCount;
procedure ReleaseRefCount; procedure ReleaseRefCount;
procedure MakeFileDateValid;
public public
property CodeCache: TCodeCache read FCodeCache write FCodeCache; property CodeCache: TCodeCache read FCodeCache write FCodeCache;
property Filename: string read FFilename write SetFilename; property Filename: string read FFilename write SetFilename;

View File

@ -88,12 +88,12 @@ function ShowDiskDiffsDialog(AnUnitList: TList): TModalResult;
i: Integer; i: Integer;
CurUnit: TUnitInfo; CurUnit: TUnitInfo;
fs: TFileStream; fs: TFileStream;
KeepUnit: Boolean; UnitDidNotChange: Boolean;
s: string; s: string;
begin begin
for i:=AnUnitList.Count-1 downto 0 do begin for i:=AnUnitList.Count-1 downto 0 do begin
CurUnit:=TUnitInfo(AnUnitList[i]); CurUnit:=TUnitInfo(AnUnitList[i]);
KeepUnit:=true; UnitDidNotChange:=false;
try try
fs:=TFileStream.Create(CurUnit.Filename,fmOpenRead); fs:=TFileStream.Create(CurUnit.Filename,fmOpenRead);
try try
@ -102,7 +102,7 @@ function ShowDiskDiffsDialog(AnUnitList: TList): TModalResult;
SetLength(s,fs.Size); SetLength(s,fs.Size);
fs.Read(s[1],length(s)); fs.Read(s[1],length(s));
if s=CurUnit.Source.Source then if s=CurUnit.Source.Source then
KeepUnit:=false; UnitDidNotChange:=true;
end; end;
finally finally
fs.Free; fs.Free;
@ -110,8 +110,10 @@ function ShowDiskDiffsDialog(AnUnitList: TList): TModalResult;
except except
// unable to load // unable to load
end; end;
if not KeepUnit then if UnitDidNotChange then begin
if (CurUnit.Source<>nil) then CurUnit.Source.MakeFileDateValid;
AnUnitList.Delete(i); AnUnitList.Delete(i);
end;
end; end;
end; end;

View File

@ -2,26 +2,26 @@ object NewOtherDialog: TNewOtherDialog
ActiveControl = ItemsTreeView ActiveControl = ItemsTreeView
BorderStyle = bsSizeToolWin BorderStyle = bsSizeToolWin
Caption = 'NewOtherDialog' Caption = 'NewOtherDialog'
ClientHeight = 300 ClientHeight = 296
ClientWidth = 400 ClientWidth = 397
PixelsPerInch = 96 PixelsPerInch = 112
Position = poScreenCenter Position = poScreenCenter
HorzScrollBar.Page = 399 HorzScrollBar.Page = 396
VertScrollBar.Page = 299 VertScrollBar.Page = 295
Left = 481 Left = 481
Height = 300 Height = 296
Top = 362 Top = 362
Width = 400 Width = 397
object ItemsTreeView: TTreeView object ItemsTreeView: TTreeView
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
DefaultItemHeight = 15 DefaultItemHeight = 14
TabOrder = 0 TabOrder = 0
OnClick = ItemsTreeViewClick OnClick = ItemsTreeViewClick
OnDblClick = OkButtonClick OnDblClick = OkButtonClick
OnSelectionChanged = ItemsTreeViewSelectionChanged OnSelectionChanged = ItemsTreeViewSelectionChanged
Left = 6 Left = 6
Height = 250 Height = 246
Top = 6 Top = 6
Width = 178 Width = 178
end end
@ -29,17 +29,17 @@ object NewOtherDialog: TNewOtherDialog
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'DescriptionGroupBox' Caption = 'DescriptionGroupBox'
ClientHeight = 232 ClientHeight = 229
ClientWidth = 200 ClientWidth = 197
TabOrder = 1 TabOrder = 1
AnchorSideLeft.Control = ItemsTreeView AnchorSideLeft.Control = ItemsTreeView
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 190 Left = 190
Height = 250 Height = 246
Top = 6 Top = 6
Width = 204 Width = 201
object DescriptionLabel: TLabel object DescriptionLabel: TLabel
Align = alClient Align = alClient
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -48,9 +48,9 @@ object NewOtherDialog: TNewOtherDialog
ParentColor = False ParentColor = False
WordWrap = True WordWrap = True
Left = 6 Left = 6
Height = 220 Height = 217
Top = 6 Top = 6
Width = 188 Width = 185
end end
end end
object CancelButton: TButton object CancelButton: TButton
@ -62,9 +62,9 @@ object NewOtherDialog: TNewOtherDialog
ModalResult = 2 ModalResult = 2
TabOrder = 2 TabOrder = 2
Left = 306 Left = 306
Height = 29 Height = 26
Top = 265 Top = 264
Width = 88 Width = 85
end end
object OkButton: TButton object OkButton: TButton
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
@ -76,9 +76,9 @@ object NewOtherDialog: TNewOtherDialog
OnClick = OkButtonClick OnClick = OkButtonClick
TabOrder = 3 TabOrder = 3
AnchorSideRight.Control = CancelButton AnchorSideRight.Control = CancelButton
Left = 231 Left = 239
Height = 29 Height = 26
Top = 265 Top = 264
Width = 69 Width = 61
end end
end end

View File

@ -3,29 +3,29 @@
LazarusResources.Add('TNewOtherDialog','FORMDATA',[ LazarusResources.Add('TNewOtherDialog','FORMDATA',[
'TPF0'#15'TNewOtherDialog'#14'NewOtherDialog'#13'ActiveControl'#7#13'ItemsTre' 'TPF0'#15'TNewOtherDialog'#14'NewOtherDialog'#13'ActiveControl'#7#13'ItemsTre'
+'eView'#11'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#14'NewOtherDialog' +'eView'#11'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#14'NewOtherDialog'
+#12'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#13'PixelsPerInch'#2'`'#8'Po' +#12'ClientHeight'#3'('#1#11'ClientWidth'#3#141#1#13'PixelsPerInch'#2'p'#8'Po'
+'sition'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBa' +'sition'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3#140#1#18'VertScrollBa'
+'r.Page'#3'+'#1#4'Left'#3#225#1#6'Height'#3','#1#3'Top'#3'j'#1#5'Width'#3#144 +'r.Page'#3''''#1#4'Left'#3#225#1#6'Height'#3'('#1#3'Top'#3'j'#1#5'Width'#3
+#1#0#9'TTreeView'#13'ItemsTreeView'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBot' +#141#1#0#9'TTreeView'#13'ItemsTreeView'#7'Anchors'#11#5'akTop'#6'akLeft'#8'a'
+'tom'#0#20'BorderSpacing.Around'#2#6#17'DefaultItemHeight'#2#15#8'TabOrder'#2 +'kBottom'#0#20'BorderSpacing.Around'#2#6#17'DefaultItemHeight'#2#14#8'TabOrd'
+#0#7'OnClick'#7#18'ItemsTreeViewClick'#10'OnDblClick'#7#13'OkButtonClick'#18 +'er'#2#0#7'OnClick'#7#18'ItemsTreeViewClick'#10'OnDblClick'#7#13'OkButtonCli'
+'OnSelectionChanged'#7#29'ItemsTreeViewSelectionChanged'#4'Left'#2#6#6'Heigh' +'ck'#18'OnSelectionChanged'#7#29'ItemsTreeViewSelectionChanged'#4'Left'#2#6#6
+'t'#3#250#0#3'Top'#2#6#5'Width'#3#178#0#0#0#9'TGroupBox'#19'DescriptionGroup' +'Height'#3#246#0#3'Top'#2#6#5'Width'#3#178#0#0#0#9'TGroupBox'#19'Description'
+'Box'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpa' +'GroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'Bord'
+'cing.Around'#2#6#7'Caption'#6#19'DescriptionGroupBox'#12'ClientHeight'#3#232 +'erSpacing.Around'#2#6#7'Caption'#6#19'DescriptionGroupBox'#12'ClientHeight'
+#0#11'ClientWidth'#3#200#0#8'TabOrder'#2#1#22'AnchorSideLeft.Control'#7#13'I' +#3#229#0#11'ClientWidth'#3#197#0#8'TabOrder'#2#1#22'AnchorSideLeft.Control'#7
+'temsTreeView'#19'AnchorSideLeft.Side'#7#9'asrBottom'#23'AnchorSideRight.Con' +#13'ItemsTreeView'#19'AnchorSideLeft.Side'#7#9'asrBottom'#23'AnchorSideRight'
+'trol'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#190#0#6 +'.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#190#0
+'Height'#3#250#0#3'Top'#2#6#5'Width'#3#204#0#0#6'TLabel'#16'DescriptionLabel' +#6'Height'#3#246#0#3'Top'#2#6#5'Width'#3#201#0#0#6'TLabel'#16'DescriptionLab'
+#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#7'Caption'#6#16'Descrip' +'el'#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#7'Caption'#6#16'Des'
+'tionLabel'#5'Color'#7#6'clNone'#11'ParentColor'#8#8'WordWrap'#9#4'Left'#2#6 +'criptionLabel'#5'Color'#7#6'clNone'#11'ParentColor'#8#8'WordWrap'#9#4'Left'
+#6'Height'#3#220#0#3'Top'#2#6#5'Width'#3#188#0#0#0#0#7'TButton'#12'CancelBut' +#2#6#6'Height'#3#217#0#3'Top'#2#6#5'Width'#3#185#0#0#0#0#7'TButton'#12'Cance'
+'ton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.' +'lButton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpac'
+'Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'CancelButton' +'ing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'CancelBut'
+#11'ModalResult'#2#2#8'TabOrder'#2#2#4'Left'#3'2'#1#6'Height'#2#29#3'Top'#3#9 +'ton'#11'ModalResult'#2#2#8'TabOrder'#2#2#4'Left'#3'2'#1#6'Height'#2#26#3'To'
+#1#5'Width'#2'X'#0#0#7'TButton'#8'OkButton'#7'Anchors'#11#7'akRight'#8'akBot' +'p'#3#8#1#5'Width'#2'U'#0#0#7'TButton'#8'OkButton'#7'Anchors'#11#7'akRight'#8
+'tom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBor' +'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.Inn'
+'der'#2#2#7'Caption'#6#8'OkButton'#7'Enabled'#8#7'OnClick'#7#13'OkButtonClic' +'erBorder'#2#2#7'Caption'#6#8'OkButton'#7'Enabled'#8#7'OnClick'#7#13'OkButto'
+'k'#8'TabOrder'#2#3#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Left'#3 +'nClick'#8'TabOrder'#2#3#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Le'
+#231#0#6'Height'#2#29#3'Top'#3#9#1#5'Width'#2'E'#0#0#0 +'ft'#3#239#0#6'Height'#2#26#3'Top'#3#8#1#5'Width'#2'='#0#0#0
]); ]);