Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search Help and Tools
#10
It will be fixed in next QM version.

To fix it now:

1. In QM, right click System folder, click Folder Properties, uncheck 'read-only', OK.

2. Find function __CHelpIndexer.IndexHelp. It is in \System\Tools\Quick help search\private\create help index.

3. Replace all its text with this:

Member function __CHelpIndexer.IndexHelp
Code:
Copy      Help
;/CHI_index_help
OnScreenDisplay "Creating QM help index..." -1 0 0 0 0 0 8 "osd_indexer"

;int t1=perf

;decompile chm

str dirhh.from(m_dir "\hh")
del- dirhh; err
mkdir dirhh
;str shf.dospath(dirhh) schm.dospath("$qm$\qm2help.chm") cl.format("-decompile %s %s" shf schm) ;;does not work on computers where disabled short path creation
;run "hh.exe" cl "" "" 0x400
cop "$qm$\qm2help.chm" dirhh
SetCurDir dirhh
run "hh.exe" "-decompile . qm2help.chm" "" "" 0x400

;int t2=perf

;index html files

str sp.from(dirhh "\*.html") s ss sss
Dir d; int i
m_curfile=0
foreach(d sp FE_Dir 0xC)
,str sPath=d.FileName(1)
,CHI_FILE& f=m_af_help[]
,f.filename=sPath+dirhh.len+1
,;sel(f.filename 3) case ["*IDP_ACC.*","*CLASS*"] case else continue ;;debug
,;out "---------- %s -----------" f.filename
,s.getfile(sPath)
,;get title
,if(findrx(s "(?s)<title>(.+?)</title>" 0 1 ss 1)>=0) ss.replacerx("\s{2,}" " "); ss.trim
,if(findrx(s "(?s)<h1>(.+?)</h1>" 0 1 f.title 1)>=0) f.title.replacerx("(?s)<.+?>"); f.title.replacerx("\s{2,}" " "); f.title.trim
,if(ss.len and !(ss~f.title)) f.title.from(ss ": " f.title)
,;get words
,;at first index most imortant places to give higher scores
,;title
,ss=f.title
,IndexText(m_mw_help ss 30)
,;h2
,ss.fix(0)
,for(i 0 s.len) i=findrx(s "<h2.*?>(.+?)</h2>" i 1 sss 1); if(i<0) break; else ss.addline(sss)
,IndexText(m_mw_help ss 10 1)
,;contents
,IndexText(m_mw_help s 1 1)
,
,m_curfile+1

;int t3=perf

;save

SaveLoad(1 1)
del- dirhh; err

;int t4=perf
;out "%i %i %i" t2-t1/1000 t3-t2/1000 t4-t3/1000

OsdHide "osd_indexer"

4. Again right click System folder. Click Export. Export it to QM folder, replacing the existing System.qml file. Possibly you will have to uncheck readonly in file properties dialog.

5. Create new macro. Paste this code:
CHI_CreateIndexOfMyFunctions

6. Run the new macro. It shows a dialog. When you click OK, it recreates help index. Then you can delete the macro.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)