Fix crash when restoring old .qmlproject files

The run configuration id changed, leaving restored qmlproject without
any run configuration.

Reviewed-by: kkoehne
This commit is contained in:
Christiaan Janssen
2010-03-31 10:36:01 +02:00
parent fdcb197033
commit 520108cbc8
2 changed files with 6 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
#include "qmlprojectmanagerconstants.h"
#include "qmlprojectrunconfiguration.h"
#include <QtCore/QDebug>
#include <QtGui/QApplication>
#include <QtGui/QStyle>
@@ -67,6 +68,11 @@ bool QmlProjectTarget::fromMap(const QVariantMap &map)
if (!Target::fromMap(map))
return false;
if (runConfigurations().isEmpty()) {
qWarning() << "Failed to restore run configuration of QML project!";
return false;
}
setDisplayName(QApplication::translate("QmlProjectManager::QmlTarget",
Constants::QML_VIEWER_TARGET_DISPLAY_NAME,
"QML Runtime target display name"));