forked from qt-creator/qt-creator
Use qEnvironmentVariableIsEmpty or qEnvironmentVariableIsSet directly
Change-Id: I4f2e61e4bade9e7b4518d144db8163e596ab6264 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
committed by
Laurent Montel
parent
2f8c2d8864
commit
d29396b164
@@ -93,7 +93,7 @@ static SharedMemory *createSharedMemory(qint32 key, int byteCount)
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command)
|
||||
{
|
||||
static const bool dontUseSharedMemory = !qgetenv("DESIGNER_DONT_USE_SHARED_MEMORY").isEmpty();
|
||||
static const bool dontUseSharedMemory = qEnvironmentVariableIsSet("DESIGNER_DONT_USE_SHARED_MEMORY");
|
||||
|
||||
if (!dontUseSharedMemory && command.valueChanges().count() > 5) {
|
||||
static quint32 keyCounter = 0;
|
||||
|
||||
@@ -152,7 +152,7 @@ static void writeStream(QDataStream &out, const QImage &image)
|
||||
QDataStream &operator<<(QDataStream &out, const ImageContainer &container)
|
||||
{
|
||||
const int extraDataSize = 20;
|
||||
static const bool dontUseSharedMemory = !qgetenv("DESIGNER_DONT_USE_SHARED_MEMORY").isEmpty();
|
||||
static const bool dontUseSharedMemory = qEnvironmentVariableIsSet("DESIGNER_DONT_USE_SHARED_MEMORY");
|
||||
|
||||
out << container.instanceId();
|
||||
out << container.keyNumber();
|
||||
|
||||
@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
//If a style different from Desktop is set we have to use QGuiApplication
|
||||
bool useGuiApplication = !qgetenv("QT_QUICK_CONTROLS_STYLE").isEmpty()
|
||||
bool useGuiApplication = qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")
|
||||
&& qgetenv("QT_QUICK_CONTROLS_STYLE") != "Desktop";
|
||||
|
||||
if (useGuiApplication) {
|
||||
|
||||
@@ -237,7 +237,7 @@ static void allSubObject(QObject *object, QObjectList &objectList)
|
||||
|
||||
static void fixResourcePathsForObject(QObject *object)
|
||||
{
|
||||
if (qgetenv("QMLDESIGNER_RC_PATHS").isEmpty())
|
||||
if (qEnvironmentVariableIsEmpty("QMLDESIGNER_RC_PATHS"))
|
||||
return;
|
||||
|
||||
PropertyNameList propertyNameList = propertyNameListForWritableProperties(object);
|
||||
|
||||
@@ -139,7 +139,7 @@ QVariant fixResourcePaths(const QVariant &value)
|
||||
|
||||
void fixResourcePathsForObject(QObject *object)
|
||||
{
|
||||
if (qgetenv("QMLDESIGNER_RC_PATHS").isEmpty())
|
||||
if (qEnvironmentVariableIsEmpty("QMLDESIGNER_RC_PATHS"))
|
||||
return;
|
||||
|
||||
PropertyNameList propertyNameList = propertyNameListForWritableProperties(object);
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
static const bool debug = ! qgetenv("QTC_LOOKUPCONTEXT_DEBUG").isEmpty();
|
||||
static const bool debug = qEnvironmentVariableIsSet("QTC_LOOKUPCONTEXT_DEBUG");
|
||||
|
||||
static void addNames(const Name *name, QList<const Name *> *names, bool addAllNames = false)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
static const bool debug = ! qgetenv("QTC_LOOKUPCONTEXT_DEBUG").isEmpty();
|
||||
static const bool debug = qEnvironmentVariableIsSet("QTC_LOOKUPCONTEXT_DEBUG");
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Utils {
|
||||
|
||||
void writeAssertLocation(const char *msg)
|
||||
{
|
||||
static bool goBoom = !qgetenv("QTC_FATAL_ASSERTS").isEmpty();
|
||||
static bool goBoom = qEnvironmentVariableIsSet("QTC_FATAL_ASSERTS");
|
||||
if (goBoom)
|
||||
qFatal("SOFT ASSERT made fatal: %s", msg);
|
||||
else
|
||||
|
||||
@@ -1223,7 +1223,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
||||
watchHandler()->appendFormatRequests(&cmd);
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
const static bool alwaysVerbose = !qgetenv("QTC_DEBUGGER_PYTHON_VERBOSE").isEmpty();
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
|
||||
@@ -4399,7 +4399,7 @@ void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
||||
watchHandler()->appendFormatRequests(&cmd);
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
const static bool alwaysVerbose = !qgetenv("QTC_DEBUGGER_PYTHON_VERBOSE").isEmpty();
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
|
||||
@@ -801,7 +801,7 @@ void LldbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
||||
watchHandler()->appendFormatRequests(&cmd);
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
const static bool alwaysVerbose = !qgetenv("QTC_DEBUGGER_PYTHON_VERBOSE").isEmpty();
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
|
||||
@@ -559,7 +559,7 @@ void PdbEngine::updateLocals()
|
||||
watchHandler()->appendFormatRequests(&cmd);
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
const static bool alwaysVerbose = !qgetenv("QTC_DEBUGGER_PYTHON_VERBOSE").isEmpty();
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace QmlDesigner {
|
||||
|
||||
|
||||
QList<QByteArray> RewriterTransaction::m_identifierList;
|
||||
bool RewriterTransaction::m_activeIdentifier = !qgetenv("QML_DESIGNER_TRACE_REWRITER_TRANSACTION").isEmpty();
|
||||
bool RewriterTransaction::m_activeIdentifier = qEnvironmentVariableIsSet("QML_DESIGNER_TRACE_REWRITER_TRANSACTION");
|
||||
|
||||
RewriterTransaction::RewriterTransaction() : m_valid(false)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Internal {
|
||||
|
||||
static bool debugExamples()
|
||||
{
|
||||
static bool isDebugging = !qgetenv("QTC_DEBUG_EXAMPLESMODEL").isEmpty();
|
||||
static bool isDebugging = qEnvironmentVariableIsSet("QTC_DEBUG_EXAMPLESMODEL");
|
||||
return isDebugging;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ CrashHandlerSetup::CrashHandlerSetup(const QString &appName,
|
||||
const QString &executableDirPath)
|
||||
{
|
||||
#ifdef BUILD_CRASH_HANDLER
|
||||
if (qgetenv("QTC_USE_CRASH_HANDLER").isEmpty())
|
||||
if (qEnvironmentVariableIsEmpty("QTC_USE_CRASH_HANDLER"))
|
||||
return;
|
||||
|
||||
appNameC = qstrdup(qPrintable(appName));
|
||||
|
||||
Reference in New Issue
Block a user