Changeset 353


Ignore:
Timestamp:
Jun 12, 2009, 8:24:30 AM (16 years ago)
Author:
RBRi
Message:

more logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/ViewStub.pas

    r256 r353  
    5757  Function FindExistingWindow(aCmdLineParameters : TCmdLineParameters) : HWND;
    5858  var
    59     tmpFileItems: TStringList;
    6059    tmpFilenames: TStringList;
    6160    tmpFullFilePath: string;
    6261    i: longint;
    63 
    64     FileWindow: HWND;
     62    tmpFileWindow: HWND;
     63
    6564  begin
    6665    result := NULLHANDLE;
    6766
    68     if aCmdLineParameters.getFileNames(false) = '' then
     67    if aCmdLineParameters.getFileNames(true) = '' then
     68    begin
    6969      // not loading files; nothing to check
    7070      exit;
    71 
    72     tmpFileItems := TStringList.Create;
     71    end;
     72
    7373    tmpFilenames := TStringList.Create;
    7474
    75     StrExtractStrings(tmpFileItems, aCmdLineParameters.getFileNames(false), [HELP_FILE_DELIMITER], #0);
    76     TranslateIPFEnvironmentVars(tmpFileItems, tmpFileNames );
     75    ParseAndExpandFileNames(aCmdLineParameters.getFileNames(true), tmpFilenames);
    7776
    7877    for i := 0 to tmpFileNames.Count - 1 do
    7978    begin
    80       tmpFullFilePath := FindHelpFile( tmpFilenames[ i ] );
     79      LogEvent(LogStartup, 'Search in GlobalFileList for ''' + tmpFilenames[i] + '''');
     80
     81      tmpFullFilePath := FindHelpFile( tmpFilenames[i] );
    8182      if tmpFullFilePath <> '' then
    8283      begin
    83         FileWindow := GlobalFilelist.FindFile(tmpFullFilePath);
    84 
    85         if FileWindow = NULLHANDLE then
     84        tmpFileWindow := GlobalFilelist.FindFile(tmpFullFilePath);
     85
     86        if tmpFileWindow = NULLHANDLE then
    8687        begin
    8788          // not found - stop searching.
     
    9192
    9293        // found it
     94        LogEvent(LogStartup, 'Found in GlobalFileList for ''' + tmpFullFilePath + '''');
    9395
    9496        // is it the same as any previous match?
    9597        if Result <> NULLHANDLE then
    9698        begin
    97           if FileWindow <> Result then
     99          if tmpFileWindow <> Result then
    98100          begin
    99101            // no, so we don't have a match.
     
    107109        begin
    108110          // no match yet - store this one
    109           result := FileWindow;
     111          result := tmpFileWindow;
    110112        end;
    111113      end;
     
    113115
    114116    tmpFilenames.Destroy;
    115     tmpFileItems.Destroy;
    116117  end;
    117118
Note: See TracChangeset for help on using the changeset viewer.