From d23afc8e61ca78c20ca35daafec35ce31af066e9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@nokia.com> Date: Mon, 11 Oct 2010 15:40:25 +0200 Subject: [PATCH] Maemo: Don't create desktop files, ask before updating project files. Also don't waste performance by repeatedly reacting to the same project file change. This is relevant for bigger projects to which a Maemo target might have been added by mistake. Task-number: QTCREATORBUG-2647 Reviewed-by: kh1 --- .../qt-maemo/maemodeployablelistmodel.cpp | 22 ++- .../qt-maemo/maemodeployablelistmodel.h | 14 +- .../qt-maemo/maemodeployablelistwidget.cpp | 1 + .../qt-maemo/maemodeployablelistwidget.h | 1 + .../qt-maemo/maemodeployables.cpp | 77 ++++++++-- .../qt-maemo/maemodeployables.h | 12 +- .../qt-maemo/maemoprofilesupdatedialog.cpp | 99 +++++++++++++ .../qt-maemo/maemoprofilesupdatedialog.h | 71 +++++++++ .../qt-maemo/maemoprofilesupdatedialog.ui | 139 ++++++++++++++++++ .../qt-maemo/maemoprofilewrapper.cpp | 3 +- .../qt-maemo/maemotemplatesmanager.cpp | 6 +- .../qt4projectmanager/qt-maemo/qt-maemo.pri | 9 +- 12 files changed, 421 insertions(+), 33 deletions(-) create mode 100644 src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.cpp create mode 100644 src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.h create mode 100644 src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.ui diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp index c5740cb0c77..668f96ffc5a 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp @@ -41,12 +41,14 @@ namespace Qt4ProjectManager { namespace Internal { MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode, - const QSharedPointer<ProFileOption> &proFileOption, QObject *parent) + const QSharedPointer<ProFileOption> &proFileOption, + ProFileUpdateSetting updateSetting, QObject *parent) : QAbstractTableModel(parent), m_proFileNode(proFileNode), m_modified(false), m_proFileWrapper(new MaemoProFileWrapper(m_proFileNode->path(), - m_proFileNode->buildDir(), proFileOption)) + m_proFileNode->buildDir(), proFileOption)), + m_proFileUpdateSetting(updateSetting), m_hasTargetPath(false) { buildModel(); } @@ -58,7 +60,8 @@ bool MaemoDeployableListModel::buildModel() m_deployables.clear(); const MaemoProFileWrapper::InstallsList &installs = m_proFileWrapper->installs(); - if (installs.targetPath.isEmpty()) { + m_hasTargetPath = !installs.targetPath.isEmpty(); + if (!m_hasTargetPath && m_proFileUpdateSetting == UpdateProFile) { const QString remoteDirSuffix = QLatin1String(m_proFileNode->projectType() == LibraryTemplate ? "/lib" : "/bin"); @@ -223,8 +226,10 @@ QString MaemoDeployableListModel::localExecutableFilePath() const QString MaemoDeployableListModel::remoteExecutableFilePath() const { - return deployableAt(0).remoteDir + '/' - + QFileInfo(localExecutableFilePath()).fileName(); + return m_hasTargetPath + ? deployableAt(0).remoteDir + '/' + + QFileInfo(localExecutableFilePath()).fileName() + : QString(); } QString MaemoDeployableListModel::projectName() const @@ -237,5 +242,12 @@ QString MaemoDeployableListModel::projectDir() const return QFileInfo(m_proFileNode->path()).dir().path(); } +void MaemoDeployableListModel::setProFileUpdateSetting(ProFileUpdateSetting updateSetting) +{ + m_proFileUpdateSetting = updateSetting; + if (updateSetting == UpdateProFile) + buildModel(); +} + } // namespace Qt4ProjectManager } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h index ee615da4748..1da79c411f3 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h @@ -52,8 +52,13 @@ class MaemoDeployableListModel : public QAbstractTableModel { Q_OBJECT public: + enum ProFileUpdateSetting { + UpdateProFile, DontUpdateProFile, AskToUpdateProFile + }; + MaemoDeployableListModel(const Qt4ProFileNode *proFileNode, - const QSharedPointer<ProFileOption> &proFileOption, QObject *parent); + const QSharedPointer<ProFileOption> &proFileOption, + ProFileUpdateSetting updateSetting, QObject *parent); ~MaemoDeployableListModel(); virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; @@ -68,6 +73,11 @@ public: QString projectName() const; QString projectDir() const; const Qt4ProFileNode *proFileNode() const { return m_proFileNode; } + bool hasTargetPath() const { return m_hasTargetPath; } + ProFileUpdateSetting proFileUpdateSetting() const { + return m_proFileUpdateSetting; + } + void setProFileUpdateSetting(ProFileUpdateSetting updateSetting); private: virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; @@ -85,6 +95,8 @@ private: QList<MaemoDeployable> m_deployables; mutable bool m_modified; const QScopedPointer<MaemoProFileWrapper> m_proFileWrapper; + ProFileUpdateSetting m_proFileUpdateSetting; + bool m_hasTargetPath; }; } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.cpp index df008ceebdb..ee872e08e6d 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.cpp @@ -72,6 +72,7 @@ MaemoDeployableListWidget::MaemoDeployableListWidget(QWidget *parent, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(enableOrDisableRemoveButton())); m_ui->deployablesView->resizeColumnsToContents(); + m_ui->deployablesView->resizeRowsToContents(); m_ui->deployablesView->horizontalHeader()->setStretchLastSection(true); enableOrDisableRemoveButton(); } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.h index fcbf75249e5..2652afabbb7 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistwidget.h @@ -61,6 +61,7 @@ class MaemoDeployableListWidget : public QWidget public: MaemoDeployableListWidget(QWidget *parent, MaemoDeployableListModel *model); ~MaemoDeployableListWidget(); + MaemoDeployableListModel *model() const { return m_model; } private slots: void addFile(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp index 9ec88695841..7549386d705 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp @@ -41,10 +41,11 @@ #include "maemodeployables.h" -#include "maemodeployablelistmodel.h" +#include "maemoprofilesupdatedialog.h" #include <profileevaluator.h> #include <projectexplorer/buildstep.h> +#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4target.h> @@ -55,46 +56,91 @@ namespace Qt4ProjectManager { namespace Internal { MaemoDeployables::MaemoDeployables(const ProjectExplorer::BuildStep *buildStep) - : m_buildStep(buildStep) + : m_buildStep(buildStep), m_updateTimer(new QTimer(this)) { QTimer::singleShot(0, this, SLOT(init())); + m_updateTimer->setInterval(1500); + connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(createModels())); } MaemoDeployables::~MaemoDeployables() {} void MaemoDeployables::init() { - createModels(); connect(qt4BuildConfiguration()->qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), - this, SLOT(createModels())); + m_updateTimer, SLOT(start())); + createModels(); } void MaemoDeployables::createModels() { - qDeleteAll(m_listModels); - m_listModels.clear(); + if (!qt4BuildConfiguration() || !qt4BuildConfiguration()->qt4Target() + || qt4BuildConfiguration()->qt4Target()->project()->activeTarget()->id() + != QLatin1String(Qt4ProjectManager::Constants::MAEMO_DEVICE_TARGET_ID)) + return; + disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(), + SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), + m_updateTimer, SLOT(start())); + m_updateTimer->stop(); m_proFileOption = QSharedPointer<ProFileOption>(new ProFileOption); m_proFileOption->properties = qt4BuildConfiguration()->qtVersion()->versionInfo(); m_proFileOption->target_mode = ProFileOption::TARG_UNIX_MODE; - createModels(qt4BuildConfiguration()->qt4Target()->qt4Project() - ->rootProjectNode()); + const Qt4ProFileNode *const rootNode + = qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode(); + if (!rootNode) // Happens on project creation by wizard. + return; + qDeleteAll(m_listModels); + m_listModels.clear(); + createModels(rootNode); + QList<MaemoDeployableListModel *> modelsWithoutTargetPath; + foreach (MaemoDeployableListModel *const model, m_listModels) { + if (!model->hasTargetPath()) { + if (model->proFileUpdateSetting() == MaemoDeployableListModel::AskToUpdateProFile) + modelsWithoutTargetPath << model; + } + } + + if (!modelsWithoutTargetPath.isEmpty()) { + MaemoProFilesUpdateDialog dialog(modelsWithoutTargetPath); + dialog.exec(); + const QList<MaemoProFilesUpdateDialog::UpdateSetting> &settings + = dialog.getUpdateSettings(); + foreach (const MaemoProFilesUpdateDialog::UpdateSetting &setting, settings) { + const MaemoDeployableListModel::ProFileUpdateSetting updateSetting + = setting.second + ? MaemoDeployableListModel::UpdateProFile + : MaemoDeployableListModel::DontUpdateProFile; + m_updateSettings.insert(setting.first->proFileNode()->path(), + updateSetting); + setting.first->setProFileUpdateSetting(updateSetting); + } + } + emit modelsCreated(); + connect(qt4BuildConfiguration()->qt4Target()->qt4Project(), + SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), + m_updateTimer, SLOT(start())); } void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode) { - if (!proFileNode) // Happens on project creation by wizard. - return; - const Qt4ProjectType type = proFileNode->projectType() ; - switch (type) { + switch (proFileNode->projectType()) { case ApplicationTemplate: case LibraryTemplate: - case ScriptTemplate: - m_listModels - << new MaemoDeployableListModel(proFileNode, m_proFileOption, this); + case ScriptTemplate: { + UpdateSettingsMap::ConstIterator it + = m_updateSettings.find(proFileNode->path()); + const MaemoDeployableListModel::ProFileUpdateSetting updateSetting + = it != m_updateSettings.end() + ? it.value() : MaemoDeployableListModel::AskToUpdateProFile; + MaemoDeployableListModel *const newModel + = new MaemoDeployableListModel(proFileNode, m_proFileOption, + updateSetting, this); + m_listModels << newModel; break; + } case SubDirsTemplate: { const QList<ProjectExplorer::ProjectNode *> &subProjects = proFileNode->subProjectNodes(); @@ -160,7 +206,6 @@ const Qt4BuildConfiguration *MaemoDeployables::qt4BuildConfiguration() const { const Qt4BuildConfiguration * const bc = qobject_cast<Qt4BuildConfiguration *>(m_buildStep->target()->activeBuildConfiguration()); - Q_ASSERT(bc); return bc; } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h index 0b9eff689c0..b056427aae2 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h @@ -43,21 +43,21 @@ #define MAEMODEPLOYABLES_H #include "maemodeployable.h" +#include "maemodeployablelistmodel.h" +#include <QtCore/QHash> #include <QtCore/QList> #include <QtCore/QObject> #include <QtCore/QSharedPointer> -QT_BEGIN_NAMESPACE -struct ProFileOption; -QT_END_NAMESPACE +QT_FORWARD_DECLARE_CLASS(QTimer); +QT_FORWARD_DECLARE_STRUCT(ProFileOption) namespace ProjectExplorer { class BuildStep; } namespace Qt4ProjectManager { namespace Internal { -class MaemoDeployableListModel; class Qt4BuildConfiguration; class Qt4ProFileNode; @@ -80,6 +80,8 @@ signals: void modelsCreated(); private: + typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap; + Q_SLOT void createModels(); Q_SLOT void init(); void createModels(const Qt4ProFileNode *proFileNode); @@ -87,7 +89,9 @@ private: QList<MaemoDeployableListModel *> m_listModels; QSharedPointer<ProFileOption> m_proFileOption; + UpdateSettingsMap m_updateSettings; const ProjectExplorer::BuildStep * const m_buildStep; + QTimer *const m_updateTimer; }; } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.cpp new file mode 100644 index 00000000000..1aba79772a3 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.cpp @@ -0,0 +1,99 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ +#include "maemoprofilesupdatedialog.h" +#include "ui_maemoprofilesupdatedialog.h" + +#include "maemodeployablelistmodel.h" + +#include <qt4projectmanager/qt4nodes.h> + +#include <QtGui/QTableWidgetItem> + +namespace Qt4ProjectManager { +namespace Internal { + +MaemoProFilesUpdateDialog::MaemoProFilesUpdateDialog(const QList<MaemoDeployableListModel *> &models, + QWidget *parent) + : QDialog(parent), + m_models(models), + ui(new Ui::MaemoProFilesUpdateDialog) +{ + ui->setupUi(this); + ui->tableWidget->setRowCount(models.count()); + ui->tableWidget->setHorizontalHeaderItem(0, + new QTableWidgetItem(tr("Updateable Project Files"))); + for (int row = 0; row < models.count(); ++row) { + QTableWidgetItem *const item + = new QTableWidgetItem(models.at(row)->proFileNode()->path()); + item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); + item->setCheckState(Qt::Unchecked); + ui->tableWidget->setItem(row, 0, item); + } + ui->tableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); + ui->tableWidget->resizeRowsToContents(); + connect(ui->checkAllButton, SIGNAL(clicked()), this, SLOT(checkAll())); + connect(ui->uncheckAllButton, SIGNAL(clicked()), this, SLOT(uncheckAll())); +} + +MaemoProFilesUpdateDialog::~MaemoProFilesUpdateDialog() +{ + delete ui; +} + +void MaemoProFilesUpdateDialog::checkAll() +{ + setCheckStateForAll(Qt::Checked); +} + +void MaemoProFilesUpdateDialog::uncheckAll() +{ + setCheckStateForAll(Qt::Unchecked); +} + +void MaemoProFilesUpdateDialog::setCheckStateForAll(Qt::CheckState checkState) +{ + for (int row = 0; row < ui->tableWidget->rowCount(); ++row) { + ui->tableWidget->item(row, 0)->setCheckState(checkState); + } +} + +QList<MaemoProFilesUpdateDialog::UpdateSetting> +MaemoProFilesUpdateDialog::getUpdateSettings() const +{ + QList<UpdateSetting> settings; + for (int row = 0; row < m_models.count(); ++row) { + const bool doUpdate = result() != Rejected + && ui->tableWidget->item(row, 0)->checkState() == Qt::Checked; + settings << UpdateSetting(m_models.at(row), doUpdate); + } + return settings; +} + +} // namespace Qt4ProjectManager +} // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.h b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.h new file mode 100644 index 00000000000..e7849060c6b --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.h @@ -0,0 +1,71 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ +#ifndef MAEMOPROFILESUPDATEDIALOG_H +#define MAEMOPROFILESUPDATEDIALOG_H + +#include <QtCore/QList> +#include <QtCore/QPair> +#include <QtCore/QString> +#include <QtGui/QDialog> + +QT_BEGIN_NAMESPACE +namespace Ui { + class MaemoProFilesUpdateDialog; +} +QT_END_NAMESPACE + +namespace Qt4ProjectManager { +namespace Internal { +class MaemoDeployableListModel; + +class MaemoProFilesUpdateDialog : public QDialog +{ + Q_OBJECT + +public: + typedef QPair<MaemoDeployableListModel *, bool> UpdateSetting; + + explicit MaemoProFilesUpdateDialog(const QList<MaemoDeployableListModel *> &models, + QWidget *parent = 0); + ~MaemoProFilesUpdateDialog(); + QList<UpdateSetting> getUpdateSettings() const; + +private: + Q_SLOT void checkAll(); + Q_SLOT void uncheckAll(); + void setCheckStateForAll(Qt::CheckState checkState); + + const QList<MaemoDeployableListModel *> m_models; + Ui::MaemoProFilesUpdateDialog *ui; +}; + +} // namespace Qt4ProjectManager +} // namespace Internal + +#endif // MAEMOPROFILESUPDATEDIALOG_H diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.ui b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.ui new file mode 100644 index 00000000000..60eaa627ebb --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilesupdatedialog.ui @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MaemoProFilesUpdateDialog</class> + <widget class="QDialog" name="MaemoProFilesUpdateDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>659</width> + <height>494</height> + </rect> + </property> + <property name="windowTitle"> + <string>Maemo Deployment Issue</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="infoLabel"> + <property name="text"> + <string>The project files listed below do not contain Maemo deployment information, which means the respective targets cannot be deployed to and/or run on a device. Qt Creator can add the missing information to these files. </string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="checkAllButton"> + <property name="text"> + <string>Check all</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="uncheckAllButton"> + <property name="text"> + <string>Uncheck All</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="Line" name="line_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QTableWidget" name="tableWidget"> + <property name="showGrid"> + <bool>false</bool> + </property> + <property name="columnCount"> + <number>1</number> + </property> + <attribute name="horizontalHeaderDefaultSectionSize"> + <number>200</number> + </attribute> + <attribute name="horizontalHeaderStretchLastSection"> + <bool>true</bool> + </attribute> + <attribute name="verticalHeaderVisible"> + <bool>false</bool> + </attribute> + <column/> + </widget> + </item> + <item> + <widget class="Line" name="line"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>MaemoProFilesUpdateDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>MaemoProFilesUpdateDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoprofilewrapper.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilewrapper.cpp index ffb4107af37..2e70d891d13 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoprofilewrapper.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoprofilewrapper.cpp @@ -222,6 +222,8 @@ QString MaemoProFileWrapper::absFilePath(const QString &relFilePath) const void MaemoProFileWrapper::parseProFile(ParseType type) const { + if (m_proFileReader) + m_proFile->deref(); m_proFileReader.reset(new ProFileReader(m_proFileOption.data())); m_proFileReader->setOutputDir(m_buildDir); m_proFileReader->setCumulative(false); @@ -241,7 +243,6 @@ void MaemoProFileWrapper::parseProFile(ParseType type) const } m_proFileReader->accept(m_proFile); - m_proFile->deref(); } bool MaemoProFileWrapper::writeProFileContents() diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemotemplatesmanager.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemotemplatesmanager.cpp index c64c35e6237..f5e809a6eeb 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemotemplatesmanager.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemotemplatesmanager.cpp @@ -402,9 +402,9 @@ void MaemoTemplatesManager::handleProFileUpdated() = qobject_cast<MaemoDeployables *>(sender()); if (!deployables) return; - const Target * const target = deployables->buildStep()->target(); - if (m_maemoProjects.contains(target->project())) - updateDesktopFiles(qobject_cast<const Qt4Target *>(target)); +// const Target * const target = deployables->buildStep()->target(); +// if (m_maemoProjects.contains(target->project())) +// updateDesktopFiles(qobject_cast<const Qt4Target *>(target)); } QString MaemoTemplatesManager::version(const Project *project, diff --git a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri index 7ce8871c4cb..a36c4a3365e 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri +++ b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri @@ -31,7 +31,8 @@ HEADERS += \ $$PWD/maemodeviceenvreader.h \ $$PWD/maemotemplatesmanager.h \ $$PWD/maemomountspecification.h \ - $$PWD/maemoremotemounter.h + $$PWD/maemoremotemounter.h \ + $$PWD/maemoprofilesupdatedialog.h SOURCES += \ $$PWD/maemoconfigtestdialog.cpp \ @@ -64,7 +65,8 @@ SOURCES += \ $$PWD/maemodeviceenvreader.cpp \ $$PWD/maemotemplatesmanager.cpp \ $$PWD/maemomountspecification.cpp \ - $$PWD/maemoremotemounter.cpp + $$PWD/maemoremotemounter.cpp \ + $$PWD/maemoprofilesupdatedialog.cpp FORMS += \ $$PWD/maemoconfigtestdialog.ui \ @@ -72,6 +74,7 @@ FORMS += \ $$PWD/maemosshconfigdialog.ui \ $$PWD/maemopackagecreationwidget.ui \ $$PWD/maemodeployablelistwidget.ui \ - $$PWD/maemodeploystepwidget.ui + $$PWD/maemodeploystepwidget.ui \ + $$PWD/maemoprofilesupdatedialog.ui RESOURCES += $$PWD/qt-maemo.qrc -- GitLab