From a985ed0100cd7de580997f8c932a67a4f520f417 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 2 May 2019 12:36:34 +0200 Subject: 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. --- src/doxygen.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- cgit v0.12 From 497d44273fa5cc619f4289a60a4c1685d7ded241 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 3 May 2019 10:09:41 +0200 Subject: Ambiguous file name in file command The file command has only one argument. --- src/doxygen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index ed189fb..39609bd 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -805,7 +805,7 @@ static void buildFileList(Entry *root) const char *fn = root->fileName.data(); QCString text(4096); text.sprintf("the name `%s' supplied as " - "the second argument in the \\file statement ", + "the argument in the \\file statement ", qPrint(root->name)); if (ambig) // name is ambiguous { -- cgit v0.12