Skip to content

Commit c9ce08d

Browse files
committed
QT help problems with tag files
The QT assistant has problems with files that are not directly included into its input file (i.e. the qch file). - This happens when we use tag files, hence `TAGFILES` will be disabled when `GENERATE_QHP` is set - When there are in the tree items that do not refer to a file (so `ref=""`) this also gives problems. hence replacing these with a placeholder `doxygen_blank` that is just an empty file and will be added when necessary.
1 parent 3ce42bf commit c9ce08d

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

src/configimpl.l

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,6 +2143,13 @@ void Config::checkAndCorrect(bool quiet, const bool check)
21432143
err("GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n");
21442144
Config_updateString(QHP_VIRTUAL_FOLDER,"doc");
21452145
}
2146+
const StringVector &tagFileList = Config_getList(TAGFILES);
2147+
if (tagFileList.size() != 0)
2148+
{
2149+
err("When enabling %s the %s option should be empty. I'll adjust it for you.\n","GENERATE_QHP","TAGFILES");
2150+
const StringVector tagFileListEmpty;
2151+
Config_updateList(TAGFILES,tagFileListEmpty);
2152+
}
21462153
}
21472154

21482155
//------------------------

src/qhp.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ void Qhp::addContentsItem(bool /* isDir */, const QCString & name,
311311
bool /* addToNavIndex */,
312312
const Definition * /*def*/)
313313
{
314+
static bool blankWritten = false;
314315
/*
315316
<toc>
316317
<section title="My Application Manual" ref="index.html">
@@ -324,6 +325,19 @@ void Qhp::addContentsItem(bool /* isDir */, const QCString & name,
324325
QCString f = file;
325326
if (!f.isEmpty() && f.at(0)=='^') return; // absolute URL not supported
326327

328+
if (f.isEmpty())
329+
{
330+
f = blankFileName;
331+
addHtmlExtensionIfMissing(f);
332+
if (!blankWritten)
333+
{
334+
QCString fileName = Config_getString(HTML_OUTPUT) + "/" + f;
335+
std::ofstream blankFile = Portable::openOutputStream(fileName); // we just need an empty file
336+
blankFile.close();
337+
addFile(f);
338+
blankWritten = true;
339+
}
340+
}
327341
QCString finalRef = makeRef(f, anchor);
328342
p->sectionTree.addSection(name,finalRef);
329343
}

src/qhp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Qhp : public IndexIntf
4646

4747
static inline const QCString qhpFileName = "index.qhp";
4848
static QCString getQchFileName();
49+
static inline const QCString blankFileName = "doxygen_blank";
4950

5051
private:
5152
void addFile(const QCString &);

0 commit comments

Comments
 (0)