From 29a31e582d238f4a04ede82046e09793762f3fb0 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 12 Aug 2010 16:20:33 +0000 Subject: [PATCH] IDE: read lpi: use default value 0 for MainUnitID even for old lpi git-svn-id: trunk@27082 - --- ide/project.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ide/project.pp b/ide/project.pp index 96e6916433..64a66889cb 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -3086,8 +3086,13 @@ begin MacroValues.LoadFromXMLConfig(xmlconfig,Path+'MacroValues/'); // load properties - if FileVersion<9 then NewMainUnitID:=-1 else NewMainUnitID:=0; - NewMainUnitID := xmlconfig.GetValue(Path+'General/MainUnit/Value', NewMainUnitID); + // Note: in FileVersion<9 the default value was -1 + // Since almost all projects have a MainUnit the value was always saved. + // Changing the default value to 0 avoids the redundancy and + // automatically fixes broken lpi files. + // When opening a new project in an old IDE the MainUnit is set to -1 + // which means the project is not compilable. + NewMainUnitID := xmlconfig.GetValue(Path+'General/MainUnit/Value', 0); AutoCreateForms := xmlconfig.GetValue( Path+'General/AutoCreateForms/Value', true); Title := xmlconfig.GetValue(Path+'General/Title/Value', '');