diff options
author | albert-github <albert.tests@gmail.com> | 2019-05-02 10:36:34 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-05-02 10:36:34 (GMT) |
commit | a985ed0100cd7de580997f8c932a67a4f520f417 (patch) | |
tree | 737756cefdcfb05a33f2dd73e6d9ed3e28cbcec4 | |
parent | ac76b9a7a70b3c828c76442f5977937fcb87811a (diff) | |
download | Doxygen-a985ed0100cd7de580997f8c932a67a4f520f417.zip Doxygen-a985ed0100cd7de580997f8c932a67a4f520f417.tar.gz Doxygen-a985ed0100cd7de580997f8c932a67a4f520f417.tar.bz2 |
Ambiguous file name in file command
I some cases a file name is used with the `\file` command and this filename exists multiple times although the `\file` command is in the file itself (actually file name can be omitted).
Another possibility is that the file description is in another file in the same directory.
When file is not found or ambiguous, try to prepend the path of the current file to it and see if the file can be found.
Example is shown in the warnings file like:
```
gmic-2.6.1/gmic-qt/src/Common.h:3: warning: the name `Common.h' supplied as the second argument in the \file statement matches the following input files:
gmic-2.6.1/gmic-qt/src/Common.h
gmic-2.6.1/zart/include/Common.h
Please use a more specific name by including a (larger) part of the path!
```
and here it is quite clear and unambiguous which file is meant.
-rw-r--r-- | src/doxygen.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 2900f49..ed189fb 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -766,6 +766,16 @@ static void buildFileList(Entry *root) { bool ambig; FileDef *fd=findFileDef(Doxygen::inputNameDict,root->name,ambig); + if (!fd || ambig) + { + int save_ambig = ambig; + // use the directory of the file to see if the described file is in the same + // directory as the describing file. + QCString fn = root->fileName; + int newIndex=fn.findRev('/'); + fd=findFileDef(Doxygen::inputNameDict,fn.left(newIndex) + "/" + root->name,ambig); + if (!fd) ambig = save_ambig; + } //printf("**************** root->name=%s fd=%p\n",root->name.data(),fd); if (fd && !ambig) { |