Skip to content

Commit

Permalink
Doxygen version information (#7645)
Browse files Browse the repository at this point in the history
- add doxygen version to rtf, comment, output
- remove duplicate code (getFullVersion)
- more clear name to get doxygen version (getVersion becomes getrDoxygenVersion). Also to overcomecofusion with the version information for files.
  • Loading branch information
albert-github committed Mar 17, 2020
1 parent 0f9075a commit 39ba759
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 52 deletions.
2 changes: 1 addition & 1 deletion addon/doxyparse/doxyparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ int main(int argc,char **argv) {
exit(1);
}
if (qstrcmp(&argv[1][2], "version") == 0) {
QCString versionString = getVersion();
QCString versionString = getDoxygenVersion();
printf("%s\n", versionString.data());
exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion addon/doxywizard/doxywizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void MainWindow::about()
QString msg;
QTextStream t(&msg,QIODevice::WriteOnly);
t << QString::fromLatin1("<qt><center>A tool to configure and run doxygen version ")+
QString::fromLatin1(getVersion())+
QString::fromLatin1(getDoxygenVersion())+
QString::fromLatin1(" on your source files.</center><p><br>"
"<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-2019</center><p>"
"</qt>");
Expand Down
2 changes: 1 addition & 1 deletion addon/doxywizard/expert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
bool Expert::writeConfig(QTextStream &t,bool brief)
{
// write global header
t << "# Doxyfile " << getVersion() << endl << endl;
t << "# Doxyfile " << getDoxygenVersion() << endl << endl;
if (!brief)
{
t << convertToComment(m_header);
Expand Down
2 changes: 1 addition & 1 deletion libversion/doxyversion.cpp.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "version.h"

char *getVersion(void)
char *getDoxygenVersion(void)
{
static char versionString[] = "@DOXYGEN_VERSION@";
return versionString;
Expand Down
2 changes: 1 addition & 1 deletion libversion/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

#ifndef VERSION_H
#define VERSION_H
char *getVersion(void);
char *getDoxygenVersion(void);
char *getGitVersion(void);
#endif
8 changes: 2 additions & 6 deletions src/configimpl.l
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd)
{
t << takeStartComment() << endl;
}
t << "# Doxyfile " << getVersion() << endl << endl;
t << "# Doxyfile " << getDoxygenVersion() << endl << endl;
if (!sl)
{
t << convertToComment(m_header,"");
Expand All @@ -1022,11 +1022,7 @@ void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd)

void ConfigImpl::compareDoxyfile(FTextStream &t)
{
t << "# Difference with default Doxyfile " << getVersion();
if (strlen(getGitVersion()))
{
t << " (" << getGitVersion() << ")";
}
t << "# Difference with default Doxyfile " << getFullVersion();
t << endl;
QListIterator<ConfigOption> it = iterator();
ConfigOption *option;
Expand Down
2 changes: 1 addition & 1 deletion src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class DoxygenContext::Private
public:
TemplateVariant version() const
{
return getVersion();
return getDoxygenVersion();
}
TemplateVariant date() const
{
Expand Down
20 changes: 2 additions & 18 deletions src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9949,15 +9949,7 @@ static int computeIdealCacheParam(uint v)

void readConfiguration(int argc, char **argv)
{
QCString versionString;
if (strlen(getGitVersion())>0)
{
versionString = QCString(getVersion())+" ("+getGitVersion()+")";
}
else
{
versionString = getVersion();
}
QCString versionString = getFullVersion();

/**************************************************************************
* Handle arguments *
Expand Down Expand Up @@ -10774,15 +10766,7 @@ void parseInput()

// we would like to show the versionString earlier, but we first have to handle the configuration file
// to know the value of the QUIET setting.
QCString versionString;
if (strlen(getGitVersion())>0)
{
versionString = QCString(getVersion())+" ("+getGitVersion()+")";
}
else
{
versionString = getVersion();
}
QCString versionString = getFullVersion();
msg("Doxygen version used: %s\n",versionString.data());

/**************************************************************************
Expand Down
18 changes: 9 additions & 9 deletions src/htmlgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ void HtmlGenerator::writeSearchData(const char *dir)
{
searchCss = mgr.getAsString("search.css");
}
searchCss = substitute(replaceColorMarkers(searchCss),"$doxygenversion",getVersion());
searchCss = substitute(replaceColorMarkers(searchCss),"$doxygenversion",getDoxygenVersion());
t << searchCss;
Doxygen::indexList->addStyleSheetFile("search/search.css");
}
Expand All @@ -1079,20 +1079,20 @@ void HtmlGenerator::writeSearchData(const char *dir)
void HtmlGenerator::writeStyleSheetFile(QFile &file)
{
FTextStream t(&file);
t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getVersion()));
t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
}

void HtmlGenerator::writeHeaderFile(QFile &file, const char * /*cssname*/)
{
FTextStream t(&file);
t << "<!-- HTML header for doxygen " << getVersion() << "-->" << endl;
t << "<!-- HTML header for doxygen " << getDoxygenVersion() << "-->" << endl;
t << ResourceMgr::instance().getAsString("header.html");
}

void HtmlGenerator::writeFooterFile(QFile &file)
{
FTextStream t(&file);
t << "<!-- HTML footer for doxygen " << getVersion() << "-->" << endl;
t << "<!-- HTML footer for doxygen " << getDoxygenVersion() << "-->" << endl;
t << ResourceMgr::instance().getAsString("footer.html");
}

Expand All @@ -1113,7 +1113,7 @@ void HtmlGenerator::startFile(const char *name,const char *,
t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),m_relPath);

t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
<< getVersion() << " -->" << endl;
<< getDoxygenVersion() << " -->" << endl;
//static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
static bool searchEngine = Config_getBool(SEARCHENGINE);
if (searchEngine /*&& !generateTreeView*/)
Expand Down Expand Up @@ -1177,7 +1177,7 @@ QCString HtmlGenerator::writeLogoAsString(const char *path)
"<img class=\"footer\" src=\"";
result += path;
result += "doxygen.png\" alt=\"doxygen\"/></a> ";
result += getVersion();
result += getDoxygenVersion();
result += " ";
return result;
}
Expand Down Expand Up @@ -1230,7 +1230,7 @@ void HtmlGenerator::writeStyleInfo(int part)
//t << "H1 { text-align: center; border-width: thin none thin none;" << endl;
//t << " border-style : double; border-color : blue; padding-left : 1em; padding-right : 1em }" << endl;

t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getVersion()));
t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
endPlainFile();
Doxygen::indexList->addStyleSheetFile("doxygen.css");
}
Expand Down Expand Up @@ -2648,7 +2648,7 @@ void HtmlGenerator::writeSearchPage()
t << substituteHtmlKeywords(g_header,"Search","");

t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
<< getVersion() << " -->" << endl;
<< getDoxygenVersion() << " -->" << endl;
t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
t << "var searchBox = new SearchBox(\"searchBox\", \""
Expand Down Expand Up @@ -2701,7 +2701,7 @@ void HtmlGenerator::writeExternalSearchPage()
t << substituteHtmlKeywords(g_header,"Search","");

t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
<< getVersion() << " -->" << endl;
<< getDoxygenVersion() << " -->" << endl;
t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
t << "var searchBox = new SearchBox(\"searchBox\", \""
Expand Down
8 changes: 4 additions & 4 deletions src/latexgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ static void writeDefaultHeaderPart3(FTextStream &t)
{
// part 3
// Finalize project number
t << " Doxygen " << getVersion() << "}\\\\\n";
t << " Doxygen " << getDoxygenVersion() << "}\\\\\n";
if (Config_getBool(LATEX_TIMESTAMP))
t << "\\vspace*{0.5cm}\n"
"{\\small " << dateToString(TRUE) << "}\\\\\n";
Expand Down Expand Up @@ -860,7 +860,7 @@ static void writeDefaultFooter(FTextStream &t)
void LatexGenerator::writeHeaderFile(QFile &f)
{
FTextStream t(&f);
t << "% Latex header for doxygen " << getVersion() << endl;
t << "% Latex header for doxygen " << getDoxygenVersion() << endl;
writeDefaultHeaderPart1(t);
t << "Your title here";
writeDefaultHeaderPart2(t);
Expand All @@ -871,14 +871,14 @@ void LatexGenerator::writeHeaderFile(QFile &f)
void LatexGenerator::writeFooterFile(QFile &f)
{
FTextStream t(&f);
t << "% Latex footer for doxygen " << getVersion() << endl;
t << "% Latex footer for doxygen " << getDoxygenVersion() << endl;
writeDefaultFooter(t);
}

void LatexGenerator::writeStyleSheetFile(QFile &f)
{
FTextStream t(&f);
t << "% stylesheet for doxygen " << getVersion() << endl;
t << "% stylesheet for doxygen " << getDoxygenVersion() << endl;
writeDefaultStyleSheet(t);
}

Expand Down
2 changes: 1 addition & 1 deletion src/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ void writeDefaultLayoutFile(const char *fileName)
}
QTextStream t(&f);
t.setEncoding(QTextStream::UnicodeUTF8);
t << substitute(layout_default,"$doxygenversion",getVersion());
t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
}

//----------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/resourcemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
}
else
{
t << substitute(buf,"$doxygenversion",getVersion());
t << substitute(buf,"$doxygenversion",getDoxygenVersion());
}
return TRUE;
}
Expand Down
6 changes: 3 additions & 3 deletions src/rtfgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ RTFGenerator::~RTFGenerator()
void RTFGenerator::writeStyleSheetFile(QFile &file)
{
FTextStream t(&file);
t << "# Generated by doxygen " << getVersion() << "\n\n";
t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes styles used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
t << "# Remove a hash to activate a line.\n\n";
Expand All @@ -99,7 +99,7 @@ void RTFGenerator::writeStyleSheetFile(QFile &file)
void RTFGenerator::writeExtensionsFile(QFile &file)
{
FTextStream t(&file);
t << "# Generated by doxygen " << getVersion() << "\n\n";
t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes extensions used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
t << "# Remove a hash to activate a line.\n\n";
Expand Down Expand Up @@ -575,7 +575,7 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isTitlePageAuthor:
{
t << " doxygen.}\n";
t << " doxygen" << getDoxygenVersion() << ".}\n";
t << "{\\creatim " << dateToRTFDateString() << "}\n}";
DBG_RTF(t << "{\\comment end of infoblock}\n");
// setup for this section
Expand Down
2 changes: 1 addition & 1 deletion src/searchindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ void writeJavaScriptSearchIndex()
" \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl;
t << "<html><head><title></title>" << endl;
t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl;
t << "<meta name=\"generator\" content=\"Doxygen " << getVersion() << "\"/>" << endl;
t << "<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() << "\"/>" << endl;
t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl;
t << "<script type=\"text/javascript\" src=\"" << baseName << ".js\"></script>" << endl;
t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl;
Expand Down
16 changes: 15 additions & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4730,7 +4730,7 @@ QCString substituteKeywords(const QCString &s,const char *title,
result = substitute(result,"$datetime",dateToString(TRUE));
result = substitute(result,"$date",dateToString(FALSE));
result = substitute(result,"$year",yearToString());
result = substitute(result,"$doxygenversion",getVersion());
result = substitute(result,"$doxygenversion",getDoxygenVersion());
result = substitute(result,"$projectname",projName);
result = substitute(result,"$projectnumber",projNum);
result = substitute(result,"$projectbrief",projBrief);
Expand Down Expand Up @@ -8526,6 +8526,20 @@ void writeLatexSpecialFormulaChars(FTextStream &t)
"\n";
}

QCString getFullVersion()
{
QCString versionString;
if (strlen(getGitVersion())>0)
{
versionString = QCString(getDoxygenVersion())+" ("+getGitVersion()+")";
}
else
{
versionString = getDoxygenVersion();
}
return versionString;
}

//------------------------------------------------------

static int g_usedTableLevels = 0;
Expand Down
1 change: 1 addition & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,4 +501,5 @@ int usedTableLevels();
void incUsedTableLevels();
void decUsedTableLevels();

QCString getFullVersion();
#endif
4 changes: 2 additions & 2 deletions src/xmlgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static void writeXMLHeader(FTextStream &t)
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
t << "version=\"" << getVersion() << "\">" << endl;
t << "version=\"" << getDoxygenVersion() << "\">" << endl;
}

static void writeCombineScript()
Expand Down Expand Up @@ -1968,7 +1968,7 @@ void generateXML()
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
t << "version=\"" << getVersion() << "\">" << endl;
t << "version=\"" << getDoxygenVersion() << "\">" << endl;

{
ClassSDict::Iterator cli(*Doxygen::classSDict);
Expand Down

0 comments on commit 39ba759

Please sign in to comment.