From 3d68fcda88d9e1e14d5e60fea64e9872786182b1 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 8 Mar 2006 01:01:37 +0000 Subject: [PATCH] improved delphi unti conversion to keep lfm files git-svn-id: trunk@8889 - --- converter/delphiproject2laz.pas | 5 ----- converter/delphiunit2laz.pas | 18 +++++++++++++++--- lcl/interfaces/gtk/gtkproc.inc | 6 ++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/converter/delphiproject2laz.pas b/converter/delphiproject2laz.pas index a78b748bf6..947861d69f 100644 --- a/converter/delphiproject2laz.pas +++ b/converter/delphiproject2laz.pas @@ -138,11 +138,6 @@ begin Result:=ExtractOptionsFromDPR(LPRCode,Project1); if Result<>mrOk then exit; - {$IFDEF NewDelphiProjConverter} - DebugLn('ConvertDelphiToLazarusProject DEBUG STOP'); - exit(mrOk); - {$ENDIF} - // find all project files FoundInUnits:=nil; MissingInUnits:=nil; diff --git a/converter/delphiunit2laz.pas b/converter/delphiunit2laz.pas index 40b4cf9823..0f8ccd0f25 100644 --- a/converter/delphiunit2laz.pas +++ b/converter/delphiunit2laz.pas @@ -191,10 +191,22 @@ begin if Result<>mrOK then exit; if RenameDFMFile then begin DFMFilename:=FindDFMFileForDelphiUnit(DelphiFilename); - if DFMFilename<>'' then begin + if (DFMFilename<>'') and (CompareFilenames(DFMFilename,LFMFilename)<>0) then + begin LFMFilename:=ConvertDFMToLFMFilename(DFMFilename,not RenameLowercase); - Result:=RenameFileWithErrorDialogs(DFMFilename,LFMFilename,[mbAbort]); - if Result<>mrOK then exit; + if FileExists(LFMFilename) then begin + if (FileAge(LFMFilename)>=FileAge(DFMFilename)) then begin + // .lfm is not older than .dfm -> keep .lfm + // beware: it could be the same file + end else begin + // .lfm is older than .dfm -> remove .lfm + DeleteFile(LFMFilename); + end; + end; + if not FileExists(LFMFilename) then begin + Result:=RenameFileWithErrorDialogs(DFMFilename,LFMFilename,[mbAbort]); + if Result<>mrOK then exit; + end; end; end; Result:=mrOk; diff --git a/lcl/interfaces/gtk/gtkproc.inc b/lcl/interfaces/gtk/gtkproc.inc index 6964e02a1a..20617caee2 100644 --- a/lcl/interfaces/gtk/gtkproc.inc +++ b/lcl/interfaces/gtk/gtkproc.inc @@ -8129,8 +8129,7 @@ begin GDK_FUNC_MINIMIZE or GDK_FUNC_CLOSE; bsSizeable : Result := GDK_FUNC_RESIZE or GDK_FUNC_MOVE or - GDK_FUNC_MINIMIZE or GDK_FUNC_CLOSE or GDK_FUNC_MAXIMIZE or - GDK_FUNC_RESIZE; + GDK_FUNC_MINIMIZE or GDK_FUNC_CLOSE or GDK_FUNC_MAXIMIZE; bsDialog : Result := GDK_FUNC_RESIZE or GDK_FUNC_CLOSE or GDK_FUNC_MINIMIZE or GDK_FUNC_MOVE; @@ -8139,8 +8138,7 @@ begin GDK_FUNC_MINIMIZE or GDK_FUNC_CLOSE; bsSizeToolWin : Result := GDK_FUNC_RESIZE or GDK_FUNC_MOVE or - GDK_FUNC_MINIMIZE or GDK_FUNC_CLOSE or GDK_FUNC_MAXIMIZE or - GDK_FUNC_RESIZE; + GDK_FUNC_MINIMIZE or GDK_FUNC_CLOSE or GDK_FUNC_MAXIMIZE; end; // X warns if marking a fixed size window resizeable: