Commit d879e30d authored by Daniel Teske's avatar Daniel Teske

QmlProjectRunConfiguraiton: Simplify code

Change-Id: I392e5ee1fcf89b4e4d871fa5935f065f29a67f1e
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 60703554
......@@ -161,9 +161,7 @@ QtSupport::BaseQtVersion *QmlProjectRunConfiguration::qtVersion() const
QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
{
QTC_ASSERT(m_configurationWidget.isNull(), return m_configurationWidget.data());
m_configurationWidget = new QmlProjectRunConfigurationWidget(this);
return m_configurationWidget.data();
return new QmlProjectRunConfigurationWidget(this);
}
Utils::OutputFormatter *QmlProjectRunConfiguration::createOutputFormatter() const
......@@ -218,8 +216,8 @@ void QmlProjectRunConfiguration::setScriptSource(MainScriptSource source,
= target()->project()->projectDirectory() + QLatin1Char('/') + m_scriptFile;
}
updateEnabled();
if (m_configurationWidget)
m_configurationWidget.data()->updateFileComboBox();
emit scriptSourceChanged();
}
ProjectExplorer::Abi QmlProjectRunConfiguration::abi() const
......
......@@ -87,6 +87,8 @@ public:
QVariantMap toMap() const;
ProjectExplorer::Abi abi() const;
signals:
void scriptSourceChanged();
private slots:
void changeCurrentFile(Core::IEditor* = 0);
......@@ -113,8 +115,6 @@ private:
QString m_scriptFile;
QString m_qmlViewerArgs;
QPointer<Internal::QmlProjectRunConfigurationWidget> m_configurationWidget;
bool m_isEnabled;
};
......
......@@ -84,6 +84,9 @@ QmlProjectRunConfigurationWidget::QmlProjectRunConfigurationWidget(QmlProjectRun
layout->addWidget(detailsWidget);
updateFileComboBox();
connect(rc, SIGNAL(scriptSourceChanged()),
this, SLOT(updateFileComboBox()));
}
static bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
......
......@@ -49,10 +49,8 @@ class QmlProjectRunConfigurationWidget : public QWidget
public:
explicit QmlProjectRunConfigurationWidget(QmlProjectRunConfiguration *rc);
public slots:
void updateFileComboBox();
private slots:
void updateFileComboBox();
void setMainScript(int index);
void onViewerArgsChanged();
......
Markdown is supported
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