From e365096d77c3e016c52115e1bf49ea2efe5324f2 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 12 May 2011 21:02:00 +0000 Subject: [PATCH] IDE/LCL: clean up git-svn-id: trunk@30706 - --- ide/idehelpmanager.pas | 20 +++++--------------- ideintf/idehelpintf.pas | 2 ++ lcl/lazhelpintf.pas | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/ide/idehelpmanager.pas b/ide/idehelpmanager.pas index 3c274ce449..e494ba0fd1 100644 --- a/ide/idehelpmanager.pas +++ b/ide/idehelpmanager.pas @@ -57,7 +57,6 @@ type private FKeywordPrefixNode: THelpNode; public - constructor Create(TheOwner: TComponent); override; function GetNodesForKeyword(const HelpKeyword: string; var ListOfNodes: THelpNodeQueryList; var ErrMsg: string ): TShowHelpResult; override; @@ -270,25 +269,18 @@ end; { TSimpleFPCKeywordHelpDatabase } -constructor TSimpleFPCKeywordHelpDatabase.Create(TheOwner: TComponent); -begin - inherited Create(TheOwner); - KeywordPrefix:='FPCKeyword_'; -end; - function TSimpleFPCKeywordHelpDatabase.GetNodesForKeyword( const HelpKeyword: string; var ListOfNodes: THelpNodeQueryList; var ErrMsg: string): TShowHelpResult; var - Path: String; KeyWord: String; begin Result:=shrHelpNotFound; if (csDesigning in ComponentState) then exit; - if (KeywordPrefix<>'') - and (LeftStr(HelpKeyword,length(KeywordPrefix))=KeywordPrefix) then begin + if (FPCKeyWordHelpPrefix<>'') + and (LeftStr(HelpKeyword,length(FPCKeyWordHelpPrefix))=FPCKeyWordHelpPrefix) then begin // HelpKeyword starts with KeywordPrefix - KeyWord:=copy(HelpKeyword,length(KeywordPrefix)+1,length(HelpKeyword)); + KeyWord:=copy(HelpKeyword,length(FPCKeyWordHelpPrefix)+1,length(HelpKeyword)); // test: testfcpkeyword if KeyWord='testfcpkeyword' then begin // this help database knows this keyword @@ -296,9 +288,7 @@ begin // show the user a dialog to choose if FKeywordPrefixNode=nil then FKeywordPrefixNode:=THelpNode.CreateURL(Self,'',''); - Path:=copy(HelpKeyword,length(KeywordPrefix)+1,length(HelpKeyword)); - FKeywordPrefixNode.Title:='Pascal keyword '+Path; - FKeywordPrefixNode.URL:='file://'+Path; + FKeywordPrefixNode.Title:='Pascal keyword '+KeyWord; CreateNodeQueryListAndAdd(FKeywordPrefixNode,nil,ListOfNodes,true); Result:=shrSuccess; end; @@ -315,7 +305,7 @@ begin Result:=shrHelpNotFound; if not (Query is THelpQueryKeyword) then exit; KeywordQuery:=THelpQueryKeyword(Query); - KeyWord:=copy(KeywordQuery.Keyword,length(KeywordPrefix)+1,length(KeywordQuery.Keyword)); + KeyWord:=copy(KeywordQuery.Keyword,length(FPCKeyWordHelpPrefix)+1,length(KeywordQuery.Keyword)); debugln(['TSimpleFPCKeywordHelpDatabase.ShowHelp Keyword=',Keyword]); end; diff --git a/ideintf/idehelpintf.pas b/ideintf/idehelpintf.pas index 07de7c9ccf..7b18c96d6d 100644 --- a/ideintf/idehelpintf.pas +++ b/ideintf/idehelpintf.pas @@ -126,6 +126,8 @@ var // and can be overidden by a package like turbopoweriprodsgn.lpk CreateIDEHTMLProvider: TCreateIDEHTMLProviderEvent = nil;// will be set by the IDE +var + FPCKeyWordHelpPrefix: string = 'FPCKeyword_'; implementation diff --git a/lcl/lazhelpintf.pas b/lcl/lazhelpintf.pas index 243e378e08..69bf12faf8 100644 --- a/lcl/lazhelpintf.pas +++ b/lcl/lazhelpintf.pas @@ -998,7 +998,7 @@ begin if (ListOfPascalHelpContextList=nil) or (ListOfPascalHelpContextList.Count=0) then exit; // add the registered nodes - debugln('THelpDatabase.GetNodesForPascalContexts A ID="',ID,'" ListOfPascalHelpContextList.Count=',dbgs(ListOfPascalHelpContextList.Count)); + //debugln('THelpDatabase.GetNodesForPascalContexts A ID="',ID,'" ListOfPascalHelpContextList.Count=',dbgs(ListOfPascalHelpContextList.Count)); if FSearchItems<>nil then begin // check every pascal context for j:=0 to ListOfPascalHelpContextList.Count-1 do begin