[Doxygen-develop] When the .CHM file is opened, it silently doesnt get recompiled
Brought to you by:
dimitri
From: Edgar 't H. <edg...@gm...> - 2009-04-04 21:51:20
|
hi, I sometimes noticed my .chm file didnt get updated. But this is due to the fact that the .chm file was already open(but minimized, or hidden). Doxygen nor the hhc.exe where telling me the pre-existing .chm file was already opened, or could not be deleted.. I made a small patch, which tries to zero the destination .chm file, if it already exists. When it exists, it will put out a message, Removing previous .chm. Then it tries to open the file in write-mode, if this fails, an err is shown: Error: CHM file is already open, cant continue... I didnot change anything to the existing behaviour. I just added some usefull messages, to detect something is going wrong. So existing users should not have any problem with this patch. This is the patch: Doxygen.cpp - line 10443: if (Config_getBool("GENERATE_HTML") && Config_getBool("GENERATE_HTMLHELP") && !Config_getString("HHC_LOCATION").isEmpty()) { msg("Running html help compiler...\n"); QString oldDir = QDir::currentDirPath(); QDir::setCurrent(Config_getString("HTML_OUTPUT")); bool bCHMAllowed = true; QCString& chmFile = Config_getString("CHM_FILE"); QFileInfo fi(chmFile); if (fi.exists() && fi.isFile()) { msg("Removing previous .chm\n"); QFile zero_length_file(chmFile); if (zero_length_file.open(IO_WriteOnly)) { zero_length_file.close(); } else { err("Error: CHM file is already open, cant continue...\n"); bCHMAllowed = false; } } if ( bCHMAllowed==false || portable_system(Config_getString("HHC_LOCATION"), "index.hhp", FALSE)) { err("Error: failed to run html help compiler on index.hhp\n"); } QDir::setCurrent(oldDir); } Together with this patch, which tells the user doxygen is finished, the Doxygen application became a bit more monkey-proof. Doxygen.cpp - line 10526: msg("\ -------------------\n\ Doxygen finished...\n\ -------------------\n"); Regards, Edgar |