forked from qt-creator/qt-creator
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:
@@ -56,24 +56,7 @@ DebuggerKitInformation::DebuggerKitInformation()
|
||||
setPriority(28000);
|
||||
}
|
||||
|
||||
QVariant DebuggerKitInformation::defaultValue(const Kit *k) const
|
||||
{
|
||||
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;
|
||||
}
|
||||
QVariant DebuggerKitInformation::defaultValue(const Kit *) const { return QVariant(); }
|
||||
|
||||
void DebuggerKitInformation::setup(Kit *k)
|
||||
{
|
||||
|
Reference in New Issue
Block a user