diff --git a/src/common/QskFunctions.cpp b/src/common/QskFunctions.cpp index 892c9a84..986daa2a 100644 --- a/src/common/QskFunctions.cpp +++ b/src/common/QskFunctions.cpp @@ -233,3 +233,17 @@ float qskConstrainedRadians( float radians ) return radians; } + +// do not export; +bool qskHasEnvironment( const char* env ) +{ + bool ok; + + const int value = qEnvironmentVariableIntValue( env, &ok ); + if ( ok ) + return value != 0; + + // All other strings are true, apart from "false" + auto result = qgetenv( env ); + return !result.isEmpty() && result != "false"; +} diff --git a/src/controls/QskSetup.cpp b/src/controls/QskSetup.cpp index e0ffb30e..21d98930 100644 --- a/src/controls/QskSetup.cpp +++ b/src/controls/QskSetup.cpp @@ -5,31 +5,19 @@ #include "QskSetup.h" +extern bool qskHasEnvironment( const char* ); extern void qskUpdateItemFlags(); namespace { - inline bool hasEnvironment( const char* env ) - { - bool ok; - - const int value = qEnvironmentVariableIntValue( env, &ok ); - if ( ok ) - return value != 0; - - // All other strings are true, apart from "false" - auto result = qgetenv( env ); - return !result.isEmpty() && result != "false"; - } - inline const QskItem::UpdateFlags environmentUpdateFlags() { QskItem::UpdateFlags flags; - if ( !hasEnvironment( "QSK_PREFER_FBO_PAINTING" ) ) + if ( !qskHasEnvironment( "QSK_PREFER_FBO_PAINTING" ) ) flags |= QskItem::PreferRasterForTextures; - if ( hasEnvironment( "QSK_FORCE_BACKGROUND" ) ) + if ( qskHasEnvironment( "QSK_FORCE_BACKGROUND" ) ) flags |= QskItem::DebugForceBackground; return flags;