Debugger: Avoid some repeated file accesses on startup

Change-Id: Id0d8458a872519156b859c40762ebc7837ef434b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-09-30 16:40:56 +02:00
parent 4d3374d23a
commit 6842745a68

View File

@@ -308,7 +308,8 @@ DebuggerKitAspect::ConfigurationErrors DebuggerKitAspect::configurationErrors(co
ConfigurationErrors result = NoConfigurationError; ConfigurationErrors result = NoConfigurationError;
const FilePath debugger = item->command(); const FilePath debugger = item->command();
if (!debugger.exists() || debugger.isDir()) const bool found = debugger.exists() && !debugger.isDir();
if (!found)
result |= DebuggerNotFound; result |= DebuggerNotFound;
else if (!debugger.isExecutableFile()) else if (!debugger.isExecutableFile())
result |= DebuggerNotExecutable; result |= DebuggerNotExecutable;
@@ -321,7 +322,7 @@ DebuggerKitAspect::ConfigurationErrors DebuggerKitAspect::configurationErrors(co
result |= DebuggerDoesNotMatch; result |= DebuggerDoesNotMatch;
} }
if (!debugger.exists() || debugger.isDir()) { if (!found) {
if (item->engineType() == NoEngineType) if (item->engineType() == NoEngineType)
return NoDebugger; return NoDebugger;