forked from qt-creator/qt-creator
ProjectExplorer: Consolidate some Session::active* accesses
Change-Id: I47b0f6c2c60b2f7c86b6ffd1ad3df393d1321c8b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -51,16 +51,14 @@ PerfTracePointDialog::PerfTracePointDialog() :
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
if (Project *currentProject = SessionManager::startupProject()) {
|
||||
if (const Target *target = currentProject->activeTarget()) {
|
||||
const Kit *kit = target->kit();
|
||||
QTC_ASSERT(kit, return);
|
||||
if (const Target *target = SessionManager::startupTarget()) {
|
||||
const Kit *kit = target->kit();
|
||||
QTC_ASSERT(kit, return);
|
||||
|
||||
m_device = DeviceKitAspect::device(kit);
|
||||
if (!m_device) {
|
||||
m_ui->textEdit->setPlainText(tr("Error: No device available for active target."));
|
||||
return;
|
||||
}
|
||||
m_device = DeviceKitAspect::device(kit);
|
||||
if (!m_device) {
|
||||
m_ui->textEdit->setPlainText(tr("Error: No device available for active target."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user