forked from qt-creator/qt-creator
Debugger: Add upgrade path for 2.8 kit debugger settings
Change-Id: I1fd01d46127b2a1dc351c789c9ba537515baba0b Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -186,6 +186,43 @@ void DebuggerKitInformation::setup(Kit *k)
|
|||||||
k->setValue(DebuggerKitInformation::id(), bestId);
|
k->setValue(DebuggerKitInformation::id(), bestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// This handles the upgrade path from 2.8 to 3.0
|
||||||
|
void DebuggerKitInformation::fix(Kit *k)
|
||||||
|
{
|
||||||
|
// This can be Id, binary path, but not "auto" anymore.
|
||||||
|
const QVariant rawId = k->value(DebuggerKitInformation::id());
|
||||||
|
|
||||||
|
if (rawId.type() == QVariant::String) {
|
||||||
|
if (!DebuggerItemManager::findById(rawId)) {
|
||||||
|
qWarning("Unknown debugger id %s in kit %s",
|
||||||
|
qPrintable(rawId.toString()), qPrintable(k->displayName()));
|
||||||
|
k->setValue(DebuggerKitInformation::id(), QVariant());
|
||||||
|
}
|
||||||
|
return; // All fine (now).
|
||||||
|
}
|
||||||
|
|
||||||
|
QMap<QString, QVariant> map = rawId.toMap();
|
||||||
|
QString binary = map.value(QLatin1String("Binary")).toString();
|
||||||
|
if (binary == QLatin1String("auto")) {
|
||||||
|
// This should not happen as "auto" is handled by setup() already.
|
||||||
|
QTC_CHECK(false);
|
||||||
|
k->setValue(DebuggerKitInformation::id(), QVariant());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileName fileName = FileName::fromUserInput(binary);
|
||||||
|
const DebuggerItem *item = DebuggerItemManager::findByCommand(fileName);
|
||||||
|
if (!item) {
|
||||||
|
qWarning("Debugger command %s invalid in kit %s",
|
||||||
|
qPrintable(binary), qPrintable(k->displayName()));
|
||||||
|
k->setValue(DebuggerKitInformation::id(), QVariant());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
k->setValue(DebuggerKitInformation::id(), item->id());
|
||||||
|
}
|
||||||
|
|
||||||
// Check the configuration errors and return a flag mask. Provide a quick check and
|
// Check the configuration errors and return a flag mask. Provide a quick check and
|
||||||
// a verbose one with a list of errors.
|
// a verbose one with a list of errors.
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ public:
|
|||||||
{ return DebuggerKitInformation::validateDebugger(k); }
|
{ return DebuggerKitInformation::validateDebugger(k); }
|
||||||
|
|
||||||
void setup(ProjectExplorer::Kit *k);
|
void setup(ProjectExplorer::Kit *k);
|
||||||
|
void fix(ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
static const DebuggerItem *debugger(const ProjectExplorer::Kit *kit);
|
static const DebuggerItem *debugger(const ProjectExplorer::Kit *kit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user