forked from qt-creator/qt-creator
KitInformation: Improve robustness to nullptr passed as kit
All the KitInformation methods need to gracefully handle a kit that is a nullptr. Ensure this is indeed the case. This might fix the actual trigger for QTCREATORBUG-19469. Change-Id: Id78ac8a26c1be908f41a425ff1935b86888e4b8b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/elidinglabel.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
@@ -73,6 +74,7 @@ KitInformation::ItemList AndroidGdbServerKitInformation::toUserOutput(const Kit
|
||||
|
||||
KitConfigWidget *AndroidGdbServerKitInformation::createConfigWidget(Kit *kit) const
|
||||
{
|
||||
QTC_ASSERT(kit, return nullptr);
|
||||
return new AndroidGdbServerKitInformationWidget(kit, this);
|
||||
}
|
||||
|
||||
@@ -94,11 +96,13 @@ bool AndroidGdbServerKitInformation::isAndroidKit(const Kit *kit)
|
||||
|
||||
FileName AndroidGdbServerKitInformation::gdbServer(const Kit *kit)
|
||||
{
|
||||
QTC_ASSERT(kit, return FileName());
|
||||
return FileName::fromString(kit->value(AndroidGdbServerKitInformation::id()).toString());
|
||||
}
|
||||
|
||||
void AndroidGdbServerKitInformation::setGdbSever(Kit *kit, const FileName &gdbServerCommand)
|
||||
{
|
||||
QTC_ASSERT(kit, return);
|
||||
kit->setValue(AndroidGdbServerKitInformation::id(), gdbServerCommand.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user