forked from qt-creator/qt-creator
Maemo: Make shared pointer an actual QSharedPointer.
Pointer was left dangling when a deploy configuration was removed.
This commit is contained in:
@@ -69,7 +69,7 @@ LinuxDeviceDeployStepHelper::LinuxDeviceDeployStepHelper(Qt4MaemoDeployConfigura
|
||||
: m_deployConfiguration(dc)
|
||||
{
|
||||
m_deviceConfig = dc->deviceConfigModel()->defaultDeviceConfig();
|
||||
connect(dc->deviceConfigModel(), SIGNAL(updated()),
|
||||
connect(dc->deviceConfigModel().data(), SIGNAL(updated()),
|
||||
SLOT(handleDeviceConfigurationsUpdated()));
|
||||
}
|
||||
|
||||
|
@@ -73,7 +73,7 @@ MaemoDeployStepBaseWidget::~MaemoDeployStepBaseWidget()
|
||||
|
||||
void MaemoDeployStepBaseWidget::init()
|
||||
{
|
||||
ui->deviceConfigComboBox->setModel(m_step->maemoDeployConfig()->deviceConfigModel());
|
||||
ui->deviceConfigComboBox->setModel(m_step->maemoDeployConfig()->deviceConfigModel().data());
|
||||
connect(&m_step->helper(), SIGNAL(deviceConfigChanged()),
|
||||
SLOT(handleDeviceUpdate()));
|
||||
handleDeviceUpdate();
|
||||
|
@@ -55,6 +55,10 @@ MaemoPerTargetDeviceConfigurationListModel::MaemoPerTargetDeviceConfigurationLis
|
||||
connect(devConfs, SIGNAL(updated()), this, SIGNAL(updated()));
|
||||
}
|
||||
|
||||
MaemoPerTargetDeviceConfigurationListModel::~MaemoPerTargetDeviceConfigurationListModel()
|
||||
{
|
||||
}
|
||||
|
||||
int MaemoPerTargetDeviceConfigurationListModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (parent.isValid())
|
||||
|
@@ -49,6 +49,7 @@ class MaemoPerTargetDeviceConfigurationListModel : public QAbstractListModel
|
||||
public:
|
||||
explicit MaemoPerTargetDeviceConfigurationListModel(QObject *parent, const
|
||||
ProjectExplorer::Target *target);
|
||||
~MaemoPerTargetDeviceConfigurationListModel();
|
||||
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual QVariant data(const QModelIndex &index,
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "maemodeployconfigurationwidget.h"
|
||||
#include "maemodeployables.h"
|
||||
#include "maemoinstalltosysrootstep.h"
|
||||
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
||||
#include "maemopackagecreationstep.h"
|
||||
#include "maemouploadandinstalldeploystep.h"
|
||||
#include "qt4maemotarget.h"
|
||||
@@ -75,7 +74,8 @@ Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(Target *target,
|
||||
}
|
||||
if (!m_deployables) {
|
||||
m_deployables = QSharedPointer<MaemoDeployables>(new MaemoDeployables(qobject_cast<Qt4BaseTarget *>(target)));
|
||||
m_devConfModel = new MaemoPerTargetDeviceConfigurationListModel(this, target);
|
||||
m_devConfModel = QSharedPointer<MaemoPerTargetDeviceConfigurationListModel>
|
||||
(new MaemoPerTargetDeviceConfigurationListModel(0, target));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#define QT4PROJECTMANAGER_QT4DEPLOYCONFIGURATION_H
|
||||
|
||||
#include"maemodeployables.h"
|
||||
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
||||
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
|
||||
@@ -53,7 +54,7 @@ public:
|
||||
virtual ProjectExplorer::DeployConfigurationWidget *configurationWidget() const;
|
||||
|
||||
QSharedPointer<MaemoDeployables> deployables() const { return m_deployables; }
|
||||
MaemoPerTargetDeviceConfigurationListModel *deviceConfigModel() const { return m_devConfModel; }
|
||||
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> deviceConfigModel() const { return m_devConfModel; }
|
||||
|
||||
static const QString FremantleWithPackagingId;
|
||||
static const QString FremantleWithoutPackagingId;
|
||||
@@ -70,7 +71,7 @@ private:
|
||||
ProjectExplorer::DeployConfiguration *source);
|
||||
|
||||
QSharedPointer<MaemoDeployables> m_deployables;
|
||||
MaemoPerTargetDeviceConfigurationListModel *m_devConfModel;
|
||||
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> m_devConfModel;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user