Provide fallback for qEnvironmentVariable() when using old Qt

This commit is contained in:
Martchus 2018-02-21 23:37:34 +01:00
parent 3c811f5968
commit 81b8a42ae4
1 changed files with 11 additions and 0 deletions

View File

@ -521,6 +521,17 @@ bool isAutostartEnabled()
#endif
}
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
/*!
* \brief Provides a fallback for qEnvironmentVariable() when using old Qt version.
*/
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
{
const auto val(qgetenv(varName));
return !val.isEmpty() ? QString::fromLocal8Bit(val) : defaultValue;
}
#endif
/*!
* \brief Sets whether the application is launchedc on startup.
* \remarks