Skip to content

Commit 94fd63c

Browse files
committed
Consistency of use of HIDE_COMPOUND_REFERENCE
In the question https://stackoverflow.com/questions/79483301/doxygen-hide-compound-reference-for-namespace it was noted that the `HIDE_COMPOUND_REFERENCE` does not work for e.g. namespaces. Currently it only works for classes (and also for Struct, Union, Interface, Protocol, Category and Exception, as they all use the routine `trCompoundReference`) Besides the problem for namespaces ithe issue is present for other parts as well that call the routines: - `trFileReference` - `trNamespaceReference` - `trDirReference` - `trCompoundReferenceFortran` - `trModuleReference` - `trEnumReference` - `trConstantGroupReference` - `trServiceReference` - `trSingletonReference` - `trCustomReference` - `trCompoundReferenceSlice` - `trConceptReference` The usage of `HIDE_COMPOUND_REFERENCE` has ben implemented for these calls as well
1 parent 33a89a6 commit 94fd63c

6 files changed

+158
-26
lines changed

src/classdef.cpp

+52-10
Original file line numberDiff line numberDiff line change
@@ -2887,31 +2887,73 @@ QCString ClassDefImpl::title() const
28872887

28882888
if (lang==SrcLangExt::Fortran)
28892889
{
2890-
pageTitle = theTranslator->trCompoundReferenceFortran(displayName(),
2891-
m_compType,
2892-
!m_tempArgs.empty());
2890+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2891+
{
2892+
pageTitle = displayName();
2893+
}
2894+
else
2895+
{
2896+
pageTitle = theTranslator->trCompoundReferenceFortran(displayName(),
2897+
m_compType,
2898+
!m_tempArgs.empty());
2899+
}
28932900
}
28942901
else if (lang==SrcLangExt::Slice)
28952902
{
2896-
pageTitle = theTranslator->trCompoundReferenceSlice(displayName(),
2897-
m_compType,
2898-
isSliceLocal());
2903+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2904+
{
2905+
pageTitle = displayName();
2906+
}
2907+
else
2908+
{
2909+
pageTitle = theTranslator->trCompoundReferenceSlice(displayName(),
2910+
m_compType,
2911+
isSliceLocal());
2912+
}
28992913
}
29002914
else if (lang==SrcLangExt::VHDL)
29012915
{
2902-
pageTitle = theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this));
2916+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2917+
{
2918+
pageTitle = VhdlDocGen::getClassName(this);
2919+
}
2920+
else
2921+
{
2922+
pageTitle = theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this));
2923+
}
29032924
}
29042925
else if (isJavaEnum())
29052926
{
2906-
pageTitle = theTranslator->trEnumReference(displayName());
2927+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2928+
{
2929+
pageTitle = displayName();
2930+
}
2931+
else
2932+
{
2933+
pageTitle = theTranslator->trEnumReference(displayName());
2934+
}
29072935
}
29082936
else if (m_compType==Service)
29092937
{
2910-
pageTitle = theTranslator->trServiceReference(displayName());
2938+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2939+
{
2940+
pageTitle = displayName();
2941+
}
2942+
else
2943+
{
2944+
pageTitle = theTranslator->trServiceReference(displayName());
2945+
}
29112946
}
29122947
else if (m_compType==Singleton)
29132948
{
2914-
pageTitle = theTranslator->trSingletonReference(displayName());
2949+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
2950+
{
2951+
pageTitle = displayName();
2952+
}
2953+
else
2954+
{
2955+
pageTitle = theTranslator->trSingletonReference(displayName());
2956+
}
29152957
}
29162958
else
29172959
{

src/conceptdef.cpp

+17-2
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,14 @@ const ModuleDef *ConceptDefImpl::getModuleDef() const
285285

286286
QCString ConceptDefImpl::title() const
287287
{
288-
return theTranslator->trConceptReference(displayName());
288+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
289+
{
290+
return displayName();
291+
}
292+
else
293+
{
294+
return theTranslator->trConceptReference(displayName());
295+
}
289296
}
290297

291298
int ConceptDefImpl::groupId() const
@@ -513,7 +520,15 @@ void ConceptDefImpl::addConceptAttributes(OutputList &ol) const
513520
void ConceptDefImpl::writeDocumentation(OutputList &ol)
514521
{
515522
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
516-
QCString pageTitle = theTranslator->trConceptReference(displayName());
523+
QCString pageTitle;
524+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
525+
{
526+
pageTitle = displayName();
527+
}
528+
else
529+
{
530+
pageTitle = theTranslator->trConceptReference(displayName());
531+
}
517532
startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::ConceptVisible,!generateTreeView);
518533

519534
// ---- navigation part

src/dirdef.cpp

+17-2
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,14 @@ void DirDefImpl::endMemberDeclarations(OutputList &ol)
486486

487487
QCString DirDefImpl::shortTitle() const
488488
{
489-
return theTranslator->trDirReference(m_shortName);
489+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
490+
{
491+
return m_shortName;
492+
}
493+
else
494+
{
495+
return theTranslator->trDirReference(m_shortName);
496+
}
490497
}
491498

492499
bool DirDefImpl::hasDetailedDescription() const
@@ -539,7 +546,15 @@ void DirDefImpl::writeDocumentation(OutputList &ol)
539546
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
540547
ol.pushGeneratorState();
541548

542-
QCString title=theTranslator->trDirReference(m_dispName);
549+
QCString title;
550+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
551+
{
552+
title=m_dispName;
553+
}
554+
else
555+
{
556+
title=theTranslator->trDirReference(m_dispName);
557+
}
543558
AUTO_TRACE("title={}",title);
544559
startFile(ol,getOutputFileBase(),name(),title,HighlightedItem::Files,!generateTreeView);
545560

src/filedef.cpp

+37-6
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,15 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
867867
versionTitle=("("+m_fileVersion+")");
868868
}
869869
QCString title = m_docname+versionTitle;
870-
QCString pageTitle=theTranslator->trFileReference(m_docname);
870+
QCString pageTitle;
871+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
872+
{
873+
pageTitle=m_docname;
874+
}
875+
else
876+
{
877+
pageTitle=theTranslator->trFileReference(m_docname);
878+
}
871879

872880
if (getDirDef())
873881
{
@@ -880,12 +888,28 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
880888
startTitle(ol,getOutputFileBase(),this);
881889
ol.pushGeneratorState();
882890
ol.disableAllBut(OutputType::Html);
883-
ol.parseText(theTranslator->trFileReference(displayName())); // Html only
891+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
892+
{
893+
ol.parseText(displayName()); // Html only
894+
}
895+
else
896+
{
897+
ol.parseText(theTranslator->trFileReference(displayName())); // Html only
898+
}
884899
ol.enableAll();
885900
ol.disable(OutputType::Html);
886-
ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
887-
pageTitle :
888-
theTranslator->trFileReference(name()));
901+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
902+
{
903+
ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
904+
pageTitle :
905+
name());
906+
}
907+
else
908+
{
909+
ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
910+
pageTitle :
911+
theTranslator->trFileReference(name()));
912+
}
889913
ol.popGeneratorState();
890914
addGroupListToTitle(ol,this);
891915
endTitle(ol,getOutputFileBase(),title);
@@ -1819,7 +1843,14 @@ void FileDefImpl::getAllIncludeFilesRecursively(StringVector &incFiles) const
18191843

18201844
QCString FileDefImpl::title() const
18211845
{
1822-
return theTranslator->trFileReference(name());
1846+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
1847+
{
1848+
return name();
1849+
}
1850+
else
1851+
{
1852+
return theTranslator->trFileReference(name());
1853+
}
18231854
}
18241855

18251856
QCString FileDefImpl::fileVersion() const

src/moduledef.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,15 @@ void ModuleDefImpl::writeDocumentation(OutputList &ol)
342342
ol.pushGeneratorState();
343343
AUTO_TRACE("%s file=%s",name(),getDefFileName());
344344
SrcLangExt lang = getLanguage();
345-
QCString pageTitle = theTranslator->trModuleReference(displayName());
345+
QCString pageTitle;
346+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
347+
{
348+
pageTitle = displayName();
349+
}
350+
else
351+
{
352+
pageTitle = theTranslator->trModuleReference(displayName());
353+
}
346354
startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::ModuleVisible,false,QCString(),0);
347355

348356
// ---- title part

src/namespacedef.cpp

+26-5
Original file line numberDiff line numberDiff line change
@@ -1566,17 +1566,38 @@ QCString NamespaceDefImpl::title() const
15661566
}
15671567
else if (lang==SrcLangExt::Fortran || lang==SrcLangExt::Slice)
15681568
{
1569-
pageTitle = theTranslator->trModuleReference(displayName());
1569+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
1570+
{
1571+
pageTitle = displayName();
1572+
}
1573+
else
1574+
{
1575+
pageTitle = theTranslator->trModuleReference(displayName());
1576+
}
15701577
}
15711578
else if (lang==SrcLangExt::IDL)
15721579
{
1573-
pageTitle = isConstantGroup()
1574-
? theTranslator->trConstantGroupReference(displayName())
1575-
: theTranslator->trModuleReference(displayName());
1580+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
1581+
{
1582+
pageTitle = displayName();
1583+
}
1584+
else
1585+
{
1586+
pageTitle = isConstantGroup()
1587+
? theTranslator->trConstantGroupReference(displayName())
1588+
: theTranslator->trModuleReference(displayName());
1589+
}
15761590
}
15771591
else
15781592
{
1579-
pageTitle = theTranslator->trNamespaceReference(displayName());
1593+
if (Config_getBool(HIDE_COMPOUND_REFERENCE))
1594+
{
1595+
pageTitle = displayName();
1596+
}
1597+
else
1598+
{
1599+
pageTitle = theTranslator->trNamespaceReference(displayName());
1600+
}
15801601
}
15811602
return pageTitle;
15821603
}

0 commit comments

Comments
 (0)