Changeset 5


Ignore:
Timestamp:
May 1, 2014, 11:31:03 PM (11 years ago)
Author:
chronos
Message:
  • Added: Compare form to show differences between two linux versions.
  • Added: Faster binary search through TConfigMenu tree.
  • Added: Some actions icons.
Location:
trunk
Files:
8 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LinuxBuilder.lpi

    r4 r5  
    3333      </Item1>
    3434    </RequiredPackages>
    35     <Units Count="5">
     35    <Units Count="6">
    3636      <Unit0>
    3737        <Filename Value="LinuxBuilder.lpr"/>
     
    5656        <IsPartOfProject Value="True"/>
    5757        <ComponentName Value="FormList"/>
     58        <HasResources Value="True"/>
    5859        <ResourceBaseClass Value="Form"/>
    5960        <UnitName Value="UFormList"/>
     
    6364        <IsPartOfProject Value="True"/>
    6465        <ComponentName Value="FormLog"/>
     66        <HasResources Value="True"/>
    6567        <ResourceBaseClass Value="Form"/>
    6668        <UnitName Value="UFormLog"/>
    6769      </Unit4>
     70      <Unit5>
     71        <Filename Value="UFormCompare.pas"/>
     72        <IsPartOfProject Value="True"/>
     73        <ComponentName Value="FormCompare"/>
     74        <HasResources Value="True"/>
     75        <ResourceBaseClass Value="Form"/>
     76        <UnitName Value="UFormCompare"/>
     77      </Unit5>
    6878    </Units>
    6979  </ProjectOptions>
  • trunk/LinuxBuilder.lpr

    r4 r5  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormMain, UKConfig, UFormList, UFormLog
     10  Forms, UFormMain, UKConfig, UFormList, UFormLog, UFormCompare
    1111  { you can add units after this };
    1212
     
    1919  Application.CreateForm(TFormList, FormList);
    2020  Application.CreateForm(TFormLog, FormLog);
     21  Application.CreateForm(TFormCompare, FormCompare);
    2122  Application.Run;
    2223end.
  • trunk/UFormMain.lfm

    r4 r5  
    3232    Top = 535
    3333    Width = 857
    34     Panels = <>
     34    Panels = <   
     35      item
     36        Width = 150
     37      end   
     38      item
     39        Width = 150
     40      end>
     41    SimplePanel = False
    3542  end
    3643  object ToolBar1: TToolBar
     
    7481        Action = AOpenDir
    7582      end
     83      object MenuItem7: TMenuItem
     84        Action = ACompare
     85      end
    7686    end
    7787    object MenuItem2: TMenuItem
     
    94104    object AOpenDir: TAction
    95105      Caption = 'Open directory'
     106      ImageIndex = 1
    96107      OnExecute = AOpenDirExecute
    97108    end
    98109    object AViemSystem: TAction
    99110      Caption = 'System options'
     111      ImageIndex = 0
    100112      OnExecute = AViemSystemExecute
    101113    end
    102114    object AShowList: TAction
    103115      Caption = 'Show list'
     116      ImageIndex = 3
    104117      OnExecute = AShowListExecute
    105118    end
    106119    object AShowLog: TAction
    107120      Caption = 'Show log'
     121      ImageIndex = 4
    108122      OnExecute = AShowLogExecute
     123    end
     124    object ACompare: TAction
     125      Caption = 'Compare with directory'
     126      OnExecute = ACompareExecute
    109127    end
    110128  end
    111129  object ImageList1: TImageList
    112130    left = 281
    113     top = 185
     131    top = 184
     132    Bitmap = {
     133      4C69050000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     134      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     135      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     136      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     137      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     138      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     139      FF00FFFFFF00FFFFFF00FFFFFF000101010001010100000000000000000E0000
     140      004E00000094000000B6000000C8000000C8000000B6000000940000004E0000
     141      000E00000000010101000101010001010100010101010000004F070707B44D4D
     142      4DD8A9A9A9EE7E7E7EF9424242FF424242FF7E7E7EF9A9A9A9EE4D4D4DD80707
     143      07B40000004F01010101010101000101010801010171353535C6CACACAF0FBFB
     144      FBFFA6A6A6FF9B9B9BFF383737FF383737FF383838FFA6A6A6FFFBFBFBFFCACA
     145      CAF0353535C6010101710101010803030348464646BEE9E9E9F9F6F6F6FFF6F6
     146      F6FFBDBDBDFFFFFFFFFF9E9B9BFF413C3CFF4C4646FF5C5C5CFFF6F6F6FFF6F6
     147      F6FFE9E9E9F9464646BE03030348030303A07E7E7ED0F0F0F0FFF0F0F0FFF0F0
     148      F0FF434343FFBAB2B2FF352E2EFF352E2EFF6D5F5FFF434343FFF0F0F0FFF0F0
     149      F0FFF0F0F0FF7E7E7ED0030303A003030341484848B1E2E2E2F7EAEAEAFFEAEA
     150      EAFF646464FF816F6FFF7A6767FF7A6767FF816F6FFF646464FFEAEAEAFFEAEA
     151      EAFFE2E2E2F7484848B103030341030303070404045A3A3A3AA5C6C6C6E6E7E7
     152      E7FFA2A2A2FF645D5DFF9E8484FF9E8484FF645D5DFFA2A2A2FFE7E7E7FFC6C6
     153      C6E63A3A3AA50404045A030303070303030004040401040404390C0C0C805454
     154      54ACAAAAAAD88C8C8CF15E5E5EFE5E5E5EFE8C8C8CF1AAAAAAD8545454AC0C0C
     155      0C800404043904040401030303000303030004040400040404000404040A0404
     156      0435040404650404047B04040488040404880404047B04040465040404350404
     157      040A040404000404040003030300FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     158      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     159      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     160      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     161      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     162      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     163      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     164      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
     165      FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000
     166      0000000000000000000000000000000000000000000000000000000000000000
     167      0000000000000000000000000000000000000000000000000000000000000000
     168      000000000000000000000000000000000000000000FF000000FF000000FF0000
     169      0000000000000000000000000000000000000000000000000000000000000000
     170      0000000000000000000000000000000000FF0000000000000000000000000000
     171      00FF00000000000000FF00000000000000000000000000000000000000000000
     172      0000000000000000000000000000000000000000000000000000000000000000
     173      0000000000FF000000FF0000000000000000000000FF000000FF000000FF0000
     174      0000000000000000000000000000000000000000000000000000000000000000
     175      00FF000000FF000000FF00000000000000FF00FFFFFFFFFFFFFF00FFFFFF0000
     176      00FF000000FF000000FF000000FF000000FF000000FF000000FF000000000000
     177      0000000000000000000000000000000000FFFFFFFFFF00FFFFFFFFFFFFFF00FF
     178      FFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF000000FF000000000000
     179      0000000000000000000000000000000000FF00FFFFFFFFFFFFFF00FFFFFFFFFF
     180      FFFF00FFFFFFFFFFFFFF00FFFFFFFFFFFFFF00FFFFFF000000FF000000000000
     181      0000000000000000000000000000000000FFFFFFFFFF00FFFFFFFFFFFFFF00FF
     182      FFFF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
     183      00FF000000FF000000FF000000FF000000FF00FFFFFFFFFFFFFF00FFFFFF0000
     184      00FF008484FF008484FF008484FF008484FF008484FF008484FF008484FF0084
     185      84FF008484FF000000FF00000000000000FFFFFFFFFF00FFFFFF000000FF0084
     186      84FF008484FF008484FF008484FF008484FF008484FF008484FF008484FF0084
     187      84FF000000FF0000000000000000000000FF00FFFFFF000000FF008484FF0084
     188      84FF008484FF008484FF008484FF008484FF008484FF008484FF008484FF0000
     189      00FF000000000000000000000000000000FF000000FF008484FF008484FF0084
     190      84FF008484FF008484FF008484FF008484FF008484FF008484FF000000FF0000
     191      0000000000000000000000000000000000FF000000FF000000FF000000FF0000
     192      00FF000000FF000000FF000000FF000000FF000000FF000000FF000000000000
     193      0000000000000000000000000000000000000000000000000000000000000000
     194      0000000000000000000000000000000000000000000000000000000000000000
     195      0000000000000000000000000000000000000000000000000000000000000000
     196      0000000000000000000000000000000000000000000000000000000000000000
     197      0000000000000000000000000000000000000000000000000000000000000000
     198      0000000000000000000000000000000000000000000000000000000000000000
     199      0000000000000000000000000000000000000000000000000000000000000000
     200      0000000000000000000000000000000000000000000000000000000000000000
     201      0000000000000000000000000000000000000000000000000000000000000000
     202      0000000000000000000000000000000000000000000000000000000000000000
     203      0000000000000000000000000000000000000000000000000000339966FF0000
     204      00000000000066CC99FF009933FF009933FF009933FF339966FF000000000000
     205      0000000000000000000000000000000000000000000000000000009933FF3399
     206      66FF009933FF009933FF009933FF009933FF009933FF339966FF339966FF0000
     207      0000000000000000000000000000000000000000000000000000009933FF0099
     208      33FF009933FF009933FF66CC99FF000000000000000066CC99FF009933FF66CC
     209      99FF000000000000000000000000000000000000000000000000009933FF0099
     210      33FF009933FF339966FF0000000000000000000000000000000066CC99FF0099
     211      33FF000000000000000000000000000000000000000000000000009933FF0099
     212      33FF009933FF009933FF339966FF000000000000000000000000000000000000
     213      0000000000000000000000000000000000000000000000000000000000000000
     214      0000000000000000000000000000000000000000000000000000000000000000
     215      0000000000000000000000000000000000000000000000000000000000000000
     216      0000000000000000000000000000339966FF009933FF009933FF009933FF0099
     217      33FF000000000000000000000000000000000000000000000000009933FF66CC
     218      99FF00000000000000000000000000000000339966FF009933FF009933FF0099
     219      33FF00000000000000000000000000000000000000000000000066CC99FF0099
     220      33FF66CC99FF000000000000000066CC99FF009933FF009933FF009933FF0099
     221      33FF000000000000000000000000000000000000000000000000000000003399
     222      66FF339966FF009933FF009933FF009933FF009933FF009933FF339966FF0099
     223      33FF000000000000000000000000000000000000000000000000000000000000
     224      0000339966FF009933FF009933FF009933FF66CC99FF00000000000000003399
     225      66FF000000000000000000000000000000000000000000000000000000000000
     226      0000000000000000000000000000000000000000000000000000000000000000
     227      0000000000000000000000000000000000000000000000000000000000000000
     228      0000000000000000000000000000000000000000000000000000000000000000
     229      0000000000000000000000000000A37B48FFA37B48FFA27A47FFA27946FFA178
     230      45FFA07744FFA07643FF9F7542FF9E7441FF9E7340FF9D723FFF9C713EFF9C70
     231      3DFF9B6F3CFF9A6E3BFF9A6D3AFFA37B48FFBEA27FFFBEA17EFFBDA17DFFBDA0
     232      7CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D79FFBA9C78FFB99B78FFB99A
     233      77FFB89A76FFB89975FF996C39FFA27A47FFFFFFFFFFFFFFFFFFFEFEFEFFFEFE
     234      FEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFAF9FFFAFAF9FFFAF9
     235      F8FFF9F9F7FFF9F8F7FF986B37FFA17946FFFFFFFFFF878787FF5D5D5DFFA0A0
     236      A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F8
     237      F7FFF8F8F7FFF8F7F6FF976A36FFA17844FFFEFEFEFF5F5F5FFF949494FF5353
     238      53FFFCFCFBFF7B7B7BFF797979FF757575FF727272FF6E6E6EFF6A6A69FF6666
     239      66FF626262FFF7F7F5FF966935FFA07643FFFEFDFDFF8C8C8CFF525252FFA4A4
     240      A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8F7FFF8F8F6FFF8F7
     241      F6FFF7F7F5FFF7F6F4FF966734FF9F7542FFFDFDFCFFFCFCFCFFFCFCFBFFFBFB
     242      FAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F6
     243      F5FFF7F6F4FFF6F5F4FF956633FF9E7441FFFCFCFCFFB5B5B5FF848484FFBEBD
     244      BDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8F6FFF8F7F5FFF7F6F5FFF7F6
     245      F4FFF6F5F3FFF6F5F3FF946531FF9D7340FFFCFBFBFF818181FFC4C4C4FF8F8F
     246      8FFFFAF9F8FF7B7B7AFF797979FF757574FF727171FF6D6D6DFF696969FF6666
     247      65FF626261FFF5F4F2FF936430FF9D723EFFFBFBFAFF9F9F9EFF7F7F7FFFAEAE
     248      ADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F4
     249      F3FFF5F4F2FFF4F3F1FF92622FFF9C703DFFFAFAF9FFFAF9F9FFF9F9F8FFF9F8
     250      F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5F4FFF6F5F3FFF5F4F3FFF5F4
     251      F2FFF4F3F1FFF4F3F0FF92612EFF9B6F3CFFFAF9F8FFBEBEBDFF929292FFBCBC
     252      BBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5F3FFF5F4F2FFF5F4F2FFF4F3
     253      F1FFF4F2F0FFF3F2F0FF91602DFF9A6E3BFFF9F9F8FF7C7C7CFFC4C4C4FF8787
     254      87FFF7F6F5FF7A7A7AFF787878FF747474FF717170FF6D6D6CFF696968FF6565
     255      65FF616161FFF2F1EFFF905F2BFF996D3AFFF9F8F7FF959594FF878787FF9B9A
     256      9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3F1FFF4F3F1FFF3F2F0FFF3F2
     257      EFFFF2F1EFFFF2F1EEFF8F5E2AFF996C38FFF8F7F6FFF8F7F5FFF7F6F5FFF6F6
     258      F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1
     259      EFFFF2F0EEFFF1F0EDFF8E5D29FF986B37FF976A36FF966935FF966734FF9566
     260      33FF946532FF946531FF936430FF92622FFF92612EFF91602DFF90602CFF905F
     261      2BFF8F5D2AFF8E5C29FF8D5B28FF000000000000000000000000000000000000
     262      0000000000000000000000000000000000000000000000000000000000000000
     263      0000000000000000000000000000000000000000000000A0C44400A0C4FF00A0
     264      C44400A0C4FF00A0C44400A0C4FF00A0C44400A0C4FF00A0C44400A0C4FF00A0
     265      C44400000000000000000000000000000000858A886600A0C4FFC6E8F9FF00A0
     266      C4FFC6E8F9FF00A0C4FFC6E8F9FF00A0C4FFC6E8F9FF00A0C4FFC6E8F9FF00A0
     267      C4FF00000000000000000000000000000000858A88FF00A0C4FF3DB1EBFF00A0
     268      C4FF3DB1EBFF00A0C4FF3DB1EBFF00A0C4FF3DB1EBFF00A0C4FF3DB1EBFF00A0
     269      C4FF02598FFF02598FFF02598F5C00000000858A88FFEBEBEBFF00A0C4FFBCBC
     270      BCFF00A0C4FFB8B8B8FF00A0C4FFB8B8B8FF00A0C4FFB8B8B8FF00A0C4FF0259
     271      8FFFC6EAEEFF71ADCFFF02598FFF00000000858A88FFFFFFFFFFECECECFFECEC
     272      ECFFECECECFFECECECFFECECECFFECECECFFECECECFFD3D3D3FF02598FFFC7EB
     273      EFFF6AACD2FF5583A1FC02598FFF00000000858A88FFFFFFFFFFDBDBDBFFCCCC
     274      CCFFCCCCCCFFCCCCCCFFCCCCCCFFCCCCCCFFB7B7B7FF02598FFFC7EBEFFF6AAC
     275      D2FF5787A4FF02598FFF02598F3300000000858A88FFFFFFFFFFECECECFFECEC
     276      ECFFECECECFFECECECFFECECECFFD3D3D3FF02598FFFC6EAEEFF69AACFFF5683
     277      A0FF02598FFF02598F330000000000000000858A88FFFFFFFFFFDBDBDBFFCCCC
     278      CCFFCCCCCCFFCCCCCCFFB7B7B7FF02598FFFC5E6EDFF68A6CEFF5784A0FF0259
     279      8FFF858A88FF000000000000000100000000858A88FFFFFFFFFFECECECFFECEC
     280      ECFFECECECFFEBEBEBFF02598FFFC4E5EDFF649FC8FF5787A4FF02598FFF7171
     281      71FF858A88FF000000000000000100000000858A88FFFFFFFFFFDBDBDBFFCCCC
     282      CCFFCBCBCBFF757575FF395B70FF8AABC2FF5585A3FF02598FFF8F8F8FFF8686
     283      86FF858A88FF000000010000000000000000858A88FFFFFFFFFFECECECFFECEC
     284      ECFFE9E9E9FF02598FFF26424CFF36576BFF02598FFF9D9D9DFFD6D6D6FFAEAE
     285      AEFF858A88FF000000000000000000000000858A88FFFFFFFFFFDBDBDBFFCBCB
     286      CBFFC4C4C4FF000000FF02598FFF636363FF8C8C8CFFCACACAFFDADADAFFB2B2
     287      B2FF858A88FF000000020000000000000000858A88FFFFFFFFFFECECECFFEBEB
     288      EBFFEAEAEAFFEAEAEAFFE9E9E9FFEBEBEBFFEAEAEAFFEBEBEBFFECECECFFB2B2
     289      B2FF858A88FF000000000000000000000000858A88FFEEEEEEFFB2B2B2FFB2B2
     290      B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFB2B2B2FFB1B1B1FFB2B2B2FFB2B2
     291      B2FF858A88FF000000000000000000000000858A88A3858A88FF858A88FF858A
     292      88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
     293      88FF858A88A30000000000000000
     294    }
    114295  end
    115296end
  • trunk/UFormMain.pas

    r4 r5  
    1414
    1515  TFormMain = class(TForm)
     16    ACompare: TAction;
    1617    AShowList: TAction;
    1718    AShowLog: TAction;
     
    2829    MenuItem5: TMenuItem;
    2930    MenuItem6: TMenuItem;
     31    MenuItem7: TMenuItem;
    3032    StatusBar1: TStatusBar;
    3133    ToolBar1: TToolBar;
     
    3335    ToolButton2: TToolButton;
    3436    TreeView1: TTreeView;
     37    procedure ACompareExecute(Sender: TObject);
    3538    procedure AOpenDirExecute(Sender: TObject);
    3639    procedure AShowListExecute(Sender: TObject);
     
    5457
    5558uses
    56   UFormList, UFormLog;
     59  UFormList, UFormLog, UFormCompare;
    5760
    5861{$R *.lfm}
     
    9093  Config.TopNode.LoadTreeNode(TreeView1.TopItem, Options);
    9194  TreeView1.TopItem.Expanded := True;
     95  StatusBar1.Panels[0].Text := 'Count: ' + IntToStr(Config.TopNode.GetCount);
    9296end;
    9397
     
    99103    Config.LoadFromDir(OutDir, 'x86');
    100104    Reload;
     105  end;
     106end;
     107
     108procedure TFormMain.ACompareExecute(Sender: TObject);
     109var
     110  List1, List2: TStringList;
     111  Missing1, Missing2: TStringList;
     112  Config2: TConfigMenu;
     113begin
     114  try
     115    List1 := TStringList.Create;
     116    List2 := TStringList.Create;
     117    Missing1 := TStringList.Create;
     118    Missing2 := TStringList.Create;
     119    Config2 := TConfigMenu.Create;
     120    Config.TopNode.SaveToList(List1);
     121    Config2.LoadFromDir('/home/chronos/Stažené/linux-3.12.18', 'x86');
     122    Config2.TopNode.SaveToList(List2);
     123    Config.CompareStringLists(List1, List2, Missing1, Missing2);
     124    FormCompare.Memo1.Lines.Assign(Missing1);
     125    FormCompare.Memo2.Lines.Assign(Missing2);
     126    FormCompare.Show;
     127  finally
     128    Config2.Free;
     129    Missing1.Free;
     130    Missing2.Free;
     131    List1.Free;
     132    List2.Free;
    101133  end;
    102134end;
  • trunk/UKConfig.pas

    r4 r5  
    4141    procedure LoadTreeNode(Node: TTreeNode; Options: TLoadTreeOptions = []); virtual;
    4242    procedure LoadStats(List: TStrings); virtual;
     43    procedure GetNodes(List: TStrings); virtual;
    4344    procedure SaveToList(List: TStrings); virtual;
    44     procedure PrepareMoveList(var List: TObjectMoves); virtual;
     45    procedure PrepareMoveList(Lookup: TStringList; var List: TObjectMoves); virtual;
     46    function GetCount: Integer; virtual;
    4547    function GetTopNode: TMenuNode; virtual;
    4648    function FindNode(ID: string): TMenuNode; virtual;
     
    6365    TopNode: TMenuNode;
    6466    BaseDir: string;
     67    procedure PrepareMoveList(var List: TObjectMoves);
     68    procedure CompareStringLists(List1, List2: TStringList; Missing1,
     69      Missing2: TStrings);
    6570    procedure LoadFromDir(Dir: string; Arch: string);
    6671    property OnLog: TOnLogEvent read FOnLog write FOnLog;
     
    133138end;
    134139
     140procedure TMenuNode.GetNodes(List: TStrings);
     141var
     142  I: Integer;
     143begin
     144  if ID <> '' then List.AddObject(ID, Self);
     145  for I := 0 to Items.Count - 1 do
     146  with TMenuNode(Items[I]) do begin
     147    GetNodes(List);
     148  end;
     149end;
     150
    135151procedure TMenuNode.SaveToList(List: TStrings);
    136152var
     
    144160end;
    145161
    146 procedure TMenuNode.PrepareMoveList(var List: TObjectMoves);
     162procedure TMenuNode.PrepareMoveList(Lookup: TStringList; var List: TObjectMoves);
    147163var
    148164  I: Integer;
    149165  Node: TMenuNode;
    150166  NewMove: TObjectMove;
     167  Index: Integer;
    151168begin
    152169  if Depends.Count > 0 then begin
    153     Node := GetTopNode.FindNode(Depends[0]);
     170    Index := Lookup.IndexOf(Depends[0]);
     171    if Index <> -1 then Node := TMenuNode(Lookup.Objects[Index])
     172      else Node := nil;
    154173    if Assigned(Node) and (Parent <> Node) then begin
    155174      NewMove.Source := Self;
     
    160179  end else
    161180  if Condition <> '' then begin
    162     Node := GetTopNode.FindNode(Condition);
     181    Index := Lookup.IndexOf(Condition);
     182    if Index <> -1 then Node := TMenuNode(Lookup.Objects[Index])
     183      else Node := nil;
    163184    if Assigned(Node) and (Parent <> Node) then begin
    164185      NewMove.Source := Self;
     
    171192  while I < Items.Count do
    172193  with TMenuNode(Items[I]) do begin
    173     PrepareMoveList(List);
     194    PrepareMoveList(Lookup, List);
    174195    Inc(I);
     196  end;
     197end;
     198
     199function TMenuNode.GetCount: Integer;
     200var
     201  I: Integer;
     202begin
     203  Result := 1;
     204  for I := 0 to Items.Count - 1 do
     205  with TMenuNode(Items[I]) do begin
     206    Result := Result + GetCount;
    175207  end;
    176208end;
     
    460492end;
    461493
     494procedure TConfigMenu.PrepareMoveList(var List: TObjectMoves);
     495var
     496  Lookup: TStringList;
     497begin
     498  try
     499    Lookup := TStringList.Create;
     500    Lookup.OwnsObjects := False;
     501    TopNode.GetNodes(Lookup);
     502    Lookup.Sorted := True;
     503    TopNode.PrepareMoveList(Lookup, List);
     504  finally
     505    Lookup.Free;
     506  end;
     507end;
     508
     509procedure TConfigMenu.CompareStringLists(List1, List2: TStringList;
     510  Missing1, Missing2: TStrings);
     511var
     512  I: Integer;
     513  J: Integer;
     514begin
     515  List1.Sort;
     516  List2.Sort;
     517  I := 0;
     518  J := 0;
     519  while (I < List1.Count) and (J < List2.Count) do
     520  begin
     521    if List1[I] < List2[J] then
     522    begin
     523      Missing2.Add(List1[I]);
     524      Inc(I);
     525    end
     526    else if List1[I] > List2[J] then
     527    begin
     528      Missing1.Add(List2[J]);
     529      Inc(J);
     530    end
     531    else
     532    begin
     533      Inc(I);
     534      Inc(J);
     535    end;
     536  end;
     537  for I := I to List1.Count - 1 do
     538    Missing2.Add(List1[I]);
     539  for J := J to List2.Count - 1 do
     540    Missing1.Add(List2[J]);
     541end;
     542
    462543procedure TConfigMenu.LoadFromDir(Dir: string; Arch: string);
    463544var
     
    473554  ParseFile(BaseDir + DirectorySeparator + 'Kconfig');
    474555
    475   TopNode.PrepareMoveList(Moves);
     556  PrepareMoveList(Moves);
    476557  for I := 0 to Length(Moves) - 1 do
    477558  with Moves[I] do begin
Note: See TracChangeset for help on using the changeset viewer.