From eca6ac029ab18699c2b12df5ef651d05fc90e589 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 8 Jul 2011 13:51:32 +0200 Subject: [PATCH] RemoteLinux: Don't build list of deployables without valid Qt version. Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=251230 Change-Id: I19f5894b52ea11590304365adae49ed148e4bd48 Reviewed-on: http://codereview.qt.nokia.com/1374 Reviewed-by: Qt Sanity Bot Reviewed-by: Tobias Hunger --- src/plugins/remotelinux/deployablefilesperprofile.cpp | 6 +++--- src/plugins/remotelinux/deploymentinfo.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/remotelinux/deployablefilesperprofile.cpp b/src/plugins/remotelinux/deployablefilesperprofile.cpp index 2f9203ff896..396357d7457 100644 --- a/src/plugins/remotelinux/deployablefilesperprofile.cpp +++ b/src/plugins/remotelinux/deployablefilesperprofile.cpp @@ -263,7 +263,7 @@ bool DeployableFilesPerProFile::addDesktopFile() } const QtSupport::BaseQtVersion * const version = qtVersion(); - QTC_ASSERT(version, return false); + QTC_ASSERT(version && version->isValid(), return false); QString remoteDir = QLatin1String("/usr/share/applications"); if (MaemoGlobal::osType(version->qmakeCommand()) == LinuxDeviceConfiguration::Maemo5OsType) remoteDir += QLatin1String("/hildon"); @@ -339,7 +339,7 @@ const QtSupport::BaseQtVersion *DeployableFilesPerProFile::qtVersion() const QString DeployableFilesPerProFile::proFileScope() const { const QtSupport::BaseQtVersion *const qv = qtVersion(); - QTC_ASSERT(qv, return QString()); + QTC_ASSERT(qv && qv->isValid(), return QString()); const QString osType = MaemoGlobal::osType(qv->qmakeCommand()); if (osType == LinuxDeviceConfiguration::Maemo5OsType) return QLatin1String("maemo5"); @@ -358,7 +358,7 @@ QString DeployableFilesPerProFile::installPrefix() const QString DeployableFilesPerProFile::remoteIconDir() const { const QtSupport::BaseQtVersion *const qv = qtVersion(); - QTC_ASSERT(qv, return QString()); + QTC_ASSERT(qv && qv->isValid(), return QString()); return QString::fromLocal8Bit("/usr/share/icons/hicolor/%1x%1/apps") .arg(MaemoGlobal::applicationIconSize(MaemoGlobal::osType(qv->qmakeCommand()))); } diff --git a/src/plugins/remotelinux/deploymentinfo.cpp b/src/plugins/remotelinux/deploymentinfo.cpp index 90bd032d499..23b23f5b6e9 100644 --- a/src/plugins/remotelinux/deploymentinfo.cpp +++ b/src/plugins/remotelinux/deploymentinfo.cpp @@ -71,6 +71,13 @@ void DeploymentInfo::createModels() { if (m_target->project()->activeTarget() != m_target) return; + if (!m_target->activeBuildConfiguration() || !m_target->activeBuildConfiguration()->qtVersion() + || !m_target->activeBuildConfiguration()->qtVersion()->isValid()) { + beginResetModel(); + m_listModels.clear(); + endResetModel(); + return; + } const Qt4ProFileNode *const rootNode = m_target->qt4Project()->rootProjectNode(); if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard.