Commit 2b8585b9 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Fix package metadata initialization bug.

We must check whether a target is fully initialized (meaning it
already has packaging metadata). Otherwise we will initialize one
target with bogus values from another, equally uninitialized one
when they are created at the same time (i.e. by a wizard).
parent e4aa8df3
......@@ -111,7 +111,8 @@ AbstractQt4MaemoTarget::AbstractQt4MaemoTarget(Qt4Project *parent, const QString
Qt4BaseTarget(parent, id),
m_filesWatcher(new QFileSystemWatcher(this)),
m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)),
m_deployConfigurationFactory(new Qt4MaemoDeployConfigurationFactory(this))
m_deployConfigurationFactory(new Qt4MaemoDeployConfigurationFactory(this)),
m_isInitialized(false)
{
setIcon(QIcon(":/projectexplorer/images/MaemoDevice.png"));
connect(parent, SIGNAL(addedTarget(ProjectExplorer::Target*)),
......@@ -300,6 +301,7 @@ void AbstractQt4MaemoTarget::handleTargetAdded(ProjectExplorer::Target *target)
return;
initPackagingSettingsFromOtherTarget();
handleTargetAddedSpecial();
m_isInitialized = true;
}
void AbstractQt4MaemoTarget::handleTargetToBeRemoved(ProjectExplorer::Target *target)
......@@ -371,7 +373,7 @@ bool AbstractQt4MaemoTarget::initPackagingSettingsFromOtherTarget()
foreach (const Target * const target, project()->targets()) {
const AbstractQt4MaemoTarget * const maemoTarget
= qobject_cast<const AbstractQt4MaemoTarget *>(target);
if (maemoTarget && maemoTarget != this) {
if (maemoTarget && maemoTarget != this && maemoTarget->m_isInitialized) {
if (!setProjectVersionInternal(maemoTarget->projectVersion()))
success = false;
if (!setPackageNameInternal(maemoTarget->packageName()))
......
......@@ -125,6 +125,7 @@ private:
Qt4BuildConfigurationFactory *m_buildConfigurationFactory;
Qt4MaemoDeployConfigurationFactory *m_deployConfigurationFactory;
MaemoPerTargetDeviceConfigurationListModel * m_deviceConfigurationsListModel;
bool m_isInitialized;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment