Remove DebuggerKitInformation::defaultValue()

The defaultValue() function was a half-baked version of the setup()
function and prevented that one from working properly.
It does not appear that anyone relies on defaultValue() having run; in
fact, this function should probably be removed from the KitInformation
interface entirely and its implementations be merged into setup().

Fixes: QTCREATORBUG-21994
Change-Id: I78525df8201ebd5e1883718ea7655297c9f58eb5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2019-03-06 10:11:18 +01:00
parent 1b581308be
commit 776d54e435

View File

@@ -56,24 +56,7 @@ DebuggerKitInformation::DebuggerKitInformation()
setPriority(28000); setPriority(28000);
} }
QVariant DebuggerKitInformation::defaultValue(const Kit *k) const QVariant DebuggerKitInformation::defaultValue(const Kit *) const { return QVariant(); }
{
const Abi toolChainAbi = ToolChainKitInformation::targetAbi(k);
const Utils::FileNameList paths = Environment::systemEnvironment().path();
QVariant nextBestFit;
for (const DebuggerItem &item : DebuggerItemManager::debuggers()) {
for (const Abi &targetAbi : item.abis()) {
if (targetAbi.isCompatibleWith(toolChainAbi)) {
if (paths.contains(item.command()))
return item.id(); // prefer debuggers found in PATH over those found elsewhere
if (nextBestFit.isNull())
nextBestFit = item.id();
}
}
}
return nextBestFit;
}
void DebuggerKitInformation::setup(Kit *k) void DebuggerKitInformation::setup(Kit *k)
{ {