Changeset 50 for trunk/Target


Ignore:
Timestamp:
Jul 13, 2012, 1:37:51 PM (12 years ago)
Author:
chronos
Message:
  • Added: Dialog for setting target options.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTarget.pas

    r48 r50  
    257257    OpenKey(Key + '\Compiler', True);
    258258    for I := 0 to Count - 1 do
    259     with TTarget(Items[I]) do
    260       if ValueExists(Name) then CompilerPath := ReadString(Name);
     259      TTarget(Items[I]).LoadFromRegistry(Root, Key + '\Compiler');
    261260  finally
    262261    Free;
     
    274273    for I := 0 to Count - 1 do
    275274    with TTarget(Items[I]) do
    276       if CompilerPath <> '' then WriteString(Name, CompilerPath)
    277         else DeleteValue(Name);
     275      TTarget(Items[I]).SaveToRegistry(Root, Key + '\Compiler');
    278276  finally
    279277    Free;
     
    465463procedure TTarget.LoadFromRegistry(Root: HKEY; Key: string);
    466464begin
    467 
     465  with TRegistryEx.Create do
     466  try
     467    RootKey := Root;
     468    OpenKey(Key + '\' + Name, True);
     469    CompilerPath := ReadStringWithDefault('CompilerPath', CompilerPath);
     470    ExecutorPath := ReadStringWithDefault('ExecutorPath', ExecutorPath);
     471  finally
     472    Free;
     473  end;
    468474end;
    469475
    470476procedure TTarget.SaveToRegistry(Root: HKEY; Key: string);
    471477begin
    472 
     478  with TRegistryEx.Create do
     479  try
     480    RootKey := Root;
     481    OpenKey(Key + '\' + Name, True);
     482    if CompilerPath <> '' then WriteString('CompilerPath', CompilerPath)
     483      else DeleteValue('CompilerPath');
     484    if ExecutorPath <> '' then WriteString('ExecutorPath', ExecutorPath)
     485      else DeleteValue('ExecutorPath');
     486  finally
     487    Free;
     488  end;
    473489end;
    474490
Note: See TracChangeset for help on using the changeset viewer.