From b458cb312c433d9c955f5268c5db321126fef143 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 12 Mar 2018 13:43:43 +0100 Subject: [PATCH] doc: Make both qEnvironmentVariable() functions visible in the docs There had been a fake declaration for qEnvironmentVariable() in qglobal.h thaqt was only visible to QDoc. It was removed in favor of documenting both the actual declarations of qEnvironmentVariable(), one with a 2nd parameter for passing a defualt value and one without that parameter. But the one without the default value parameter was marked internal, so it didn't appear in the docs. When both functions were documented with a shared comment, a bug in QDoc was revealed, because these functions are global, while the shared comment functionality had only been implemented for class member functions. Now the shared comment functionality has been implemented for global functions, so these two functions are now documented with a shared comment. We can, of course, reintroduce the #ifdef QCLANG_QDOC trick, if that is pre3ferred. Change-Id: I41d85def5daa3215a995d7697d064dfae37e8b2a Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index b75b218201..30c80b8b6f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3268,14 +3268,15 @@ QByteArray qgetenv(const char *varName) /*! - QString qEnvironmentVariable(const char *varName, const QString &defaultValue); + \fn QString qEnvironmentVariable(const char *varName, const QString &defaultValue) + \fn QString qEnvironmentVariable(const char *varName) \relates \since 5.10 - Returns the value of the environment variable with name \a varName as a - QString. If no variable by that name is found in the environment, this - function returns \a defaultValue. + These functions return the value of the environment variable, \a varName, as a + QString. If no variable \a varName is found in the environment and \a defaultValue + is provided, \a defaultValue is returned. Otherwise QString() is returned. The Qt environment manipulation functions are thread-safe, but this requires that the C library equivalent functions like getenv and putenv are @@ -3344,9 +3345,6 @@ QString qEnvironmentVariable(const char *varName, const QString &defaultValue) #endif } -/*! - \internal -*/ QString qEnvironmentVariable(const char *varName) { return qEnvironmentVariable(varName, QString());