From 39ba759f4dba837818f07451314b3612d438a1bd Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 17 Mar 2020 20:29:45 +0100 Subject: Doxygen version information (#7645) - 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. --- addon/doxyparse/doxyparse.cpp | 2 +- addon/doxywizard/doxywizard.cpp | 2 +- addon/doxywizard/expert.cpp | 2 +- libversion/doxyversion.cpp.in | 2 +- libversion/version.h | 2 +- src/configimpl.l | 8 ++------ src/context.cpp | 2 +- src/doxygen.cpp | 20 ++------------------ src/htmlgen.cpp | 18 +++++++++--------- src/latexgen.cpp | 8 ++++---- src/layout.cpp | 2 +- src/resourcemgr.cpp | 2 +- src/rtfgen.cpp | 6 +++--- src/searchindex.cpp | 2 +- src/util.cpp | 16 +++++++++++++++- src/util.h | 1 + src/xmlgen.cpp | 4 ++-- 17 files changed, 47 insertions(+), 52 deletions(-) diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp index 78a91d3..24769e0 100644 --- a/addon/doxyparse/doxyparse.cpp +++ b/addon/doxyparse/doxyparse.cpp @@ -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); } diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index dc0a6dc..d0811d4 100755 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -228,7 +228,7 @@ void MainWindow::about() QString msg; QTextStream t(&msg,QIODevice::WriteOnly); t << QString::fromLatin1("
A tool to configure and run doxygen version ")+ - QString::fromLatin1(getVersion())+ + QString::fromLatin1(getDoxygenVersion())+ QString::fromLatin1(" on your source files.


" "

Written by
Dimitri van Heesch
© 2000-2019

" ""); diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp index 1303a22..c043994 100644 --- a/addon/doxywizard/expert.cpp +++ b/addon/doxywizard/expert.cpp @@ -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); diff --git a/libversion/doxyversion.cpp.in b/libversion/doxyversion.cpp.in index 11bca8d..614aa07 100644 --- a/libversion/doxyversion.cpp.in +++ b/libversion/doxyversion.cpp.in @@ -1,6 +1,6 @@ #include "version.h" -char *getVersion(void) +char *getDoxygenVersion(void) { static char versionString[] = "@DOXYGEN_VERSION@"; return versionString; diff --git a/libversion/version.h b/libversion/version.h index a656e74..22a054d 100644 --- a/libversion/version.h +++ b/libversion/version.h @@ -17,6 +17,6 @@ #ifndef VERSION_H #define VERSION_H -char *getVersion(void); +char *getDoxygenVersion(void); char *getGitVersion(void); #endif diff --git a/src/configimpl.l b/src/configimpl.l index 1490912..055304d 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -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,""); @@ -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 it = iterator(); ConfigOption *option; diff --git a/src/context.cpp b/src/context.cpp index d4e2799..1536715 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -380,7 +380,7 @@ class DoxygenContext::Private public: TemplateVariant version() const { - return getVersion(); + return getDoxygenVersion(); } TemplateVariant date() const { diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 56fac35..c269067 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -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 * @@ -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()); /************************************************************************** diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 0e3b146..ac42a6a 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -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"); } @@ -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 << "" << endl; + t << "" << endl; t << ResourceMgr::instance().getAsString("header.html"); } void HtmlGenerator::writeFooterFile(QFile &file) { FTextStream t(&file); - t << "" << endl; + t << "" << endl; t << ResourceMgr::instance().getAsString("footer.html"); } @@ -1113,7 +1113,7 @@ void HtmlGenerator::startFile(const char *name,const char *, t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),m_relPath); t << "" << endl; + << getDoxygenVersion() << " -->" << endl; //static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); static bool searchEngine = Config_getBool(SEARCHENGINE); if (searchEngine /*&& !generateTreeView*/) @@ -1177,7 +1177,7 @@ QCString HtmlGenerator::writeLogoAsString(const char *path) "\"doxygen\"/ "; - result += getVersion(); + result += getDoxygenVersion(); result += " "; return result; } @@ -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"); } @@ -2648,7 +2648,7 @@ void HtmlGenerator::writeSearchPage() t << substituteHtmlKeywords(g_header,"Search",""); t << "" << endl; + << getDoxygenVersion() << " -->" << endl; t << "" << endl; t << "" << endl; diff --git a/src/util.cpp b/src/util.cpp index 97d03c5..7a7d56e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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); @@ -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; diff --git a/src/util.h b/src/util.h index fc5eee4..07fc375 100644 --- a/src/util.h +++ b/src/util.h @@ -501,4 +501,5 @@ int usedTableLevels(); void incUsedTableLevels(); void decUsedTableLevels(); +QCString getFullVersion(); #endif diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index bca5f7b..284332e 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -154,7 +154,7 @@ static void writeXMLHeader(FTextStream &t) t << "" << endl;; t << "" << endl; + t << "version=\"" << getDoxygenVersion() << "\">" << endl; } static void writeCombineScript() @@ -1968,7 +1968,7 @@ void generateXML() t << "" << endl;; t << "" << endl; + t << "version=\"" << getDoxygenVersion() << "\">" << endl; { ClassSDict::Iterator cli(*Doxygen::classSDict); -- cgit v0.12