Changeset 390 for Common


Ignore:
Timestamp:
Jul 18, 2012, 4:13:05 PM (12 years ago)
Author:
chronos
Message:
Location:
Common
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • Common/Common.lpk

    r387 r390  
    9191    <RequiredPkgs Count="3">
    9292      <Item1>
    93         <PackageName Value="RegistryPkg"/>
     93        <PackageName Value="GeneralRegistry"/>
     94        <MinVersion Minor="1" Valid="True"/>
    9495      </Item1>
    9596      <Item2>
  • Common/StopWatch.pas

    r358 r390  
    2222    function GetElapsed: string;
    2323  public
    24     constructor Create(const startOnCreate : Boolean = False) ;
     24    constructor Create(const startOnCreate: Boolean = False) ;
    2525    procedure Start;
    2626    procedure Stop;
    27     property IsHighResolution : Boolean read fIsHighResolution;
    28     property ElapsedTicks : TLargeInteger read GetElapsedTicks;
    29     property ElapsedMiliseconds : TLargeInteger read GetElapsedMiliseconds;
    30     property Elapsed : string read GetElapsed;
    31     property IsRunning : Boolean read fIsRunning;
     27    property IsHighResolution: Boolean read fIsHighResolution;
     28    property ElapsedTicks: TLargeInteger read GetElapsedTicks;
     29    property ElapsedMiliseconds: TLargeInteger read GetElapsedMiliseconds;
     30    property Elapsed: string read GetElapsed;
     31    property IsRunning: Boolean read fIsRunning;
    3232  end;
    3333
  • Common/UApplicationInfo.pas

    r387 r390  
    66
    77uses
    8   SysUtils, Registry2, Classes, Forms, URegistry;
     8  SysUtils, Classes, Forms, UGeneralRegistry;
    99
    1010type
     
    7474  FAppName := Application.Name;
    7575  FRegistryKey := '\Software\' + FAppName;
    76   FRegistryRoot := rrKeyCurrentUser;
     76  FRegistryRoot := rrApplicationUser;
    7777end;
    7878
  • Common/ULastOpenedList.pas

    r387 r390  
    66
    77uses
    8   Classes, SysUtils, Registry2, URegistry, Menus;
     8  Classes, SysUtils, UGeneralRegistry, Menus;
    99
    1010type
     
    2323    destructor Destroy; override;
    2424    procedure LoadToMenuItem(MenuItem: TMenuItem; ClickAction: TNotifyEvent);
    25     procedure LoadFromRegistry(Root: HKEY; Key: string);
    26     procedure SaveToRegistry(Root: HKEY; Key: string);
     25    procedure LoadFromRegistry(Root: Integer; const Key: string);
     26    procedure SaveToRegistry(Root: Integer; const Key: string);
    2727    procedure AddItem(FileName: string);
    2828  published
     
    8787end;
    8888
    89 procedure TLastOpenedList.LoadFromRegistry(Root: HKEY; Key: string);
     89procedure TLastOpenedList.LoadFromRegistry(Root: Integer; const Key: string);
    9090var
    9191  I: Integer;
    92   Registry: TRegistryEx;
     92  Registry: TGeneralRegistry;
    9393  FileName: string;
    9494begin
    95   Registry := TRegistryEx.Create;
     95  Registry := TGeneralRegistry.Create(nil);
    9696  with Registry do
    9797  try
    98     RootKey := Root;
     98    CurrentRoot := Root;
    9999    OpenKey(Key, True);
    100100    Items.Clear;
    101101    I := 0;
    102102    while ValueExists('File' + IntToStr(I)) and (I < MaxCount) do begin
    103       FileName := UTF8Encode(ReadStringWithDefault('File' + IntToStr(I), ''));
     103      if ValueExists('File' + IntToStr(I)) then
     104        FileName := UTF8Encode(ReadString('File' + IntToStr(I)))
     105        else FileName := '';
    104106      if Trim(FileName) <> '' then Items.Add(FileName);
    105107      Inc(I);
     
    112114end;
    113115
    114 procedure TLastOpenedList.SaveToRegistry(Root: HKEY; Key: string);
     116procedure TLastOpenedList.SaveToRegistry(Root: Integer; const Key: string);
    115117var
    116118  I: Integer;
    117   Registry: TRegistryEx;
     119  Registry: TGeneralRegistry;
    118120begin
    119   Registry := TRegistryEx.Create;
     121  Registry := TGeneralRegistry.Create(nil);
    120122  with Registry do
    121123  try
    122     RootKey := Root;
     124    CurrentRoot := Root;
    123125    OpenKey(Key, True);
    124126    for I := 0 to Items.Count - 1 do
Note: See TracChangeset for help on using the changeset viewer.