Ignore:
Timestamp:
Jan 2, 2007, 8:30:33 PM (19 years ago)
Author:
RBRi
Message:

% command line
% debug output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/MainForm.pas

    r38 r44  
    830830  ACLFileIOUtility,
    831831  ACLUtility,
    832   ACLProfile,
    833832  ACLDialogs,
    834833  ACLString,
    835834  RunProgramUnit,
    836835  StringUtilsUnit,
     836  DebugUnit,
    837837
    838838  // Components
     
    11601160  if SettingFont or StartingUp then
    11611161    exit;
    1162   ProfileEvent( 'SetTopicFont' );
     1162  LogEvent(LogSettings, 'SetTopicFont');
    11631163
    11641164  SettingFont := true;
     
    11711171    Settings.NormalFont := NewFont;
    11721172
    1173   ProfileEvent( 'Saving settings' );
     1173  LogEvent(LogSettings, 'Saving settings');
    11741174
    11751175  SaveSettings;
    1176   ProfileEvent( 'Applying settings' );
     1176  LogEvent(LogSettings, 'Applying settings');
    11771177  ApplySettings;
    11781178
    11791179  SettingFont := false;
    1180   ProfileEvent( 'SetTopicFont done' );
     1180  LogEvent(LogSettings, 'SetTopicFont done');
    11811181End;
    11821182
     
    22632263var
    22642264  i: integer;
    2265   tmpCmdLine: String;
    2266   tmpSplittedCmdLine : TStringList;
    22672265  tmpRc : Integer;
    22682266  tmpWindowPosition : TWindowPosition;
     
    22702268  with InformationForm.InformationMemo do
    22712269  begin
    2272     tmpCmdLine := nativeOS2GetCmdLineParameter;
    2273     tmpSplittedCmdLine := TStringList.Create;
    22742270
    22752271    Lines.Clear;
    2276     Lines.Add(ParameterCountLabel +IntToStr(tmpSplittedCmdLine.count));
    2277     tmpRc := splitCmdLineParameter(tmpCmdLine, tmpSplittedCmdLine);
    2278     for i := 0 to tmpSplittedCmdLine.Count -1 do
    2279       Lines.Add( ' '
    2280                  + IntToStr( i )
    2281                  + ' ['
    2282                  + tmpSplittedCmdLine[i]
    2283                  + ']' );
    2284 
    2285     tmpSplittedCmdLine.Destroy;
    22862272    Lines.Add('');
    22872273    Lines.Add('parsed infos:');
    22882274    Lines.Add('getShowUsageFlag: ' + boolToStr(CmdLineParameters.getShowUsageFlag));
    2289     Lines.Add('getSearchTextFlag: ' + boolToStr(CmdLineParameters.getSearchTextFlag));
     2275    Lines.Add('getSearchFlag: ' + boolToStr(CmdLineParameters.getSearchFlag));
    22902276    Lines.Add('getSearchText: ' + CmdLineParameters.getSearchText);
    2291     Lines.Add('getGlobalSearchTextFlag: ' + boolToStr(CmdLineParameters.getGlobalSearchTextFlag));
    2292     Lines.Add('getGlobalSearchText: ' + CmdLineParameters.getGlobalSearchText);
     2277    Lines.Add('getGlobalSearchFlag: ' + boolToStr(CmdLineParameters.getGlobalSearchFlag));
    22932278    Lines.Add('getLanguage: ' + CmdLineParameters.getLanguage);
    22942279    Lines.Add('getHelpManagerFlag: ' + boolToStr(CmdLineParameters.getHelpManagerFlag));
     
    23062291    Lines.Add('getWindowTitle: ' + CmdLineParameters.getWindowTitle);
    23072292    Lines.Add('getFileNames: ' + CmdLineParameters.getFileNames);
    2308     Lines.Add('getTopics: ' + CmdLineParameters.getTopics);
    2309 
    23102293  end;
    23112294
     
    29182901  FileIndex: longint;
    29192902Begin
    2920   ProfileEvent( 'DisplayTopicInWindow' );
     2903  LogEvent(LogDisplay, 'DisplayTopicInWindow');
    29212904
    29222905  SetWaitCursor;
     
    30203003  Var CanClose: Boolean);
    30213004Begin
    3022   ProfileEvent( '-------- Shutdown ----------' );
     3005  LogEvent(LogShutdown, '-------- Shutdown ----------');
    30233006
    30243007
     
    35153498  S: string;
    35163499begin
    3517   ProfileEvent( 'Load bookmarks for ' + HelpFile.Filename );
     3500  LogEvent(LogSettings, 'Load bookmarks for ' + HelpFile.Filename);
    35183501
    35193502  BookmarksFileName:= ChangeFileExt( HelpFile.FileName, '.bmk' );
     
    35643547  HelpFile: THelpFile;
    35653548begin
    3566   ProfileEvent( 'Save notes' );
     3549  LogEvent(LogSettings, 'Save notes');
    35673550
    35683551  for FileIndex := 0 to CurrentOpenFiles.Count - 1 do
     
    35813564  BookmarkCount: integer;
    35823565begin
    3583   ProfileEvent( 'Save bookmarks for ' + HelpFile.Filename );
     3566  LogEvent(LogSettings, 'Save bookmarks for ' + HelpFile.Filename);
    35843567
    35853568  BookmarksFileName:= ChangeFileExt( HelpFile.FileName, '.bmk' );
     
    36443627Procedure TMainForm.MainFormOnDestroy (Sender: TObject);
    36453628Begin
    3646   ProfileEvent( 'MainFormOnDestroy' );
    3647 
    3648   ProfileEvent( 'Write window position' );
    3649 
     3629  LogEvent(LogShutdown, 'MainFormOnDestroy');
     3630
     3631  LogEvent(LogSettings, 'Write window position');
    36503632  WriteWindowPos( self );
    36513633
    3652   ProfileEvent( 'Update colors' );
     3634  LogEvent(LogSettings, 'Update colors');
    36533635  GetColors;
    36543636
    3655   ProfileEvent( 'Save settings' );
    3656 
     3637  LogEvent(LogSettings, 'Save settings');
    36573638  SaveSettings;
    3658 
    3659   ProfileEvent( '  Done' );
     3639  LogEvent(LogSettings, 'Save settings done');
    36603640
    36613641  // else- don't save position/size if doing own help
     
    36633643  TopicText.Destroy;
    36643644
    3665   ProfileEvent( 'Destroy MRU menu items' );
     3645  LogEvent(LogShutdown, 'Destroy MRU menu items');
    36663646  MRUMenuItems.Destroy;
    36673647
    3668   ProfileEvent( 'Destroy navigate to menu items' );
     3648  LogEvent(LogShutdown, 'Destroy navigate to menu items');
    36693649  NavigateToMenuItems.Destroy;
    36703650
    3671   ProfileEvent( 'Destroy pagehistory' );
     3651  LogEvent(LogShutdown, 'Destroy pagehistory');
    36723652  PageHistory.Destroy;
    36733653
    3674   ProfileEvent( 'Clear/destroy notes' );
     3654  LogEvent(LogShutdown, 'Clear/destroy notes');
    36753655  ClearNotes;
    36763656  Notes.Destroy;
    36773657
    3678   ProfileEvent( 'Clear/destroy bookmarks' );
     3658  LogEvent(LogShutdown, 'Clear/destroy bookmarks');
    36793659  ClearBookmarks;
    36803660  Bookmarks.Destroy;
    36813661
    3682   ProfileEvent( 'Destroy bookmark menu items' );
     3662  LogEvent(LogShutdown, 'Destroy bookmark menu items');
    36833663  BookmarksMenuItems.Destroy;
    36843664
    3685   ProfileEvent( 'Destroy files/index/windows' );
     3665  LogEvent(LogShutdown, 'Destroy files/index/windows');
    36863666  CurrentOpenFiles.Destroy;
    36873667  DisplayedIndex.Destroy;
     
    37023682    g_CurrentLanguageFile.Destroy;
    37033683
    3704   ProfileEvent( 'Close global filelist' );
     3684  LogEvent(LogShutdown, 'Close global filelist');
    37053685  GlobalFilelist.Destroy;
    37063686
    3707   ProfileEvent( 'Close shared memory' );
     3687  LogEvent(LogShutdown, 'Close shared memory');
    37083688  SharedMemory.Destroy;
    37093689
    37103690  AllFilesWordSequences.Destroy;
    37113691
    3712   ProfileEvent( 'MainFormOnDestroy done' );
     3692  LogEvent(LogShutdown, 'MainFormOnDestroy done');
    37133693End;
    37143694
    37153695Procedure TMainForm.MainFormOnSetupShow (Sender: TObject);
    37163696Begin
    3717   ProfileEvent( 'OnSetupShow' );
     3697  LogEvent(LogSettings, 'OnSetupShow');
    37183698  TabSet.TabIndex := 0;
    37193699  Notebook.PageIndex := 0;
     
    38433823var
    38443824  tmpCmdLine: String;
    3845   tmpSplittedCmdLine : TStringList;
    38463825  tmpRc : Integer;
    38473826Begin
    3848   ProfileEvent( 'MainFormOnCreate' );
     3827  LogEvent(LogStartup, 'MainFormOnCreate');
    38493828
    38503829  StartingUp := true;
     
    38583837  // parse parameters into Parameters object
    38593838  tmpCmdLine := nativeOS2GetCmdLineParameter;
    3860   tmpSplittedCmdLine := TStringList.Create;
    3861   tmpRc := splitCmdLineParameter(tmpCmdLine, tmpSplittedCmdLine);
    38623839  CmdLineParameters := TCmdLineParameters.Create;
    3863   CmdLineParameters.parseCmdLine(tmpSplittedCmdLine);
    3864   tmpSplittedCmdLine.destroy;
     3840  CmdLineParameters.parseCmdLine(tmpCmdLine);
     3841
    38653842  RegisterForLanguages( OnLanguageEvent );
    38663843
     
    38853862  ContentsOutline.SmoothScroll := false;
    38863863
    3887   ProfileEvent( 'Choosing default font: Trying WarpSans' );
     3864  LogEvent(LogStartup, 'Choosing default font: Trying WarpSans');
    38883865
    38893866  Font := GetNiceDefaultFont;
     
    38963873  // in TApplication.Run
    38973874
    3898   ProfileEvent( 'Starting NewView: MainFormOnCreate' );
     3875  LogEvent(LogStartup, 'Starting NewView: MainFormOnCreate');
    38993876
    39003877  Application.OnHint := OnHint;
     
    39283905  NavigateToMenuItems := TList.Create;
    39293906
    3930   ProfileEvent( 'Loading settings' );
     3907  LogEvent(LogSettings, 'Loading settings');
    39313908
    39323909  LoadSettings;
     
    39343911
    39353912  // load default strings
    3936   ProfileEvent( 'Loading language' );
     3913  LogEvent(LogSettings, 'Loading language');
    39373914
    39383915  if CmdLineParameters.getLanguage <> '' then
     
    39413918    LoadDefaultLanguage( 'newview' );
    39423919
    3943   ProfileEvent( 'Applying settings' );
    3944 
     3920  LogEvent(LogSettings, 'Applying settings');
    39453921  ApplySettings;
    39463922
    39473923  // default position is centered..
    3948   ProfileEvent( 'Set default position' );
     3924  LogEvent(LogSettings, 'Set default position');
    39493925  if Width > Screen.Width then
    39503926    Width := Screen.Width;
     
    39543930  Bottom := ( Screen.Height - Height ) div 2;
    39553931
    3956   ProfileEvent( 'ReadWindowPos' );
    3957 
     3932  LogEvent(LogSettings, 'ReadWindowPos');
    39583933  ReadWindowPos( Self );
    39593934
    39603935  PositionWindow;
    39613936
    3962   ProfileEvent( 'Creating MRU list' );
     3937  LogEvent(LogSettings, 'Creating MRU list');
    39633938
    39643939  CreateMRUMenuItems;
     
    39663941  CloseFile;
    39673942
    3968   ProfileEvent( 'OnCreate done' );
     3943  LogEvent(LogStartup, 'OnCreate done');
    39693944
    39703945  if CmdLineParameters.getWindowPositionFlag then
     
    39783953  end;
    39793954
    3980   ProfileEvent( 'MainFormOnCreate Done' );
     3955  LogEvent(LogStartup, 'MainFormOnCreate Done');
    39813956End;
    39823957
     
    40754050  EnableCallstackLogging( true );
    40764051
    4077   ProfileEvent( 'MainFormOnShow' );
     4052  LogEvent(LogStartup, 'MainFormOnShow');
    40784053
    40794054  if CmdLineParameters.getOwnerWindow <> NULLHANDLE then
    40804055  begin
    4081     ProfileEvent( 'Setting owner: '
    4082                   + IntToStr( CmdLineParameters.getOwnerWindow ) );
     4056    LogEvent(LogStartup, 'Setting owner: '
     4057                  + IntToStr( CmdLineParameters.getOwnerWindow));
    40834058    WinSetOwner( Frame.Handle,
    40844059                 CmdLineParameters.getOwnerWindow );
     
    40884063  if CmdLineParameters.getHelpManagerFlag then
    40894064  begin
    4090     ProfileEvent( '  Help Manager Title: '
     4065    LogEvent(LogStartup, '  Help Manager Title: '
    40914066                  + StrNPas( pSharedStruct ^. Title,
    40924067                             SHARED_STRUCT_TITLE_SIZE ) );
    40934068    HelpManagerVersion := StrNPas( pSharedStruct ^. Version,
    40944069                                   SHARED_STRUCT_VERSION_SIZE );
    4095     ProfileEvent( '  Help Manager Version: '
    4096                   + HelpManagerVersion );
     4070    LogEvent(LogStartup, '  Help Manager Version: ' + HelpManagerVersion );
    40974071
    40984072  end;
     
    41004074  CoolBar.SetMinConstButtonWidth;
    41014075
    4102   ProfileEvent( 'Post WM_OPENED' );
     4076  LogEvent(LogStartup, 'Post WM_OPENED');
    41034077
    41044078  ResetProgress;
     
    41894163  LoadSupportDLL;
    41904164
    4191   ProfileEvent( 'WMOpened: SetLayout' );
     4165  LogEvent(LogStartup, 'WMOpened: SetLayout');
    41924166
    41934167  if CmdLineParameters.getHelpManagerFlag then
     
    42014175//  ApplySettings;
    42024176
    4203   ProfileEvent( 'Enable controls' );
     4177  LogEvent(LogStartup, 'Enable controls');
    42044178  EnableControls;
    42054179
     
    42074181//  ReadWindowPos( Self );
    42084182
    4209   ProfileEvent( 'Finish paint' );
     4183  LogEvent(LogStartup, 'Finish paint');
    42104184  Update;
    42114185
    42124186  if not CmdLineParameters.getHelpManagerFlag then
    42134187  begin
    4214     ProfileEvent( 'Check environment vars' );
     4188    LogEvent(LogStartup, 'Check environment vars');
    42154189    CheckEnvironmentVars;
    42164190
    42174191    if CmdLineParameters.getShowUsageFlag then
    42184192    begin
    4219       ProfileEvent( 'Showing usage' );
     4193      LogEvent(LogStartup, 'Showing usage');
    42204194      ShowUsage;
    42214195      exit;
     
    42334207    StringToList(cmdLineParameters.getFileNames, Filenames, '+' );
    42344208
    4235     ProfileEvent( 'Call OpenFiles' );
     4209    LogEvent(LogStartup, 'Call OpenFiles');
    42364210
    42374211    OpenFirstTopic := true;
    4238     if    ( CmdLineParameters.getTopics <> '' )
    4239        or CmdLineParameters.getSearchTextFlag then
     4212    if ( CmdLineParameters.getSearchText <> '' )
     4213       or CmdLineParameters.getSearchFlag then
    42404214      // if we're going to search, don't open first topic
    42414215      OpenFirstTopic := false;
     
    42534227    Filenames.Destroy;
    42544228
    4255     if CmdLineParameters.getTopics <> '' then
     4229    if CmdLineParameters.getSearchText <> '' then
    42564230    begin
    42574231      // search in contents only!
    4258       ProfileEvent( 'Do startup topic search' );
    4259 
    4260       StartupTopicSearch( CmdLineParameters.getTopics );
     4232      LogEvent(LogStartup, 'Do startup topic search');
     4233
     4234      StartupTopicSearch( CmdLineParameters.getSearchText );
    42614235    end
    4262     else if CmdLineParameters.getSearchTextFlag then
     4236    else if CmdLineParameters.getSearchFlag then
    42634237    begin
    42644238      // search in specified files
    4265       ProfileEvent( 'Do search for topic' );
     4239      LogEvent(LogStartup, 'Do search for topic');
    42664240      DisplaySearch;
    42674241
     
    42704244  end;
    42714245
    4272   if CmdLineParameters.getGlobalSearchTextFlag then
     4246  if CmdLineParameters.getGlobalSearchFlag then
    42734247  begin
    42744248    // Global search
    4275     ProfileEvent( 'Do global search: ' + CmdLineParameters.getGlobalSearchText );
    4276     DoGlobalSearch( CmdLineParameters.getGlobalSearchText );
     4249    LogEvent(LogStartup, 'Do global search: ' + CmdLineParameters.getSearchText );
     4250    DoGlobalSearch( CmdLineParameters.getSearchText );
    42774251  end;
    42784252
    42794253  if     ( length(CmdLineParameters.getFileNames) = 0 )
    4280      and ( not CmdLineParameters.getGlobalSearchTextFlag ) then
     4254     and ( not CmdLineParameters.getSearchFlag ) then
    42814255  begin
    42824256    // user hasn't requested any particular file
     
    42994273  end;
    43004274
    4301   ProfileEvent( 'Open finished' );
     4275  LogEvent(LogStartup, 'Open finished');
    43024276
    43034277  if CmdLineParameters.getHelpManagerFlag then
     
    43134287  StartingUp := false;
    43144288
    4315   ProfileEvent( 'RUN PROGRAM' );
     4289  LogEvent(LogStartup, 'RUN PROGRAM');
    43164290end;
    43174291
     
    44014375                      - Notebook.Bottom;
    44024376
    4403   ProfileEvent( 'TMainForm.SetLayout' );
    4404   ProfileEvent( '  RealClientHeight: '  + IntToStr( RealClientHeight ) );
    4405 
    4406   ProfileEvent( '  Form Width: '  + IntToStr( Width ) );
    4407   ProfileEvent( '  Form Height: '  + IntToStr( Height ) );
    4408   ProfileEvent( '  Form ClientWidth: '  + IntToStr( ClientWidth ) );
    4409   ProfileEvent( '  Form ClientHeight: '  + IntToStr( ClientHeight ) );
    4410   ProfileEvent( '  CoolBar.Height: '  + IntToStr( CoolBar.Height ) );
    4411   ProfileEvent( '  CoolBar.Bottom: '  + IntToStr( CoolBar.Bottom ) );
     4377  LogEvent(LogStartup, 'TMainForm.SetLayout');
     4378  LogEvent(LogStartup, '  RealClientHeight: '  + IntToStr( RealClientHeight ));
     4379
     4380  LogEvent(LogStartup, '  Form Width: '  + IntToStr( Width ));
     4381  LogEvent(LogStartup, '  Form Height: '  + IntToStr( Height ) );
     4382  LogEvent(LogStartup, '  Form ClientWidth: '  + IntToStr( ClientWidth ) );
     4383  LogEvent(LogStartup, '  Form ClientHeight: '  + IntToStr( ClientHeight ) );
     4384  LogEvent(LogStartup, '  CoolBar.Height: '  + IntToStr( CoolBar.Height ) );
     4385  LogEvent(LogStartup, '  CoolBar.Bottom: '  + IntToStr( CoolBar.Bottom ) );
    44124386
    44134387  if CurrentOpenFiles.Count > 0 then
     
    44494423  DisplayPanel.Width:= ClientWidth - DisplayPanel.Left;
    44504424  DisplayPanel.Height := RealClientHeight;
    4451   ProfileEvent( '  DisplayPanel.Width: '  + IntToStr( DisplayPanel.Width ) );
    4452   ProfileEvent( '  DisplayPanel.Height: '  + IntToStr( DisplayPanel.Height ) );
    4453   ProfileEvent( '  DisplayPanel.Bottom: '  + IntToStr( DisplayPanel.Bottom ) );
     4425  LogEvent(LogStartup, '  DisplayPanel.Width: '  + IntToStr( DisplayPanel.Width ) );
     4426  LogEvent(LogStartup, '  DisplayPanel.Height: '  + IntToStr( DisplayPanel.Height ) );
     4427  LogEvent(LogStartup, '  DisplayPanel.Bottom: '  + IntToStr( DisplayPanel.Bottom ) );
    44544428
    44554429  ProgressBar.Left:= 1;
     
    57775751begin
    57785752  ContentsOutline.BeginUpdate;
    5779   ProfileEvent( 'Load contents outline' );
     5753  LogEvent(LogStartup, 'Load contents outline');
    57805754
    57815755  // we don't clear it first, to allow adding additional files
    57825756  // into the contents tree
    57835757
    5784   ProfileEvent( 'Loop files' );
     5758  LogEvent(LogStartup, 'Loop files');
    57855759
    57865760  FirstNode := nil;
     
    57915765  begin
    57925766    HelpFile := Files[ FileIndex ];
    5793     ProfileEvent( 'File ' + IntToStr( FileIndex ) );
     5767    LogEvent(LogStartup, 'File ' + IntToStr( FileIndex ) );
    57945768    TopicIndex := 0;
    57955769    while TopicIndex < HelpFile.TopicCount do
     
    58265800    end;
    58275801  end;
    5828   ProfileEvent( '  EndUpdate' );
     5802  LogEvent(LogStartup, '  EndUpdate' );
    58295803  ContentsOutline.EndUpdate;
    58305804
    58315805  if Settings.OpenWithExpandedContents then
    58325806  begin
    5833     ProfileEvent( '  Expand all contents' );
     5807    LogEvent(LogStartup, '  Expand all contents' );
    58345808    ContentsOutline.ExpandAll
    58355809  end
    58365810  else if ContentsOutline.ChildCount = 1 then
    58375811  begin
    5838     ProfileEvent( '  Expand first node' );
     5812    LogEvent(LogStartup, '  Expand first node' );
    58395813    // Contents has only one top level node... expand it
    58405814    FirstNode.Expand;
     
    58425816
    58435817  ContentsLoaded := true;
    5844   ProfileEvent( '  Contents loaded' );
     5818  LogEvent(LogStartup, '  Contents loaded' );
    58455819
    58465820end;
     
    58605834
    58615835begin
    5862   ProfileEvent( 'Save notes for ' + HelpFile.Filename );
     5836  LogEvent(LogStartup, 'Save notes for ' + HelpFile.Filename );
    58635837
    58645838  if not HelpFile.NotesLoaded then
     
    58675841    exit;
    58685842
    5869   ProfileEvent( 'Really saving' );
     5843  LogEvent(LogStartup, 'Really saving' );
    58705844
    58715845  NotesFileName := ChangeFileExt( HelpFile.FileName, '.nte' );
     
    59535927
    59545928begin
    5955   ProfileEvent( 'Load notes for ' + HelpFile.Filename );
     5929  LogEvent(LogStartup, 'Load notes for ' + HelpFile.Filename );
    59565930
    59575931  if HelpFile.NotesLoaded then
     
    61196093  StopPrinting;
    61206094
    6121   ProfileEvent( 'Set Caption' );
     6095  LogEvent(LogShutdown, 'Set Caption' );
    61226096  MainTitle := '';
    61236097  SetMainCaption;
    61246098
    6125   ProfileEvent( 'Close Windows' );
     6099  LogEvent(LogShutdown, 'Close Windows' );
    61266100  CloseWindows;
    6127   ProfileEvent( 'Set selected node to nil' );
    6128 
     6101
     6102  LogEvent(LogShutdown, 'Set selected node to nil' );
    61296103  ContentsOutline.SelectedNode:= Nil;
    61306104
    61316105  M1:= MemAvail;
    61326106
    6133   ProfileEvent( 'Clear contents outline' );
    6134 
     6107  LogEvent(LogShutdown, 'Clear contents outline' );
    61356108  ContentsOutline.Clear;
    61366109
    6137   ProfileEvent( 'Free contents: ' + IntToStr( MemAvail - M1 ) );
     6110  LogEvent(LogShutdown, 'Free contents: ' + IntToStr( MemAvail - M1 ) );
    61386111  M1:= MemAvail;
    61396112
    61406113  DisplayedIndex.Clear;
    61416114  IndexListBox.Clear;
    6142   ProfileEvent( 'Clear index ' + IntToStr( MemAvail - M1 ) );
     6115  LogEvent(LogShutdown, 'Clear index ' + IntToStr( MemAvail - M1 ) );
    61436116  M1:= MemAvail;
    61446117
     
    61466119  SearchResultsListBox.Clear;
    61476120
    6148   ProfileEvent( 'Notes, search etc ' + IntToStr( MemAvail - M1 ) );
     6121  LogEvent(LogShutdown, 'Notes, search etc ' + IntToStr( MemAvail - M1 ) );
    61496122  M1:= MemAvail;
    61506123
     
    61596132  ClearAllWordSequences;
    61606133
    6161   ProfileEvent( 'Destroy helpfile objects' );
     6134  LogEvent(LogShutdown, 'Destroy helpfile objects' );
    61626135
    61636136  // Now destroy help files
     
    61726145  CurrentOpenFiles.Clear;
    61736146
    6174   ProfileEvent( 'Destroy helpfiles ' + IntToStr( MemAvail - M1 ) );
     6147  LogEvent(LogShutdown, 'Destroy helpfiles ' + IntToStr( MemAvail - M1 ) );
    61756148  M1 := MemAvail;
    61766149
    6177   ProfileEvent( 'Clear notes' );
     6150  LogEvent(LogShutdown, 'Clear notes' );
    61786151  ClearNotes;
    61796152
    6180   ProfileEvent( 'Clear bookmarks' );
     6153  LogEvent(LogShutdown, 'Clear bookmarks' );
    61816154  ClearBookmarks;
    61826155
    61836156  ClearPageHistory;
    61846157
    6185   ProfileEvent( 'Enable controls' );
     6158  LogEvent(LogShutdown, 'Enable controls' );
    61866159  EnableControls;
    61876160
    6188   ProfileEvent( 'CloseFile done' );
     6161  LogEvent(LogShutdown, 'CloseFile done' );
    61896162
    61906163end;
     
    62416214  i : longint;
    62426215begin
    6243   ProfileEvent( 'Create index' );
     6216  LogEvent(LogStartup, 'Create index' );
    62446217
    62456218  SetWaitCursor;
    62466219
    6247   ProfileEvent( '  Get/sort lists' );
     6220  LogEvent(LogStartup, '  Get/sort lists' );
    62486221
    62496222  ProgressBar.Position := 70;
     
    62946267  ProgressBar.Position := 80;
    62956268
    6296   ProfileEvent( '  Merge lists' );
     6269  LogEvent(LogStartup, '  Merge lists' );
    62976270
    62986271  pLastEntry := NullStr;
     
    63976370
    63986371  ProgressBar.Position := 95;
    6399   ProfileEvent( '  Display index (count = '
     6372  LogEvent(LogStartup, '  Display index (count = '
    64006373                + IntToStr( DisplayedIndex.Count )
    64016374                + ')' );
     
    64046377  IndexListBox.Items.Assign( DisplayedIndex );
    64056378
    6406   ProfileEvent( '  Tidy up' );
     6379  LogEvent(LogStartup, '  Tidy up' );
    64076380
    64086381  IndexLists.Destroy;
     
    64156388
    64166389  SetStatus( 'Index loaded' );
    6417   ProfileEvent( '  Done' );
     6390  LogEvent(LogStartup, '  Done' );
    64186391end;
    64196392
     
    65276500  RequiredFileHandles: LONG;
    65286501begin
    6529   ProfileEvent( 'LoadFiles' );
     6502  LogEvent(LogStartup, 'LoadFiles' );
    65306503
    65316504  LoadingFilenameList := TStringList.Create;
     
    65336506  TranslateIPFEnvironmentVars( FileNames, LoadingFilenameList );
    65346507
    6535   ProfileEvent( 'Finding files' );
     6508  LogEvent(LogStartup, 'Finding files' );
    65366509
    65376510  ProgressBar.Show;
     
    65426515  begin
    65436516    FileName := LoadingFilenameList[ FileIndex ];
    6544     ProfileEvent( '  File: ' + FileName );
     6517    LogEvent(LogStartup, '  File: ' + FileName );
    65456518
    65466519    // Find the help file, if possible
     
    65486521    if FullFilePath <> '' then
    65496522    begin
    6550       ProfileEvent( '    Full path: ' + FullFilePath );
     6523      LogEvent(LogStartup, '    Full path: ' + FullFilePath );
    65516524    end
    65526525    else
    65536526    begin
    6554       ProfileEvent( '    File not found' );
     6527      LogEvent(LogStartup, '    File not found' );
    65556528      FullFilePath := FileName; // we'll complain later.
    65566529    end;
     
    65796552  begin
    65806553    Filename := LoadingFilenameList[ FileIndex ];
    6581     ProfileEvent( '  Loading: ' + Filename );
     6554    LogEvent(LogStartup, '  Loading: ' + Filename );
    65826555    try
    65836556      LoadingFileIndex := FileIndex;
     
    66596632  FileIndex: longint;
    66606633begin
    6661   ProfileEvent( 'DisplayFiles' );
     6634  LogEvent(LogStartup, 'DisplayFiles' );
    66626635  // Now load the various parts of the file(s)
    66636636  // into the user interface
     
    66936666  SetStatus( LoadingStatusDone );
    66946667
    6695   ProfileEvent( 'DisplayFiles Done' );
     6668  LogEvent(LogStartup, 'DisplayFiles Done' );
    66966669
    66976670end;
     
    67046677  FirstContentsNode: TNode;
    67056678begin
    6706   ProfileEvent( 'OpenFiles' );
     6679  LogEvent(LogStartup, 'OpenFiles' );
    67076680
    67086681  if not OKToCloseFile then
     
    67616734  if FirstContentsNode <> nil then
    67626735  begin
    6763     ProfileEvent( '  Select first node' );
     6736    LogEvent(LogStartup, '  Select first node' );
    67646737    ContentsOutline.SelectedNode := FirstContentsNode;
    67656738  end;
     
    67756748  if DisplayFirstTopic then
    67766749  begin
    6777     ProfileEvent( 'Display first topic' );
     6750    LogEvent(LogStartup, 'Display first topic' );
    67786751    DisplaySelectedContentsTopic;
    67796752  end;
    67806753
    6781   ProfileEvent( 'OpenFiles complete' );
     6754  LogEvent(LogStartup, 'OpenFiles complete' );
    67826755end;
    67836756
     
    67886761  FirstNewContentsNode: TNode;
    67896762begin
    6790   ProfileEvent( 'OpenAdditionalFiles' );
     6763  LogEvent(LogStartup, 'OpenAdditionalFiles' );
    67916764
    67926765  if not OKToCloseFile then
     
    68296802    DisplaySelectedContentsTopic;
    68306803
    6831   ProfileEvent( 'OpenAdditionalFiles complete' );
     6804  LogEvent(LogStartup, 'OpenAdditionalFiles complete' );
    68326805end;
    68336806
Note: See TracChangeset for help on using the changeset viewer.